Pappnase - User online ?
Pappnase - User online ?
Hi
How to create that online user stuff in phpwcms? http://www.phpwcms-docu.de
And can it be hidden someway?
How to create that online user stuff in phpwcms? http://www.phpwcms-docu.de
And can it be hidden someway?
hehe
thats not my solution cos i need no db connection
at the docu page it look this way
in the root lies an file called. useronline.php
also create in root an file called besucher.txt this need chmod 777
And the script you call via the rep tag {PHP:useronline.php}
thats not my solution cos i need no db connection
at the docu page it look this way
in the root lies an file called. useronline.php
Code: Select all
<?php
$daten = "besucher.txt";
$time = time();
$ip = getenv("REMOTE_ADDR");
$ablaufzeit = $time - "300";
$pruefung = @file($daten);
while (list ($line_num, $line) = @each ($pruefung)) {
$zeiten = explode("&&",$line);
if($zeiten[0] <= $ablaufzeit) {
$fp = fopen( "$daten", "r" );
$contents = fread($fp, filesize($daten));
fclose($fp);
$line=quotemeta($line);
$string2 = "";
$replace = ereg_replace($line, $string2, $contents);
$fh=fopen($daten, "w");
@flock($fp,2);
fputs($fh, $replace);
@flock($fp,3);
fclose($fh);
}
}
$ippruefung = @file($daten);
while (list ($line_num, $line) = @each ($ippruefung)) {
$ips = explode("&&",$line);
if($ips[1] == $ip) {
$fp = fopen( "$daten", "r" );
$contents = fread($fp, filesize($daten));
fclose($fp);
$line=quotemeta($line);
$string2 = "";
$replace = ereg_replace($line, $string2, $contents);
$fh=fopen($daten, "w");
@flock($fp,2);
fputs($fh, $replace);
@flock($fp,3);
fclose($fh);
}
}
$fp = fopen("$daten", "a+");
flock($fp,2);
fputs ($fp, "$time&&$ip&&\n");
flock($fp,3);
fclose ($fp);
$anzahldaten = file($daten);
$anzahl = count($anzahldaten);
echo $anzahl." User online";
?>
And the script you call via the rep tag {PHP:useronline.php}
helloStim wrote:Thanks Pappnase
I will try that today. Thanks to you to DeXXus, but I didn’t understand anything from that topic!! Maybe someone should separate instruktions from that code.
the link dexxuss end creates an rep tag. but there you need also an db connection and need to create sme db tables for this user online script!
-
- Posts: 35
- Joined: Fri 27. May 2005, 11:45
helloStim wrote:Hi Pappnase,
I use your online stuff and its works nice
I removed that online user text, and just changed colour to hide that. It’s not good if it’s visible for many reason, and I think you should hide it you to.
Thanks again for your help
hmm wich reaseons did you have to make it not visible! and for what did you have the script included!? when you hide it
There are many reasons to hide it. Example if you have few users on the site, other user can think this site is “shit” because there are no users here. But it depends on what kinds of site it is.
I didn’t understand your last questions, but I have hide my online in the footer with same colour as background.. When I won’t to see online user, I just double click on it. I also removed “User online” text so only numbers shows up when I double click.
If I get a 1000000000000000 user every day then there are no reasons to hide it anymore
I didn’t understand your last questions, but I have hide my online in the footer with same colour as background.. When I won’t to see online user, I just double click on it. I also removed “User online” text so only numbers shows up when I double click.
If I get a 1000000000000000 user every day then there are no reasons to hide it anymore
Hi Pappnase
Your site is good even if you hide online user or not
My site have lots off same content as many other there sites have many more users what i have to my site. Therefore its very important to me hide it right now
Your site is good even if you hide online user or not
My site have lots off same content as many other there sites have many more users what i have to my site. Therefore its very important to me hide it right now
Last edited by Stim on Wed 19. Apr 2006, 10:49, edited 1 time in total.