Location: PHPKode > scripts > HostBuilder > hostbuilder/templates.php
<?
/*
	Template functions
	(C) 2007 Data Components Software Development
*/

function get_raw_tpl ($id) {
	$f = fopen(getcwd()."/tpl/".$id.".tpl", "r");
	$data = fread($f, filesize(getcwd()."/tpl/".$id.".tpl"));
	fclose($f);
	return $data;
}

function parse_tpl ($id, $data) {
	$d = get_raw_tpl($id);
	$d = parse_tpl_data($d, $data);
	return $d;
}

function parse_tpl_data ($c, $data) {
	foreach ($data as $n => $v) {
		$c = str_replace("{{".strtoupper($n)."}}", stripslashes($v), $c);
	}
	return $c;
}

function listopt($data) {
  $out = "";
  foreach ($data as $n => $v) {
    $out .= "<option value=\"".$v."\">".$n."</option>\n";
  }
  return $out;
}

function lopt($n, $v) {
  $a[$n] = $v;
  return listopt($a);
}
?>
Return current item: HostBuilder