dsiwarsza โพสต์ 2009-11-1 09:54:40

[mod] แสดงค่าประสบการณ์ที่แถบข้อมูลส่วนตัว 7.0 / 7.1 / 7.2

แก้ไขล่าสุดโดย dsiwarsza เมื่อ 2009-12-19 09:27

แก้ไขล่าสุดโดย dsiwarsza เมื่อ 2009-12-19 09:27

ที่มา http://www.alan888.com/Discuz/

สืบจาก http://www.discuzthai.com/thread-8833-1-2.html
ตัวอย่าง : http://www.bf-thai.net/bbs/thread-2-1-1.html

จาก 7.00 ทำเหมือนกานเลยนะคับ ใช้ได้ 100 เปอร์ทดสอบแล้ว

ขอรูปจาก theerawutนะคับผม


ไฟล์ที่ทำการแก้ไข

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.แตกไฟล์แล้วอัพโหลดไปยังตำแหน่งต้นฉบับ

       http://www.discuzthai.com/images/attachicons/rar.gifimages_level.rar (872 Bytes)


5.อัพเดชแคช เสร็จสมบูรณ์

arezapper โพสต์ 2009-11-1 12:06:26

ขอบคุณครับ

kawin17823 โพสต์ 2009-11-1 12:24:08

ขอบคุณครับ

trickstertik โพสต์ 2009-11-1 13:25:49

ขอบคุณคร้าบ

DarkEagle โพสต์ 2009-11-1 13:29:08

ขอบคุณครับ

Casnovanutz โพสต์ 2009-11-1 14:05:12

ขอบคุณครับ

keardoo โพสต์ 2009-11-1 15:13:26

ขอบคุณครับ

com-my โพสต์ 2009-11-1 15:22:56

ขอบคุณครับ

rujoflight โพสต์ 2009-11-1 16:16:54

ขอบคุณครับ

rujoflight โพสต์ 2009-11-1 16:50:22

ขอบคุณครับ
หน้า: [1] 2 3 4 5 6 7 8 9 10
ดูในรูปแบบกติ: [mod] แสดงค่าประสบการณ์ที่แถบข้อมูลส่วนตัว 7.0 / 7.1 / 7.2