USANet Creations
Users Support and Discussion Areas

NOTE: Always state the software package you have
when asking questions so you will get the correct answer,
as it does make a big difference in the answers you'll get!

| Main Site Home Page | Forums Home Page |

Subject: "Online Users and Visitors"   Page 1 | 2 | Previous Topic | Next Topic
nonePrinter-friendly copy    
Conferences MakeBid Auction users addons and fixes Topic #135
Reading page 1 of 2 pages
weiterer
unregistered user
Apr-10-03, 01:43 AM (CST)
 
"Online Users and Visitors"
 
   I have on my website a script that displays online users it is very very simple. It would be great is the auctions could do this, show online users(registered) and visitors. A nice addon.


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
Richardadmin click here to view user rating
Charter Member
1987 posts, 10 feedbacks, 19 points
Jan-11-06, 02:15 PM (CST)
Click to view user profileClick to add this user to your buddy list  
10. "RE: Online Users and Visitors"
 
   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>";


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
auctionit
Member since Sep-16-05
23 posts, Rate this user
Jun-13-06, 03:36 PM (CST)
Click to add this user to your buddy list  
15. "RE: Online Users and Visitors"
 
   hi,

i added this code as described but i get the error below in site :-

Software error:
Can't locate /home/******/public_html/global/uk/cgi-bin/usersonline.pl in @INC (@INC contains: /usr/lib/perl5/5.8.7/i686-linux /usr/lib/perl5/5.8.7 /usr/lib/perl5/site_perl/5.8.7/i686-linux /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .) at /home/******/public_html/global/uk/cgi-bin/auction/dispcat8.pl line 125.

For help, please send mail to the webmaster (webmaster@***********.org), giving this error message and the time and date of the error.

Software error:
[Tue Jun 13 15:31:36 2006] auction.pl: Can't locate /home/******/public_html/global/uk/cgi-bin/usersonline.pl in @INC (@INC contains: /usr/lib/perl5/5.8.7/i686-linux /usr/lib/perl5/5.8.7 /usr/lib/perl5/site_perl/5.8.7/i686-linux /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .) at /home/******/public_html/global/uk/cgi-bin/auction/dispcat8.pl line 125.
Compilation failed in require at auction.pl line 20.


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
Richardadmin
unregistered user
Jun-13-06, 07:59 PM (CST)
 
16. "RE: Online Users and Visitors"
 
   LAST EDITED ON Jun-13-06 AT 08:04 PM (GMT)
 
The you do not have the absoulte server path setup correctly in this line below as described in the above instructions"
require "/your/server/path/cgi-bin/auction/usersonline.pl";
if this is not setup correctly you will get a error just like you're getting.


You have it setup like this and is not correct:
require "/public_html/global/uk/cgi-bin/usersonline.pl";

should be more like this:
require "/public_html/global/uk/cgi-bin/auction/usersonline.pl";


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
dajceo
Member since Feb-20-06
40 posts, Rate this user
Jul-01-06, 04:13 PM (CST)
Click to add this user to your buddy list  
17. "RE: Online Users and Visitors"
 
   What is the correct line for my site? I keep trying and I get errors.

require "/bidonland/cgi-bin/auction/usersonline.pl";
I know i'm doing something wrong. Please advise. Thanks.


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
Richardadmin
unregistered user
Jul-01-06, 06:59 PM (CST)
 
18. "RE: Online Users and Visitors"
 
   >What is the correct line for my site? I keep trying and I get
>errors.
>require "/bidonland/cgi-bin/auction/usersonline.pl";
>I know i'm doing something wrong. Please advise. Thanks.

All web host and the sites under it have a totaly different absolute server paths so I would have no idea what it is, so you need to contact your web host and get your sites setup paths and or download the envtest3.pl file from any of the main pages of this site upload it to your /cgi-bin/ dir and give it the permissions of 755 it will display all your web sites info like the absolute server path.


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
dajceo
unregistered user
Jul-02-06, 10:09 AM (CST)
 
19. "RE: Online Users and Visitors"
 
   got it to work. had to put www/before bidonland/
Thanks


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
shnippy
unregistered user
Oct-08-07, 03:22 PM (CST)
 
20. "RE: Online Users and Visitors"
 
   Hi,

Can you use this script on the stats page?

Thank You,
Shnippy


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
Richardadmin
unregistered user
Oct-08-07, 07:10 PM (CST)
 
21. "RE: Online Users and Visitors"
 
   >Can you use this script on the stats page?

If you have installed the above addon and have it working then all you would have to do is add this line below to the stats.pl file where you want it displayed

require "/your/server/path/cgi-bin/auction/usersonline.pl";


"Remember" to change the /your/server/path/ to your sites server path


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
shnippy
unregistered user
Oct-10-07, 11:47 PM (CST)
 
22. "RE: Online Users and Visitors"
 
   neat addon, i will have to give it a try.

thanks Richard


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
shnippy click here to view user rating
Charter Member
493 posts, 2 feedbacks, 4 points
Feb-23-08, 05:29 PM (CST)
Click to add this user to your buddy list  
23. "RE: Online Users and Visitors"
 
   Hi,

does this only count visits to the page the require is located on?

added it to the stats page, but the count only counts me.

does this have to be on the landing page in order to keep a current tally?

Thanks,
Shnippy


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote


Page 1 | 2 | Conferences | Topics | Previous Topic | Next Topic
Rate this topic Rate this topic