You are here

function authcache_preprocess_forum_list in Authenticated User Page Caching (Authcache) 7

Same name and namespace in other branches
  1. 6 authcache.module \authcache_preprocess_forum_list()

Process forum template variables

Remove "new" marker

See also

forum.module

File

./authcache.module, line 639
Authenticated User Page Caching (and anonymous users, too!)

Code

function authcache_preprocess_forum_list(&$variables) {

  // Will use Ajax to determine whether to display "new" marker for user
  if ($variables['authcache_is_cacheable'] === true) {
    foreach ($variables['forums'] as $id => $forum) {
      if ($variables['user']->uid) {
        if ($forum->num_topics) {
          $forum->num_topics .= '<span class="authcache-topic-new" data-forum-id="' . $id . '"></span>';
        }
      }
      $variables['forums'][$id]->new_text = '';
      $variables['forums'][$id]->new_url = '';
    }
  }
}