Views Count not updating

swift
swift's picture

Joined: 2003-12-08
Posts: 39
Posted: Tue, 2005-02-22 01:00

I just installed G2 on my own machine so that I could see what it could do, and overall I'm quite impressed, but I've noticed that the views counter will only update once per user (I think) for any images I put in any of my albums. The albums certainly increase in view count (almost more than I would expect, 3 where I would think only 2...), and even sub-albums update properly, it is just items that do not update.

When I view the debugging tree while on an image page, I get an error page with the following quote:

Fatal error: Call to undefined function: getorderby() in /gallery/modules/core/classes/helpers/GalleryChildEntityHelper_simple.class on line 444"

I'm asssuming this has something to do with the counter not updating, but I'm hoping someone can help me here. I don't have the latest CVS, I'm just using the "Nice Commits" Alpha build (a5?). I just installed MySQL on my own recently, and while it appears to work and I think I've got it right, I'm by no means an expert and so something could have happened. In looking up getorderby(), it appears to be a Java method, and i've installed all the recent recommended Java updates for my Mac (am running v1.4.2_05).

Any suggestions would be nice, or hopefully this will help you all make G2 work on OS X.

----

Gallery URL (optional): http://garudha.homeip.net/gallery/
Gallery version:2.0 a5
Webserver (with version): Apache
Datatabase (with version): MySQL 4.0.23
PHP version (eg 4.2.1):
phpinfo URL (optional):
Graphics Toolkit(s): NetPBM
Operating system: Mac OS X 10.3.8
Web browser/version: Safari

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-02-22 07:20

image view count is incremented when the image itself is downloaded. if one user views the image the image is usually cached in their browser.. if they view the same image again it is retrieved from the cache and not the webserver. thus, the view count doesn't go up.
no one really uses the debug tree i think, but i'll take a look at that error.

 
swift
swift's picture

Joined: 2003-12-08
Posts: 39
Posted: Tue, 2005-02-22 16:04

Thanks mindless - makes a little more sense now...

However, I'd rather see an accurate item view count, is there any way that you could attach the counter to the actual page so that it does increase properly (usually the whole page doesn't cache does it?). I guess this might make it more complicated when trying to keep track of image views in other locations (ie. if you view it in a slideshow...) but would it be possible? As I said before, the albums page view counter increases with each actual page view (so the number quickly goes up, while the item views stays low), so it'd be nice to at least have the two numbers working on the same counting system... (decrease the frequency of album view counts so that it only increases when you directly click on the album from a parent for example... if you want to go this way)

About the album view counter, I've figured out that it does appear to double count whenever you return to the album view from an image page (I'm using the links at the top to navigate). Any reason for this? When I click on an album in its parent, the view counter increases by only 1 (as it should), so something funny is going on...

I know these are minor issues, but it'd be nice to have them sorted out right if someone has some time...

Thanks, and great work so far!

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-02-22 16:26

answering in reverse order..
album double-count: good catch.. it's counting on a redirect and again on the page view. i'll fix that.
item counting: you can modify your code locally to count item page views instead of actual image views. then the slideshow won't increment any count, nor anywhere else the image may appear (that's why we went with image-download counting).
1) comment out the "Increment the view count" section in modules/core/DownloadItem.inc
2) comment out the "if" and one closing } in the "Update the view-count" section in modules/core/ShowItem.inc. this code currently counts for albums, but you can change it to count for items too.

personally I think your suggestion of reducing album counts is better.. maybe file a feature request on sourceforge for that. don't know when any developer might work on it though.