Notes News Block

From GeeklogWiki

  • If the block display looks off (bad alignment, incorrect content, ect). Delete the news_cache and set news_cache_expire = 1 for the suspect user (uid 1 = anonyumous) in gl_userprefs. This will re-paint the block with updated content.
  • The block also has a built in timer. To enable the timer, uncomment the following lines in lib-custom.php:
//$_NEWS_TIMER = new timerobject();
//$_NEWS_TIMER->startTimer();
AND uncomment the lines in display_news.php
//$boxtitle.= "<small><br>Created this block in <b>";
//$boxtitle.= $_NEWS_TIMER->stopTimer();
//$boxtitle.= "</b> seconds.</small>";
  • You can adjust the cache values by editing the display_news.php file. By default, cache is stored for 30 minutes. To change the value, edit the following lines of code and replace 30 with your preference:
if ($age_minutes > 30) // if cache is more than 30 minutes old
if ($user_age > 30) // if cache is more than 30 minutes old
You will need to do this in two places in the display_news.php page, once for logged in users and once for anonymous users.
  • You can turn on a message that displays the last update time of the cache. By default this message is turned off. To enable the message uncomment the following lines of code in display_news.php (lines below shown without comments):
// ADD cache age message is more than 1 minute old -- off by default
if ($user_age > 2)
{
$boxtitle.= "
Last updated $user_age minutes ago
.";
}
// ADD cache age message is more than 1 minute old -- off by default
if ($age_minutes > 2)
{
$boxtitle.= "
Last updated $age_minutes minutes ago
.";
}
Next Page Prev Page Contents