開啟 global.func.php
找
function language($file, $templateid = 0, $tpldir = '') {
..中間省略..
}function template($file, $templateid = 0, $tpldir = '') {
..中間省略..
}function checktplrefresh($maintpl, $subtpl, $timecompare, $templateid, $tpldir) {
..中間省略..
}
以上刪除
找檔案最底下的
?>
在上面加上
// bluelvoers
function language($file, $templateid = 0, $tpldir = '') {
if (!$templateid && $tpldir == '' && defined('PTPLDIR')) {
$tpldir = PTPLDIR;
} elseif (!$templateid && $tpldir != '' && !defined('PTPLDIR')) {
define(PTPLDIR, $tpldir);
} else {
$tpldir = $tpldir ? $tpldir : TPLDIR;
$templateid = $templateid ? $templateid : TEMPLATEID;
}
$languagepack = DISCUZ_ROOT.'./'.$tpldir.'/'.$file.'.lang.php';
if(file_exists($languagepack)) {
return $languagepack;
} elseif(TEMPLATEID != 1 && $templateid != 1 && TPLDIR != $tpldir) {
return language($file, TEMPLATEID, TPLDIR);
} elseif($templateid != 1 && $tpldir != './templates/default') {
return language($file, 1, './templates/default');
} else {
return FALSE;
}
}
function template($file, $templateid = 0, $tpldir = '') {
global $inajax;
$file .= $inajax && ($file == 'header' || $file == 'footer') ? '_ajax' : '';
$templateidex = '';
if (!$templateid && $tpldir == '' && defined('PTPLDIR')) {
global $pluginmodule;
$tpldir = PTPLDIR;
$templateidex = '_ptpldir'.($pluginmodule['pluginid'] ? '_'.$pluginmodule['pluginid'] : '');
} elseif (!$templateid && $tpldir != '' && TPLDIR != $tpldir && !defined('PTPLDIR')) {
define(PTPLDIR, $tpldir);
} else {
$tpldir = $tpldir ? $tpldir : TPLDIR;
}
$templateid = !empty($templateid) && $templateid ? $templateid : TEMPLATEID;
$tplfile = DISCUZ_ROOT.'./'.$tpldir.'/'.$file.'.htm';
$objfile = DISCUZ_ROOT.'./forumdata/templates/'.$templateid.$templateidex.'_'.$file.'.tpl.php';
if (TEMPLATEID != 1 && $templateid != 1 && TPLDIR != $tpldir && !file_exists($tplfile)) {
return template($file, TEMPLATEID, TPLDIR);
} elseif(TEMPLATEID != 1 && $templateid != 1 && !file_exists($tplfile)) {
return template($file, TEMPLATEID, './templates/default/');
}
@checktplrefresh($tplfile, $tplfile, filemtime($objfile), $templateid, $tpldir, $objfile);
return $objfile;
}
function checktplrefresh($maintpl, $subtpl, $timecompare, $templateid, $tpldir, $objfile = '') {
global $tplrefresh;
if(empty($timecompare) || $tplrefresh == 1 || ($tplrefresh > 1 && !($GLOBALS['timestamp'] % $tplrefresh))) {
if(empty($timecompare) || @filemtime($subtpl) > $timecompare) {
require_once DISCUZ_ROOT.'./include/template.func.php';
parse_template($maintpl, $templateid, $tpldir, $objfile);
return TRUE;
}
}
return FALSE;
}
// bluelovers開啟 template.func.php
找
function parse_template($tplfile, $templateid, $tpldir) {改為
function parse_template($tplfile, $templateid, $tpldir, $objfile = '') {找
$objfile = DISCUZ_ROOT."./forumdata/templates/{$templateid}_$file.tpl.php";改為
$objfile = !empty($objfile) ? $objfile : DISCUZ_ROOT."./forumdata/templates/{$templateid}_$file.tpl.php";找
function loadsubtemplate($file, $templateid = 0, $tpldir = '') {
..中間省略..
}function languagevar($var) {
..中間省略..
}以上刪除
找檔案最底下的
複製內容到剪貼板
代碼:
?>在上面加上
// bluelovers
function loadsubtemplate($file, $templateid = 0, $tpldir = '') {
global $subtemplates;
$templateidex = '';
if (!$templateid && $tpldir == '' && defined('PTPLDIR')) {
global $pluginmodule;
$tpldir = PTPLDIR;
$templateidex = '_ptpldir'.($pluginmodule['pluginid'] ? '_'.$pluginmodule['pluginid'] : '');
} elseif (!$templateid && $tpldir != '' && TPLDIR != $tpldir && !defined('PTPLDIR')) {
define(PTPLDIR, $tpldir);
} else {
$tpldir = $tpldir ? $tpldir : TPLDIR;
}
$templateid = $templateid ? $templateid : TEMPLATEID;
$tplfile = DISCUZ_ROOT.'./'.$tpldir.'/'.$file.'.htm';
if (TEMPLATEID != 1 && $templateid != 1 && TPLDIR != $tpldir && !file_exists($tplfile)) {
return loadsubtemplate($file, TEMPLATEID, TPLDIR);
} elseif(TEMPLATEID != 1 && $templateid != 1 && !file_exists($tplfile)) {
return loadsubtemplate($file, TEMPLATEID, './templates/default/');
}
$subtemplates[] = $tplfile;
return @implode('', file($tplfile));
}
function languagevar($var) {
if (defined('PLANG') && isset($GLOBALS[PLANG][$var])) {
return $GLOBALS[PLANG][$var];
} elseif(isset($GLOBALS['language'][$var])) {
return $GLOBALS['language'][$var];
} else {
return "!$var!";
}
}
// bluelovers