Advertisement:

Author Topic: how to get Site Visitors Count (Hit Count)  (Read 26515 times)

kris

  • Full Member
  • ***
  • Posts: 106
how to get Site Visitors Count (Hit Count)
« on: March 06, 2012, 01:21:19 pm »
i want Visit counter, it may be Registered & non registered. in Statistics Reports it has users but its only posting.

Evelyne

  • Full Member
  • ***
  • Posts: 134
Re: how to get Site Visitors Count (Hit Count)
« Reply #1 on: May 10, 2012, 01:46:34 am »
I'd like that too... :)

adsjapan

  • Newbie
  • *
  • Posts: 31
Re: how to get Site Visitors Count (Hit Count)
« Reply #2 on: May 10, 2012, 02:29:10 am »
Is it not Google analytics you are looking about? Or you are looking out for something else?

Evelyne

  • Full Member
  • ***
  • Posts: 134
Re: how to get Site Visitors Count (Hit Count)
« Reply #3 on: May 10, 2012, 03:25:58 am »
Nope. Besides Google analytics, I also have Awstats from my cpanel. But only I can see those...

What I mean is a hit counter ON the website main page, at least (total views the website had), and also a hit counter on each ad page (total views that specific ad had), so that users and viewers can know how many people have visited the website since the beginning/this week and the ad since it was published.
« Last Edit: May 10, 2012, 07:52:48 am by Evelyne »

rmarques

  • Newbie
  • *
  • Posts: 26
Re: how to get Site Visitors Count (Hit Count)
« Reply #4 on: May 10, 2012, 07:19:12 am »
I'm also trying to have something similar.

I think showing some sort of stats causes a feeling that the website is successful, and it will attract more users.

Right now there is a code we can use <?php echo osc_item_views(); ?> that shows the total item views on the item page.

The problem I'm having is that this code on the main page and on the user profile page shows only hits from ONE day and not all days available in the database.

If someone finds a solution for this problem I'll be really grateful. Detailed info on this thread: http://forums.osclass.org/general-help/how-to-display-total-item-views-on-main-page/

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: how to get Site Visitors Count (Hit Count)
« Reply #5 on: May 10, 2012, 11:07:33 am »
This should show total item view count on ANY page for any particular item:

Code: [Select]
<?php echo ItemStats::newInstance()->getViews(osc_item_id()); ?>

I'll post a more detailed response to this here... http://forums.osclass.org/general-help/how-to-display-total-item-views-on-main-page/


Evelyne

  • Full Member
  • ***
  • Posts: 134
Re: how to get Site Visitors Count (Hit Count)
« Reply #6 on: May 11, 2012, 06:01:33 am »
Is it possible to make a plugin for this feature?

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: how to get Site Visitors Count (Hit Count)
« Reply #7 on: May 11, 2012, 06:09:02 am »
What would you want the plugin to do other than showing the total view count, which the code above shows?

Evelyne

  • Full Member
  • ***
  • Posts: 134
Re: how to get Site Visitors Count (Hit Count)
« Reply #8 on: May 11, 2012, 06:23:33 am »
I was thinking something like this:

A plugin often comes with a configuration board on the admin dashboard. where we could choose if we want:
- hits on the website
- hits on each ad
(or both)
- interval for the counting (today, this week, this month, total).

hope I'm not asking too much, but I think it would cover all needs, right?  :)

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: how to get Site Visitors Count (Hit Count)
« Reply #9 on: May 11, 2012, 06:45:45 am »
That looks like a very good outline for such a plugin. If I get "extra" time I may try to play with it, but perhaps others may be able to jump on it.

Evelyne

  • Full Member
  • ***
  • Posts: 134
Re: how to get Site Visitors Count (Hit Count)
« Reply #10 on: May 11, 2012, 06:51:38 am »
Thanks Jesse!

Whenever you (or any other experienced member) can do it, it will be really appreciated! 

rmarques

  • Newbie
  • *
  • Posts: 26
Re: how to get Site Visitors Count (Hit Count)
« Reply #11 on: May 11, 2012, 07:51:36 am »
Total item views on the main page and on the user public profile are working perfectly with <?php echo ItemStats::newInstance()->getViews(osc_item_id()); ?>

Thank you very much!

Ricardo

Evelyne

  • Full Member
  • ***
  • Posts: 134
Re: how to get Site Visitors Count (Hit Count)
« Reply #12 on: May 11, 2012, 07:14:45 pm »
Total item views on the main page and on the user public profile are working perfectly with <?php echo ItemStats::newInstance()->getViews(osc_item_id()); ?>

on what file does this code go, again?

Thanks,

asimshaz

  • Sr. Member
  • ****
  • Posts: 311
  • 01tec
Re: how to get Site Visitors Count (Hit Count)
« Reply #13 on: May 11, 2012, 08:02:19 pm »
use this code

<?php echo ItemStats::newInstance()->getViews(osc_item_id()); ?>

Looking at the actual function for osc_item_views() within the Helper functions file hItems.php, there are two possible returned results. The result being returned when you're calling this function from the Main page is not returning the total item count. So you can simply call it manually by the code I showed above. I didn't look into why that case isn't being called, but I do know the above code works.

Evelyne

  • Full Member
  • ***
  • Posts: 134
Re: how to get Site Visitors Count (Hit Count)
« Reply #14 on: May 11, 2012, 11:11:12 pm »
once again:

On WHICH pages (and where within it) should this code line be inserted for the views to show? (both main page and item page)

pretty please???