| www.simball.de | Links mods | Live Search Mod | 

Gossamer-Threads - Links 2.0 mod

Live Search Mod - with SSI and Javascript - for templates.

This modification allows you to build a live search like the "Live Search" by www.fireball.de.
It displays the last X search terms with a Javascript ticker on a .shtml page.

You can find a demo here. Instructions in a text file: follow this.

Download a .zip file with all Live Search files: here.


Step 1.1:

File: search.cgi

In search.cgi find the following:

code:


# Word is too common, don't try and sort it, can cause problems.    
    if (($numhits > 50) and (($grand_total * 0.75) < $numhits)) {
        return "Search term is too common.";
    }
and add the following under it:

code:


&livesearch;

Step 1.2:

File: search.cgi

In search.cgi add the following sub at the end of the file:

code:


Step 2:

File: jslivesearch.pl

The jslivesearch.pl.txt file: Rename it to jslivesearch.pl and upload it to the directory where your other Links 2.0 CGI files like add.cgi, search.cgi, ... are stored. CHMOD it to Read & Execute for all three columns.


Step 3.1:

File: livesearch.shtml

The livesearch.shtml.txt file: Remane it to livesearch.shtml.
Change the following code in the Javascript in the <Head> of the document:

code:


http://www.YOURDOMAIN.com/cgi-bin/jslivesearch.pl
to the URL of the jslivesearch.pl file.

And change:

code:


http://www.YOURDOMAIN.com/cgi-bin/search.cgi
to the URL of your search.cgi file.

Upload it to directory where .shtml files could be run.


Step 3.2:

File: home.shtml

Or put following code in the <Head> of your home.shtml template, if you want to display the Live Search on your Links 2.0 homepage.

code:

Perhaps change the URL (YOURDOMAIN) to the URL of the jslivesearch.pl file and add a "<" in front and a ">" at the end of the following:

code:


!--#include virtual="http://www.YOURDOMAIN.com/cgi-bin/jslivesearch.pl"--


In the <Body> tag of the document add the following:

code:


onload="scroll();"


In the <Body> of your home.shtml template add the following form:

code:


<form name="search" action="http://www.YOURDOMAIN.com/cgi-bin/search.cgi" method="GET">
	Live Search:<br>
	<textarea name="query" rows="2" cols="20" wrap="virtual">
	</textarea><br>
	<input type="submit" value="Search">
</form>	
Perhaps change the URL (YOURDOMAIN) to the URL of your search.cgi file.
Upload this file and rebuild your Links 2.0 pages.


Step 4:

File: livesearch.txt

Upload the livesearch.txt (an empty .txt file called livesearch.txt) data file to your Links 2.0 data directory and CHMOD it 666 = Read & Write for all three columns.


Step 5:

File: links.cfg

In your links.cfg file find:

code:


# Database Options
And add following above it:

code:


# Live Search option - display maximum number of search terms
$maxterms = "5";
In this example the last 5 search terms would be displayed.
Upload your Links 2.0 links.cfg file.


That's it. Enjoy it. For installation of modifications please visit the webservices.


AnzeigeGratisworld.de - Das Onlinemagazin

Problems with installing or questions, visit the Gossamer-Threads Support Forum.


| Top