<?php defined('ADMIN_KEKE') or exit('Access Denied'); kekezu::admin_check_role(51); $filename = S_ROOT . './tpl/' . $tplname . '/' . $tname; $code_content = htmlspecialchars(keke_tpl_class::sreadfile($filename)); if ($sbt_edit) { $filename = S_ROOT . $tname; if (!is_writable($filename)) { kekezu::admin_show_msg($_lang['file'] . $filename . $_lang['can_not_write_please_check'], "index.php?do=tpl&view=tpllist&tplname={$tplname}", 3, '', 'warning'); } keke_tpl_class::swritefile($filename, htmlspecialchars_decode(kekezu::k_stripslashes($txt_code_content))); kekezu::admin_system_log($_lang['edit_template'] . $tplname . '/' . $tname); kekezu::admin_show_msg($_lang['tpl_edit_success'], "index.php?do=tpl&view=tpllist&tplname={$tplname}", 3, '', 'success'); } require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_tpl_' . $view);
} if (mysql_get_server_info() > '4.1') { mysql_query("CREATE DATABASE IF NOT EXISTS `{$dbname}` DEFAULT CHARACTER SET " . DBCHARSET, $link); } else { mysql_query("CREATE DATABASE IF NOT EXISTS `{$dbname}`", $link); } if (mysql_errno()) { $error_arr['dbname'] = 'database_errno_1044' . mysql_error(); include INSTALL_ROOT . 'tpl' . DIRECTORY_SEPARATOR . 'sql.tpl.php'; break; } mysql_close($link); $db = new db_tool(); $db->connect($dbhost, $dbuser, $dbpw, $dbname, DBCHARSET); $temp_arr = array("dbhost" => $dbhost, "dbname" => $dbname, "dbuser" => $dbuser, "dbpass" => $dbpw, "tablepre" => $tablepre, 'cookie_path' => $c_path); $config_content = keke_tpl_class::sreadfile($config_path); foreach ($temp_arr as $key => $value) { $key = strtoupper($key); $config_content = preg_replace("/define\\s?+\\(\\s?+'({$key})'\\s?+,\\s?+.*'\\s?+\\);/i", "define ( '{$key}', '{$value}');", $config_content); } keke_tpl_class::swritefile($config_path, $config_content); // 写配置文件 if ($data_type == 'b') { // 带演示版本 $sqlfile = $sqldemofile; } $sql = file_get_contents($sqlfile); $sql = str_replace("\r\n", "\n", $sql); include INSTALL_ROOT . 'tpl' . DIRECTORY_SEPARATOR . $step . '.tpl.php'; runquery($sql, $tablepre, $db); // ob
} $postdata = "m=app&a=add&ucfounder=&ucfounderpw=" . urlencode($ucfounderpw) . "&apptype=" . urlencode($app_type) . "&appname=" . urlencode($app_name) . "&appurl=" . urlencode($app_url) . "&appip=&appcharset=" . CHARSET . '&appdbcharset=' . DBCHARSET . '&' . $app_tagtemplates . '&release=' . UC_CLIENT_RELEASE; $ucconfig = uc_fopen($ucapi . '/index.php', 500, $postdata, '', 1, $ucip); if (empty($ucconfig)) { kekezu::admin_show_msg($_lang['uc_app_fail_to_add'], 'index.php?do=config&view=integration&type=uc', '', 3, 'warning'); } elseif ($ucconfig == '-1') { kekezu::admin_show_msg($_lang['uc_error_author_password'], 'index.php?do=config&view=integration&type=uc', 3, '', 'warning'); } else { list($appauthkey, $appid) = explode('|', $ucconfig); if (empty($appauthkey) || empty($appid)) { kekezu::admin_system_log($_lang['add_log_msg']); kekezu::admin_show_msg(keke::lang('uc_app_invalid_to_add'), 'index.php?do=config&view=integration&type=uc', 3, '', 'success'); } } } $ucconfig_info = explode('|', $ucconfig); $config_ucenter = keke_tpl_class::sreadfile(S_ROOT . "/config/config_ucenter.php"); $config_ucenter = preg_replace("/define\\('UC_KEY',\\s*'.*?'\\);/s", "define('UC_KEY', '" . $ucconfig_info['0'] . "');", $config_ucenter); $config_ucenter = preg_replace("/define\\('UC_APPID',\\s*'*.*?'*\\);/s", "define('UC_APPID', " . $ucconfig_info[1] . ");", $config_ucenter); keke_tpl_class::swritefile(S_ROOT . "/config/config_ucenter.php", $config_ucenter); $config_obj->setWhere(" k = 'user_intergration'"); $config_obj->setV(2); $config_obj->edit_keke_witkey_basic_config(); $kekezu->_cache_obj->gc(); kekezu::admin_system_log($_lang['uc_integrate_log']); kekezu::admin_show_msg($_lang['uc_integrate_success'], "index.php?do=config&view=integration", 2, '', 'success'); } require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_config_' . $view . '_uc'); die; } require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_config_' . $view);