Upgrading the Search Script
My search script like any computer program needs to be upgraded on occasion to fix problems with the script and perhaps to add functionality. All updates within 12 months of your original purchase are included in the purchase price.
Since I first published the script in September 2003 I have applied a number of fixes and enhancements as listed below. The current version number is 4.1
- Amended the build page for both flat file and database to add additional field validations.
- Additional validations on spidering pages:
- If <title> and <h1> are both missing then page will not be indexed.
- If description missing then title will be used.
- If keywords missing then title will be used with commas replacing spaces.
- If keywords start with or end with a comma the comma will be removed.
- Additional validation for both spider and edit:
- If keywords contains two, three, or four adjacent commas then the surplus commas will be removed.
- find.php renamed resinc.php and find.htm renamed to search.htm to avoid confusion
- new parameter $imgdir added to config.php. If this field is not set to '~' and a gif, jpg, or jpeg image exists in the specified directory with the same filename as a local page listed in the results then that image will be displayed at the front of the entry in the results.
- Updated to allow for multiple search tables with the database version. Both database and flat file versions updated to allow gif, jpg, jpeg, and png files to be added to the search results. Also rwl.php amended to allow images to be added to the database version in bulk. Display of images next to results now works for sub-directories as well. Where the images in the search result are from the thumbnail directory they will be not be displayed as links.
- Where images are displayed in the search results and do not link to anything they will be overlaid with a transparent image.
- Fix to convert all text (not just some) to lowercase before comparing.
- New configuration option to turn off display of number of matches on each entry.
- New configuration option to restrict multiword search to those entries matching on all words instead of any one or more words.
- Version 2.0 sees a major rewrite of much of the processing. Two extra search fields have been added called category and subject. The search results script has also now been completely rewritten to allow you to lay out the results page however you like as well as being able to display long lists of results over multiple pages.
- ability to scale down images displayed with the results if required.
- Version 3.0 Additional security enhancements
- Correct matching errors in flat file version.
- More minor security fixes
- Add .pdf to allowable file types.
- Version 4.0 implements a number of changes to make the processing more flexible, a couple of which involve updates to the config file.
- allow HTML in description field (tags are not included in searched text)
- include title with description match
- convert keywords to lowercase for compare so as to ensure matches even if the flat file was populated manually using mixed case
- replace some deprecated PHP calls
- move valid file types for spidering and validation into arrays in config file to make them easier to modify
- extract some common code for admin functionality (also to make them easier to modify)
The easiest way to implement these changes to your copy of the script is to resend the script (you will need the item and invoice numbers from your original purchase to request a resend).
A conversion script is provided for those updating from version one to version two.
This article written by Stephen Chapman, Felgall Pty Ltd.