




Google Bot Sitenize Nezaman Geldi Kaydet Gör
-
<?
if (strstr($_SERVER['HTTP_USER_AGENT'], 'Yandex')){ $bot='Yandex';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'Googlebot')){$bot='Google';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'Mediapartners-Google')){$bot='Mediapartners-Google (Adsense)';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'Slurp')){$bot='Hot Bot search';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'WebCrawler')){$bot='WebCrawler search';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'ZyBorg')){$bot='Wisenut search';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'scooter')){$bot='AltaVista';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'StackRambler')){$bot='Rambler';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'Aport')){$bot='Aport';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'lycos')){$bot='Lycos';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'WebAlta')){$bot='WebAlta';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'yahoo')){$bot='Yahoo';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'msnbot')){$bot='msnbot/1.0';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'ia_archiver')){$bot='Alexa search engine';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'FAST')){$bot='AllTheWeb';}
if($bot !=""){
$tdiff = 3600 * 0; // เปลี่ยนจาภ0 เป็น 7 ถ้า Server นà¸à¸ (GMT) หรืà¸à¹€à¸žà¸´à¹ˆà¸¡à¸¥à¸”ได้ตามà¹à¸•่ Time Zone à¸à¸¢à¸¹à¹ˆà¸—ี่ได (GMT -12 ถึง GMT +13)
$file = "bots.txt";
$day = date("d/m/Y",time() + $tdiff);
$time = date("H:i:s",time() + $tdiff);
$ip = $_SERVER['REMOTE_ADDR'];
$fh = fopen($file, "w");
fwrite($fh, "$day|$time|$bot|$ip");
fclose($fh);
}
$month[1] = _F_Month_1;
$month[2] = _F_Month_2;
$month[3] = _F_Month_3;
$month[4] = _F_Month_4;
$month[5] = _F_Month_5;
$month[6] = _F_Month_6;
$month[7] = _F_Month_7;
$month[8] = _F_Month_8;
$month[9] = _F_Month_9;
$month[10] = _F_Month_10;
$month[11] = _F_Month_11;
$month[12] = _F_Month_12;
$file = "bots.txt";
if(file_exists($file)) {
$fh = fopen($file, 'r+');
$s = filesize($file);
if($s == 0) {
$out = "<strong>"._BOT_NOACCESS."</strong>";
}else{
$contents = fread($fh, $s);
fclose($fh);
$info = explode("|",$contents);
$day = explode("/",$info[0]);
$m = number_format($day[1]);
$tm = explode(":",$info[1]);
$agent = $info[2];
$ip = $info[3];
$out = "<strong>"._BOT_ACCESS." ".$agent ." (".$ip.") ";
if(date('d',time()) == $day[0]){
$out .= _BOT_TODAY;
}else{
$out .=" "._BOT_TODAYS." ".$day[0]." ".$month[$m]." ". ($day[2]+543);
}
$out .= " "._BOT_TIMES." ". $tm[0]. ".".$tm[1]." "._BOT_TIMESN."</strong>";
}
echo $out;
}
?> -
Edit : imzamiza karisan yonetici postlarada mudahale etmeye basladi .
HoLyCat tarafından 28/Kas/12 01:25 tarihinde düzenlenmiştir -
index.php include ederek
-
php dosyası , sonrasında bot.txt oluştur bi ara urarsa not defterine tarihini kaydediyor.
-
sistem çalışmaz ise sayfanın en başına
ob_start(); eklemeyi unutmayın.
-
şu php de ne anlama geliyor
if($bot !=""){
bot boşsa mı doluysamı
-
FOXXLY bunu yazdı
şu php de ne anlama geliyor
if($bot !=""){
bot boşsa mı doluysamı
tahminim doluysa.
-
myblackworldweb bunu yazdıFOXXLY bunu yazdı
şu php de ne anlama geliyor
if($bot !=""){
bot boşsa mı doluysamı
tahminim doluysa.
boş değilse :)
-
teşekkürler hocam
-
else if yerine switch case kullanılabilir...
-
sezeruludag bunu yazdımyblackworldweb bunu yazdıFOXXLY bunu yazdı
şu php de ne anlama geliyor
if($bot !=""){
bot boşsa mı doluysamı
tahminim doluysa.
boş değilse :)
bende öyle düşünmüştüm :=) demekki ! yüzünden hata alıyomuşm ben :D