Hi all,
in updating my theme for Drupal 7, I ned to figure out how to add a forum topic pager.
I have currently added this to my template.php
<?php
function mytheme_preprocess_forum_topic_list(&$variables) {
global $forum_topic_list_header;
// Create the tablesorting header.
$ts = tablesort_init($forum_topic_list_header);
$header = '';
foreach ($forum_topic_list_header as $cell) {
$cell = tablesort_header($cell, $forum_topic_list_header, $ts);
$header .= _theme_table_cell($cell, TRUE);
}
$variables['header'] = $header;
if (!empty($variables['topics'])) {
$row = 0;
foreach ($variables['topics'] as $id => $topic) {
$variables['topics'][$id]->icon = theme('forum_icon', array('new_posts' => $topic->new, 'num_posts' => $topic->comment_count, 'comment_mode' => $topic->comment_mode, 'sticky' => $topic->sticky, 'first_new' => $topic->first_new));
$variables['topics'][$id]->zebra = $row % 2 == 0 ? 'odd' : 'even';
$row++;
if ($variables['tid'] != $topic->forum_tid) {
$variables['topics'][$id]->message = l(t('This topic has been moved'), "node/$topic->nid");
}
$variables['topics'][$id]->pager = '';
$comments_per_page = variable_get('comment_default_per_page_' . $topic->type, 30);
if ($topic->comment_count > $comments_per_page) {