You are here

function authcache_preprocess_forum_list in Authenticated User Page Caching (Authcache) 6

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

Process forum template variables

Remove "new" marker

See also

forum.module

File

./authcache.module, line 589
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['is_page_authcache']) {
    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 = '';
    }
  }
}