assign(filename,htmlentities($file)); $tpl->parseDynamic(fileitem); $i++; if($i==3) { $i=0; $tpl->parseDynamic(filerow); } } } if($i>0) $tpl->parseDynamic(filerow); return $tpl; } function myreadfile($file){ if($file=="" || @ereg("\.\.",$file)|| @ereg("/",$file) ||@ereg("\\\\",$file)) { return "Ga iemand anders pesten"; } if(!($fd = fopen ("funny_txt/$file", "r"))) { return "Ga je mammie pesten"; } $ret=date("l, j M Y G:i:s ",filemtime("funny_txt/$file")); $ret="Last Changed:$ret\n\n"; while (!feof ($fd)) { $buffer =fgets($fd, 4096); $ret="$ret$buffer"; } fclose ($fd); return $ret; } $head = new DTE("tpl/", "DTE/"); $head->define(template, "head.html"); $foot = new DTE("tpl/", "DTE/"); $foot->define(template, "foot.html"); $tpl = new DTE("tpl/", "DTE/"); $tpl->define(template, "files2.html"); $tpl=indextextdir($tpl,"funny_txt/"); if(isset($lees) && !@ereg("/","$lees")) { if($source=="yes") { header('Content-Type: text/plain'); $text=myreadfile("$lees"); print "$text"; exit; } $text=nl2br(htmlentities(myreadfile("$lees"))); $tpl->assign(file,htmlentities($lees)); $tpl->assign(txt,$text); $tpl->parseDynamic(filetxt); } $head->parse(index, template); $head->rollOut(); $tpl->parse(index, template); $tpl->rollOut(); $foot->parse(index, template); $foot->rollOut(); ?>