Hitcounter - Admin sees others don't

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

Comments

  • acrylian Administrator, Developer
    Calling it via the object model should work always.
  • What means?
    I called it up in the php code like this <?php echo getHitcounter(); ?> (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.

    ???
  • acrylian Administrator, Developer
    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?
  • Well, just the center div-tag, line 78 to 98 i.e. of image.php

    --------------------------------------------

    <?php
    if (!empty($tburl)) {
    ?>

    <?php
    }
    ?>
    </div>
    <div id="Hitcounter">
    <center><font size="-2">(Dieses Bild wurde schon <?php echo getHitcounter(); ?> mal angesehen. Klicken Sie es an, um es in der Lightbox zu sehen.) </font></center>
    </div>
    <div id="narrow">
    <p><?php printImageDesc(true); ?></p>
    <?php printTags('links', gettext('Tags:').' ', 'taglist', ', '); ?>
    <br style="clear:both;" />
    <?php if (function_exists('printSlideShowLink')) {
    echo '<span id="slideshowlink">';
    printSlideShowLink(gettext('View Slideshow'));
    echo '</span>';
    }
    ?>
    --------------------------------------------------------------------

    Same in album & gallery.
    Well, I'm not good in PHP. Maybe I made a mistake.
  • acrylian Administrator, Developer
    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..;-)
  • 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! :-)
  • 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.
    ...
  • acrylian Administrator, Developer
    Ok, I should have thought about this... But that is of course meant that way, cached is cached...;-)
  • 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
  • acrylian Administrator, Developer
    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.
  • 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.
  • acrylian Administrator, Developer
    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.
  • 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
Sign In or Register to comment.