Advertisement:

Author Topic: Hit counter for each ad  (Read 17933 times)

donaldjack

  • Newbie
  • *
  • Posts: 5
Re: Hit counter for each ad
« Reply #15 on: November 24, 2011, 07:09:13 am »

I think a small script needs to be added to item.php at the "Modern" folder. I could not figure out how OSClass creates functions. There are many functions used in the script (e.g. osc_item_region(), osc_item_pub_date(), osc_item_description()) but I could not find where these functions are defined. I need a function to retrieve number of views information.

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: Hit counter for each ad
« Reply #16 on: November 24, 2011, 08:53:01 am »
Hi donaldjack

You can find all the helper functions in oc-includes/osclass/helpers. The helper you are looking for would be in hItems.php

Use this helper function to show the number of views an ad has.

osc_item_views
()


Jay

JohnnyBoy

  • Jr. Member
  • **
  • Posts: 65
Re: Hit counter for each ad
« Reply #17 on: December 12, 2011, 04:39:42 am »
Hi,


I try the code but nothink in my website (www.lannonce.be).. i have OSClass 2.3.1

RajaSekar

  • Hero Member
  • *****
  • Posts: 791
  • ராஜசேகர்
Re: Hit counter for each ad
« Reply #18 on: December 12, 2011, 07:10:34 am »
@jonnyboy

Use echo to print

romantica

  • Premium
  • Hero Member
  • *****
  • Posts: 1092
  • salut tout le monde
Re: Hit counter for each ad
« Reply #19 on: December 12, 2011, 12:02:04 pm »
hello this purpose counter code also applies to bcute theme?
thank you

zombie

  • Sr. Member
  • ****
  • Posts: 376
Re: Hit counter for each ad
« Reply #20 on: August 12, 2012, 01:28:58 pm »
osc_item_views() does not update when i refresh the page :( it does not update at all. stays at 0 all the time.
 How to fix it? Let me know, please!  :(

EDIT:
 i_num_views stays 0 in the database, too. Is it cached or something?
« Last Edit: August 12, 2012, 03:20:17 pm by zealotry »

jonny512379

  • Newbie
  • *
  • Posts: 9
Re: Hit counter for each ad
« Reply #21 on: October 18, 2012, 10:28:39 pm »
Hi All, hoping this thread is still read by the clever people.....

Thanks for the advice on the stat counter, i have added it to item.php and it work as it should.

However i am running OSclass on 2 domains, but using the same DB to store all the info
(i have had to do a few tweaks to get this to work, but all now works well)

The problem i have is that the counter only counts on one of the domains (the count is displayed on the 2nd domain, but does not increase with pageviews).
I think i need to find the code that does the counting to establish why it only counts on the one site, but with my limited knowledge i can not see this.

Any advice would be greatly appreciated

Best Regards
Jon

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: Hit counter for each ad
« Reply #22 on: October 18, 2012, 11:03:11 pm »
Hi Jon,

Are you by any chance logged into the admin side of the site that the page count is not going up? If you are then the page count will not increase as the script does not increase the page count when the admin is logged in.

Jay

jonny512379

  • Newbie
  • *
  • Posts: 9
Re: Hit counter for each ad
« Reply #23 on: October 18, 2012, 11:56:23 pm »
Hi Jon,

Are you by any chance logged into the admin side of the site that the page count is not going up? If you are then the page count will not increase as the script does not increase the page count when the admin is logged in.

Jay

Ohhh yes.. i was logged in the admin for the domain that was not working..
thank you very much all now works fine!!!

Best Regards
Jon

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: Hit counter for each ad
« Reply #24 on: October 19, 2012, 03:39:33 am »
Hi,

I am glad to hear it is working.

Jay

Legion

  • Hero Member
  • *****
  • Posts: 622
  • I am founder of top20remedies.com buyeradvise.com
Re: Hit counter for each ad
« Reply #25 on: October 19, 2012, 06:25:08 pm »
how to show hit counter it in a box?

decanus

  • Jr. Member
  • **
  • Posts: 65
Re: Hit counter for each ad
« Reply #26 on: October 19, 2012, 07:26:35 pm »
This also works on Latest Ads on the main page.

I just inserted it after

Code: [Select]
<p><?php echo osc_highlightstrip_tagsosc_item_description() ) ) ; ?></p>


so it looks like this

Code: [Select]
<p><?php echo osc_highlightstrip_tagsosc_item_description() ) ) ; ?></p>
<?php _e('This listing has been viewed''modern') ; ?>
  <?php echo osc_item_views(); ?>
  <?php _e('times''modern') ; ?>
                                         </td> 


ugogo.info

  • Sr. Member
  • ****
  • Posts: 369
  • I just let my mind wander, and it didn’t come back
Re: Hit counter for each ad
« Reply #27 on: September 24, 2013, 06:48:12 pm »
Thank you akapar.

I used the script on item.php today, and it works perfectly.  I am using osclass 3.2

Cheers
Caz

sigivr

  • Sr. Member
  • ****
  • Posts: 471
Re: Hit counter for each ad
« Reply #28 on: September 25, 2013, 11:16:58 am »
Thank you akapar.

I used the script on item.php today, and it works perfectly.  I am using osclass 3.2

Cheers
Caz

wich one?

ugogo.info

  • Sr. Member
  • ****
  • Posts: 369
  • I just let my mind wander, and it didn’t come back
Re: Hit counter for each ad
« Reply #29 on: September 25, 2013, 04:39:35 pm »