$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));
$sql=db_rewrite_sql($sql);
$result=db_query($sql,$node->tid);
while($topic=db_fetch_object($result)){
if($stop==1){
$next=newStdClass();
$next->nid=$topic->nid;
$next->title=$topic->title;
break;
}
if($topic->nid==$node->nid){
$stop=1;
}
else{
$prev=newStdClass();
$prev->nid=$topic->nid;
$prev->title=$topic->title;
}
}
if($prev){
$links[]=l(t('previous forum topic'),"node/$prev->nid",array('title'=>check_plain($prev->title)));
}
if($next){
$links[]=l(t('next forum topic'),"node/$next->nid",array('title'=>check_plain($next->title)));
}
}
return$links;
}
functionforum_term_path($term){
return'forum/'.$term->tid;
}
...
...
@@ -497,7 +453,6 @@ function forum_menu($may_cache) {
* Format the next/previous forum topic navigation links.
*
* @ingroup themeable
*/
functiontheme_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));
$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));
$sql=db_rewrite_sql($sql);
$result=db_query($sql,$node->tid);
while($topic=db_fetch_object($result)){
if($stop==1){
$next=newStdClass();
$next->nid=$topic->nid;
$next->title=$topic->title;
break;
}
if($topic->nid==$node->nid){
$stop=1;
}
else{
$prev=newStdClass();
$prev->nid=$topic->nid;
$prev->title=$topic->title;
}
}
if($prev){
$links[]=l(t('previous forum topic'),"node/$prev->nid",array('title'=>check_plain($prev->title)));
}
if($next){
$links[]=l(t('next forum topic'),"node/$next->nid",array('title'=>check_plain($next->title)));
}
}
return$links;
}
functionforum_term_path($term){
return'forum/'.$term->tid;
}
...
...
@@ -497,7 +453,6 @@ function forum_menu($may_cache) {
* Format the next/previous forum topic navigation links.
*
* @ingroup themeable
*/
functiontheme_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));