All pastes #465705 Raw Edit

ranza

public php v1 · immutable
#465705 ·published 2007-04-30 15:01 UTC
rendered paste body
<?phpclass guestlog {		public $checkIps 		= true;	public $checkWords 		= true;	public $ips 			= array();	public $words 			= array();	public $saveType		= 'xml';	public $saveFile		= 'logs.xml';		public function __construct($saveType = 'xml', $saveFile = 'logs.xml') {			}		public function setIps($ips = array()) {		/*check the array first */		$this->ips = $ips;		return;	}		public function setWords($words = array()) {		/*check the array first */		$this->words = $words;		return;	}		private function checkIps() {		/* creates an array with ips, split with , */		return true;	}		private function checkWords() {		/* creates an array with ips, split with , if found return true*/		return true;	}			public function saveLog() {		switch ($this->saveType) {			case 'xml':							break;					default:			break;		}	}		public function fetchLogs($template = null) {		if ($template) {						$xmldata = new SimpleXMLElement($this->saveFile, null, true);			/* create replace array */			foreach ($xmldata->fields->xpath('//field') as $replacements) {				$replacelog[] = '<#='.$replacements.'#>';			}						/* make an array of the logs */			foreach ($xmldata->logs->xpath('//log') as $xmllog) {				$logs[] = $xmllog;			}						/* reverse logs so newest comes first */			$logs = array_reverse($logs);								} else {			return array();		}	}	}?>