From: <ama...@us...> - 2003-08-05 05:58:03
|
Update of /cvsroot/binaryphp/binaryphp/examples In directory sc8-pr-cvs1:/tmp/cvs-serv1730/examples Modified Files: irc.php Log Message: cleaned up functions/ and fixed up functions.php Index: irc.php =================================================================== RCS file: /cvsroot/binaryphp/binaryphp/examples/irc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** irc.php 4 Aug 2003 05:38:31 -0000 1.1 --- irc.php 5 Aug 2003 05:58:00 -0000 1.2 *************** *** 12,17 **** $temp2 = explode('!', $temp[1]); $temp3 = explode(' ', $temp2[1]); ! if(strpos('TestBOT: PING?', $temp[2]) !== false) ! socket_write($sock, 'PRIVMSG ' . $temp3[2] . ' :' . $temp2[0] . ": PONG!\r\n"); } ! ?> \ No newline at end of file --- 12,26 ---- $temp2 = explode('!', $temp[1]); $temp3 = explode(' ', $temp2[1]); ! $admin = 'Amaranth'; ! $args = explode(' ,', $temp2[2]); ! if($args[0][0] == '!') ! { ! $text = substr($args[0], 1, 4); ! if($text == 'ping') ! socket_write($sock, 'PRIVMSG ' . $temp3[2] . ' :' . $temp2[0] . ": PONG!\r\n"); ! ! elseif($text == 'quit' && $temp[0] == $admin)) ! socket_write($sock, 'QUIT :Seeya ' $temp3[2] . "\r\n"); ! } } ! ?> |