All pastes #794362 Raw Edit

Something

public text v1 · immutable
#794362 ·published 2007-11-23 01:51 UTC
rendered paste body
<?php

// Module to Ignore and Unignore Users
// Copyright (c) Charlie Melbye, All Rights Reserved
//
// Part of the BONO IRC Bot

$theParmP1=explode("PRIVMSG $channel :".$comchar."ignore ",$bufferO);
$theParm=$theParmP1[1];
$theParm=trim($theParm);

if(stristr($bufferO,"PRIVMSG $channel :".$comchar."ignore ") OR stristr($bufferO,"PRIVMSG $sender :".$comchar."ignore ")){
	if(in_array(substr(strtolower($buffer),1,strpos($buffer,"!")-1),$admin) and in_array($senderHost,$adminHostmask)){
		$ignoredUsers[] = $theParm;
		$returnignore = "$theParm has been ignored.";
	}
}

cs('ignore', $returnignore, true);

$theParmP1=explode("PRIVMSG $channel :".$comchar."unignore ",$bufferO);
$theParm=$theParmP1[1];
$theParm=trim($theParm);

if(stristr($bufferO,"PRIVMSG $channel :".$comchar."unignore ") OR stristr($bufferO,"PRIVMSG $sender :".$comchar."unignore ")){
	if(in_array(substr(strtolower($buffer),1,strpos($buffer,"!")-1),$admin) and in_array($senderHost,$adminHostmask)){
		$ignoreid = array_search($theParm, $ignoredUsers);
		unset($ignoredUsers[$ignoreid]);
		$unresult = "$theParm (ID $ignoreid) has been unignored.";
	}
}

cs('unignore', $unresult, true);

if(stristr($bufferO,"PRIVMSG $channel :".$comchar."ignored") OR stristr($bufferO,"PRIVMSG $sender :".$comchar."ignored")){
	$ignoredlist = "";
	foreach($ignoredUsers as $iggy) {
		$ignoredlist .= $iggy.", ";
	}
}

cs('ignored', 'Ignored Users: '.$ignoredlist, false);

?>