All pastes #996011 Raw Edit

asd

public php v1 · immutable
#996011 ·published 2008-04-24 17:37 UTC
rendered paste body
if(command('factoids',5)){		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]] = $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));		} elseif($cmdparamsarray[0] == 'load'){			$accesslevels = unserialize(file_get_contents($dir.'factss.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]');		}}