Member
Member
bonez   2008-05-03, 19:04
#1

First, let me say I am very impressed with ZenPhoto!

My galler is up, but I'm having a real hard time trying to get the hit counters to work. My questions...

  1. What file(s) do I need to add the hitcounter function to?
  2. What should the function look like?
    string hitcounter( [string $option = 'image'], [bool $viewonly = false], [int $id = NULL] )
  3. Where in the file should I add the function?

any other advice on how to get this function enabled while using the default template is much appreciated.

Administrator
Administrator
acrylian   2008-05-04, 10:26
#2

Since that function is able to count either album or image hit, you can add it to album.php or image.php. If you want the counter to be shown, you need to place that function where you want it to appear.
Usage is simple `

Member
Member
bonez   2008-05-04, 17:22
#3

Just so I understand; hit counts will not start until this fundtion is added to either images.php or album.php in the appropriate theme folder.

Also, I noticed you used true in your hitcount fuction. According to to the parameters in template-functions.php, if set to true: "...you don't want to increment the counter." [http://www.zenphoto.org/documentation/zenphoto/_template-functions.php.html#functionhitcounter]

I'd like to be able to see which pictures are getting more clicks, so I DO want to increment the counter. I placed the following in my image.php file:

But I don't know how to either 'print the actual hit count near the image' or 'find out which images are getting the most traffic'. Is there a section in the admin area that shows hit counts or can someone give me some advice on printing hit count?

thanks

UPDATE: I noticed that hit counts are recorded on 'Edit' tab for galleries, and hits are now being recorded. However, this method of checking hits is a bit troublesome. Maybe there is a plugin or hack that provided administrators with... Top 5, 10, 20, 50 rated images; albums with most hits, images with most hits, etc.

Administrator
Member
Member
bonez   2008-05-04, 19:38
#5

Hey Acrylian,
Thanks for your support. I've got the hitcounter working as I'd like on the default theme's image.php file and here's what I did...

Replaced:

With:

Image Views: 

Now the hits display beneath the image. Thanks again!

Member
Member
bill61   2008-05-04, 20:52
#6

hi developers

when i did what "bones" did by :

Replaced:

With:

Image Views:

in the album file in nighty build i got this message:

Zenphoto Error
MySQL Query ( SELECT total_value FROM zp_images WHERE id = ) Failed. Error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Member
Member
bill61   2008-05-04, 21:10
#7

hi developers

hi developers

it is ok i got it right

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.