XSearch 5.0

User manual

Overview

The XSearch script is a powerfull javascript search engine. This version5.0 is a improved version of the older v4.x versions. One of the main changes is that it's not compatible with 3.0 browsers. There are some other minor changes and some things have been left out because not many people used it. If you still want the functionality of the previous versions please download version4.3 from the Just4fun Productions website http://www.twicefun.com/just4fun. Note that XSearch5.0 is much faster, and more customizeable then the older versions.

Files explained

The following files are supplied with XSearch5.0:

Creating the Database

This chapter will explain how you can fill the XSearch database with your own url's and keywords.

The db.js file contains the definition of the database needed by XSearch. XSearch is build using Javascript, this has the advantage that everybody can use it without the need for a cgi-bin or other server side options. The disadvantage of using Javascript is that it's impossible to search through directory structures and files on the server. So you'll have to create the database manually for every page in your website.

Initialisation

The db.js file contains a few lines that initialise the database:

var records_count=0
v1=new Array(records_count)
v2=new Array(records_count)
v3=new Array(records_count)
var a=0

These lines should stay unchanged, allways start an XSearch database using the above lines.

Entries

Every XSearch database entry (record) is created using three text array's. The first of these arrays will contain a working link to the target html file, the second array contains a set of keywords, and finally the third array contains a description of the current database entry.

a+=1
v1[a]="<a href='http://www.twicefun.com/just4fun'>Just4Fun Productions</a>"
v2[a]="just4fun great dhtml xsearch javascript search engine"
v3[a]="This is the homepage of Just4Fun productions, including the XSearch5.0 homepage"

As you can see in the above example, it's very simple to create a new record.The a+=1 infront of the entry is only to increase the record counter. Don't forget the a+=1 because else you'll mis a few records.

XSearch CSS style sheet

The xsearch.css file, contains the styles used by the XSearch5.0 engine to display the different text lines. By modifying this file, you can change the look of every text line used in the XSearch engine. This is a big improvement over the old XSearch engines that could only change the color of the fonts.

Configuration parameters

The Xsearch-5.0.js file contains a few variables that need to be set to make the search work correctly.

ButtonCode = "<img src='searchbutton.gif' border=0>"

templateBody() , templateEnd() and bannerCode() for more information on these functions, read the article: Setting up your own search engine. That article was written for the older versions of XSearch, but the templateBody(), templateEnd() and bannerCode() workings haven't changed.

Making it work

Finally you'll have to create a HTML file that links the XSearch5.0 engine and the database like this:

<html>
<head>
<title>Xsearch 5.0</title>

<script language="Javascript" src="db.js"></script>
<script language="Javascript" src="xsearch-5.0.js"></script>

<body bgColor="#ffffff">
<script language="Javascript">
    initXsearch()
</script>
</body>
</html>

Contact information

If you have any questions after this manual, please browse through the old XSearch FAQ and knowledge base articles (http://www.twicefun.com/just4fun) before mailing me. Most problems have already been explained in one of those files. If you still can't get it to work you can mail me: <pascal@twicefun.com>

 

Last modified 30-01-2000