Gossamer Forum
Home : Products : Links 2.0 : Customization :

Keyword Table Mod Error

Quote Reply
Keyword Table Mod Error
Hi to all, I've downloaded this mod from your site. It reads a logfile and displays the results on my screen.
The script works great when someone has visit my website for more then 1 time but when he has visit my website for only 1 time the script doesn't display the results...

The script can't read this from my log file:
http://www.hacktor.com|1|997494838

I hope you can help me with this little one....

Greetings Hacktor
#!/usr/bin/perl
#
# Keyword Table by PainAngel's Scripts
# http://www.simsearch.com/pascripts/
#
# Features:
# Highlighting of Average and Hot Keywords
# Ranking Based on Status
# Last Searched Date
#
# INSTALL:
# Plug - And - Run Script
# Upload It, CHMOD It, Run It
#
# (note: make sure the require "links.cfg" tag below points to your links config file)
#
# HISTORY:
# version 1.0.0 => 1.0.1
# - Improved Highlighting algorithms
############################################################

print "Content-Type: text/html\n\n";
require "d:/inetpub/wwwroot/cgi-bin/admin/links.cfg";

# Path to keyword log file
$kword_file = "d:/inetpub/wwwroot/pages/log/additionstatslog.txt";

# 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, "<$kword_file") or die $!;
@lines = <DB>;
close DB;

#First get the top percent of searches
foreach $line (@lines) {
chomp $line;
($name, $score, $date) = split (/\|/, $line);
$date = &unix_to_date($date);
$n++;
$average = $average + $score;
$total = $total + $score;
if ($score > $hotsite) {
$hotsite = $score;
}
}

$average = int($average / $n);
#if average is too low give hotsite marking a five point span
if ($average eq 1) {
foreach $line (@lines) {
chomp $line;
($name, $score, $date) = split (/\|/, $line);
if ($score != 1) {
$x++;
$average = $average + $score;
}
}
$average = int($average / $x);
}
$hotsite = int($hotsite - ($hotsite / $average) + $average);
$highliter = int(($hotsite - ($hotsite / $average)) / $average);

# Print out the HTML that Appears BEFORE the sorting.
print "<HTML><HEAD><TITLE>Keyword List Html Build</TITLE></HEAD><body link=red vlink=red bgcolor=ffffff text=000000><center>\n";
print "
<font size=2>There are a total of <font color=RED>$total</font> searches to work with.</font>\n";
print "
<font size=2>Currently Highlighting words greater than <font color=RED>$highliter</font> searches.</font>\n";
print "
<font size=2>Current HOT words greater than <font color=RED>$hotsite</font> searches.</font>

\n";
print "<table bgcolor=C0C0C0 width=600 border=1 cellpadding=0 cellspacing=0><tr><td bgcolor=E0E0E0 valign=top>Keyword</td><td bgcolor=E0E0E0 valign=top>Number of Searches</td><td bgcolor=E0E0E0 valign=top>Last Searched On</td></tr>\n";

#Print the results here
foreach $line (@lines) {
chomp $line;
($name, $score, $date) = split (/\|/, $line);
$date = &unix_to_date($date);
if ($score > $hotsite)
{
$hotw = $hotw . "<tr><td valign=top bgcolor=\"red\"><font><b><em>$name</font></em></b></td><td valign=top bgcolor=\"red\"><font><b><em>$score</font></em></b></td><td bgcolor=\"red\">$date</td></tr>\n";
}
elsif ($score > $highliter)
{
$avew = $avew . "<tr><td valign=top bgcolor=\"lightyellow\"><font><b><em>$name</font></em></b></td><td valign=top bgcolor=\"lightyellow\"><font><b><em>$score</font></em></b></td><td bgcolor=\"lightyellow\">$date</td></tr>\n";
}
else {
$regw = $regw . "<tr><td valign=top><font><b><em>$name</font></em></b></td><td valign=top><font><b><em>$score</font></em></b></td><td>$date</td></tr>\n";
}
}

print $hotw;
print $avew;
print $regw;

# Prints the End of the HTML

print "</table>

<font size=1>Modified Search Log Table-izer by PainAngel pain_angel\@hotmail.com (original by Crowe\@darkspiral.com)</font></center></body></html>\n";


Quote Reply
Re: Keyword Table Mod Error In reply to
Is there somebody who can help me with this mod problem. Thx all....