ZenphotoCMS Forum
Hitcounter - Admin sees others don't - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Hitcounter - Admin sees others don't (/thread-7306.html)



Hitcounter - Admin sees others don't - Fotoman - 2010-07-06

Hi!

I use the current release of ZP and current zenpage as my theme. I made the modifications to show the hitcounter in image.php, album.php & gallery.php.

It works fine, if I'm in admin mode. If I log out and come back as a normal visitor, I don't see any hitcounter for image, album or gallery at all. Funny, if I switch then from german to english, I see all the hitcounters.

How come & why?
Fotoman




Hitcounter - Admin sees others don't - acrylian - 2010-07-06

Calling it via the object model should work always.




Hitcounter - Admin sees others don't - Fotoman - 2010-07-06

What means?
I called it up in the php code like this (is that right?) and it appears below every picture as logged in as admin or changing the language from german to english.

Take a look: http://www.strickwerk-productions.com/foto

hitcounter plug in 1.30 is enabled. Multilanguage is enabled. footer chnged also when changing language or adimin/visitor.

???




Hitcounter - Admin sees others don't - acrylian - 2010-07-06

Hm, that is actually right. I have no idea what is happening there, that function is neither tied to loggin stuff nor to multilingual. Any specific custom code around those parts?




Hitcounter - Admin sees others don't - Fotoman - 2010-07-06

Well, just the center div-tag, line 78 to 98 i.e. of image.php


  (Dieses Bild wurde schon  mal angesehen. Klicken Sie es an, um es in der Lightbox zu sehen.) 

Same in album & gallery.
Well, I'm not good in PHP. Maybe I made a mistake.




Hitcounter - Admin sees others don't - acrylian - 2010-07-06

Looks actually good, I will try to reproduce it later.

Btw, you should update you HTML-knowledge a little, `` are both deprecated tags and should be avoided..;-)




Hitcounter - Admin sees others don't - Fotoman - 2010-07-06

Hey, thanks, yes that would be nice. Counters are not the most important thing. An yes, i'll promise to use css instead. (But it still works so fine! :-)




Hitcounter - Admin sees others don't - Fotoman - 2010-07-06

Okay,
I found out, what made the difference. It's the static html cache.

If I switch it off in the plugins and purge the folder cache_html by ftp the site reloads perfectly. If I switch it on again, the problem occurs.
...




Hitcounter - Admin sees others don't - acrylian - 2010-07-06

Ok, I should have thought about this... But that is of course meant that way, cached is cached...;-)




Hitcounter - Admin sees others don't - Fotoman - 2010-07-06

Okay, chached is cached, right. But shouldn't it be permanent? Cached with counters if they were on?! So they are off with the cache & on without. Hm. Okay, but now I know.

Thanks for your help!
FM




Hitcounter - Admin sees others don't - acrylian - 2010-07-06

No, the reason is that for loggedin admins nothing is cached to prevent security issues as password protected or unpublished albums would also be cached. It is therefore only cached and used from cache for normal visitors.




Hitcounter - Admin sees others don't - Fotoman - 2010-07-06

Okay, I see.
That means: donig all you have to do with the code as admin while cache is off. So you make sure to see all the changes you've made. Than, in a last step, turning on the caching and logoff.

I'll try that.




Hitcounter - Admin sees others don't - acrylian - 2010-07-06

Not exactly. The html cache and also the rss cache are disabled automatically if you are logged in. You don't need to enable/disable anything. All you need to do is to clear the cache so that your normal visitors see any possible changes.




Hitcounter - Admin sees others don't - Fotoman - 2010-07-06

Okay, got it. Now it all works well. Thanks again for you patience and help. Love that ZP and your theme. Made a donation!

Greetz,
FM