<?php
#------------------------------------------------------#
#               本程序为zChain.net提供                 #
#                zChain论坛(ZBB)v2.00                  #
#------------------------------------------------------#
# INPUT[GET] : $bid, $num;

require "bin/config.php";
require "bin/common.php";

require_once('core/class_forum_base.php');
CForumBase::setFileBase("$filepath");
require_once('core/base_memo_file.php');
require_once('core/class_topic.php');
require_once('core/base_record_file.php');
require_once('core/class_topic_list.php');

function printLine($a_line)
{
 echo "document.write('$a_line<br>');";
}

$oTpcLst=new CTopicList;
$oTpc=new CTopic;

if(!$oTpcLst->open($bid)){exit;}

if(!$num){$num=5;}
$flag=$oTpcLst->moveFirst();
while($flag && $num){
 $oTpc->setBrief($oTpcLst->brief);
 printLine("<a href=$prgurl/viewtopic.php?bid=$bid&tid=$oTpcLst->id>$oTpc->title</a>($oTpc->user)");

 $flag=$oTpcLst->moveNext();
 $num--;
}

$oTpcLst->close();

?>