public static function template($file, $subdir = '', $templateid = 1, $tpldir = 'templates') { global $inajax; $file .= $inajax && ($file == 'header' || $file == 'footer') ? '_ajax' : ''; $tpldir = $tpldir ? $tpldir : TPLDIR; $templateid = TEMPLATEID; $objfile = NOWHERE_ROOT . './data/templates/' . $templateid . '_' . $file . '.tpl.php'; if ($subdir) { $tplfile = NOWHERE_ROOT . './templates/' . $templateid . '/' . $subdir . '/' . $file . '.htm'; if ($templateid != 1 && !file_exists($tplfile)) { $tplfile = NOWHERE_ROOT . './templates/' . $templateid . '/' . $subdir . '/' . $file . '.htm'; } } else { $tplfile = NOWHERE_ROOT . './templates/' . $templateid . '/' . $file . '.htm'; if ($templateid != 1 && !file_exists($tplfile)) { $tplfile = NOWHERE_ROOT . './templates/' . $templateid . '/' . $file . '.htm'; } } GlobalCore::checktplrefresh($tplfile, $tplfile, @filemtime($objfile), $templateid, $tpldir); return $objfile; }