- เครดิต
- 0
- เพื่อน
- ทักทาย
- บล็อก
- อัลบั้ม
- โพสต์
- กระทู้
- แชร์
- สำคัญ
- สิทธิ์อ่าน
- 10
- จำนวนผู้ติดตาม
- จำนวนผู้กำลังติดตาม
- เพศ
- ไม่บอก
|
คือว่าผมลง Discuz! 6.0 =>Discuz board! premod2.1 Thai มาลงบนโฮส
แล้วปัญหามันอยู่ที่ว่า ใน TOPLIST ไม่มีการแสดงอะไรเลย แม้ว่าจะโพสต์รูป และอื่นๆแล้วก็ตามมันก็ยังโล่ง อยู่เหมือนเดิมทุกช่อง
อยากทราบว่า จะแก้ยังไงครับ
นี่โค้ดในไฟล์ toplist.php- <?php
- //---砞竚---start
-
- $shownums = 10; //逼计
- $hotforumday = 15; //ぶぱず荐
- $subjectcut= 14; //夹肈陪ボ计
- $authorcut= 4; //﹎计
- $cachelife = 1800; //酚龟悔薄猵砞竚纐粄1800.
- $cachename = 'toplist_' . $_GET['toplist_type']; //絯.璝籔ㄤ础ン侥叫э,璶ぃ侥ぃ穦紇臫ㄏノ.
- //---砞竚---end
- require_once ('../include/common.inc.php');
- include(DISCUZ_ROOT . 'forumdata/cache/cache_' . $cachename . '.php');
- if($expiration < time()){
- switch($_GET['toplist_type']){
- case 'new':
- $query = $db->query("select f.name,t.tid,t.subject,t.author,t.authorid,t.lastposter,t.dateline,t.views,t.replies,t.lastpost,t.lastposter
- from {$tablepre}threads as t, {$tablepre}forums as f
- where t.fid = f.fid order by dateline desc limit $shownums");
- $lastposturl = '';
- break;
- case 'hot':
- $datatime = time()-($hotforumday * 24 * 60 * 60);
- $query = $db->query("select f.name,t.tid,t.subject,t.author,t.authorid,t.lastposter,t.dateline,t.views,t.replies,t.lastpost,t.lastposter
- from {$tablepre}threads as t, {$tablepre}forums as f
- where t.fid = f.fid and dateline > $datatime order by views desc limit $shownums");
- $lastposturl = '';
- break;
- case 'newposts':
- $query = $db->query("select p.author,p.authorid,f.name,t.tid,t.author as forumauthor,t.authorid as forumauthorid,t.subject,t.lastposter,t.dateline,t.views,t.replies,t.lastpost,t.lastposter
- from {$tablepre}threads as t, {$tablepre}posts as p, {$tablepre}forums as f
- where t.tid = p.tid and t.fid = f.fid and p.first = 0 order by p.dateline desc limit $shownums");
- $lastposturl = '&goto=lastpost#lastpost';
- break;
- }
- $num = 0;
- while($res = $db->fetch_array($query)){
- $data['foruminfo'][$num] = array(
- 'authorid' => $res['authorid'],
- 'tid' => $res['tid'],
- 'subject' => cutstr($res['subject'],$subjectcut*2,$dot='..'),
- 'subjectfull' => $res['subject'],
- //'forumname' => $res['name'],
- 'author' => cutstr($res['author'],$authorcut*2,$dot='..'),
- 'authorfull' => $res['author'],
- 'posttime' => date('Y-m-d H:i', $res['dateline']),
- 'vw_tm' => $res['views'],
- 'replies' => $res['replies'],
- 'lastposttime' => date('Y-m-d H:i', $res['lastpost']),
- 'lastposter' => $res['lastposter'],
- );
- if($_GET['toplist_type'] == 'newposts'){
- $data['foruminfo'][$num]['forumauthor'] = $res['forumauthor'];
- $data['foruminfo'][$num]['forumauthorid'] = $res['forumauthorid'];
- }
- $num++;
- }
- $data['expiration'] = $cachelife + time();
- $data['cacheshownums'] = $shownums;
- require_once (DISCUZ_ROOT . 'include/cache.func.php');
- writetocache($cachename, '', getcachevars($data));
- include(DISCUZ_ROOT . 'forumdata/cache/cache_' . $cachename . '.php');
- }
- foreach($foruminfo as $k => $v){
- $jsstr = "document.write('<span style="margin-right:8px;float:right;"><a href="space.php?action=viewpro&uid=" . $v['authorid'] . "" style="color:#535353;">" . $v['author'] . "</a></span><span style="float:left;"><a href="viewthread.php?tid=" . $v['tid'] . $lastposturl . """;
- $jsstr .= "title="หัวข้อ: " . $v['subjectfull'] . "";
- if($_GET['toplist_type'] == 'newposts'){
- $jsstr .= " โพสโดย: " . $v['forumauthor'] . "";
- }else{
- $jsstr .= " โพสโดย: " . $v['author'] . "";
- }
- $jsstr .= " โพสเมื่อ: " . $v['posttime'] . " ดูแล้ว: " . $v['vw_tm'] . " ตอบแล้ว: " . $v['replies'] . " ตอบล่าสุดเวลา: " . $v['lastposttime'] . " ตอบล่าสุดโดย: " . $v['lastposter'] . """;
- $jsstr .= " "style="color:#535353;">" . $v['subject'] . "</a></span><br />');";
- echo $jsstr;
- }
- ?>
คัดลอกไปที่คลิปบอร์ด ไฟล์ usertoplist.php- <?php
- //---砞竚---start
-
- $shownums = 10; //逼计
- $authorcut= 4; //﹎计
- $cachelife = 1800; //酚龟悔薄猵砞竚纐粄1800.
- $cachename = 'toplist_usertoplist'; //絯.璝籔ㄤ础ン侥叫э,璶ぃ侥ぃ穦紇臫ㄏノ.
- //---砞竚---end
- require_once ('../include/common.inc.php');
- include(DISCUZ_ROOT . 'forumdata/cache/cache_' . $cachename . '.php');
- if($expiration < time()){
- $datatime = time()-(24 * 60 * 60);
- $query = $db->query("select author,authorid from {$tablepre}posts where dateline > $datatime");
- $num = 0;
- while($res = $db->fetch_array($query)){
- $datatmp[$num] = $res['authorid'];
- $num++;
- }
- $datacount = array_flip(array_count_values($datatmp));
- $datarsort = krsort($datacount);
- $num = 0;
- foreach($datacount as $k => $v ){
- if($num == $shownums){
- break;
- }
- $query = $db->query("select username from {$tablepre}members where uid = $v");
- $res = $db->fetch_array($query);
- $data['usertoplistinfo'][$num]['userid'] = $v;
- $data['usertoplistinfo'][$num]['username'] = cutstr($res['username'],$authorcut*2,$dot='..');
- $data['usertoplistinfo'][$num]['postscount'] = $k;
- $num++;
- }
- $data['expiration'] = $cachelife + time();
- require_once (DISCUZ_ROOT . 'include/cache.func.php');
- writetocache($cachename, '', getcachevars($data));
- include(DISCUZ_ROOT . 'forumdata/cache/cache_' . $cachename . '.php');
- }
- foreach($usertoplistinfo as $k => $v){
- $jsstr = "document.write('<a href="space.php?action=viewpro&uid=" . $v['userid'] . "" style="color:#535353;">" . $v['username'] . "</a><span style="color:#FF6D00;">[" . $v['postscount'] . "]</span><br />');";
- echo $jsstr;
- }
- ?>
คัดลอกไปที่คลิปบอร์ด
[ แก้ไขล่าสุด iplus เมื่อ 2008-7-23 21:33 ] |
ขออภัย! โพสต์นี้มีไฟล์แนบหรือรูปภาพที่ไม่ได้รับอนุญาตให้คุณเข้าถึง
คุณจำเป็นต้อง ลงชื่อเข้าใช้ เพื่อดาวน์โหลดหรือดูไฟล์แนบนี้ คุณยังไม่มีบัญชีใช่ไหม? สมัครสมาชิก
x
|