Member
Member
edasque   2009-01-05, 23:46
#1

Hi,

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.

Erik

Member
Member
sbillard   2009-01-06, 00:50
#2

$h = getHitcounter($_zp_current_album);

Member
Member
edasque   2009-01-06, 01:20
#3

Hmm, that doesn't seem to work on the Default theme, line 33, as such:
`

...

Views: 

...

`

Member
Member
sbillard   2009-01-06, 02:32
#4

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.

Member
Member
edasque   2009-01-06, 04:42
#5

ok, sorry, you're right, typo. What about:

...

Views:

...

because it doesn't work either.

Administrator
Administrator
acrylian   2009-01-06, 11:35
#6

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.

Member
Member
edasque   2009-01-06, 19:42
#7

This is a site that's been going on for a long while. There is a hit count on those albums when I use the deprecated function.

Member
Member
edasque   2009-01-07, 18:13
#8

Yes, checked again, those hitcounts are not 0:

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

`

Member
Member
sbillard   2009-01-08, 01:57
#9

Have you run the Effervescence+ theme on your site? It displays hits on albums and seems to be working correctly at least on my site.

Member
Member
edasque   2009-01-08, 22:55
#10

Hmmm, no it doesn't display hits on the albums in index.php. What I want is to display the hits for each album in the loop of index.php, like so:

http://www.frenchguys.com/gallery/

Where it says:
Quote:Viewed:: times

Member
Member
sbillard   2009-01-09, 02:45
#11

Do the hits show up on the albums page?

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.

Member
Member
edasque   2009-01-09, 15:49
#12

Ok, that makes sense. Would I use something similar to `in a
loop ? How does one get the current album ?

Administrator
Administrator
acrylian   2009-01-09, 16:00
#13

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.

Member
Member
edasque   2009-01-09, 16:18
#14

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.

Administrator
Administrator
acrylian   2009-01-09, 16:49
#15

Should be fixed in the svn now. Btw, you can also use echo $_zp_current_album->get("hitcounter")to get the hitcount within the next_album loop.

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