trickstertik โพสต์ 2009-10-23 10:30:18

หน้าฟอรั่มแสดงกระทู้ล่าสุด 5 อันดับ

Resource Name: Home straight row of landscaping For DZ 7.1
Version: Discuz! 7.1
Language codes: GBK UTF-8
The original author: 不详
Credit : http://bbs.7drc.com/thread-5040-1-1.html
Demo : www.parestz.com



เปิดไฟล์include/index_classics.inc.php ค้นหา$newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;เพิ่มลงบรรทัดต่อไป//Post call the beginning
$hack_cut_str =60; // Modify the title here, the length of
$fids = array();
if (file_exists("./forumdata/cache/cache_forums.php")){
      require_once "./forumdata/cache/cache_forums.php";
      if (is_array($_DCACHE['forums'])){
               foreach ($_DCACHE['forums'] as $k => $v){
                        if (!strstr(',sub,forum,',','.$v['type'].',')) continue;
                        $fids[$k] = 5; // Here is the first call at the number of articles behind the needs and the same settings.
                }
      }
}
if (count($fids) < 1){
      $query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type='forum' OR type='sub'");
      while ($row = $db->fetch_array($query)){
                $fids[$row['fid']] = 5; // Here is the second call at the number of needs and the same as the previous settings.
      }
}
$limit_counts = 0;
foreach ($fids as $k => $v){
      $sql .= "(SELECT t.*, f.name FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f.fid = t.fid WHERE t.fid='$k' ORDER BY t.dateline DESC LIMIT $v) UNION ";
}
if ($sql){
      $sql = substr($sql,0,strlen($sql)-6);
}
$query = $db->query($sql);
while ($row = $db->fetch_array($query)){
      $row['view_subject'] = cutstr($row['subject'],$hack_cut_str);
      $row['date']= gmdate("$dateformat", $row['dateline'] + $timeoffset * 3600);
      if($row['highlight']) {
                        $string = sprintf('%02d', $row['highlight']);
                        $stylestr = sprintf('%03b', $string);
                        $row['highlight'] = 'style="';
                        $row['highlight'] .= $stylestr ? 'font-weight: bold;' : '';
                        $row['highlight'] .= $stylestr ? 'font-style: italic;' : '';
                        $row['highlight'] .= $stylestr ? 'text-decoration: underline;' : '';
                        $row['highlight'] .= $string ? 'color: '.$colorarray[$string] : '';
                        $row['highlight'] .= '"';
      } else {
                        $row['highlight'] = '';
      }
      ${'new_no'.$row['fid'].'_threadlist'}[] = $row;
}
//Call the end of the postเปิดไฟล์ templates/default/css_common.htm ค้นหา.list th { background: url({IMGDIR}/forum.gif) 5px 10px no-repeat; padding-left: 45px !important; }เปลี่ยนเป็น.list th { background: url({IMGDIR}/forum.gif) 3px 17px no-repeat; padding-left: 15px !important; }เปิดไฟล์ templates/default/discuz.htm ค้นหา<tbody id="forum$forum">
จนถึง
$cat['endrows']เปลี่ยนเป็น<tbody id="forum$forum">
<tr>
<td>
$forum
<div class="left">
<h2><a href="forumdisplay.php?fid=$forum" {if $forum}target="_blank" {/if}>$forum</a> <font class="smalltext"><!--{if $forum}-->T: <font color="#FF3399">$forum</font><img src="{IMGDIR}/new.gif" align="absmiddle"><!--{else}-->T: <font color="#FF3399">0</font><!--{/if}--> P: <font color="#00CCFF">$forum</font> R: <font color="#99CC00">$forum</font></font> <!--{if $forum['moderators']}--><!--{if $moddisplay == 'flat'}--><img src="{IMGDIR}/moderator.gif" title="Forum Moderator" style="cursor:pointer" /> <em class="moderators" id="coll_1" style="display:none">$forum</em><!--{/if}--><!--{/if}--></h2>
<!--{if $forum}--><p>$forum</p><!--{/if}-->
<!--{if $forum['subforums']}--><p>{lang forum_subforums}: $forum['subforums']</p><!--{/if}-->
</div>
</td>
<th class="forumlast"{$forum}>
<!--{if $forum['permission'] == 1}-->
{lang private_forum}
<!--{else}-->
<!--{if $forum['redirect']}-->
<a href="forumdisplay.php?fid=$forum">{lang url_link}</a>
<!--{elseif is_array($forum['lastpost'])}-->
<p> <a href="redirect.php?tid=$forum&goto=lastpost#lastpost">{echo cutstr($forum, 26)}</a></p>
<cite><!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}--> - $forum</cite>
<!--{else}-->
{lang never}
<p>{lang never}</p>
<!--{/if}-->
<!--{/if}-->
</td>
</tr>
</tbody>
<!--{/loop}-->
<!--{else}-->
<tr class="narrowlist">
<!--{loop $cat['forums'] $forumid}-->
<!--{eval $forum=$forumlist[$forumid];}-->
<!--{if $forum['orderid'] && ($forum['orderid'] % $cat['forumcolumns'] == 0)}-->
</tr></tbody>
<!--{if $forum['orderid'] < $cat['forumscount']}-->
<tbody><tr>
<!--{/if}-->
<!--{/if}-->
<td width="$cat" style="vertical-align: top; background-image: none; padding:8px !important;">
<div style="width:100%; "><div style="float:left; "><h2><a href="forumdisplay.php?fid=$forum" {if $forum}target="_blank" {/if}>$forum</a></h2></div><div style="float:right; "><!--{if $forum['moderators']}--><!--{if $moddisplay == 'flat'}--><img src="{IMGDIR}/moderator.gif" title="论坛版主" style="cursor:pointer" /> <em class="moderators" id="coll_2" style="display:none">$forum</em><!--{/if}--><!--{/if}-->
<!--{if $forum}-->
<!--{else}-->
<!--{/if}--></div></div>
<br>$forum
<!--{if $forum}--><div style="width:100%; ">$forum</div><!--{/if}-->
<!--{if $forum['subforums']}--><div style="width:100%; ">{lang forum_subforums}: $forum['subforums']</div><!--{/if}-->
<!--{if $forum}-->Today: <font color="#FF3399">$forum</font><img src="{IMGDIR}/new.gif" align="absmiddle"><!--{else}-->Today: <font color="#FF3399">0</font><!--{/if}--> Post: <font color="#00CCFF">$forum</font> Reply: <font color="#99CC00">$forum</font></font><br /><br />
<ul style="background-image: url(images/listbg_li.gif); padding:1px 2px 0px 10px; list-style-type: none; line-height: 20px; clear: both; margin:8px 0; ">
<!--{loop ${"new_no".$forum."_threadlist"} $row}-->
<div style="overflow: hidden; height:20px; width:100%"><small style="float:right; color:#9C8B88; margin: 0 0 0 5px">$row['date']</small><a href="viewthread.php?tid=$row" title="$row" target='_self'>$row</a></div>
<!--{/loop}-->
</ul>
</td>
<!--{/loop}-->
$cat['endrows']เปิดไฟล์ templates/default/forumdisplay_subforum.htm ค้นหา<!--{if !$forum['forumcolumns']}-->
จนถึง
<!--{loop $sublist $sub}-->เปลี่ยนเป็น<!--{if !$forum['forumcolumns']}-->
<!--{loop $sublist $sub}-->
<tbody>
<tr>
<td>
$sub
<div class="left">
<h2><a href="forumdisplay.php?fid=$sub" {if $sub}target="_blank"{/if}>$sub</a> <font class="smalltext"><!--{if $sub && !$sub['redirect']}-->今日: <font color="#FF3399">$forum</font><img src="{IMGDIR}/new.gif" align="absmiddle"><!--{else}-->今日: <font color="#FF3399">0</font><!--{/if}--> 主题: <font color="#00CCFF">$forum</font> 回复: <font color="#99CC00">$forum</font></font> <!--{if $sub['moderators']}--><!--{if $moddisplay == 'flat'}--><img src="{IMGDIR}/moderator.gif" title="论坛版主" style="cursor:pointer" /> <em class="moderators" id="coll_3" style="display:none">$forum</em><!--{/if}--><!--{/if}--></h2>
<!--{if $sub}--><p>版块介绍: $sub</p><!--{/if}-->
<!--{if $sub['subforums']}--><p>{lang forum_subforums}: $sub['subforums']</p><!--{/if}-->
</div>
</td>
<th class="forumlast"{$forum}>
<!--{if $sub['permission'] == 1}-->
{lang private_forum}
<!--{else}-->
<!--{if $sub['redirect']}-->
<a href="forumdisplay.php?fid=$sub">{lang url_link}</a>
<!--{elseif is_array($sub['lastpost'])}-->
<p>最新主题: <a href="redirect.php?tid=$sub&goto=lastpost#lastpost">{echo cutstr($sub, 20)}</a></p>
<cite><!--{if $sub['lastpost']['author']}-->作者相关: $sub['lastpost']['author']<!--{else}-->作者相关: {lang anonymous}<!--{/if}--> - $sub</cite>
<!--{else}-->
最新主题: {lang never}
<p>作者相关: {lang never}</p>
<!--{/if}-->
<!--{/if}-->
</td>
</tr>
</tbody>
<!--{/loop}-->
<!--{else}-->
<tr class="narrowlist">
<!--{loop $sublist $sub}-->ไฟล์รูปที่ต้องใช้ อัพไปตามตำแหน่งเลยครับ

THEZEN โพสต์ 2009-10-24 05:54:23

แก้ไขล่าสุด THEZEN เมื่อ 2009-10-24 05:56

ขอบคุณมากครับ7.0 ใช้ได้ไหมครับ

mza โพสต์ 2009-10-24 12:54:17

ขอบคุณครับบบ...{:18_789:}

suthida โพสต์ 2009-10-24 14:57:58

เยี่ยมค่ะ {:21_830:} ขอบคุณค่ะ

sangvichai โพสต์ 2009-10-24 17:37:57

อยากใช้กับ 7.0 อะ T-

DragoNKing โพสต์ 2009-10-26 20:53:45

ขอคำตอบหน่อยครับ 7.0 ใช้ได้ไหมครับ ผมไม่อยากลองเอง
เน่ามาแล้วที เข็ด 55+ เพราะ 7.1 นั่นแหละ รอมันใช้การดีก่อน
เดะอัพเดทตามไป

banksanti โพสต์ 2009-11-4 02:42:31

ขอคำตอบหน่อยครับ 7.0 ใช้ได้ไหมครับ ผมไม่อยากลองเอง
เน่ามาแล้วที เข็ด 55+ เพราะ 7.1 นั่นแหละ รอมันใช้การดีก่อน
...
ต้นฉบับโพสโดย DragoNKing เมื่อ 2009-10-26 20:53 http://www.discuzthai.com/images/common/back.gif


7.0 มาที่นี่เลย http://www.discuzthai.com/thread-10418-1-1.html

ถ้าอยากให้เหมือนก็โหลดไฟล์แนบในกระทู้ของคุณ trickstertik มาด้วยก็ได้

สมมุติถ้าภาษามันเพี้ยนก็ก็อปโค้ดมาวางไว้ใน Dream ก่อนด้วยก็กด Modify >> Page >>Properties >> ในช่องCategoryให้กดที่ Title/Encoding เลือกเป็น
จากนั้นในช่อง Encoding ให้เลือกเป็น Unicode(UTF-8)แล้วก็คลิก OK เป็นอันเสร็จ

จากนั้นก็สามารถก็อปไปวางได้เลย

sangvichai โพสต์ 2009-11-7 16:06:10

คือ แถว5 แถวมันไม่ขึ้นอะ

sumet โพสต์ 2009-11-8 20:19:26

ขอบคุณมากครับ

sumet โพสต์ 2009-11-8 20:22:46

คือ แถว5 แถวมันไม่ขึ้นอะ
ต้นฉบับโพสโดย sangvichai เมื่อ 2009-11-7 16:06 http://www.discuzthai.com/images/common/back.gif
ของผมก็ไม่แสดงเหมือนกัน เอ...เราผิดตรงไหนนะ
ก็ทำตามหมดแล้วนี่นา
หน้า: [1] 2 3
ดูในรูปแบบกติ: หน้าฟอรั่มแสดงกระทู้ล่าสุด 5 อันดับ