how would one use getHitCounter() to print the counts for each album in index.php ? At this point, I am in an album loop, I think. I used to call hitcounter(getAlbumID()) or something similar.
That might just be because your statement creates no output. Nor does it match what I showed you. You need to print the value of the hitcounter if you want it to show up.
This is probably because there is no hitcount taken. With 1.2.2 the hitcounting is enabled always by default but is only taken for not logged in users.
if you pass an album parameter it will return the hitcounter for that album. If you do not pass an album parameter it will determine if you are on an image, album, or other page and return the image hitcount, the album hitcount, or NULL.
Ok, that makes sense. Would I use something similar to `<?php echo getHitcounter($_zp_current_album); ?>`in a <?php while `(next_album()): ?>` loop ? How does one get the current album ?
I just took a quick look at the function and it actually does not allow to display the hitcounter within the next_album loop. It checks currently automatically for the gallery page to be either "album.php" or "image.php" and if not always return NULL. We will need to change the function so that it behaves like the old one again.
Ah good, I thought I was going crazy or was really incompetent. Turns out that it's that and I might have encountered a problem (I didn't cause). I am glad. Thanks for helping out guys. You're doing a great job with ZP. Can't say enough good things about it and your support.
Comments
`
...
<?php printAlbumDesc(); ?>
Views: <?php getHitcounter($_zp_current_album); ?>
...
`
...
<p><?php printAlbumDesc(); ?></p>
<p>Views: <?php echo getHitcounter($_zp_current_album); ?></p>
</div>
...
because it doesn't work either.
`SELECT folder,hitcounter FROM albums where isnull(parentid)`
`
folder hitcounter
Portfolio 2003 911
Portfolio 2002 1103
Portfolio 2005 967
Portfolio 2001 500
Miscellaneous 405
Portfolio 2006 1562
Sports 504
Underwater 602
Themed 613
Others 900
Portfolio 2007 1683
Techniques 457
Portfolio 2008 2196
`
http://www.frenchguys.com/gallery/
Where it says:
The function behaves as follows:
if you pass an album parameter it will return the hitcounter for that album.
If you do not pass an album parameter it will determine if you are on an image, album, or other page and return the image hitcount, the album hitcount, or NULL.
Perhaps the parameter you passed is NULL.
loop ? How does one get the current album ?
We will need to change the function so that it behaves like the old one again.