Discuz Thai

 ลืมรหัสผ่าน
 สมัครสมาชิก

ข้อตกลงการใช้งานกระดานข่าวดิสคัสไทย DiscuzThai Agreement (English Version) ประกาศดิสคัสไทย - ทำเนียบดิสคัสภาษาไทย

Discuz! X3.5 Thai R20231001 Rev.8 (NEW) [วิดีโอช่วยสอน] อัปเกรด Discuz! X3.4 เป็น X3.5 Discord ของ Discuz! Thai Community อย่างเป็นทางการ

Discuz! X3.4 Thai R20220811 (REV.75) สิ้นสุดการสนับสนุน Discuz! X3.4 ภาษาไทยตั้งแต่วันนี้เป็นต้นไป (ขอแนะนำให้อัปเกรดเป็น X3.5 แทน)

ค้นหา
แท็กยอดนิยม: ดิสคัสภาษาไทย Discuz Thai
ดู: 16943|ตอบกลับ: 17

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

    [คัดลอกลิงก์]
konggang โพสต์ 2010-5-5 16:20:22 |โหมดอ่าน
แก้ไขล่าสุดโดย konggang เมื่อ 2010-5-10 14:20

อ้างอิงจากกระทู้นี้ครับ
http://www.discuzthai.com/thread-13679-1-1.html


ผมได้แก้ภาษานิดหน่อย



เปิดไฟล์  include/index_classics.inc.php ค้นหา
  1. $newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
คัดลอกไปที่คลิปบอร์ด
เพิ่มลงบรรทัดต่อไป
  1. //Post call the beginning
  2. $hack_cut_str =60; // Modify the title here, the length of
  3. $fids = array();
  4. if (file_exists("./forumdata/cache/cache_forums.php")){
  5.         require_once "./forumdata/cache/cache_forums.php";
  6.         if (is_array($_DCACHE['forums'])){
  7.                foreach ($_DCACHE['forums'] as $k => $v){
  8.                         if (!strstr(',sub,forum,',','.$v['type'].',')) continue;
  9.                         $fids[$k] = 5; // Here is the first call at the number of articles behind the needs and the same settings.
  10.                 }
  11.         }
  12. }
  13. if (count($fids) < 1){
  14.         $query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type='forum' OR type='sub'");
  15.         while ($row = $db->fetch_array($query)){
  16.                 $fids[$row['fid']] = 5; // Here is the second call at the number of needs and the same as the previous settings.
  17.         }
  18. }
  19. $limit_counts = 0;
  20. foreach ($fids as $k => $v){
  21.         $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 ";
  22. }
  23. if ($sql){
  24.         $sql = substr($sql,0,strlen($sql)-6);
  25. }
  26. $query = $db->query($sql);
  27. while ($row = $db->fetch_array($query)){
  28.         $row['view_subject'] = cutstr($row['subject'],$hack_cut_str);
  29.         $row['date']= gmdate("$dateformat", $row['dateline'] + $timeoffset * 3600);
  30.         if($row['highlight']) {
  31.                         $string = sprintf('%02d', $row['highlight']);
  32.                         $stylestr = sprintf('%03b', $string[0]);
  33.                         $row['highlight'] = 'style="';
  34.                         $row['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  35.                         $row['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  36.                         $row['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  37.                         $row['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  38.                         $row['highlight'] .= '"';
  39.         } else {
  40.                         $row['highlight'] = '';
  41.         }
  42.         ${'new_no'.$row['fid'].'_threadlist'}[] = $row;
  43. }
  44. //Call the end of the post
คัดลอกไปที่คลิปบอร์ด
เปิดไฟล์ templates/default/css_common.htm ค้นหา
  1. .list th { background: url({IMGDIR}/forum.gif) 5px 10px no-repeat; padding-left: 45px !important; }
คัดลอกไปที่คลิปบอร์ด
เปลี่ยนเป็น
  1. .list th { background: url({IMGDIR}/forum.gif) 3px 17px no-repeat; padding-left: 15px !important; }
คัดลอกไปที่คลิปบอร์ด
เปิดไฟล์ templates/default/discuz.htm ค้นหา
  1. <tbody id="forum$forum[fid]">
  2. จนถึง
  3. $cat['endrows']
คัดลอกไปที่คลิปบอร์ด
เปลี่ยนเป็น
  1. <tbody id="forum$forum[fid]">
  2. <tr>
  3. <td>
  4. $forum[icon]
  5. <div class="left">
  6. <h2><a href="forumdisplay.php?fid=$forum[fid]" {if $forum[redirect]}target="_blank" {/if}>$forum[name]</a> <font class="smalltext"><!--{if $forum[todayposts]}-->T: <font color="#FF3399">$forum[todayposts]</font><img src="{IMGDIR}/new.gif" align="absmiddle"><!--{else}-->T: <font color="#FF3399">0</font><!--{/if}--> P: <font color="#00CCFF">$forum[threads]</font> R: <font color="#99CC00">$forum[posts]</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[moderators]</em><!--{/if}--><!--{/if}--></h2>
  7. <!--{if $forum[description]}--><p>$forum[description]</p><!--{/if}-->
  8. <!--{if $forum['subforums']}--><p>{lang forum_subforums}: $forum['subforums']</p><!--{/if}-->
  9. </div>
  10. </td>
  11. <th class="forumlast"{$forum[folder]}>
  12. <!--{if $forum['permission'] == 1}-->
  13. {lang private_forum}
  14. <!--{else}-->
  15. <!--{if $forum['redirect']}-->
  16. <a href="forumdisplay.php?fid=$forum[fid]">{lang url_link}</a>
  17. <!--{elseif is_array($forum['lastpost'])}-->
  18. <p> <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">{echo cutstr($forum[lastpost][subject], 26)}</a></p>
  19. <cite><!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}--> - $forum[lastpost][dateline]</cite>
  20. <!--{else}-->
  21. {lang never}
  22. <p>{lang never}</p>
  23. <!--{/if}-->
  24. <!--{/if}-->
  25. </td>
  26. </tr>
  27. </tbody>
  28. <!--{/loop}-->
  29. <!--{else}-->
  30. <tr class="narrowlist">
  31. <!--{loop $cat['forums'] $forumid}-->
  32. <!--{eval $forum=$forumlist[$forumid];}-->
  33. <!--{if $forum['orderid'] && ($forum['orderid'] % $cat['forumcolumns'] == 0)}-->
  34. </tr></tbody>
  35. <!--{if $forum['orderid'] < $cat['forumscount']}-->
  36. <tbody><tr>
  37. <!--{/if}-->
  38. <!--{/if}-->
  39. <td width="$cat[forumcolwidth]" style="vertical-align: top; background-image: none; padding:8px !important;">
  40. <div style="width:100%; "><div style="float:left; "><h2><a href="forumdisplay.php?fid=$forum[fid]" {if $forum[redirect]}target="_blank" {/if}>$forum[name]</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[moderators]</em><!--{/if}--><!--{/if}-->
  41. <!--{if $forum[todayposts]}-->
  42. <!--{else}-->
  43. <!--{/if}--></div></div>
  44. <br>$forum[icon]
  45. <!--{if $forum[description]}--><div style="width:100%; ">$forum[description]</div><!--{/if}-->
  46. <!--{if $forum['subforums']}--><div style="width:100%; ">{lang forum_subforums}: $forum['subforums']</div><!--{/if}-->
  47. <!--{if $forum[todayposts]}-->Today: <font color="#FF3399">$forum[todayposts]</font><img src="{IMGDIR}/new.gif" align="absmiddle"><!--{else}-->Today: <font color="#FF3399">0</font><!--{/if}--> Post: <font color="#00CCFF">$forum[threads]</font> Reply: <font color="#99CC00">$forum[posts]</font></font><br /><br />
  48. <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; ">
  49. <!--{loop ${"new_no".$forum[fid]."_threadlist"} $row}-->
  50. <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[tid]" title="$row[subject]" target='_self'>$row[view_subject]</a></div>
  51. <!--{/loop}-->
  52. </ul>
  53. </td>
  54. <!--{/loop}-->
  55. $cat['endrows']
คัดลอกไปที่คลิปบอร์ด
เปิดไฟล์ templates/default/forumdisplay_subforum.htm ค้นหา
  1. <!--{if !$forum['forumcolumns']}-->
  2. จนถึง
  3. <!--{loop $sublist $sub}-->
คัดลอกไปที่คลิปบอร์ด
เปลี่ยนเป็น
  1.         <!--{if !$forum['forumcolumns']}-->
  2. <!--{loop $sublist $sub}-->
  3. <tbody>
  4. <tr>
  5. <td>
  6. $sub[icon]
  7. <div class="left">
  8. <h2><a href="forumdisplay.php?fid=$sub[fid]" {if $sub[redirect]}target="_blank"{/if}>$sub[name]</a> <font class="smalltext"><!--{if $sub[todayposts] && !$sub['redirect']}-->今日: <font color="#FF3399">$forum[todayposts]</font><img src="{IMGDIR}/new.gif" align="absmiddle"><!--{else}-->Today: <font color="#FF3399">0</font><!--{/if}--> Post: <font color="#00CCFF">$forum[threads]</font> Reply: <font color="#99CC00">$forum[posts]</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[moderators]</em><!--{/if}--><!--{/if}--></h2>
  9. <!--{if $sub[description]}--><p>กระทู้แนะนำ: $sub[description]</p><!--{/if}-->
  10. <!--{if $sub['subforums']}--><p>{lang forum_subforums}: $sub['subforums']</p><!--{/if}-->
  11. </div>
  12. </td>
  13. <th class="forumlast"{$forum[folder]}>
  14. <!--{if $sub['permission'] == 1}-->
  15. {lang private_forum}
  16. <!--{else}-->
  17. <!--{if $sub['redirect']}-->
  18. <a href="forumdisplay.php?fid=$sub[fid]">{lang url_link}</a>
  19. <!--{elseif is_array($sub['lastpost'])}-->
  20. <p>โพสต์ล่าสุด: <a href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost">{echo cutstr($sub[lastpost][subject], 20)}</a></p>
  21. <cite><!--{if $sub['lastpost']['author']}-->คนโพสต์ล่าสุด: $sub['lastpost']['author']<!--{else}-->คนโพสต์ล่าสุด: {lang anonymous}<!--{/if}--> - $sub[lastpost][dateline]</cite>
  22. <!--{else}-->
  23. โพสต์ล่าสุด: {lang never}
  24. <p>คนโพสต์ล่าสุด: {lang never}</p>
  25. <!--{/if}-->
  26. <!--{/if}-->
  27. </td>
  28. </tr>
  29. </tbody>
  30. <!--{/loop}-->
  31. <!--{else}-->
  32. <tr class="narrowlist">
  33. <!--{loop $sublist $sub}-->
คัดลอกไปที่คลิปบอร์ด
ไฟล์ภาพที่ต้องใช้


ไฟล์ภาพนี้ไปไว้ที่สกินที่คุณใช้

ขออภัย! โพสต์นี้มีไฟล์แนบหรือรูปภาพที่ไม่ได้รับอนุญาตให้คุณเข้าถึง

คุณจำเป็นต้อง ลงชื่อเข้าใช้ เพื่อดาวน์โหลดหรือดูไฟล์แนบนี้ คุณยังไม่มีบัญชีใช่ไหม? สมัครสมาชิก

x

คะแนน

จำนวนผู้เข้าร่วม 4จิตพิศัย +4 Money +1 ย่อ เหตุผล
kanungkanpim + 1 โดนใจให้ทิป
bomwhat + 1
chooicwwe + 1
suthida + 1 + 1 เยี่ยมค่ะ

ดูบันทึกคะแนน

realsaks โพสต์ 2010-5-5 18:56:12
ขอบคุณครับ
ว่าแต่อัพข้อมูลไปไว้ที่ไหครับ
GaLonKung โพสต์ 2010-5-5 20:20:47
เปิดไฟล์ templates/default/css_common.htm

ค้นหา .list th { background: url({IMGDIR}/forum.gif) 5px 10px no-repeat; padding-left: 45px !important; }

ตรงนี้ หาไม่เจออ่ะครับ
chooicwwe โพสต์ 2010-5-6 06:44:54
ขอบคุณอย่างสูง
peterza โพสต์ 2010-5-7 19:45:56
ตอบกลับ 3# GaLonKung


    หาไม่เจอด้วยแฮะ แก้ไงดี
แบนรูปโปรไฟล์
momozung โพสต์ 2010-5-8 13:29:47
หมายเหตุ: ผู้โพสต์ถูกแบนหรือถูกลบ โพสต์นี้ถูกปิดโดยอัตโนมัติ
knot06666 โพสต์ 2010-5-22 14:39:16
ขอบคุณมากก ครับ !!
peterza โพสต์ 2010-5-22 15:44:10
ตอบกลับ 1# konggang


    .list th { background: url({IMGDIR}/forum.gif) 5px 10px no-repeat; padding-left: 45px !important; }

หาไม่เจอ ช่วยแนะทีครับ
 เจ้าของ| konggang โพสต์ 2010-5-27 01:01:12
แก้ไขล่าสุดโดย konggang เมื่อ 2010-5-27 01:04

ตอบกลับ 9# jay17

ตอบกลับ 8# peterza

    โค้ดที่ให้หานี้ บางสกินอาจจะไมเหมือนกันก็ได้ โค้ดที่ผมให้หานั้นมันเป็นโค้ดที่ใช้เกือบทุกสกินอยู่แล้วนะครับ

คุณก็เปลี่ยน Class
.list th ใน CSS_common ให้เป็น
  1. .list th { background: url({IMGDIR}/forum.gif) 3px 17px no-repeat; padding-left: 15px !important; }
คัดลอกไปที่คลิปบอร์ด
บอกได้นะครับหากมีข้อสงสัย ^^
jay17 โพสต์ 2010-5-27 01:32:10
แก้ไขล่าสุดโดย konggang เมื่อ 2010-5-27 01:04

ตอบกลับ  jay17

ตอบก ...
ต้นฉบับโพสต์โดย konggang เมื่อ 2010-5-27 01:01



   


ขอบคุณสำหรับคำแนะนำ ยังไงผมก็ต้องอภัยด้วยนะครับ ที่ใจร้อนไปหน่อย
ขออภัย! คุณไม่ได้รับสิทธิ์ในการดำเนินการในส่วนนี้ กรุณาเลือกอย่างใดอย่างหนึ่ง ลงชื่อเข้าใช้ | สมัครสมาชิก

รายละเอียดเครดิต

รายชื่อผู้กระทำผิด|Archiver|ดิสคัส ไทย Follow us: Become a fan on facebook. Follow us on Twitter.

GMT+7, 2024-3-29 00:26

Powered by Discuz! X3.4, Rev.66

Copyright © 2001-2021 Tencent Cloud. Licensed

ตอบกระทู้ ขึ้นไปด้านบน ไปที่หน้ารายการกระทู้