cvs: pear /Net_SmartIRC/SmartIRC example2.php

From: Date: Thu, 02 Jan 2003 19:17:57 +0000
Subject: cvs: pear /Net_SmartIRC/SmartIRC example2.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-8051@lists.php.net to get a copy of this message
meebey Thu Jan 2 14:17:57 2003 EDT Modified files: /pear/Net_SmartIRC/SmartIRC example2.php Log: changed the login() parameter to the new one, usermode is a new parameter. changed listenFor(), the return value is the result instead of a reference to the $result parameter. added result check, if it's an array and if the index exists, before echoing it Index: pear/Net_SmartIRC/SmartIRC/example2.php diff -u pear/Net_SmartIRC/SmartIRC/example2.php:1.1.1.1 pear/Net_SmartIRC/SmartIRC/example2.php:1.2 --- pear/Net_SmartIRC/SmartIRC/example2.php:1.1.1.1 Sun Dec 22 20:53:04 2002 +++ pear/Net_SmartIRC/SmartIRC/example2.php Thu Jan 2 14:17:56 2003 @@ -1,9 +1,9 @@ <?php /** - * $Id: example2.php,v 1.1.1.1 2002/12/23 01:53:04 meebey Exp $ - * $Revision: 1.1.1.1 $ + * $Id: example2.php,v 1.2 2003/01/02 19:17:56 meebey Exp $ + * $Revision: 1.2 $ * $Author: meebey $ - * $Date: 2002/12/23 01:53:04 $ + * $Date: 2003/01/02 19:17:56 $ */ /** * Copyright (C) 2002-2003 Mirco "MEEBEY" Bauer <mail@meebey.net> <http://www.meebey.net> @@ -31,17 +31,24 @@ $irc = &new Net_SmartIRC(); $irc->startBenchmark(); $irc->setDebug(SMARTIRC_DEBUG_ALL); -$irc->useSockets(TRUE); +$irc->setUseSockets(TRUE); $irc->setBenchmark(TRUE); $irc->connect('irc.freenet.de', 6667); -$irc->login('Net_SmartIRC', 'Net_SmartIRC Client '.SMARTIRC_VERSION, 'Net_SmartIRC'); +$irc->login('Net_SmartIRC', 'Net_SmartIRC Client '.SMARTIRC_VERSION, 0, 'Net_SmartIRC'); $irc->getList('#debian.de'); -$resultar = array(); -$irc->listenFor(SMARTIRC_TYPE_LIST, $resultar); +$resultar = $irc->listenFor(SMARTIRC_TYPE_LIST); $irc->disconnect(); $irc->stopBenchmark(); -$resultex = explode(' ', $resultar[0]); -$count = $resultex[1]; -?> -<B>On our IRC Channel #debian.de are <? echo $count; ?> Users</B> \ No newline at end of file +if (is_array($resultar)) { + $resultex = explode(' ', $resultar[0]); + $count = $resultex[1]; + ?> + <B>On our IRC Channel #debian.de are <? echo $count; ?> Users</B> + <? +} else { + ?> + <B>An error occured, please check the specified server and settings<B> + <? +} +?> \ No newline at end of file

« previous php.pear.cvs (#8051) next »