All pastes #996071 Raw Edit

asd

public php v1 · immutable
#996071 ·published 2008-04-24 18:28 UTC
rendered paste body
if(command('factoids',3)){		if($cmdparamsarray[0] == 'list'){			$factsout = $factoids;			foreach($factsout as $key => $number){				$factsout[$key] = $key.' ('.$number.')';			}			SendCommand("PRIVMSG $sender :".implode(' || ',$factsout));		} elseif($cmdparamsarray[0] == 'add'){			if($cmdparamsarray[1] != '' && $cmdparamsarray[2] != ''){				$factoids[$cmdparamsarray[1]] = implode(' ',array_slice($cmdparamsarray,2));				SendCommand("PRIVMSG $sender :adding $cmdparamsarray[1] (".$cmdparamsarray[2].") ");			}		} elseif($cmdparamsarray[0] == 'del'){			if($cmdparamsarray[1] != ''){				unset($factoids[$cmdparamsarray[1]]);				SendCommand("PRIVMSG $sender :deleting $cmdparamsarray[1]");			}		} elseif($cmdparamsarray[0] == 'save'){			file_put_contents($dir.'facts.dat',serialize($accesslevels));			sendcommand("PRIVMSG $sender :factoids loaded!");		} elseif($cmdparamsarray[0] == 'load'){			$accesslevels = unserialize(file_get_contents($dir.'facts.dat'));			$accesslevels[$adminmask] = 5;			SendCommand("PRIVMSG $sender :Factoids file list loaded!");		} else {			SendCommand("PRIVMSG $sender :Usage: ".$comchar.'factoids [list], [add <factoid> <deff>  , [del <fact>], [save], [load]');		}}