TGPX includes a script that your website visitors can use to search your gallery database. This will allow them to quickly find the content they are looking for on your site. The search function is not enabled on the software's default template set, so this document will assist you in setting it up.
Adding a Search Box
Adding a search box on your TGP pages is pretty straightforward, and you will have the option of allowing users to search in a specific category and a specific gallery format if you wish. The following shows the complete code for an advanced search box that you can use on your TGP page templates:
The end-user gallery search function will search both the description and keywords fields for all of the galleries that currently have Used status. Since only galleries with Used status are searched, this will ensure that your pending galleries or galleries waiting in the approved queue will not show up as search results. If you plan on using the end-user search function it is a good idea to require that your gallery submitters provide at least a description with their gallery, and possibly also keywords. Galleries that do not have a description and keywords set will not be eligible to show up in the search results.
Boolean Mode Search
The end-user gallery search function uses boolean mode searches, just like you can use for some fields in the TGPX control panel. The Boolean Searches section of the software manual describes the available options and restrictions for using boolean mode searches. You may want to provide your users with details on the different search formats they can use. Feel free to copy the information from the Boolean Searches section of the software manual to use for your end-user documentation.
To help reduce the load caused by offering a search feature, the software uses a caching system. Search results will be cached for 1 hour, so if another user comes along within 1 hour and enters the same search term as a previous user, the cached results will be displayed. This will reduce the number of database queries required, but you do need to be aware of the caching system when you are testing the search feature. If you do a search and then build your pages with new galleries added, don't expect those new galleries to immediately appear in the search results if you search for the exact same term.