/** * */ function boinc_preprocess_forum_topic_list(&$variables) { if (!empty($variables['topics'])) { foreach ($variables['topics'] as $id => $topic) { if ($topic->new_replies) { $cid = boincuser_get_first_unread_comment_id($topic->nid); $variables['topics'][$id]->new_url = url("goto/comment/{$cid}"); } } } }
/** * */ function boinc_preprocess_forum_topic_list(&$variables) { if (!empty($variables['topics'])) { foreach ($variables['topics'] as $id => $topic) { if ($topic->new_replies) { $cid = boincuser_get_first_unread_comment_id($topic->nid); if ($cid) { $variables['topics'][$id]->new_url = url("goto/comment/{$cid}"); } else { // User hasn't visited this topic before, so all replies are new... $topic->new_replies = NULL; } } } } }