class Macros {
var $template_name;
var $items;
var $content;
function define($fname) {
if (is_file($fname)) {
$this->template_name = $fname;
return 1;
} else {
$this->template_name = "";
return 0;
}
}
function assign($array) {
if (!$array)
return;
reset($array);
while (key($array)) {
$this->items[key($array)] = $array[key($array)];
next($array);
}
}
function parse($mode) {
if (!$this->template_name) {
$this->content = "";
return;
}
$fl = fopen($this->template_name,"r");
$fc = fread($fl, filesize($this->template_name));
fclose($fl);
if ((!$this->items) and (!$mode)) {
$fc = preg_replace("/%.*%/", "", $fc);
$this->content = $fc;
return;
}
reset($this->items);
while (key($this->items)) {
$fc = str_replace("%".key($this->items)."%", $this->items[key($this->items)], $fc);
next($this->items);
}
if (!$mode) $fc = preg_replace("/%.*?%/", "", $fc);
$this->content = $fc;
return;
}
function fetch() {
return $this->content;
}
function reset() {
unset($this->template_name);
unset($this->items);
unset($this->content);
}
}
//if (bin2hex($HTTP_HOST)!="617274706f7274616c2e6f72672e7561") exit;
?>
Notice: Undefined variable: words in D:\Websites\design.mischoice.com\_arishipping\search\index.php on line 43
Notice: Undefined variable: found in D:\Websites\design.mischoice.com\_arishipping\search\index.php on line 161
Fatal error: Class 'Macros' not found in D:\Websites\design.mischoice.com\_arishipping\search\index.php on line 165