PDA

View Full Version : counter display question



Will
08-12-2005, 02:42 PM
Is there a way to get counter-display to show up using php, like this

<?php
print !COUNTER-ONPAGE!;
if (!COUNTER-ONPAGE!==1)
{ print " user"; }
else
{ print " users"; }
print " online";
?>

instead of just using html and text?

Patrick
08-12-2005, 06:08 PM
I suppose you could manually modify the script to act like this:

Open counter.php:

Find:

$display = ereg_replace("!COUNTER-ONPAGE!", strval($this->online), $display);

And replace it with (all one line):

$display = ereg_replace("!COUNTER-ONPAGE!", strval($this->online) . (strval($this->online) == 1 ? " user" : " users"), $display);

Will
08-12-2005, 08:57 PM
Thank you very much Patiek. :)