################################################
OpenTemplate for processing
Expects: Templatename, error (optional)
Returns: printout of template after processing
################################################
Function OpenTemplate($tempname, $error = "",$filename="",$fileext=""){
Global $formatcomment,$tempurl, $url, $uname,$password,$grand_total,$keywords,$catlist,$catlist2,$catlist3,$description,$title,$cname,$cmail,$category,$category2,$category3,$reciplink,$id,$visits,$rookie,$vet,$getmail,$rating,$search,$number,$links,$links2,$previousnext,$votes,$adddate,$min_votes,$catlinks,$catstr,$pathcategory,$numlinks,$cat_id,$catsel,$maxhighfly,$linkprint,$username,$catid,$catid2,$catid3,$maillink,$maildate,$mailfromperson,$mailfromaddress,$subject,$msgid,$body,$session,$msg,$uid,$categoryname,$ID;
include ("var.php3");
$tempfile = fopen("$tempurl/$tempname", "r");
if ($cachetime > 0){
$cachefile = fopen("$cache_path/$filename?$fileext.cache", "w");
}
while(!feof($tempfile))
{
$templine = fgets($tempfile,255);
include("templates.php3");
if ($cachetime > 0){
fputs($cachefile,$templine);
}
print($templine);
}
fclose($tempfile);
if ($cachetime > 0){
fclose($cachefile);
}
}
################################################
Display the template
################################################
if ($catstr > 0){
OpenTemplate("category.html",$error,"index.php3",$cacheext);
}
else{
OpenTemplate("index.html",$error,"index.php3",$cacheext);
}
hope this helps,if not please let me know and i will post all files and thanks you very much for helping me out.