Gossamer Forum
Home : Products : DBMan : Discussions :

Re: [LoisC] Search tracking

Quote Reply
Re: [LoisC] Search tracking In reply to
Here is a copy of the keyword.cgi file I am using:

print "Content-Type: text/html\n\n";
# If greater than this number the script will highlight those entries.
$targetnumba = 5 ;
$font = 'font size=2';

# Print out the HTML that Appears BEFORE the sorting.

print "<HTML><HEAD><TITLE>Keyword List Html Build</TITLE></HEAD>\n";
print "<BODY background=\"../../images/bkgrnd1.gif\" BGCOLOR=\"#FFFFFF\" TEXT=\"#110000\" LINK=\"#3333FF\" VLINK=\"#23238E\" ALINK=\"#000000\">\n";
print "<P><center><a href=\"keyword.cgi\">Build Keywords</a><br><br>\n";
print "<font size=1>Currently Highlighting words greater than</font> <font color=RED>$targetnumba</font> <font size=1>searches.</font><P>\n";
print "<table width=600 border=1 cellpadding=0 cellspacing=0><tr><td>Keyword</td><td>Number of Searches</td></tr>\n";

# Open The DB, Sorts and Print out the Results.
# I run mine from the same dir as my Keywords.txt file, change it to your full path if you want people to have access to it.

open (DB, "keywords.txt") or die $!;
while (<DB> ) {
chomp;
($name, $score) = split /:/;
$scores{$name} = $score;
}
close DB;
foreach $word (sort { $scores{$b} <=> $scores{$a} } keys %scores) {
if ($scores{$word} > $targetnumba)
{
print "<TR align=left><TH><$font><em>$word</font></em></TH><TH><$font><em>$scores{$word}</em></font></TH></TR>\n";
}
else {
print "<tr><td><$font>$word</font></td><td><$font>$scores{$word}</font></td></tr>\n";
}
}
# Prints the End of the HTML
print "</table><P><font size=\"-1\">Search Log Table-izer by Crowe\@darkspiral.com</font></center></BODY></HTML>\n";

Please not I defined the font tag variable within the script. One other thing you might not realize is that the line:

$targetnumba = 5; # Highlights words greater than 5 searches.

Will only display the list of words that have been searched for more than 5 times. For testing purposes you might want to change this to a lower number such as:

$targetnumba = 2;

and then be sure to search for each word at least 2 or more times.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Subject Author Views Date
Thread Search tracking lookerjdc 6993 Oct 17, 2002, 7:03 PM
Thread Re: [lookerjdc] Search tracking
LoisC 6840 Oct 17, 2002, 7:22 PM
Thread Re: [LoisC] Search tracking
lookerjdc 6868 Oct 17, 2002, 7:35 PM
Thread Re: [lookerjdc] Search tracking
LoisC 6842 Oct 17, 2002, 7:52 PM
Thread Re: [LoisC] Search tracking
lookerjdc 6868 Oct 17, 2002, 9:31 PM
Thread Re: [lookerjdc] Search tracking
LoisC 6825 Oct 18, 2002, 10:37 AM
Thread Re: [LoisC] Search tracking
lookerjdc 6820 Oct 18, 2002, 11:43 AM
Thread Re: [lookerjdc] Search tracking
LoisC 6820 Oct 18, 2002, 1:07 PM
Thread Re: [LoisC] Search tracking
lookerjdc 6846 Oct 18, 2002, 3:16 PM
Thread Re: [lookerjdc] Search tracking
LoisC 6823 Oct 18, 2002, 6:20 PM
Thread Re: [LoisC] Search tracking
lookerjdc 6816 Oct 18, 2002, 7:58 PM
Thread Re: [lookerjdc] Search tracking
LoisC 6821 Oct 19, 2002, 8:48 AM
Post Re: [LoisC] Search tracking
LoisC 6807 Oct 19, 2002, 9:16 AM