Gossamer Forum
Home : Products : Links 2.0 : Customization :

visitors online = ?

(Page 2 of 2)
> >
Quote Reply
Re: visitors online = ? In reply to
***Sorry for being fussy***

Code:
my @data = split /\|/, $_;
...can be just...

Code:
my @data = split /\|/;
Installations:http://www.wiredon.net/gt/

Quote Reply
Continue of topic visitors online. In reply to
So it was a good idea to make a counter like this. I am really enjoing using it. But I found a bug (maybe really it is not a bug).
Example: There are 2 persons currently are online. And both of them are using THE SAME PUBLIC PROXY SERVER (not anomim.). And that`s why counter shows ONLY 1 PERSON IS ONLINE.
_______________________
I know that public proxies do not change user ip, and anonimous proxies do.
So is there any way to fix this problem?
____________________________
PS I really like this counter %)

Quote Reply
Re: [DenisSlinkin] Continue of topic visitors online. In reply to
having problems, every time I access the page, and I know there are other visitors online it only shows 1. I have another php counter to show online users and it sometimes says I have 22 visitors online. I had another person I showed this code to say the same thing.
thanks,
Paul
Webmaster Discussions
Quote Reply
Is this the problem In reply to
Is this the problem:
Here you have the following to print out:
print $count;

isn't that just calling the my $count which is set at 1 like this:
my $count = 1;
Thanks,
Paul
Webmaster Discussions
Quote Reply
Re: [hacker] Is this the problem In reply to
DenisSlinkin,

an alternate method would be to set cookies and have randomly generated session ID's stored in the cookie.

Hacker,

aside from what DenisSlinkin mentioned, it also has to do with when a certain user is expired. You php script may have a longer period of time before a user is considered inactive and is removed.

I'll post an update for this sometime in the next couple weeks.

--Philip
Links 2.0 moderator
Quote Reply
Re: [PerlFreak] Is this the problem In reply to
Drew I really dont think that's it, my PHP script is set at 15 minutes and this is set at 10. Let me check very quickly if this is even logging the data into the DB.
Thanks,
Paul
Webmaster Discussions
Quote Reply
Re: [hacker] Is this the problem In reply to
Nope doesn't even log this. My permissions are set at 777 for the loo files. I did try 666 and that didn't work eighter. My directory the script is in is set 777. Maybe the problem is in where it renames the temp.db script. Do we really need this step or can we just skip to log.db.
Thanks,
Paul
Webmaster Discussions
Quote Reply
Re: [hacker] Is this the problem In reply to
Nope this isn't even logging the IPs to the database, it only has 1. Can someone please help, I want to incorporate this into a portal script I will write for my links site.
Thanks,
Paul
Webmaster Discussions
Quote Reply
Re: [hacker] Is this the problem In reply to
can you show me what code you are using in the script and how you are calling it from within your templates?

--Philip
Links 2.0 moderator
Quote Reply
Re: [PerlFreak] Is this the problem In reply to
use strict;
my $log = '/home/fanaticn/www/cgi-bin/counter';
my $ip = $ENV{REMOTE_ADDR};
my $now = time();
my %ip;
my $count = 2;
open (LOG, "$log/log.db") or die("Could not open log file for reading: $!");
open (TEMP, ">$log/temp.db") or die("Couldn't create temp log file: $!");
flock (TEMP, 2);
while (<LOG> ) {
chomp;
my @data = split /\|/, $_;
(($now - $data[1] > 600) or ($ip eq $data[0]) or (exists $ip{$data[0]})) and next;
$ip{$data[0]} = 4;
$count++;
print TEMP join("|", @data), "\n";
}
print TEMP join("|", ($ip, $now)), "\n";
close (TEMP);
close (LOG);
rename ("$log/temp.db", "$log/log.db");
print $count;

I use a standard SSI tag to call the script. It works as far as not giving any errors, just always shows 1.
thanks,
Paul
Webmaster Discussions
Quote Reply
Re: [hacker] Is this the problem In reply to
Problem I had and gave up on.

I tried this script out awhile back. It worked fine on one server and wouldnt work at all on another server.

They were both red hat 7.? and both supposedly set up properly (the working one I suspect would be the better of the two from those two hosts).

Fancy trying it again, can someone list the most up to date ssi and java code versions please?
> >