Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Unique Visits

Asked Modified Viewed 3,287 times
B
bonnis
B
bonnis 10
  • Member, joined since
  • Contributed 100 posts on the community forums.
  • Started 29 threads in the forums
  • Started this discussions
asked
Member

what the code for this? i have it in the footer.
i want to make a panel with the same code.

and one more thing. does it really work correcly?

/Bonnis1992
0 replies

5 posts

N
NetriX
N
NetriX 10
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Mon-Thurs. Send me a PM if urgent.
  • Senior Member, joined since
  • Contributed 566 posts on the community forums.
  • Started 93 threads in the forums
answered
Senior Member

echo showcounter();
0 replies
S
skpacman
S
My PHP-Fusion site: https://skpacman.live
  • Member, joined since
  • Contributed 150 posts on the community forums.
  • Started 25 threads in the forums
answered
Member

Quote

bonnis wrote:
and one more thing. does it really work correcly?


From maincore.php:
// 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.
0 replies
B
bonnis
B
bonnis 10
  • Member, joined since
  • Contributed 100 posts on the community forums.
  • Started 29 threads in the forums
  • Started this discussions
answered
Member

Quote

skpacman wrote:

Quote

bonnis wrote:
and one more thing. does it really work correcly?


From maincore.php:
// 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.


allright thanks. ! :)

Merged on Apr 24 2013 at 08:53:31:

Quote

skpacman wrote:

Quote

bonnis wrote:
and one more thing. does it really work correcly?


From maincore.php:
// 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.



hmm, i tried that code, it does not work.
Edited by bonnis on 24-04-2013 08:53,
0 replies
S
skpacman
S
My PHP-Fusion site: https://skpacman.live
  • Member, joined since
  • Contributed 150 posts on the community forums.
  • Started 25 threads in the forums
answered
Member

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:
echo 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.
0 replies
B
bonnis
B
bonnis 10
  • Member, joined since
  • Contributed 100 posts on the community forums.
  • Started 29 threads in the forums
  • Started this discussions
answered
Member

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:
echo 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.


thanks alot ! :)
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 5 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

N
N
NetriX 10
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Mon-Thurs. Send me a PM if urgent.
  • Senior Member, joined since
  • Contributed 566 posts on the community forums.
  • Started 93 threads in the forums
S
S
My PHP-Fusion site: https://skpacman.live
  • Member, joined since
  • Contributed 150 posts on the community forums.
  • Started 25 threads in the forums
B
B
bonnis 10
  • Member, joined since
  • Contributed 100 posts on the community forums.
  • Started 29 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet