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 | 3 | Previous Topic | Next Topic
nonePrinter-friendly copy    
Conferences MakeBid Auction user submitted addons and updates Topic #135
Reading page 2 of 3 pages
Richardadmin click here to view user rating
Charter Member
2036 posts, 11 feedbacks, 21 points
Feb-23-08, 08:54 PM (CST)
Click to view user profileClick to add this user to your buddy list  
25. "RE: Online Users and Visitors"
 
   LAST EDITED ON Feb-23-08 AT 09:06 PM (GMT)
 
>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?

Yes this has to be on the main page so it can count the new users comming into your site then you can also add it to the stats page and it will count correctly just will not if it's on the ststs page only.


Also you have to create the usersonline.txt file and it has to be under your site /cgi-bin/auction/ folder and it has to have the permissions of 777


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
Tropical1
Charter Member
257 posts, Rate this user
Nov-10-08, 07:24 PM (CST)
Click to add this user to your buddy list  
26. "RE: Online Users and Visitors"
 
How do i set the time longer I tried adding 4000 to my $deltime = 900; so it looks like this my $deltime = 4000; but it only seems to be clearing at 15 min only. Is there some thing else I have to change?

Set the time to delete old user on line records
# 60 = 1 min, 900 = 15 min
my $deltime = 900;


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
Tropical1
Charter Member
257 posts, Rate this user
Nov-11-08, 02:24 PM (CST)
Click to add this user to your buddy list  
27. "RE: Online Users and Visitors"
 
Ok I got it my mistake its couting by seconds and not minutes.


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
moneysav
Charter Member
102 posts, Rate this user
Jul-15-10, 09:00 PM (CST)
Click to add this user to your buddy list  
28. "RE: Online Users and Visitors"
 
   Hi, I am not a programmer, but, as i see it, all the above coding is for Users, where is the coding for visitors.?

Where is the print statement for print "visitors = " ?????

or am i missing something.


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
Richardadmin click here to view user rating
Charter Member
2036 posts, 11 feedbacks, 21 points
Jul-17-10, 00:48 AM (CST)
Click to view user profileClick to add this user to your buddy list  
29. "RE: Online Users and Visitors"
 
   >Hi, I am not a programmer, but, as i see it, all the above coding
>is for Users, where is the coding for visitors.?
>Where is the print statement for print "visitors = " ?????
>or am i missing something.

This add-on is for visitors, in the coding it will show users =
as it counting all users online registered and unregistered


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
Len click here to view user rating
Member since May-4-04
601 posts, 6 feedbacks, 10 points
Jul-20-10, 12:03 PM (CST)
Click to view user profileClick to add this user to your buddy list  
30. "RE: Online Users and Visitors"
 
   To/All
Is there a way to show members and visitors online separately?
perhaps get it to read a members I.P. from the reg file.
and not count the users online if a member's I.P. is read?
i.e. like the below

Members Online Now = (20)
Visitors Online Now = (22)

Many thanks for any help


Best Regards
Len


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
moneysav
Charter Member
102 posts, Rate this user
Nov-06-11, 10:20 PM (CST)
Click to add this user to your buddy list  
31. "RE: Online Users and Visitors"
 
   Hi,

Great addon, works just great.

I was wondering. Is there a way to use the visitors' quad ip number and go out into the net and freely get the visitors' country, city, longitude and latitude? This way when someone visits you could print "<Welcome Visitor from $city, $country>";

Any Ideas ?
Cheers,
Moneysav


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
moneysav
Charter Member
102 posts, Rate this user
Apr-15-12, 07:03 AM (CST)
Click to add this user to your buddy list  
32. "RE: Online Users and Visitors"
 
   LAST EDITED ON Apr-15-12 AT 07:20 AM (CST)
 
Hi Len,
regarding comment #30 above, I've been looking into this and believe it can be done, however, I forsee problems that need to be addressed.

When a new user registers, his ip gets recorded into the reg file. If the new user is going through a ISP, most likely the ISP will assign a dynamic ip address and what you may be recording into the reg file is only one ip address of a possible many ip address for this user. I may be wrong in this thinking and please correct me.

The usersonline.pl is called from your dispcat.pl (which ever version you are using) and records the ip address (12.452.3.112) into the usersonline.txt with a time stamp like this:
1332561284/12.452.3.112 The incomming ip is captured with this line:$ip = $ENV{'REMOTE_ADDR'};

All visitors and members gets this kind of recording into the temporary usersonline.txt. This file gets opened every time the dispcat is run and checks the time stamp of each line item and removes the line after a certain time of inactivity so as not to clutter your usersonline.txt file.

Now, when you look at the visitor counter on the mainpage site stats, you may see visitors(15).
ONE of those visitors is YOU as admin looking at your own site.
Some maybe members who may have logged on or not.
Some maybe visitors.

How to filter the members from visitors I guess is now the question.

I have been keeping a permanent record of ALL incomming ip's in a separate file and after awhile, I have seen a series of ip's that belong to me comming from my ISP. I use http://whatismyipaddress.com to get ip details.

After several months of recording I could see that my ip's would be grouped in to blocks.
The blocks of ips would look something like this:
xxx.58.12.15 - xxx.58.12.250
xx.2.32.1 - xx.2.33.9
etc

The first thing I did was to write a short script using these blocks of ip's to bypass the recording into usersonline.txt, this way I knew that I was not in the count of visitors.

The script I used was:
if($ip ge "110.58.12.15" && $ip le "110.58.12.250"){goto END;}

NOTE: at the very end of usersonline.pl just above the 1; I added the lable END:

Now that I am not counted, the next step is to separate the visitors from the members.

I don't think I have come across a file with just the names of members or members' ip's in it who are logged on. (I could be wrong) If such a file exsisted you could just subtract the visitor count from this file and end up with pure visitors.

So now the site stats would be:
Members online(3)
Visitors online(11)
----------- =(14) because you as admin are not counted now.

Assuming that such a file does not exsist then here comes the theoretical part.

In the config.pl sub setlogin subroutine (where only members log in), a line needs to be added to a new file that saves $alias.

example:
open(FILE, ">> $basepath/membersonly.dat");
flock(FILE, 2);
print FILE "$alias\n";
flock(FILE, 8);
close(FILE);

This would get all the logged in members in to one appending(continously being added to) file.

To read this file your would do this:
open(FILE, "$config{'basepath'}/membersonly.dat");
@members = <FILE>;
close(FILE);
my $membercount = scalar(@members);

Now when usersonline.pl reads the usersonline.txt with this:
open(FILE1,"...path/auction/usersonline.txt");
my @userdata = <FILE1>;
close(FILE1);

add after close(FILE1);
my $usercount = scalar(@userdata);

and now your can print the 2 lines for the site stats as:

print "Members online($membercount);
print "Visitors online($usercount-$membercount);

of course every time a member would log off, your would have to remove him from the membersonly.dat file.

The above is theorectical off the top of my head, but the concept I believe is sound. Maybe recording the cookie into the file is better?
Maybe someone with more tech knowledge can add something.

Regards,
Moneysav


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
Len click here to view user rating
Member since May-4-04
601 posts, 6 feedbacks, 10 points
Apr-16-12, 07:59 AM (CST)
Click to view user profileClick to add this user to your buddy list  
33. "RE: Online Users and Visitors"
 
   LAST EDITED ON Apr-16-12 AT 08:01 AM (CST)
 
Hi moneysav
Many thankd for your Post!
I think Richard or Homer
are the ones who can help us with this addon?
it must be possible, as it's on most forum scripts.

Best Regards
Len


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote
Homermoderator click here to view user rating
Member since Jan-10-08
335 posts, 3 feedbacks, 6 points
Apr-16-12, 02:43 PM (CST)
Click to view user profileClick to add this user to your buddy list  
34. "RE: Online Users and Visitors"
 
   LAST EDITED ON Apr-16-12 AT 02:46 PM (CST)
 
it's really a 'fastdraw-solution', created out of one of my Statistic Addons. Nothing serious, but after playing a couple of hours with that thing after reading moneysav's post, I give it to you to play with it...

It will display 'registered members' only to logged in users. Not, because it's on purpose, but because I was just to lazy to look for another piece of code to display it to all users. Would not be a big problem to change this...

Other things could be improved also, but I just wanted to give you an idea how it could be solved.

A long time ago, a fellow named "SPLATT" wrote routine, but it's more difficult to implement, I figure, anyway.

Good Luck

Homer

BTW. See it here: http://www.everyauction.info/cgi-bin/ea/auction.pl

If you don't know where you're going, any road will get you there.

Attachments
http://www.usanetcreations.com/dcforum/User_files/4f8c765a19ae7c3d.txt

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


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