- <?php
- if(!defined('IN_DISCUZ')) {
- exit('Access Denied');
- }
- //首页帖子主列表
- $fids='0';//不调用的版块,多个用半角逗号分开
- if($_GET['order']=='dateline' || $_GET['order']=='views' || $_GET['order']=='replies' || $_GET['order']=='digest'){
- $order= $_GET['order'];
- }else{
- $order= 'dateline';
- }
- $messagelength='140';//内容字数
- $tnum=100;//每页显示的数量
- $begin=($_G['page']-1)*$tnum;
- $thread=array();
- require_once libfile('function/post');
- $rs=DB::query("
- SELECT t.*,p.message,p.pid,f.name,ft.attachment as forum_pic
- FROM ".DB::table("forum_thread")." t
- LEFT JOIN ".DB::table("forum_post")." p on p.tid=t.tid
- LEFT JOIN ".DB::table("forum_forum")." f on f.fid=t.fid
- LEFT JOIN ".DB::table("forum_threadimage")." ft on ft.tid=t.tid
- WHERE t.`fid` NOT in ($fids) and t.displayorder>=0 and p.first=1
- group by t.tid
- ORDER BY t.`$order` DESC
- LIMIT $begin , $tnum");
- while ($rw=DB::fetch($rs)) {
- $rw['message']=messagecutstr($rw['message'],$messagelength,'');
- $rw['message']=dhtmlspecialchars($rw['message']);
- $Hei_portal_list[]=$rw;
- }
- $allnum=DB::result_first("select count(*) from ".DB::table("forum_thread")." where fid NOT in ($fids)");
- $pagenav=multi($allnum,$tnum,$_G['page'],"forum.php?order=$order");
- $ntpage=$_G['page']+1;
- $fynum=intval(floor($allnum/$tnum));
- ?>
$DiyPost['tid'] | 主题TId | $DiyPost['subject'] | 主题标题 | $DiyPost[forum_pic] | 封面图文件名 | $DiyPost['authorid'] | 作者Uid | $DiyPost['author'] | 作者 | $DiyPost[views] | 查看数 | $DiyPost[replies] | 回复数 | $DiyPost[dateline] | 发布时间 | $DiyPost['message'] | 主题内容 | $DiyPost['name'] | 所属板块名称
|
|