function botsendmsg($text) { global $caffie_irc_bot; if($caffie_irc_bot['on']) { if($sock = @fsockopen($caffie_irc_bot['host'], $caffie_irc_bot['port'], $errno, $errstr, 2)) { stream_set_timeout($sock, 2); @fputs($sock, "AUTH ".$caffie_irc_bot['auth']."\r\n"); $in = trim(@fgets($sock, 4096)); if(strtoupper($in) == "OK") { @fputs($sock, "PLUGIN ".$caffie_irc_bot['plugin']." smwc_web_send ".$caffie_irc_bot['secret']." ".str_replace("\n", " ", str_replace("\r", "", $text))."\r\n"); } } @fclose($sock); } }