arezapper โพสต์ 2010-2-27 22:43:25

[Greanthai] Bot List Online for Discuz 7.2

แก้ไขล่าสุดโดย arezapper เมื่อ 2010-3-8 07:14

จากกระทู้ : http://www.discuzthai.com/thread-16692-1-1.html
ดูตัวอย่าง : http://bbs.greanthai.com

*ขออณุญาติไม่ครอบลิงค์ซักครั้ง*
แสดงไอพีบอทของเสริชต่างๆเป็นชื่อบอทนั้นครับ
Google Bot
Yahoo Bot
WindowLive Bot
Baidu Spider

ปล.สำรอไฟล์ ที่จะ MODก่อนน่ะครับ เพื่อเพิ่มความปลอดภัยฝห้กับเว็บ ไม่งั้น MOD ผิด จะ พังซะก่อน


1. เปิดไฟลล์ include/global.func.php
ค้นหาif(!defined('IN_DISCUZ')) {

      exit('Access Denied');

}เพิ่มด้านล่าง//Bot Authentication By IP Start By ntf

function ip2bot($IP2BOT_IP){

      $IP2BOT_IPX=explode(".",$IP2BOT_IP,4);

if(($IP2BOT_IPX['0']=='66' && $IP2BOT_IPX['1']=='249') && ($IP2BOT_IPX['2']>=64 && $IP2BOT_IPX['2']<=95)){ //Google 66.249.64.0 - 66.249.95.255

$IP2BOT_NAME='<img src="http://bbs.greanthai.com/images/bot/gg.png" width="52" height="14" title="Google Bot">';

}elseif(($IP2BOT_IPX['0']=='64' && $IP2BOT_IPX['1']=='68') && ($IP2BOT_IPX['2']==82 && $IP2BOT_IPX['3']<='80')){//Google 64.68.82.0 - 64.68.82.80

$IP2BOT_NAME='<img src="http://bbs.greanthai.com/images/bot/gg.png" width="52" height="14" title="Google Bot">';

}elseif(($IP2BOT_IPX['0']=='74' && $IP2BOT_IPX['1']=='6') or ($IP2BOT_IPX['0']=='72' && $IP2BOT_IPX['1']=='30')){//yahoo 74.6.0.0 - 74.6.255.255 ,72.30.0.0 - 72.30.255.255

$IP2BOT_NAME='<img src="http://bbs.greanthai.com/images/bot/yahoo.png" width="52" height="14" title="Yahoo Bot">';

}elseif(($IP2BOT_IPX['0']=='65' && $IP2BOT_IPX['1']=='52') or ($IP2BOT_IPX['0']=='65' && $IP2BOT_IPX['1']=='55')){//Window Live 65.52.0.0 - 65.55.255.255

$IP2BOT_NAME='<img src="http://bbs.greanthai.com/images/bot/windowslive.png" width="52" height="14" title="Windows Live Bot">';

}elseif(($IP2BOT_IPX['0']=='202' && $IP2BOT_IPX['1']=='108' && $IP2BOT_IPX['2']=='1') or ($IP2BOT_IPX['0']=='202' && $IP2BOT_IPX['1']=='96' && $IP2BOT_IPX['2']=='63')){ //baidu 202.108.1.* - 202.96.63.*

$IP2BOT_NAME='<img src="http://bbs.greanthai.com/images/bot/baidu.png" width="52" height="14" title="Baidu Spider">';

}else{

return false;

}



return $IP2BOT_NAME;

}

//Bot Authentication By IP End By ntf2. เปิดไฟลล์ member.php
ค้นหาwhile($online = $db->fetch_array($query)) {

                $online['lastactivity'] = gmdate($timeformat, $online['lastactivity'] + $timeoffset * 3600);

                $online['action'] = $actioncode[$online['action']];

                $online['subject'] = $online['subject'] ? cutstr($online['subject'], 35) : NULL;

                $online['ip'] = $online['ip1'].'.'.$online['ip2'].'.'.$online['ip3'].'.'.$online['ip4'];วางโค๊ดนี้ไว้บรรทัดต่อไปif(!$online['username']) $online['username']=ip2bot($online['ip']);3. เปิดไฟลล์ include/index_classics.inc.php
ค้นหา$query = $db->query("SELECT uid, username, groupid, invisible, action, lastactivity, fid FROM {$tablepre}sessions ".(isset($_DCACHE['onlinelist']) ? '' : 'WHERE uid <> 0')." ORDER BY uid DESC LIMIT ".$maxonlinelist);เปลี่ยนเป็น$query = $db->query("SELECT ip1,ip2,ip3,ip4,uid, username, groupid, invisible, action, lastactivity, fid FROM {$tablepre}sessions ".(isset($_DCACHE['onlinelist']) ? '' : 'WHERE uid <> 0')." ORDER BY uid DESC LIMIT ".$maxonlinelist);ค้นหา$online['username'] = $_DCACHE['onlinelist']['guest'];วางโค๊ดนี้ไว้บรรทัดต่อไป$online['ip'] = $online['ip1'].'.'.$online['ip2'].'.'.$online['ip3'].'.'.$online['ip4'];                              

$online['username']=(!ip2bot($online['ip']))?$_DCACHE['onlinelist']['guest']:ip2bot($online['ip']);4. เปิดไฟลล์ /default/whosonline.htm
ค้นหา(มี 2 ที่)<!--{if $online['uid']}--><a href="space.php?uid=$online">$online</a><!--{else}-->{lang guest}<!--{/if}-->เปลี่ยนเป็น<!--{if $online['uid']}--><a href="space.php?uid=$online">$online</a><!--{else}-->

                              <!--{if ($online['username'] && $online['uid']==0)}-->$online<!--{else}-->{lang guest}<!--{/if}-->

                              <!--{/if}-->5. อัพเดทแคช Admincp > เครื่องมือ > อัพเดทแคชไฟลล์

affoman โพสต์ 2010-2-27 23:23:31

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

Newcanosava โพสต์ 2010-2-28 01:47:01

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

arezapper โพสต์ 2010-3-4 19:03:08

-0- ไม่มีใครสน
น้อยใจ

kim2543 โพสต์ 2010-3-4 20:35:50

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

mujjijung โพสต์ 2010-3-4 22:12:13

ออ๋ อย่างนีเอง thk มากๆนะใจ

toomza โพสต์ 2010-3-4 23:51:47

ขอบคุณครับๆๆๆๆๆๆๆๆๆๆ

zlayier โพสต์ 2010-3-14 13:15:17

อย่างงี้ต้องรีบมาขอบคุณ:) ขอบคุณมากครับ

super2816 โพสต์ 2010-5-26 00:05:56

เยี่ยมมากค่ะคนเข้ามาอ่านเยอะนะค่ะ

jaideejung007 โพสต์ 2010-6-6 10:49:03

เอ่อ ขอบคุณครับ

โมดีจริงๆ ต้องลองๆๆ

น่าจะมีปลั๊กอินด้วยเน๊อะ คงจะง่าย
หน้า: [1] 2
ดูในรูปแบบกติ: [Greanthai] Bot List Online for Discuz 7.2