How do I remove the next/ previous forum topic links when I view a node in forum? I don't think anyone uses this.

Comments

dawehner’s picture

As a fast solution
Copy

<?php
function phptemplate_forum_topic_navigation($node) {
  $output = '';
/*
  // get previous and next topic
  $sql = "SELECT n.nid, n.title, n.sticky, l.comment_count, l.last_comment_timestamp FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = %d WHERE n.status = 1 AND n.type = 'forum' ORDER BY n.sticky DESC, ". _forum_get_topic_order_sql(variable_get('forum_order', 1));
  $result = db_query(db_rewrite_sql($sql), $node->tid);

  $stop = 0;
  while ($topic = db_fetch_object($result)) {
    if ($stop == 1) {
      $next = new stdClass();
      $next->nid = $topic->nid;
      $next->title = $topic->title;
      break;
    }
    if ($topic->nid == $node->nid) {
      $stop = 1;
    }
    else {
      $prev = new stdClass();
      $prev->nid = $topic->nid;
      $prev->title = $topic->title;
    }
  }

  if ($prev || $next) {
    $output .= '<div class="forum-topic-navigation clear-block">';

    if ($prev) {
      $output .= l(t('‹ ') . $prev->title, 'node/'. $prev->nid, array('class' => 'topic-previous', 'title' => t('Go to previous forum topic')));
    }
    if ($prev && $next) {
      // Word break (a is an inline element)
      $output .= ' ';
    }
    if (!empty($next)) {
      $output .= l($next->title . t(' ›'), 'node/'. $next->nid, array('class' => 'topic-next', 'title' => t('Go to next forum topic')));
    }

    $output .= '</div>';
  }*/

  return $output;
}
?>

Copy this in your template.php
It does just print out nothing
----------------------------------------
Blog: www.freeblogger.org: German IRC-Channel: irc.freenode.net #drupal.de ... Jabber-me: dwehner@im.calug.deXING

tanyi’s picture

It works. Thx

aharown07’s picture

For the benefit of newbies... I was briefly confused by the above.
All you really need in your template.php are the portions at the beginning and end of the code above.
Also, if your template.php file is written w/a <?php at the beginning and a single ?> at the end, you don't need those tags.

In mine it looks like this...

function phptemplate_forum_topic_navigation($node) {
  $output = '';
  return $output;
}
that0n3guy’s picture

This should be made into a little bitty module.

Want better gas mileage - no joke - Join the community - aquauto.com