Blog ยป Archive by category 'Software'
There are a lot of PHP photo gallery scripts out there. I know; because I went looking for one some time ago, and found myself barraged with Javascript, AJAX, and complicated installations. I didn’t want any of those things, so in the end I just wrote one for myself — - and this is the end result. Download the ZIP package.
It’s not a complicated script, and it doesn’t do a whole lot for you: but, assuming you’re running on Linux with PHP, it’ll be incredibly easy for you to install and configure. View the sample installation.
What’s in the Package?
There are six main files included in this zip package (Version 1.1):
gallery.php — - the photo gallery script.
index.php — - the home file which includes the gallery script and contains configuration info. You can copy this page to create additional galleries just by saving it with a new name and changing the configuration information.
titles.txt — - a simple text file which uses pipe-separated fields to indicate the image name, an image description, and an alt text option.
title.php — - a script which provides a unique title element for each image in the gallery.
basic_styles.css — - a very basic stylesheet so that your default photo gallery doesn’t look too boring. Warning: no attempt whatsoever has been made to test these styles outside of Firefox.
readme.txt — - installation instructions
I’ve also supplied a (very) small gallery of images for the included gallery.
What does the script do?
This is pretty straightforward. The configuration information you’ll send to the script provides the title of the gallery, the relative path to your images folder, and the name of your text file containing the image information. Using this information, the gallery script creates a page containing (in order):
- Navigation links to move between the previous and next images in the gallery. The sequence is the order in which you’ve listed the images in your text file. The navigation is circular, so in the initial position the previous link will send you to the last image in the gallery.
- A full size image with a caption. The caption is the second field in your text file.
- An unordered list of thumbnail images in the gallery. Again, the order is from the text file. In the default styling, the list is displayed as a panel of images rather than as a list. Each image is a link to the full sized image within the gallery.
The script does NOT automatically generate your thumbnail images. Sure, I could have done that — - but my feeling is that manually creating thumbnail images will usually be more aesthetically pleasing. My preference is to create 80×80 square thumbnails cropped from the image. The tiling effect of the unordered list is much more effective with square thumbnails; and the ability to choose a particular section of the image for the thumbnail is much nicer than whatever programmatically selected truncation might have done.
Some Small Recommendations
The script allows the ability to use an alt text on your images. It also provides a description which can be used to caption the images in a paragraph either over or under the image. To me, it’s redundant to provide both descriptive text associated with the image AND a descriptive alt attribute. Therefore, I’ve also provided the option to turn off alt text in the full sized images. The default settings are what I’d recommend: visible descriptions enabled for the full size image, alt attributes left blank, and alt attributes enabled for all thumbnails.
I also recommend keeping your alt attributes short and to the point. The reason for having separate descriptions and alt attributes is because they serve different purposes: don’t try and use the description field as an alt attribute and don’t try and use the alt field for a description!
There’s nothing fancy about this script. Really — - I mean it. It’s down and dirty “make me a photo gallery” programming. Use at your own risk!
Changes as of 7/7/2007
I’ve made a number of small changes, including correcting some missing closing tags (oops!). The biggest change is that the Easy PHP Gallery is now capable of being a bit more search friendly. I’ve done a little rewriting to make the script capable of providing unique title elements for each image, rather than just giving the main gallery page title for every single page. This does make the script a tiny bit more difficult to implement, I suppose — - but I’d say it’s worth it.
Download PHP Script
The script includes a single file with the functioning script and form, a sample blank comma separated values file you can upload to your server, and the SQL statement to create the table for this script. Otherwise, you’re on your own.
The beginning stages of a web-based form are very simple: you read the HTML guide, learn about select menus, options, form labels, radio inputs and all the myriad ways you can inveigle information from your visitors. You also learn about the action and method attributes. Great. So all of this HTML you’ve learned is wonderful - but won’t actually do anything. You need to provide some kind of back-end rules to actually make any use of this information.
Deciding how to use the Data
First things first, you have to decide what you want to do with the data. I’m only going to deal with the most common probable tasks, here - no image editing or complex database updates, just simple data management. Are you going to write your data to a database? Do you want to use it to create a file which will hold a record of the transaction? Do you want it to send an email?
Read more: Processing Forms with PHP, a Beginner’s Guide
Following an article by Larry Constantine, I began a thread at Cre8asite Forums discussing the usability of open source software. The subject of the original article is the advantages (and disadvantages) of open source software - one of the chief weaknesses cited by Constantine is poor usability.
Now, I don’t have the kind of knowledge of open source software to be able to make that kind of judgement. Some open source software I know is quite difficult to use, but some is very easy. Some closed source software is very difficult, some is not. I’m not capable of drawing that line. Regardless of the reality, the impression that open source software is more difficult to use than its closed source counterparts is rampant.
I’m inclined to believe that people involved in the open source usability movement are those who are knowledgeable about the problems in open source projects. After all, it’s probably quite true that most open source projects are developed by engineers and code geeks - not usability experts. Some of these engineers are undoubtedly thinking about usability: but certainly not all. Establishing a movement to improve usability can hardly be a bad thing!
But is this usability challenge an illusion?
Ruud, at Cre8asite, states:
My guess is that poor usability isn’t always recognized as such in closed source though. The difficulty a company has to use that $75,000 CMS is expected: of course such an expensive system is “complex”…
But the strange clickthrough path in a freebie open source project? Bad usability, cloaked functionality…
To what degree do our expectations cloud our judgement? Is open source more difficult to use, or is it just that training and thorough documentation is less available? After all, the thousand hours of training required to install, administer, and use some complex software packages is simply not available for an open source equivalent: there isn’t necessarily a company established behind the product to provide these services.
On the other hand, Rashmi Sinha states:
Open source software projects are often feature driven. People join a project, they want to contribute. How can they contribute - by adding a feature. The user experience becomes more and more complex over time, as more and more features get added.
So open source projects are subject to feature bloat. Well…I’d argue this is equally true of many closed source projects. Many, many software packages add features in order to be able to ship a new version: in order to sell again, they need to offer something more. Perhaps this is less a division between open source and closed source and more a division between good project planning and oversight and bad.
I’ve just done some moderately substantial updates to my script for fulltext searches in PHP with MySQL. Although I don’t think the changes merit a whole new version number, I’ve made enough changes to justify releasing it to the public, I think! Mostly, I’ve focused on making it easier to implement, although I’ve also made changes to make the actual searching better, as well.
The principal changes include:
- Extended the Boolean capabilities to include the full range of MySQL boolean query options, including the “less desirable” and “more desirable” modifiers (<, >), complex queries using parentheses, and wildcard searching using the asterisk.
- Added options to display results in either a definition list or a table format.
- Made it far easier to customize the script to your own database: it’s no longer necessary to dive into the script and rewrite the MySQL
SELECT statements or customize variables.
- Added an option to allow the script to search on email addresses. This has been requested a couple of times, so I figured I might as well provide it as a choice.
- Made a lot of settings controllable without diving into the script itself: heading levels, extracted text length, whether to give me attribution…
My next goal is to improve the overall security of the script: but that will have to wait until later. Next week will definitely not be a week for programming: instead, it will be a week for moving.
I welcome bug reports: I’m sure they’re there - they just need to be chased down.
Read further details about the script.
Download the script now.
Kelly Ford, from the IE Accessibility Team, posted today in the IEBlog about IE7’s expected behavior with a variety of commercial screen readers and screen magnifiers.
The general sound of things is that IE7 will be compatible (or mostly compatible) with the most recent versions of most assistive technology software.
Although the number of products detailed on the IEblog is quite small, it does cover the better known products in assistive technology, all of which either are currently compatible with IE7 or will be patched for compatibility within the next month.
The information in the post is brief and provides little information about any kind of advanced functionality: however, if you want to verify whether your assistive technology will be compatible with IE7 it’s probably best that you check this out — before you install IE7!
This post has nothing to do with IE7’s support for CSS, adherence to web standards, or general functionality. Instead, it’s a general complaint about one specific annoyance: why did Microsoft’s IE development team want IE7 to “click”?
I mean, as a marketing metaphor, it’s great. Everybody wants their product to “click”. However, in this case I think they’ve taken it a bit too literally.
Read more: Internet Explorer 7: Irritation of the Day
My little boolean search engine has been receiving a fairly substantial amount of traffic, so I thought I should make it a little bit more user friendly. I just uploaded a new version of the zip package which includes a template file to connect to your MySQL database and, most importantly, a little readme file with some very basic instructions for installing and modifying the search engine for your site.
Finally, I put up a example implementation so you can try it out for real. Also made some minor changes to the script itself, but no real spectacular changes - it should be a TINY TINY bit faster now, but that’s about it.
Edit: put up the wrong link to the search script. Oops!
Other Resources: People Search at PeekYou — the free people search engine
Return to Top