Searching directories to get around Search.php limitation

jlhughes

Joined: 2002-06-05
Posts: 81
Posted: Mon, 2002-08-26 19:51

Gallery v.1.3.x does not allow for the search results to be sorted. You get the oldest image first and every image on a single page. You are out of luck if you want to get the newest image and you want to break up the display. (I've been told in the past that this will be "fixed" in Gallery 2.x)

I have very specific needs at my sight and I have created a workaround that gets me what I want. I am making it available so that anyone who has similar needs can explore the code to see if it offers ideas for meeting other needs.

To see the working example visit <!-- BBCode Start --><A HREF="http://rcubarcelona.org/roster" TARGET="_blank">rcubarcelona.org/roster</A><!-- BBCode End -->

Clicking on a photo (or the name or number) will take you to page of thumbnails taken from the Gallery .thumbs. The most recent photo is first. The thumbs are shown nine to a page. Clicking on the thumb image takes you to Gallery's full (or sized) image.

On my site every file begins with the date in YYYYMMDD format and includes the player(s) name. For instance, 20020818_game4_richard_38.jpg This allows the images to be sorted by filename and searched for names, but it only works because of the particular file naming convention I have employed.

The albums directory contents are searched for .thumb. file names that contain the search term. The result is then "reverse" sorted and the results processed to create a table of 9 image thumbnails.

This DOES NOT search the captions or the keywords and therefore should not be considered a replacement for the search function.

The source code is available at <!-- BBCode Start --><A HREF="http://rcubarcelona.org/download" TARGET="_blank">rcubarcelona.org/download</A><!-- BBCode End -->

John Hughes