Hi folks,
I am using fancybox for showing my images. As I need to link to the images directly and not to the image view page, the hitcounter does not work.
Does anyone have an idea how I can get the hitcounter to work in this scenario?
Thanks and regards,
bll0
Comments
- use a custom theme page to call the full image on. ++
- user some jQuery JS to use ajax to call a separate page to count.
In any case this will require some work and knowledge by you and getting familiar with some Zenphoto internals. You should read the theming tutorial for the basics first.
The first variant would be to call a page with the embedded image in the fancybox I assume. So the fancybox needs to open a page instead of a picture... Not sure if it does support page viewing.
The second jQuery might be to difficult for me as I am not to familiar with jQuery. Do you have a hint where to start in the code? Maybe here: $(document).ready(function()?
Is there a way to do this with the colorbox plugin or does this have the same impact on the hitcount? Does colorbox support page viewing?
I think, it would be possible to add/modify the function getFullImage() so that the counter is considered. But of course this would mean to modify core files!
And the counter would add up every time the album is viewed, not the very image. It's inelegant.
Fancybox does support opening html pages instead of pictures, but I think, this is also very inelegant.
Wete
The best and easiest is to use a "custom theme page" for this. What that is is explained on the theming tutorial. You should also get familiar with the object model as you will need that to create the image object on that custom page.
If you want to count hits for when the image is viewed via a "box" script you will have to incorporate that into how the box script displays the image. Presumably that means having a script that causes the display and also counts the hit. Or at least a script for counting the hit that can be ajaxed from the box handler when it displays the image. Both are possible, but do require implementation.
Can you tell me, how the function call of the image counter increment is called? After studying the different image.php examples I am not sure where to look.
I assume it is in the zp_apply_filter(), but have not found that function yet...
When I have time, I will implement a custom page with arrows, which will be loaded in a box frame. That gives the user a similar feeling like having the box frame and I can use all the nice built in gimmicks from zenphoto.
Thanks again!