function template($file) { global $template_loaded; $template_loaded = false; HOOK::run(str_replace('/', '_', "template_load_{$file}")); $template_name = defined('IN_ADMINCP') ? 'default' : getSetting('template'); if (IN_MOBILE) { $mobilefile = ROOT . "./template/{$template_name}/mobile/{$file}.php"; if (file_exists($mobilefile)) { return $mobilefile; } $mobilefile_default = ROOT . "./template/default/mobile/{$file}.php"; if (file_exists($mobilefile_default)) { return $mobilefile_default; } } $path = ROOT . "./template/{$template_name}/{$file}.php"; if (file_exists($path)) { return $path; } $path = ROOT . "./template/default/{$file}.php"; if (file_exists($path)) { return $path; } error::system_error("Missing template '{$file}'."); }
function template($file) { if (IN_MOBILE) { $mobilefile = ROOT . "./template/mobile/{$file}.php"; if (file_exists($mobilefile)) { return $mobilefile; } } $path = ROOT . "./template/{$file}.php"; if (file_exists($path)) { return $path; } error::system_error("Missing template '{$file}'."); }
<?php if (!defined('IN_KKFRAME')) { exit('Access Denied'); } $query = DB::query('SHOW TABLES'); $tables = array(); while ($table = DB::fetch($query)) { $tables[] = implode('', $table); } if (!in_array('member', $tables)) { include SYSTEM_ROOT . './function/updater/install.php'; } elseif (!in_array('setting', $tables)) { include SYSTEM_ROOT . './function/updater/1.0.php'; } elseif (!in_array('member_setting', $tables)) { include SYSTEM_ROOT . './function/updater/1.13.8.18.php'; } error::system_error('找不到更新程序,无法进行更新!');