Page 1 of 2
Pappnase - User online ?
Posted: Thu 23. Feb 2006, 22:13
by Stim
Hi
How to create that online user stuff in phpwcms?
http://www.phpwcms-docu.de
And can it be hidden someway?
Posted: Thu 23. Feb 2006, 22:55
by DeXXus
Posted: Fri 24. Feb 2006, 07:53
by Pappnase
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
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";
?>
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}
Posted: Fri 24. Feb 2006, 08:38
by Stim
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.
Posted: Fri 24. Feb 2006, 08:51
by Pappnase
Stim 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.
hello
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!
Posted: Tue 28. Feb 2006, 23:01
by Stim
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
Posted: Thu 30. Mar 2006, 18:08
by Quizmaster
Hey Pappnase,
Works okay for me !
Thanks for that...
Posted: Fri 31. Mar 2006, 06:45
by Pappnase
Stim 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
hello
hmm wich reaseons did you have to make it not visible! and for what did you have the script included!? when you hide it
Posted: Thu 6. Apr 2006, 13:55
by Stim
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
Posted: Thu 6. Apr 2006, 16:14
by jscholtysik
Hi Stim,
that are strange reasons I also cannot understand...
Joachim
Posted: Thu 6. Apr 2006, 18:28
by Stim
No thats not strange reasons
It is almost same strange reasons with webcounter.
It is not good to use. Well, not visible anyway
Posted: Fri 7. Apr 2006, 04:31
by Pappnase
hehe
i think the user itself decide whats good and what not. i don't think that this will cause on an online monitor how many users online.
and an public counter i think is nothing really needed script! cos it says nothing abut the quality of teh website !
Posted: Mon 17. Apr 2006, 21:17
by Stim
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
Posted: Tue 18. Apr 2006, 06:55
by Pappnase
hehe
thanks for the compliment
Posted: Sun 30. Apr 2006, 03:30
by ndm
tnx leute.
klappt prima...