เพิ่มรูปและสีของสมาชิกที่โพสต์ล่าสุดในหน้าแรก
แก้ไขครั้งสุดท้ายโดย discuzmod เมื่อ 2013-10-19 19:29ตัวอย่าง
1. แก้ไขโค้ดไฟล์ source/function/function_forumlist.php
ค้นหา
if($lastpost['author']) {
$lastpost['author'] = '<a href="home.php?mod=space&username='.rawurlencode($lastpost['author']).'">'.$lastpost['author'].'</a>';
}
แก้ไขโค้ด if($lastpost['author']) {
$member = C::t('common_member')->fetch_by_username($lastpost['author']);
$lastpost['authorid'] = $member['uid'];
loadcache('usergroup_'.$member['groupid']);
$lastpost['color'] = $_G['cache']['usergroup_'.$member['groupid']]['color'];
if(!empty($lastpost['color']))
$lastpost['author'] = '<font color="'. $lastpost['color'] .'" >'.$lastpost['author'].'</font>';
$lastpost['author'] = '<a href="home.php?mod=space&username='.rawurlencode($lastpost['authorusername']).'">'.$lastpost['author'].'</a>';
$lastpost['authoravatar'] = '<a href="home.php?mod=space&uid='.$member['uid'].'">'.avatar($member['uid'],small).'</a>';
}2.แก้ไขไฟล์สำหรับการแสดงผล/template/default/forum/discuz.htm
ค้นหา บรรทัดประมาณ 409<td class="fl_by">แก้เป็น<td class="fl_by pstyle">ค้นหา บรรทัดประมาณ 416<!--{elseif is_array($forum['lastpost'])}-->เพิ่ม<!--{echo $forum['lastpost']['authoravatar']}-->*ปล. ปรับแต่งตำแหน่งการแสดงผลเพิ่มเติมได้ตามต้องการ
3. เพิ่ม CSS แก้ไขไฟล์ template/default/common/module.css
ค้นหา/** forum::index **/เพิ่ม.pstyle img {width:25px;height:25px;float:left;border: 1px solid #ccc; padding: 2px; margin: 0px; background-color: #fff;margin:3px 3px 0 0;}
อัพเดทแคชสังเกตผล
สำหรับคนขี้เกียจแก้ไขไฟล์และยังไม่เคยแก้ไขไฟล์
source/function/function_forumlist.php
template/default/forum/discuz.htm
template/default/common/module.css
สามารถดาวน์โหลดไฟล์ที่แก้ไขแล้วไปทับได้เลย
*สำรองไฟล์ตามรายการนี้ก่อนแก้ไขข้อมูล
source/function/function_forumlist.php
template/default/forum/discuz.htm
template/default/common/module.css
*แก้ไขข้อมูลเสร็จอัพเดตแคชเพื่อดูความเปลี่ยนแปลง ทำแล้วหน้าขาวครับ โชคดีที่ผมสำรองไฟล์ไว้ ทำแล้วหน้าข่าวคือกัน สำรองไฟล์ไว้ >< เดียวขอดูแปปว่าเป็นเพราะสกินผมหรือป่าววว อัพไฟล์ที่แก้ไขแล้ว ให้ลองนำไปใช้ดูครับ ขอบคุณครับ ผลงานของท่าน Discuzmod เยี่ยมทุกผลงานจริงๆ แก้ไขครั้งสุดท้ายโดย zeawer เมื่อ 2013-11-16 10:57
ขอเอาไปลองก่อนนะครับผม
มันได้เฉพาะ ธีม default ป่าวครับ ขอบคุณครับ ทำแล้วของผมเป็นช่องว่างๆ ไม่มีชื่อไม่มีรูปขึ้นเลย sm942dz ขอบคุณครับอยากทราบว่า ถ้าตั้งหมวดหมู่ย่อยเป็น 2 คอลัมน์ หรือ 3 จะต้องแก้ตรงไหนยังไงบ้างครับ
หน้า:
[1]