* * Full LGPL License: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // ---EXAMPLE OF HOW TO USE Net_SmartIRC--- // this code shows how you could show on your homepage how many users are in a specific channel // include_once('./SmartIRC.php'); $irc = &new Net_SmartIRC(); $irc->setDebug(SMARTIRC_NONE); $irc->setUseSockets(FALSE); $irc->setBenchmark(FALSE); $irc->connect('myserver.org', 6667); $irc->login('Net_SmartIRC', 'Net_SmartIRC Client '.SMARTIRC_VERSION.' (example2.php)', 0, 'Net_SmartIRC'); $irc->_send('lusers'); $irc->getList('#mychannel'); $resultar = $irc->listenFor(SMARTIRC_TYPE_INFO); $irc->disconnect(); if (is_array($resultar)) { $resultex = explode(' ', $resultar[2]); $count = $resultex[2]; $count--; $time = time(); echo"On #mychannel are $count Users
"; if ($count > 0){ $root = "/some/dir/"; $file = $root . "/make/this/file.php"; $fd = fopen($file, "w"); $content .= " \n"; fwrite($fd, $content); fclose($fd); }else{ echo "count is not correct ($count)\n"; } } else { ?> An error occured, please check the specified server and settings