[mod] แสดงค่าประสบการณ์ที่แถบข้อมูลส่วนตัว
แก้ไขล่าสุด theerawut เมื่อ 2009-3-15 11:36ที่มา http://www.alan888.com/Discuz/
ถ้าซ้ำกับของพี่โจ้ก็ออภัยด้วยนะครับ พอดีหากระทู้นั้นไม่เจอ
ตัวอย่างครับ
ไฟล์ที่ทำการแก้ไข
bbs/include/global.func.php
bbs/viewthread.php
bbs/templates/default/viewthread_node.htm
1. เปิดไฟล์bbs/include/global.func.php
เพิ่มโค๊ดนี้ไว้บรรทัดล่างสุด ก่อน ?>function getexp($credits,$usergid){
global $_DCACHE;
if($_DCACHE['usergroups'][$usergid]['type'] != 'member' || $_DCACHE['usergroups'][$usergid]['creditslower'] == '999999999' || $_DCACHE['usergroups'][$usergid]['creditshigher'] == '-999999999'){
$exp ="
<span class=small>ประสบการณ์ : สูงสุด</span>
<tablecellspacing=0 cellpadding=0>
<thead><tr>
<td align=left height=13><img height=9 src=images/default/blue.gif width=98%><img height=9 src=images/default/exp.gif></td>
</tr></thead></table>";
}else{
$range = $_DCACHE['usergroups'][$usergid]['creditslower'] - $_DCACHE['usergroups'][$usergid]['creditshigher'];
$haveget = $credits - $_DCACHE['usergroups'][$usergid]['creditshigher'];
$need = $range - $haveget;
$ep = intval($haveget*100/$range);
$wid = intval(97*$ep/100);
$exp ='
<span class=small>ค่าประสบการณ์: '.$ep.' %
และต้องการอีก<font color=blue>'.$need.'</font>เพื่อเปลี่ยนระดับ</span>
<tablecellspacing=0 cellpadding=0>
<thead><tr>
<td align=left height=13><img height=9 src=images/default/blue.gif width='.$wid.'%><img height=9 src=images/default/exp.gif></td>
</tr></thead></table>';
}
return $exp;
}
2. เปิดไฟล์ bbs/viewthread.php
ค้นหา$post['dateline'] = dgmdate("$dateformat $timeformat", $post['dateline'] + $timeoffset * 3600);เพิ่มโค๊ดนี้ด้านล่าง$post['userexp'] = getexp($post['credits'],$post['groupid']);3.เปิดไฟล์bbs/templates/default/viewthread_node.htm
ค้นหา<!--{if $post['customstatus']}--><p class="customstatus">$post</p><!--{/if}-->เพิ่มโค๊ดนี้ด้านล่าง<p>$post</p>4.แตกไฟล์แล้วอัพโหลดไปยังตำแหน่งต้นฉบับ
5.อัพเดชแคช เสร็จสมบูรณ์ ไม่เหมือนกันครับอันนี้ดูดีกว่าเยอะเลย ขอบคุณมากครับ สวยค่ะ ดูไฮโซเลย เยี่ยมๆขอบคุณค่ะ ว๊าวๆ ขอเอาไปใช้นะคะ
ขอบคุณมากค่ะ ^^ ขอบคุณมากครับ แก้ไขล่าสุด bonparadorn เมื่อ 2009-3-25 23:04
ขอบคุณจ้า แต่ว่าระดับมาจากค่าชั่วโมงออนไลน์ใช่ไหม?
เปิดมาหน้าขาวเลย ยังไม่ได้อัพเดทแคช ง่า ขึ้นหน้าขาวโบ๊ะเลย คงไม่มีดวงละมั้งคราวนี้ แต่ก็ขอบคุณครับ ที่นำมาเสนอ ขอบคุณมากครับ ขอบคุงครับบ ขอบคุณมากครับ
หน้า:
[1]
2