Hi,
I want to see on my index.php the total images views per album including subalbums. I've done it at the moment this way:
in my image.php I have:
<?php echo hitcounter('image', false); ?>
<?php hitcounter('album', false); ?>
So everytime the image is viewed it adds 1 to the image hitcounter and 1 to the albums hitcounter.
Therefore with <?php echo hitcounter('album',true,getAlbumID()); ?> on index.php I get the total views of that album.
The only problem with this workaround is, it doesn't work anymore if I work with subalbums. Is there a code that gives the total image views per album including subalbums?
Like <?php echo getTotalImagesIn($_zp_current_album);?> does it for the total number of images.
I hope you understand my problem (well its not huge a problem though, I still enjoy my zenphoto very much),
cheers,
Jeroen
Comments
or i can use Idrownpuppies way. only its not working for subalbums
<?php
$sum = mysql_query("SELECT SUM(hitcounter) FROM zp_images");
$views = mysql_fetch_array($sum);
$total = $views[0];
echo $total;
?>