Another Cache Bug... :)

Report bugs and errors in this forum.

Another Cache Bug... :)

Postby IvoSilva » Thu Jan 19, 2006 11:00 am

Hello all



Im using the latest version of cutehack and notice that once i define ('global_cache', true); the script doesnt work with [if logged] [/if logged] tags.

Even when im sure im logged in, i cant see the edit on the frontend.



Also the views count doesn work!!!



Any chance to workaround this? Im really delighted with the speed that global_cache option gives to the script... :) but... it would be better if we can put all together :)



Sorry for bad english...



Regards From Portugal
IvoSilva
 
Posts: 22
Joined: Thu Oct 13, 2005 2:26 pm

Postby FI-DD » Thu Jan 19, 2006 11:18 am

That's not a bug.



It's this part in inc/show.news.php:

Code: Select all
   if (!global_cache){

      if ($is_logged_in and ($member['level'] < 3 or $member['username'] == $row['author'])){

         $cache = str_replace('[if-logged]', '', $cache);

         $cache = str_replace('[/if-logged]', '', $cache);

         $cache = preg_replace('/\[not-logged\](.*?)\[\/not-logged\]/i', '', $cache);

      } else {

         $cache = str_replace('[not-logged]', '', $cache);

         $cache = str_replace('[/not-logged]', '', $cache);

         $cache = preg_replace('/\[if-logged\](.*?)\[\/if-logged\]/i', '', $cache);

      }

   }




Don't know what will happen but you can try to change it to this:

Code: Select all
      if ($is_logged_in and ($member['level'] < 3 or $member['username'] == $row['author'])){

         $cache = str_replace('[if-logged]', '', $cache);

         $cache = str_replace('[/if-logged]', '', $cache);

         $cache = preg_replace('/\[not-logged\](.*?)\[\/not-logged\]/i', '', $cache);

      } else {

         $cache = str_replace('[not-logged]', '', $cache);

         $cache = str_replace('[/not-logged]', '', $cache);

         $cache = preg_replace('/\[if-logged\](.*?)\[\/if-logged\]/i', '', $cache);

      }




Global cache is designed for very busy and thus slow servers. Normally, the ordinary cache should do it - no need for global cache. (I never tested it - I just read it in the original russian readme file)
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby IvoSilva » Thu Jan 19, 2006 12:25 pm

Yes, normal cache will work for most of the cases but... try to hit and old the Refresh command in the site running the sript.... :(



The server will go down!!!



I think thas an important issue to look to...



Best Regards



PS: By the way, the change doesnt really do anything... :(
IvoSilva
 
Posts: 22
Joined: Thu Oct 13, 2005 2:26 pm


Return to Bugs and errors



Who is online

Users browsing this forum: No registered users and 0 guests

cron