调用代码,取最新15条问题记录:
{eval $questionlist=$this->getlistbysql("select id,title,answers,status,time from ".$this->db->dbprefix."question where status!=0 and cid=分类id order by time desc limit 0,15");}模板中loop标记循环问题列表
{loop $questionlist $thequestion}
问答标题:{$thequestion['title']}
问答回答数:{$thequestion['answers']}
问答id:{$thequestion['id']}
问答详情页面地址:{url question/view/$thequestion['id']}
问答发布时间: {eval echo tdate($thequestion['time']);}
{/loop}返回参数详见问题表: