/////////////////////////////////////////////////////
// //
// PHPSiteSearch //
// Version 1.3.0 //
// //
// Copyright 2001 //
// David Broker //
// php@warpedweb.net //
// All Rights Reserved //
// //
// In using this script you //
// agree to the following: //
// //
// This script may be used and modified //
// freely as long as this //
// copyright remains intact. //
// //
// You may not distibute this script, or //
// any modifications of it. //
// //
// A link must be provided on the website that //
// uses the script to: //
// http://php.warpedweb.net/ //
// //
// Any breaches of these conditions //
// will result in legal action. //
// //
// This script is distributed with //
// no warrenty, free of charge. //
// //
/////////////////////////////////////////////////////
Readme File for PHPSiteSearch Version 1.3.0
Contents:
A site index and search script for small to medium sites.
The indexer searches your site and indexes it from either
meta-tags or all words into a text database.
The search script then performs searches on that database.
Here is a list of files that should be included in this distribution:
- readme.txt
This file.
- indexer.php
The php script which indexes your site.
- search.php
The script that does the actual searching.
- search_index.dat
The text file where the index database will be stored.
- exclude_words.txt
A list of words NOT to be indexed (and, the, or).
- exclude_files.txt
A list of files not to be index.
- Requirements:
- PHP Version 4.0.2 or greater.
This is needed because of the functions used in the script are not valid in PHP3
- VERY basic knowledge of PHP.
This is required to install the script. You need to edit a few lines of the script, all of which is described in detail.
- Configure the scripts:
In indexer.php there are 6 lines which need to be edited:
- Set the username and passowrd.
$user = "Bob";
$pass = "Bill123";
- Full server path to files (DO NOT include trailing slashes).
If using Window make sure to use double back slashes for server paths.
EG: $file_root = "c:\\html";
$file_root = "/home/user/public_html";
- Equivilent URL of the above path (DO NOT include trailing slashes).
EG: $http_root = "http://127.0.0.1";
- Full server path to the index file:
EG: $index_file = "c:\\html\\search\\search_index.dat";
$index_file = "/home/user/public_html/search/search_index.dat";
- Full server path to the file list of words not to index.
EG: $exclude_words = "c:\\html\\search\\exclude_words.txt";
$exclude_words = "/home/user/public_html/search/exclude_words.txt";
- Full server path to the file list of words not to index.
EG: $exclude_files = "c:\\html\\search\\exclude_files.txt";
$exclude_files = "/home/user/public_html/search/exclude_files.txt";
In search.php only 1 needs to be edited:
- The full server path to the search index.
EG: $index_file = "c:\\html\\search\\search_index.dat";
$index_file = "/home/user/public_html/search/search_index.dat";
- Installing the Scripts:
- Preparing Your Site:
There are a number of things which you need to take note of, in order to prepare
your site to be indexed by this script.
- Meta Tag Indexing:
- Full Indexing:
- Search Results:
- Search results will also arise from meta-tags:
<meta name="title" content="Title of the Page">
<meta name="description" content="This page is about something...">
The search engine will display the results like so:
- Title of Page http://www.whatever.com/
This page is about something...
- If there is no meta tags found the results will be like so:
- http://www.whatever.com/
The first few lines taken from the page.
- Excluding Files/Words:
- There are 2 files included in the distribution, these allow you to exclude files/words
from being indexed.
- exclude_words.txt
This file contains a list of common words (and, the, or) which will not be
indexed, you can add any words to this file that you do not want.
- exclude_files.txt
This contains a list of files not to be indexed.
If you do not want the file http://www.whatever.com/page.html to be indexed, you would place
this in the file "exclude_files.txt": /page.html
- Indexing:
- First open indexer.php in your browser and log in using the username/password you choose.
- The first thing you must do is index your site:
- Select "Create Site Index" and press submit.
- Choose between "Full Index" and "Meta Tag Index".
- If you get an error message, check the configuration of the script.
- Now you can view your index. Select "View Index" and press submit.
The table shows what your search_index.dat file looks like, with all the files and coresponding keywords.
- You can also clear the index file. Select "Clear Index" and press submit.
It will ask you to confirm before it completes this operation.
The index is cleared automatically before re-indexing.
- Searching:
That's all there is to it!
- 17-04-01 V1.3.0
- Rewrote site indexer in an attempt to order & optimise it.
- Added option to choose which file extentions to index.
- Added option to exclude certain files.
- Checks if line has keywords before writing to file.
- 28-02-01 V 1.4.5 (Not released)
- Added confirmation of clearing of index file.
- Added password protection on indexer.
- If meta tag "description" is not found search script will display first 600 characters of page (excluding HTML).
- Rewrote readme.txt.
- 17-03-01 V 1.1.4a
- Fixed irritating bug in remove_words() function that I kept forgetting to do.
- 15-02-01 V 1.1.4
- Removed "Configure" option from indexer. To much trouble for 4 lines of code.
- Fixed bug so as the indexer with work with Unix (Contributed by Vigya Shah ).
- Fixed another bug for Unix relating to file permissions (Contributed by Vigya Shah ).
- Fixed a little bug which made the address appear as http://www.abc.com//file.htm.
- Added error checking for files opening in indexer.php.
- Added an online demo of the search script and a "dummy" indexer.
- Made "View Index" option a bit "nicer".
- 01-01-01 V 1.1.3
- Changed name from PHPSearch to PHPSiteSearch.
- Added "Configure" option in indexer.php. No need to edit the
variables anymore (except in the search script).
- Set timeout of full indexer option higher than the
default 30 seconds, so as it would index larger sites.
- Added error checking in search script.
- Fixed up readme file accordingly.
- 30-12-00 V 1.1a
- Fixed a bug with the "full index" option caused by having
my "if" statements the wrong way around.
- 28-12-00 V 1.1
- Introducted meta tag indexing as default option, (full index too slow)
- Added full index as another option, and as default for text files
seeing as text file can't have meta tags.
- Added external text file for words to be excluded, couldn't do it the
other day because of PHP bug with nested "foreach" function.
Upgraded from PHP 4.0.1 to PHP 4.0.4.
- 26-12-00 V 1.0
- Initial release.
- Search engine indexes entire site excuding certain words.
- Search for single keywords only at this stage. More words result in "No Match".
- Options when searching, boolean searches, title searches, description searches.
- Implement option for wildcard (*) when searching.
- Possiblity of having option of mySQL database backend or a flatfile database.
- Re-instate webbased config of script, like Version 1.1.3 & PHPMailList.