		/*////////////CREDITS/////////////////
		//                                  //   
		//  copyright  Pierre Hannah 2001  //
		//  Pierre.Hanna@fceduc.umu.se      //
		//                                  //
		//  search engine project           //
		//  MAZOT v 0.0.7                   //
		//                                  //
		/////////////ENDOF CREDITS//////////*/

/*/////////////////////////TERMS OF AGREEMENT///////////////////////////
// 								      //	
//      IN USING THIS SEARCH ENGINE, YOU AGREE TO THE FOLLOWING:      //		
//								      //	
//      -------------------------------------------------------       //	                           
//      The credits information must remain as is and may not be      //
//      modified or removed in any way. This, e.g, means that any     // 
//	links, related to information about the author, must be       //
//	visible on the same pages that targets the search engine      //
//	and display its results.   				      //
//	--------------------------------------------------------      //
//	You may not, under any circumstances, use these scripts       //
//	for any commercial purposes.				      //	
//	--------------------------------------------------------      //
//	You may redistribute the codes only if the credits remain     //
//	intact as is. Profit may not be made in any form.             //		
//	--------------------------------------------------------      //
//	You may modify portions of the code to suit your individual   //
//	needs, credits must nonetheless remain intact. You may only   //
//	redistribute the code in a modified form if attached is       //
//	information about it, preferably what specific modifications  //
//	are done.						      //
//	---------------------------------------------------------     //
//	The author of this search engine cannot be held responsible   // 
//	for any consequences, in any form, related to the use of it.  //
//								      //
//	ALL RIGHTS RESERVED...					      //
//	---------------------------------------------------------     //								      //	
//	Any attempts to break the terms above will lead to            //	
//	legal action.						      //
//	___________________________________________________________   //	
//      I hope you enjoy using this search engine. Please don't       //
//	hesitate to contact me if you find any bugs, which I am sure  //  
//	are many, in these scripts. It is very appreciated if you     //
//	could let me know about them since that will only be of       //
//	benefication to future versions of this search engine.        //
//								      //
//	Pierre Hannah						      //
//	Sweden, july 15 2001					      //
//								      //
////////////////////////ENDOF TERMS OF AGREEMENT//////////////////////*/

////////////////////////////BRIEF DESCRIPTION///////////////////////////

This version, v.0.1, of the MAZOT search engine is pre beta release 1.
The engine is suitable for the small to medium sized web sites. Among its
supported features is boolean search, regular expression search, pronunctiation
search, different syntax specifications searches and other features among some
are unique.

Multiple SQL support is yet to be added.


/////////////////////////ENDOF BRIEF DESCRIPTION////////////////////////

The procedures to set up these engines are very simple and there is no
need for thorough understanding of the PHP scripting language or HTML and
JavaScript for that matter( the three languages that these engines utilizes)
since these scripts are pretty selfrunning.

Although it is good if you have basic knowledge of at least HTML because you will
probably want to change the appearance of the scripts to fit your existing
site design. 

If you do know how to make custom changes in PHP source codes, I refer you 
to the legal terms above.

/////////////HOW TO SET UP THE SEARCH ENGINE ON YOUR WEB SITE///////////

First of all: Ofcourse you need to have your site on a server that supports
PHP. This version is only tested on PHP version 4.0.6. Older versions exclude
guarantee of full function, although it should work fine with versions 4.x and 
above.

You must also take into account that the client need a browser that supports
JavaScript. Most browsers today do, but it is good to know in case you want
to attach information to the client about that on your site; or make a re-
direction of the visitor.

To be on the secure side, be sure to chmod "hitwrite.txt" to 755 inorder to
provide  for the correct filepermissions. I have included an chmod in the source
code, however, it is no guarantee that it will work for everybody, so you'd really
be better off if you take care of that manually.

These are the files you should and must have:
	
	SOURCE CODES:
	  pathlisting.php
	  search.php
	  search_Case.php
	  search_CaseWhole.php
	  search_Whole.php
	  metasonly.php
	  report_metakey.php
	  report.php
	  query_machine.php
	  startengine.php
	  startengine_Case.php
	  startengine_CaseWhole.php
	  startengine_Whole.php
	  cachemachine.php
	  form2.php
	  execute.php
	  mexecute.php
	  printlinks.php
	  meta_printlinks.php
	  within.php
	  searchwithin.php
	  mFilterFunction.php
	  FilterFunction.php
	  filter.php
	  mFilterFunction.php
	  exclude_ext.php
	  similar_txt_function.php
	  msimilar_txt_function.php
	  prefilter.php
	  pronsimilar_txt_function.php
	  startengine_pron.php
	  search_pron.php
	  startengine_lev.php
	  search_lev.php
	  extr_meta_function.php
	  near_functions.php
	  near_functionsEW.php
	  startengine_near.php
	  boolean_beast.php
	  boolean_beast_c.php
	
	IMAGES AND HTML RELATED STUFF:
	  cl_style3b.css
	  logo.gif
	  exact.gif
	  logo.psd
	
	ADDITIONAL:
	  .htaccess (directory access restriction)
	  todo
	  readme
	  changes
	  hitwrite.txt
	  within.txt 
	  exclude_ext.htm 
	
	
Put all the files in the root dir from which you want to trigger your search.note
that only files in and from that dir will be scanned. That means that in order to
search a page, it must be located in the same directory as the search engine, or
in any subfolder relative to it. In other words, all the files will be searched if
you put the search engine in your root dir. To exclude files read below...	
	
In "pathlisting.php" you will find these lines (maybe not exactly like that, 
but you can't miss them):
	
	if (ereg(".html|.htm|.php|.asp|.txt", $filePath)){ //include files	                
	       //no need to touch this one if (!ereg ("/\w.+tar/|/\w.+ace/|/\w.+rar/|/\w.+zip/|/w.+gif/|/w.+jpg/|/w.+jpeg/|/w.+png/|/w.+bmp/|/w.+css/|/w.+psd/", $filePath)){ //exclude files with substring. default: not used           		      
		            if (!ereg ("pathlisting.php|search.php|search_CaseWhole.php|search_Case.php|search_Whole.php", $filePath)){ //exclude source codes
		      
Modify them to include and/or exclude files and/or file extentions. (The syntax
should be pretty self explanatory. I made it almost as simple as it can get.)

In "query_machine.php" you will find the line:
	
	$urlbase = "http://localhost/my_sites/tests/temp/txt_test/subfolder/";
	
Change the line to the path where you put your search engine files, 
which will most likely be the path to your root dir. e.g, if your site's url address
is: http://mysite.dot.com/, so will the the $urlbase be. If you
decide to put your files in a subdir: http://mysite.dot.com/subfolder/ then it will be
according to that, very simple. It is important to add the final slash to the end of
the path, it will fail otherwise.

In "querymachine.php" and "report.php" you will find the lines below. These are used
to set the option for using the domain restriction search option or not. It is set to
"true" by default, which means that it is used. If you want to turn it off you must
set the variable "$use_list" to "false". I recommend using it. 

$use_list = true;
            if ($use_list == true){
        
         ////////////INCLUDE LIST/////////////           
            include ('restlist.php');
         /////////////////////////////////////
         }
         
         
If you leave it in default state, you need to only modify the file "restlist.php".
In it you will find lines that look like this:

<option\n"; 
       if($path == ".")               {echo "\nselected\n";}   echo "\nvalue=";  echo "\".\"";                echo ">Entire Site</option>
    <option\n";
       if($path == "./subfolder1-2")  {echo "\nselected\n";}   echo "\nvalue=";  echo "\"./subfolder1-2\"";   echo ">subfolder1-2</option>
    <option\n";
    
    ...and so on
    
Looking at its pattern it should be pretty self explanatory how to set up the
folders and the paths so that they mirror your site structure.             

The first pre beta versions of these engines offered the webmaster to make a custom
standart html form to trigger the scripts, however things has changed along the developement
and there is at this temporarily stage practically no such option offered by my
recommendation since that would require PHP knowledge and the ambition to do so, something
which I don't take into consideration that the bulk of the eventual users of these engines 
have, nor do I think they have the time to put off for such an exhaustive custom change.
One can ofcourse still write a custom form, however that will most probably not work correct,
which in turn will disable many features of the engines if done wrongly.
   The reason for this sad evolution is my limited amount of time along with the features added
to the scripts. However there will ofcourse be an option to make such a custom html form which
will preserve all the features of the engines. But that lies ahead.



As you've probably noticed in the filelisting above, I have included three image files
and one style sheet file. Two of the image files are optimized .gif files, the logo and the
form. The other image file has a .psd extention, i.e a Photoshop file format. It contains 
the original logo, i.e a higher rez version of the .gif logos. I included it in case you 
want to reoptimize the logo to fit your own site.

The fourth file has a .css extention and you can use it, to some extention, change the
existing format of the displaying text. If you are familiar with style sheets, this can
be a pretty good and fast way to make the engine fit smoothly into your graphical design.
Although, you are indeed limited of what you can change by changing the style sheet alone.
To make more radical changes of the appearance, you will have to change the PHP HTML
formatting output and if you can, the PHP itself (see the legal terms above).

If you wish to translate the language of the various alerts and reports, you should know that
the various reports are spread over all the source codes except "pathlisting.php". The main
report is in "report.php" and the bulk of the rest in "query_machine.php". Since this is a pre-
beta release of the engine, it has not yet an implented language engine, however there will most
likely be one before version 1.

Future versions may include an implemented full formatting engine.

I have tried to ship the engine with a plausible format, ready for you to run as is, but
that is ofcourse inevitably, much colored by my own individual taste.


That should do the trick!

cheers
Pierre			    	

Pierre.Hanna@fceduc.umu.se

-------------------------------------------------------------------------------
"If you don't know where to go, every road will take you there" (Jiddish saying)
-------------------------------------------------------------------------------