Tipue

Tipue is an open source JavaScript site search engine. It works
with any browser that supports JavaScript 1.3 and at least
partially supports the W3C DOM Level 1.

Tipue is released under the GPL licence.

Tipue 1.6

This or the latest version of Tipue can be downloaded from
www.tipue.com

We also have a Knowledge Base at www.tipue.com/kb/

Tipue Copyright (C) 2002-2004 Tri-State Consultants


DOCUMENTATION
-------------

1. Introduction
2. Installing the scripts on your pages
3. Creating the data file
4. The script properties
5. The Tipue button
6. Support
7. Donations
8. Revision history
9. Licence


--------------------------------------------------------------------

1. INTRODUCTION

Tipue is small and lightweight at less than 9Kb, platform independent
and doesn't require any other technologies on your host. It's best
suited to smaller sites with less than 100 pages.

Tipue circumvents HMTL's inability to pass a value from one page to
another by using a session or non-persistent cookie. The cookie expires
when the user's session ends. 

Tipue consists of two scripts. The first writes a cookie containing the
search words and then loads the results page. The second script does all
the work; reading the cookie and the data file, defining the matches and
generating the search results. 

For users, searching is similar to Google. A preceding minus character
excludes a word, while phrases are supported within double-quotes. The
logical OR and NOT operators are also supported.

The returned pages are ranked according to how often the search words
occur and where. You can also weight a page so that its scores higher.
For more information on page ranking see www.tipue.com/kb/a0005.html


--------------------------------------------------------------------

2. INSTALLING THE SCRIPTS ON YOUR PAGES

For examples of how to install Tipue on your pages please see form.html
and results.html.

The page containing the search box should include in the <head> section: 

<script language="JavaScript1.3" type="text/javascript" src="tip_form.js">
</script>

The <form> code should be similar to the example below. Please note that
the <form> name, onsubmit and initial <input> values are fixed.

<form name="tip_Form" onsubmit="search_form(tip_Form);return false">
<input type="text" name="d">
<input type="submit" value="Go">
</form>

For the results page, the <head> section should include: 

<script language="JavaScript1.3" type="text/javascript" src="tip_form.js">
</script>
<script language="JavaScript1.3" type="text/javascript" src="tip_data.js">
</script>
<script language="JavaScript1.3" type="text/javascript" src="tip_search.js">
</script>

The code below returns the number of matches found:

<script language="JavaScript1.3" type="text/javascript">tip_num()</script>

There is also an external JavaScript variable: 

tip_Num 

This returns the number of matches found and can be used within your own
JavaScript functions.

The code below returns the search results:

<script language="JavaScript1.3" type="text/javascript">tip_out()</script>

There is one additional, nonessential function. This should only be used on
the results page, and should follow the <form> code. It adds the previous
search query to the <form> search field.

<script language="JavaScript1.3" type="text/javascript">tip_query()</script>


--------------------------------------------------------------------

3. CREATING THE DATA FILE

The site data is held as a JavaScript array in the tip_data.js file. The
format of the array is: 

s[NUM] = "TITLE^URL^TEXT^CONTENT^OPEN^RANK"; 

The ^ character acts as a record separator. The TITLE, TEXT and CONTENT
fields are searched. 

NUM is a sequential integer number, starting at zero.

TITLE is the title of the page.

URL can be either a file name or a fully qualified URL, including the http://
element.

TEXT is a line of text that describes the page.

CONTENT can be a short list of keywords to the full text of the page. If you
have a site with less than fifty pages close to the latter is recommended. 

OPEN specifies how the link displays when it is selected. If the field is 0
the link opens in the current window. If the value is 1 the link displays in
a new browser window. If you're using frames you can also specify a frame name.
For more information on using frames with Tipue see www.tipue.com/kb/a0003.html

RANK adds a value to the page's ranking score; which has the effect of making it
return correspondingly higher in a group of results with a similar score. The
value is 0 to 10, with 0 as the default. This field is optional.


--------------------------------------------------------------------

4. THE SCRIPT PROPERTIES

There are several script properties to control output and specify file location.
Each of these properties can be found at the beginning of the scripts. 

There is one property for the tip_form.js script: 

results_location = FILENAME 

Where FILENAME is the location of the search results page. This can be either
a file name or a fully qualified URL, including the http:// element. 

Example: 
var results_location = "results.html";

There are five properties for the tip_search.js script: 

results_location = FILENAME

This property should contain the same value as in the tip_form.js script.

Example: 
var results_location = "results.html";

return_results = INTEGER;

Where INTEGER is the number of results returned per page.

Example:
var return_results = 10;

include_num = INTEGER 

Where INTEGER is either 1 or 0. Sets results numbering on or off. 

Example: 
var include_num = 1; 

bold_query = INTEGER 

The first instance of the search terms are highlighted in bold if
INTEGER is 1, and returned as plain text if INTEGER is 0. The results
highlighted are case-sensitive. 

Example: 
var bold_query = 0; 

include_url = INTEGER 

Where INTEGER is either 1 or 0. If INTEGER is 1 the URL is displayed as
an additional line in the search results. 

Example: 
var include_url = 0;


--------------------------------------------------------------------

5. THE TIPUE BUTTON

Use of the Tipue button on your pages is entirely voluntary. There are
three included here designed for different page backgrounds. Please
note though that if you do decide to support Tipue via any of the
buttons the graphic shouldn't be altered and must always link to
www.tipue.com 


--------------------------------------------------------------------

6. SUPPORT

For support you need a Tipue Id. With a Tipue Id you receive e-mail
support for all Tipue products. A Tipue Id costs $29.99 per year. We also
process payment in other currencies including Pounds Sterling and Euros.
You can purchase a Tipue Id from www.tipue.com/id/ or see more details at
www.tipue.com/support/

We also have a Knowledge Base at www.tipue.com/kb/


--------------------------------------------------------------------

7. DONATIONS

Tipue is funded via a combination of advertising, support services
and donations. If you use Tipue and would like to show your
appreciation please either purchase a Tipue Id or make a donation.

You can donate at www.tipue.com/donate/


--------------------------------------------------------------------

8. REVISION HISTORY

1.6

New features:
Introduction of the page ranking system.
You can now choose to open a link in a specified frame.
The logical NOT operator is now supported.

Minor bug fixes and code revision.

1.51 - 1.53

Minor bug fixes.

1.5

New features:
The logical OR operator is now supported.
You can now return a number of results per page.	

Bold case bug fixed and other minor bug fixes.

1.4

New features:
You can now choose to open a link in a new window.

Minor bug fixes.

1.0 - 1.31

Minor bug fixes.


--------------------------------------------------------------------

9. LICENCE

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
