Tekil Mesaj gösterimi
Alt 03 Şubat 2008, 21:43   #10
Çevrimdışı
SurucLu
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
Cevap: IRC de olan biteni webe yansıtmak?




Kod:   Kodu kopyalamak için üzerine çift tıklayın!
<? include("baglanti.php"); class PHPbot { var $localhost; var $host; var $port; var $timeout; var $kanal; var $nick; var $closecode; var $logfile; var $server; var $log; function PHPbot() { define(n, "\n"); $this -> localhost = 'adsluser-2866.adsl.ttnet.net.tr'; $this -> host = 'irc.xxxxxx.com'; //*Sunucu Adresiniz. $this -> port = 6667; $this -> timeout = 0; $this -> kanal = 'coders'; //*Botun girecegi kanal "#" karakterini kullanmayin. $this -> nick = 'PHPBot'; $this -> closecode = 'kapanma sifresi'; $this -> logfile = 'log.txt'; } function Connect() { set_time_limit ($this->timeout); $this -> server = fsockopen ($this -> host, $this -> port, $hatano, $hatastr, $this -> timeout) or die('Sunucuya Ba?lanamad?'); $this -> log = fopen ($this -> logfile, 'w+') or die('Dosya Yarat?lamad?'); fputs($this->server, 'NICK '.$this->nick.n); fputs($this->server, 'USER '.$this->nick.' '.$this->localhost.' '.$this->remotehost.' :'.$this->nick.n); fputs($this->server, 'JOIN #'.$this->channel.n); fputs($this->server, 'PRIVMSG #'.$this->channel.' :Phpbot aktiftir.'.n); return; } function Disconnect() { fclose($this->server); fclose($this->log); exit; return; } function PrivMsg($nick,$cmd,$arg) { if($cmd[1] == '#'.$this->channel) fputs($this->log, '<'.date("H:i").' '.$nick.'> '.$arg.n); if(preg_match("'\!(.*?)'U",$arg,$set)) { switch($set[1]) { case $this->closecode: $this->Disconnect(); break; // Kapan (Cal?smay? Durdur) } } return; } function Run() { $this->Connect(); while (!feof($this->server)) { $data = fgets ($this->server,1024); if(preg_match("'PING(.*?)'si", $data, $set)) fputs($this->server,'PONG '.trim($set[1]).n); if(preg_match("':(.*?)!([^\s]*?)\s(.*?)\s:(.*?)'U", $data, $set)) { $nick = trim($set[1]); $host = trim($set[2]); $cmd = explode(" ",trim($set[3])); $arg = trim($set[4]); switch($cmd[0]) { case "PRIVMSG": $this->PrivMsg($nick,$cmd,$arg); break; // Mesaj Gonder?ld?g?nde case "PART": break; // Tamamlanmad?.. case "JOIN": break; // Tamamlanmad?.. case "NICK": break; // Tamamlanmad?.. case "QUIT": break; // Tamamlanmad?.. } } } } } $PHPbot = new PHPbot(); $PHPbot->Run(); ?>

sadece bu sayfada degişiklik yapılacak degilmi ?

ve bu sayfadan sadece bu bolum
Kod:   Kodu kopyalamak için üzerine çift tıklayın!
$this -> localhost = 'adsluser-2866.adsl.ttnet.net.tr'; $this -> host = 'irc.xxxxxxxxx.com'; //*Sunucu Adresiniz. $this -> port = 6667; $this -> timeout = 0; $this -> kanal = 'coders'; //*Botun girecegi kanal "#" karakterini kullanmayin. $this -> nick = 'PHPBot'; $this -> closecode = 'kapanma sifresi'; $this -> logfile = 'log.txt';

aynen yaptim ve
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
klasorune atim ama olmadı

 
Alıntı ile Cevapla

IRCForumlari.NET Reklamlar
sohbet odaları sohbet bizimmekan sohbet odaları