In info.cgi, replace sub main with the following:
Code:
sub main {
%in = &parse_form();
my (%rec) = &get_record ($in{'ID'});
if ($rec{$db_key} eq $in{'ID'}) {
if (open (HIT, "<$db_hits_path/$id")) {
my ($count, $old_time, @IP, $ip, $visited);
chomp ($count = <HIT>);
chomp ($old_time = <HIT>);
chomp (@IP = <HIT>);
(($time - $old_time) > 21600) and (@IP = ());
foreach $ip (@IP) {
$ip eq $ENV{'REMOTE_ADDR'} and ($visited++ and last);
}
if (!$visited) {
push (@IP, $ENV{'REMOTE_ADDR'});
$count = $count + 1;
open (HIT, ">$db_hits_path/$id") or &error ("$cant_increment_counter");
if ($db_use_flock) { flock (HIT, 2) or &error ("$cant_flock"); }
local $" = "\n";
print HIT "$count\n$time\n@IP";
close HIT;
}
}
else {
open (HIT, ">$db_hits_path/$id") or &error ("$cant_increment_counter");
print HIT "1\n$time\n$ENV{'REMOTE_ADDR'}";
close HIT;
}
$title_unlinked = &build_unlinked_title ("$rec{'Category'}/$rec{'Title'}");
$title_linked = &build_linked_title ("$rec{'Category'}/$rec{'Title'}");
&html_print_headers;
print &site_html_detailed (%rec);
}
else {
&html_print_headers;
print &site_html_detailed_error ("Link not found or not specified.");
}
}
and let me know if that works.
Happy Coding,
--Drew
http://www.FindingHim.com