<?php
///////////////////////////////////////////////////////////////////////////////////////
// PHPizabi 0.848b C1 [ALICIA]                               http://www.phpizabi.net //
///////////////////////////////////////////////////////////////////////////////////////
// Please read the license.txt file before using / modifying this software           //
// Original author:         Claude Desjardins, R - feedback@realitymedias.com        //
// Last modification date:  February 21th 2007                                       //
// Version:                 PHPizabi 0.848b C1                                       //
//                                                                                   //
// (C) 2005, 2007 Real!ty Medias / PHPizabi - All rights reserved                    //
///////////////////////////////////////////////////////////////////////////////////////

	class t_command extends triton {
		function runCommand($param, $channel=NULL) {

			$usersList = $this -> getChannelData($this -> channel, "users");
						
			/* Are we allowed ? */
			if (
				!$this -> getChannelData($channel, "mode_t") or
				($this -> getChannelData($channel, "mode_t") and strstr($usersList, "O:".$this -> nickname.","))
			) {
				
				unset($param[0]);
				
				$newTopic = implode(" ", $param);
				$this -> setChannelData($channel, "topic", substr($newTopic, 0, 255));
				$this -> sysMsg('SYS_TOPIC', array($this -> nickname, $newTopic));
			}
			
			else $this -> localEcho('ERR_NOACCESS', array());
		}
	}

?>