All pastes #677333 Raw Edit

Mine

public text v1 · immutable
#677333 ·published 2007-08-31 22:31 UTC
rendered paste body
	public function beta_privmsg($lines)
	{
		if ($lines['text']{0} != $this->channelConfig['trigger']) { return; }
		$lines['text']=$this->ircClass->left($lines['text'],1);
		if ($lines['text']{0} == '#') {
			$newChan = $this->ircClass->gettok($lines['text'],'1',32);
			$lines['text'] = $this->ircClass->gettok($lines['text'],'2-',32);
			if ($lines['to'] != $newChan) {
				$lines['to'] = $newChan;
				$p = m_q('SELECT * FROM `channels` WHERE `channel` = \''.addslashes($lines['to']).'\'');
				//make sure they have data in there..
				if (mysql_num_rows($p) == '0') { $this->notice($lines,'error','22',array($newChan));return; }
				//set the global $channelConfig
				$this->channelConfig=mysql_fetch_assoc($p);
				//close the socket.
				$lines['authserv'] = $this->beta_getAuth( $this->ircClass->gettok($lines['from'],'2-',ord('!') ));
				//set the users access:
				$this->channelConfig['useraccess'] = $this->beta_getUseraccess($lines['to'],$lines['authserv']);
				$p = m_q('SELECT * FROM `staff` WHERE `authserv` = \''.addslashes($lines['authserv']).'\'');
				if (mysql_num_rows($p) == '0') { unset($this->channelConfig['staff']); }
				$this->channelConfig['staff'] = mysql_fetch_assoc($p);
			}
		}
		$command = explode(' ',$lines['text']);$command=$command['0'];
		$cmd = $this->beta_getCommand($command);
		if (!$cmd) { $this->beta_Binds($lines,$command); }
		if ($cmd) {
			//9: You must first authicate with authserv before using this command. If you are authicated please type %whoami.
			if ($cmd['requireauth'] == '1' && $lines['authserv'] == '') { $this->notice($lines,$cmd['alias'],'9',array($this->channelConfig['trigger']));return; }
			if ($cmd['requireaccess'] > $this->channelConfig['useraccess']) {
				if ($this->channelConfig['staff']['access'] != '' && $this->channelConfig['useraccess'] < $cmd['requireaccess']) { $this->beta_log($lines,$cmd['alias'],1); }
				else {
					$this->notice($lines,$cmd['alias'],'10',array($cmd['requireaccess']));return;
				}
			}
			elseif ($cmd['requireaccess'] <= $this->channelConfig['useraccess']) {
				$this->beta_log($lines,$cmd['alias'],0);
			}
			//$lines['text'] = $this->ircClass->left($lines['text'],1);
			// $cmd = actual alias of $command
			$c0m=$cmd['alias'];
			if (method_exists($this,$c0m)) {
				$this->$c0m($lines);
			}
			else {
				$this->beta_sockwrite('BetaServ')->ircClass->privmsg('#BetaBots-staff','['.BOLD.'ERROR'.BOLD.'] No function: '.$cmd['alias'].' found.');
				return;
			}
		}
	}