/***************************************************************************** * phorum * * www.phorum.org * * Created 04/16/98 Last Modified 11/5/98 * ****************************************************************************** * Copyright (C) 1998 Phorum Dev Team * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * * any later version. * * * * You should have received a copy of the GNU General Public License * * if not, write to: * * Free Software Foundation Inc. * * 675 Mass Ave * * Cambridge, MA 02139, USA. * * * *****************************************************************************/ include "header.inc"; include "forum.ini"; /* Begin PHP Code */ /**************************************************** * Determine if there are params and build page SQL * ****************************************************/ if($back!=""){ $sSQL = "Select thread from $sTable where thread <>0 and thread > $back order by thread limit $nDisplay"; } elseif($more!=""){ $sSQL = "Select thread from $sTable where thread <>0 and thread < $more order by thread desc limit $nDisplay"; } else{ $sSQL = "Select thread from $sTable where thread <>0 order by thread desc limit $nDisplay"; } $nThreads = mysql_db_query($sDB, $sSQL, $nConnection); $nRows = mysql_num_rows ( $nThreads ); if($nRows<$nDisplay){ if($back!=""){ $sSQL = "Select thread from $sTable where thread <>0 order by thread desc limit $nDisplay"; $nThreads = mysql_db_query($sDB, $sSQL,$nConnection); $nRows = mysql_num_rows ( $nThreads ); } } $topics = ""; if ( $nRows > 0 ){ $a=1; $thread = mysql_result($nThreads, 0, "thread"); $topics = "$thread"; While($a<$nRows){ $thread = mysql_result($nThreads, $a, "thread"); $topics = $topics.",$thread"; $a++; } } if($topics!=""){ $sSQL = "Select id,topic,name,datestamp,thread from $sTable where thread in ($topics) order by thread desc, id"; } else{ $sSQL = "Select id,topic,name,datestamp,thread from $sTable"; } echo ""; ?> echo "\n"; if($nTopics>0){ $nRows = mysql_num_rows($nTopics); $nav = "
\n
|
\n"; echo $nav; echo "\n"; if($nRows>0){ include "threads.inc"; echo $nav; echo "\n"; } else{ echo "
\n"; } } else{ ?>