/***************************************************************************** * php/mysql forum * * Copyright 1998 Brian Moon brianlmoon@iname.com * * Created 04/16/98 Last Modified 06/22/98 * ****************************************************************************** * COPYRIGHT NOTICE * * Copyright 1998 Brian L. Moon All Rights Reserved. * * * * This code may be used and modified free of charge by anyone so long as * * this copyright notice and the comments above remain intact. By using this * * code you agree to indemnify Brian L. Moon from any liability that * * might arise from it's use. * * * * Selling the code for this program without prior written consent is * * expressly forbidden. In other words, please ask first before you try and * * make money off of my program. * * * * Obtain permission before redistributing this software over the Internet or * * in any other medium. In all cases copyright and header must remain intact.* *****************************************************************************/ 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{ ?>