LAST EDITED ON Feb-19-06 AT 05:15 PM (GMT)
Here's the code and instructions for the "Users Online" addon.In your dispcat8.pl file find these lines:
######## Auction Statistics ##################
print "<p>";
print "<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\" WIDTH=\"100%\">";
print "<TR><TD ALIGN=\"CENTER\" BGCOLOR=\"$config{'colortablehead'}\"><b>Auction Statistics</b></TD></TR>";
print "<TR><TD BGCOLOR=\"$config{'colortablebody'}\">Current Auctions Listed</b><font Color=\"red\"> ($totalfiles)</FONT></TD></TR>";
print "<TR><TD BGCOLOR=\"$config{'colortablebody'}\">Total Registered Users</b><font Color=\"red\"> ($numusers)</FONT></TD></TR>";
print "</TABLE>";
Now add this line listed below to the above lines just above the print "</TABLE>";
require "/your/server/path/cgi-bin/auction/usersonline.pl";
NOTE: rember to change this section /your/server/path/ of the above line to your absoulte server path, if your dont set this correctly the "users online" will not function!!
NOW copy and save the code below to a file called usersonline.pl and upload it to your /cgi-bin/auction dir and give it the permissions of 755
#!/usr/bin/perl
#!perl
#!/usr/bin/perl5
#!/usr/local/bin/perl
#!/usr/local/bin/perl5
use strict;
#-################################################
# Users Online Version 1.1 USANet Creations
#######################################
# Set the time to delete old user on line records
# 60 = 1 min, 900 = 15 min
my $deltime = 900;
#######################################
my $ip = $ENV{'REMOTE_ADDR'};
my @olddata;
open(FILE1,"usersonline.txt");
my @userdata = <FILE1>;
close(FILE1);
my $user;
foreach $user (@userdata){
chop($user);
my($usertime,$userip) = split(/\//,$user);
my $comparetime = (time - $usertime);
if (($ip ne $userip) && ($comparetime < $deltime)) {
push (@olddata,$user);
}
}
my $newusertime = time;
my $newuser = "$newusertime/$ip";
push (@olddata,$newuser);
my $usernumber = scalar(@olddata);
open(FILE2,">usersonline.txt");
flock(FILE2,2);
foreach $newuser (@olddata){
print (FILE2 "$newuser\n");
}
flock(FILE2,8);
close (FILE2);
print "<TR><TD BGCOLOR=\"$config{'colortablebody'}\">Users Online<font Color=\"#009900\"> ($usernumber)</FONT></TD></TR>";