NetTalk Central

Author Topic: How to count visits  (Read 5100 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
How to count visits
« on: January 07, 2009, 02:25:27 AM »
Hi,
How can I count the number of user logged in and the number of visits per page to implement something like Moolets?
Thanks
-----------
Regards
Alberto

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: How to count visits
« Reply #1 on: January 08, 2009, 10:49:52 AM »
Hi Michelis, The easiest method is to use the free tool at GoStats.com. I also posted an example app some time back under the share knowledge forum.
Mike Grigsby
Credify Systems
Central Oregon, USA

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: How to count visits
« Reply #2 on: January 08, 2009, 11:01:36 AM »
OK, thanks
But what if I need to show how many Users are loged in?
Thanks again.
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to count visits
« Reply #3 on: January 09, 2009, 09:30:24 AM »
  p_web.requestdata.webserver._Wait()
  counter = 0
  loop x = 1 to records(p_web.requestdata.webserver._SessionQueue)
    get(p_web.requestdata.webserver._SessionQueue,x)
    if p_web.requestdata.webserver._SessionQueue.LoggedIn
      counter += 1
    end
  end
  p_web.requestdata.webserver._Release()

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: How to count visits
« Reply #4 on: January 12, 2009, 02:55:27 AM »
Thanks! but...
Where to add this code?
Suppouse the Frame example with the login/logout before the xp-taskbar menu, if I want to show the counter after the logout button, before the menu?
Or there are another smart way to show it?
Thanks again
Alberto
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to count visits
« Reply #5 on: January 13, 2009, 01:00:40 AM »
Hi Alberto,

How are you planning for the user to ask for this value?
Remember the browser model is _always_ that the browser asks.

If you put it in the header pane of the frame it'll only get updated when they refresh
the header page - which I'm thinking is not often.

Where to put the code?
put it just before the value is used.
So if you've put it in a page, calculate it just before the value is included on the page.

Cheers
Bruce