35 if (is_object(
$tpl)) {
37 $source =
$tpl->getVar(
'tpl_source',
'n');
38 $mtime =
$tpl->getVar(
'tpl_lastmodified',
'n');
45 $filesize = $stat[
'size'];
46 $fp = fopen(
$tpl,
'r');
47 $source = ($filesize > 0) ? fread($fp, $filesize) :
'';
65 static $cache = array();
69 if (isset($cache[$tpl_name])) {
70 return $cache[$tpl_name];
72 $tplset = $xoopsConfig[
'template_set'];
73 $theme = isset($xoopsConfig[
'theme_set']) ? $xoopsConfig[
'theme_set'] :
'default';
74 $tplfile_handler =
$xoops->getHandlerTplfile();
76 if ($tplset !=
"default") {
77 $tplobj = $tplfile_handler->find($tplset, null, null, null, $tpl_name,
true);
79 return $cache[$tpl_name] = $tplobj[0];
83 $tplobj = $tplfile_handler->find(
"default", null, null, null, $tpl_name,
true);
85 if (!count($tplobj)) {
86 return $cache[$tpl_name] = $tpl_name;
90 $module = $tplobj->getVar(
'tpl_module',
'n');
91 $type = $tplobj->getVar(
'tpl_type',
'n');
99 $theme = isset($xoopsConfig[
'cpanel']) ? $xoopsConfig[
'cpanel'] :
'default';
109 $filepath = $directory .
"/{$theme}/modules/{$module}/{$path}{$tpl_name}";
110 if (!file_exists($filepath)) {
113 if (!file_exists($filepath)) {
114 return $cache[$tpl_name] = $tplobj ;
117 return $cache[$tpl_name] = $filepath;
fetch($name, &$source, &$mtime)
if($file===false||$dir===false||!strstr($file, $dir)) if(empty($file)||strpos($file, '.php')!==false) $mtime