echo showcounter();
Quote
bonnis wrote:
and one more thing. does it really work correcly?
// PHPFusion user cookie functions
if (!isset($_COOKIE[COOKIE_PREFIX.'visited'])) {
$result = dbquery("UPDATE ".DB_SETTINGS." SET settings_value=settings_value+1 WHERE settings_name='counter'");
setcookie(COOKIE_PREFIX."visited", "yes", time() + 31536000, "/", "", "0");
}
$lastvisited = Authenticate::setLastVisitCookie();
Quote
skpacman wrote:Quote
bonnis wrote:
and one more thing. does it really work correcly?
From maincore.php:Code Download source// PHPFusion user cookie functions
if (!isset($_COOKIE[COOKIE_PREFIX.'visited'])) {
$result = dbquery("UPDATE ".DB_SETTINGS." SET settings_value=settings_value+1 WHERE settings_name='counter'");
setcookie(COOKIE_PREFIX."visited", "yes", time() + 31536000, "/", "", "0");
}
$lastvisited = Authenticate::setLastVisitCookie();
Basically, every time a user connects to your site that has never had their "visited" cookie set, it increments the counter. It's very reliable, but there are still ways to trick it like deleting that cookie and connecting to the site again.
Quote
skpacman wrote:Quote
bonnis wrote:
and one more thing. does it really work correcly?
From maincore.php:Code Download source// PHPFusion user cookie functions
if (!isset($_COOKIE[COOKIE_PREFIX.'visited'])) {
$result = dbquery("UPDATE ".DB_SETTINGS." SET settings_value=settings_value+1 WHERE settings_name='counter'");
setcookie(COOKIE_PREFIX."visited", "yes", time() + 31536000, "/", "", "0");
}
$lastvisited = Authenticate::setLastVisitCookie();
Basically, every time a user connects to your site that has never had their "visited" cookie set, it increments the counter. It's very reliable, but there are still ways to trick it like deleting that cookie and connecting to the site again.
echo showcounter();
Quote
skpacman wrote:
Bonnis,
All you need to do to show "Unique Visitors: #####" anywhere else on your site is to put the following in a panel or in the page code wherever you want to show it:Code Download sourceecho showcounter();
My other post was explaining how the Unique Visitors function works and why it's reliable. I wasn't posting code for you to use.
Use the code from NetriX's post to show the counter.
Category Forum
Content Administration - 8Labels
None yet
Statistics
3 participants
Notifications
You are not receiving notifications from this thread.
Related Questions