本文整理汇总了PHP中update_config函数的典型用法代码示例。如果您正苦于以下问题:PHP update_config函数的具体用法?PHP update_config怎么用?PHP update_config使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了update_config函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowTeamspeakPage
function ShowTeamspeakPage()
{
global $CONF, $LNG;
if ($_POST) {
if (isset($_POST['ts_on']) && $_POST['ts_on'] == 'on') {
$CONF['ts_modon'] = 1;
} else {
$CONF['ts_modon'] = 0;
}
$CONF['ts_server'] = request_var('ts_ip', '');
$CONF['ts_tcpport'] = request_var('ts_tcp', 0);
$CONF['ts_udpport'] = request_var('ts_udp', 0);
$CONF['ts_timeout'] = request_var('ts_to', 0);
$CONF['ts_version'] = request_var('ts_v', 0);
update_config('ts_timeout', $CONF['ts_timeout']);
update_config('ts_modon', $CONF['ts_modon']);
update_config('ts_server', $CONF['ts_server']);
update_config('ts_tcpport', $CONF['ts_tcpport']);
update_config('ts_udpport', $CONF['ts_udpport']);
update_config('ts_version', $CONF['ts_version']);
}
$template = new template();
$template->page_header();
$template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_server_id' => $LNG['ts_server_id'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version']));
$template->show('adm/TeamspeakPage.tpl');
}
示例2: DeleteSelectedUser
/**
_ \_/ |\ | /¯¯\ \ / /\ |¯¯) |_¯ \ / /¯¯\ | | |´¯|¯` | /¯¯\ |\ |5
¯ /¯\ | \| \__/ \/ /--\ |¯¯\ |__ \/ \__/ |__ \_/ | | \__/ | \|Core.
* @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution
* @link: http://www.xnovarevolution.con.ar
* @package 2Moons
* @author Slaver <slaver7@gmail.com>
* @copyright 2009 Lucky <douglas@crockford.com> (XGProyecto)
* @copyright 2011 Slaver <slaver7@gmail.com> (Fork/2Moons)
* @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
* @version 1.3 (2011-01-21)
* @link http://code.google.com/p/2moons/
* Please do not remove the credits
*/
function DeleteSelectedUser($UserID)
{
global $db, $CONF;
$TheUser = $db->uniquequery("SELECT universe, ally_id FROM " . USERS . " WHERE `id` = '" . $UserID . "';");
$SQL = "";
if ($TheUser['ally_id'] != 0) {
$TheAlly = $db->uniquequery("SELECT ally_members FROM " . ALLIANCE . " WHERE `id` = '" . $TheUser['ally_id'] . "';");
$TheAlly['ally_members'] -= 1;
if ($TheAlly['ally_members'] > 0) {
$SQL .= "UPDATE " . ALLIANCE . " SET `ally_members` = '" . $TheAlly['ally_members'] . "' WHERE `id` = '" . $TheUser['ally_id'] . "';";
} else {
$SQL .= "DELETE FROM " . ALLIANCE . " WHERE `id` = '" . $TheUser['ally_id'] . "';";
$SQL .= "DELETE FROM " . STATPOINTS . " WHERE `stat_type` = '2' AND `id_owner` = '" . $TheUser['ally_id'] . "';";
}
}
$SQL .= "DELETE FROM " . BUDDY . " WHERE `owner` = '" . $UserID . "' OR `sender` = '" . $UserID . "';";
$SQL .= "DELETE FROM " . FLEETS . " WHERE `fleet_owner` = '" . $UserID . "';";
$SQL .= "DELETE FROM " . MESSAGES . " WHERE `message_owner` = '" . $UserID . "' OR `message_sender` = '" . $UserID . "';";
$SQL .= "DELETE FROM " . NOTES . " WHERE `owner` = '" . $UserID . "';";
$SQL .= "DELETE FROM " . PLANETS . " WHERE `id_owner` = '" . $UserID . "';";
$SQL .= "DELETE FROM " . USERS . " WHERE `id` = '" . $UserID . "';";
$SQL .= "DELETE FROM " . STATPOINTS . " WHERE `stat_type` = '1' AND `id_owner` = '" . $UserID . "';";
$db->multi_query($SQL);
$SQL = $db->query("SELECT fleet_id FROM " . FLEETS . " WHERE `fleet_target_owner` = '" . $UserID . "';");
while ($FleetID = $db->fetch_array($SQL)) {
SendFleetBack($UserID, $FleetID);
}
update_config(array('users_amount' => $CONF['users_amount'] - 1), $TheUser['universe']);
}
示例3: ShowConfigPage
function ShowConfigPage()
{
global $CONF, $LNG, $USER, $LANG;
if (!empty($_POST)) {
$CONF['game_disable'] = isset($_POST['closed']) && $_POST['closed'] == 'on' ? 1 : 0;
$CONF['noobprotection'] = isset($_POST['noobprotection']) && $_POST['noobprotection'] == 'on' ? 1 : 0;
$CONF['debug'] = isset($_POST['debug']) && $_POST['debug'] == 'on' ? 1 : 0;
$CONF['adm_attack'] = isset($_POST['adm_attack']) && $_POST['adm_attack'] == 'on' ? 1 : 0;
$CONF['OverviewNewsFrame'] = isset($_POST['newsframe']) && $_POST['newsframe'] == 'on' ? 1 : 0;
$CONF['capaktiv'] = isset($_POST['capaktiv']) && $_POST['capaktiv'] == 'on' ? 1 : 0;
$CONF['reg_closed'] = isset($_POST['reg_closed']) && $_POST['reg_closed'] == 'on' ? 1 : 0;
$CONF['user_valid'] = isset($_POST['user_valid']) && $_POST['user_valid'] == 'on' ? 1 : 0;
$CONF['ga_active'] = isset($_POST['ga_active']) && $_POST['ga_active'] == 'on' ? 1 : 0;
$CONF['bgm_active'] = isset($_POST['bgm_active']) && $_POST['bgm_active'] == 'on' ? 1 : 0;
$CONF['mail_active'] = isset($_POST['mail_active']) && $_POST['mail_active'] == 'on' ? 1 : 0;
$CONF['OverviewNewsText'] = $_POST['NewsText'];
$CONF['close_reason'] = request_var('close_reason', '', true);
$CONF['game_name'] = request_var('game_name', '', true);
$CONF['forum_url'] = request_var('forum_url', '', true);
$CONF['game_speed'] = 2500 * request_var('game_speed', 0.0);
$CONF['fleet_speed'] = 2500 * request_var('fleet_speed', 0.0);
$CONF['resource_multiplier'] = request_var('resource_multiplier', 0.0);
$CONF['halt_speed'] = request_var('halt_speed', 0.0);
$CONF['initial_fields'] = request_var('initial_fields', 0);
$CONF['metal_basic_income'] = request_var('metal_basic_income', 0);
$CONF['crystal_basic_income'] = request_var('crystal_basic_income', 0);
$CONF['deuterium_basic_income'] = request_var('deuterium_basic_income', 0);
$CONF['norio_basic_income'] = request_var('norio_basic_income', 0);
$CONF['lang'] = request_var('lang', '');
$CONF['Defs_Cdr'] = request_var('Defs_Cdr', 0);
$CONF['Fleet_Cdr'] = request_var('Fleet_Cdr', 0);
$CONF['noobprotectiontime'] = request_var('noobprotectiontime', 0);
$CONF['noobprotectionmulti'] = request_var('noobprotectionmulti', 0);
$CONF['capprivate'] = request_var('capprivate', '');
$CONF['cappublic'] = request_var('cappublic', '');
$CONF['min_build_time'] = request_var('min_build_time', 0);
$CONF['ga_key'] = request_var('ga_key', '', true);
$CONF['bgm_file'] = request_var('bgm_file', '', true);
$CONF['mail_use'] = request_var('mail_use', 0);
$CONF['smail_path'] = request_var('smail_path', '');
$CONF['smtp_host'] = request_var('smtp_host', '', true);
$CONF['smtp_port'] = request_var('smtp_port', 0);
$CONF['smtp_user'] = request_var('smtp_user', '', true);
$CONF['smtp_sendmail'] = request_var('smtp_sendmail', '', true);
$CONF['smtp_pass'] = request_var('smtp_pass', '', true);
$CONF['smtp_ssl'] = request_var('smtp_ssl', '');
$CONF['ftp_server'] = request_var('ftp_server', '', true);
$CONF['ftp_user_name'] = request_var('ftp_user_name', '', true);
$CONF['ftp_root_path'] = request_var('ftp_root_path', '', true);
$CONF['trade_allowed_ships'] = request_var('trade_allowed_ships', '');
$CONF['trade_charge'] = request_var('trade_charge', 0.0);
$CONF['ftp_root_path'] = request_var('ftp_root_path', '', true);
update_config(array('noobprotectiontime' => $CONF['noobprotectiontime'], 'noobprotectionmulti' => $CONF['noobprotectionmulti'], 'noobprotection' => $CONF['noobprotection'], 'Defs_Cdr' => $CONF['Defs_Cdr'], 'Fleet_Cdr' => $CONF['Fleet_Cdr'], 'game_disable' => $CONF['game_disable'], 'close_reason' => $CONF['close_reason'], 'OverviewNewsFrame' => $CONF['OverviewNewsFrame'], 'reg_closed' => $CONF['reg_closed'], 'OverviewNewsText' => $CONF['OverviewNewsText'], 'game_name' => $CONF['game_name'], 'forum_url' => $CONF['forum_url'], 'game_speed' => $CONF['game_speed'], 'fleet_speed' => $CONF['fleet_speed'], 'resource_multiplier' => $CONF['resource_multiplier'], 'halt_speed' => $CONF['halt_speed'], 'initial_fields' => $CONF['initial_fields'], 'metal_basic_income' => $CONF['metal_basic_income'], 'crystal_basic_income' => $CONF['crystal_basic_income'], 'deuterium_basic_income' => $CONF['deuterium_basic_income'], 'norio_basic_income' => $CONF['norio_basic_income'], 'debug' => $CONF['debug'], 'adm_attack' => $CONF['adm_attack'], 'lang' => $CONF['lang'], 'min_build_time' => $CONF['min_build_time'], 'user_valid' => $CONF['user_valid'], 'trade_charge' => $CONF['trade_charge'], 'trade_allowed_ships' => $CONF['trade_allowed_ships']), false, $_SESSION['adminuni']);
update_config(array('mail_active' => $CONF['mail_active'], 'mail_use' => $CONF['mail_use'], 'smail_path' => $CONF['smail_path'], 'smtp_host' => $CONF['smtp_host'], 'smtp_port' => $CONF['smtp_port'], 'smtp_user' => $CONF['smtp_user'], 'smtp_pass' => $CONF['smtp_pass'], 'smtp_ssl' => $CONF['smtp_ssl'], 'smtp_sendmail' => $CONF['smtp_sendmail'], 'ftp_server' => $CONF['ftp_server'], 'ftp_user_name' => $CONF['ftp_user_name'], 'ftp_root_path' => $CONF['ftp_root_path'], 'ga_active' => $CONF['ga_active'], 'ga_key' => $CONF['ga_key'], 'bgm_active' => $CONF['bgm_active'], 'bgm_file' => $CONF['bgm_file'], 'capaktiv' => $CONF['capaktiv'], 'capprivate' => $CONF['capprivate'], 'cappublic' => $CONF['cappublic'], 'min_js' => $CONF['min_js']), true);
}
$template = new template();
$template->assign_vars(array('se_server_parameters' => $LNG['se_server_parameters'], 'se_name' => $LNG['se_name'], 'se_cookie_advert' => $LNG['se_cookie_advert'], 'se_lang' => $LNG['se_lang'], 'se_general_speed' => $LNG['se_general_speed'], 'se_fleet_speed' => $LNG['se_fleet_speed'], 'se_halt_speed' => $LNG['se_halt_speed'], 'se_normal_speed' => $LNG['se_normal_speed'], 'se_normal_speed_fleet' => $LNG['se_normal_speed_fleet'], 'se_resources_producion_speed' => $LNG['se_resources_producion_speed'], 'se_normal_speed_resoruces' => $LNG['se_normal_speed_resoruces'], 'se_normal_speed_halt' => $LNG['se_normal_speed_halt'], 'se_forum_link' => $LNG['se_forum_link'], 'se_server_op_close' => $LNG['se_server_op_close'], 'se_server_status_message' => $LNG['se_server_status_message'], 'se_server_planet_parameters' => $LNG['se_server_planet_parameters'], 'se_initial_fields' => $LNG['se_initial_fields'], 'se_metal_production' => $LNG['se_metal_production'], 'se_admin_protection' => $LNG['se_admin_protection'], 'se_crystal_production' => $LNG['se_crystal_production'], 'se_deuterium_production' => $LNG['se_deuterium_production'], 'se_norio_production' => $LNG['se_norio_production'], 'se_several_parameters' => $LNG['se_several_parameters'], 'se_min_build_time' => $LNG['se_min_build_time'], 'se_reg_closed' => $LNG['se_reg_closed'], 'se_verfiy_mail' => $LNG['se_verfiy_mail'], 'se_min_build_time_info' => $LNG['se_min_build_time_info'], 'se_verfiy_mail_info' => $LNG['se_verfiy_mail_info'], 'se_fields' => $LNG['se_fields'], 'se_per_hour' => $LNG['se_per_hour'], 'se_debug_mode' => $LNG['se_debug_mode'], 'se_title_admins_protection' => $LNG['se_title_admins_protection'], 'se_debug_message' => $LNG['se_debug_message'], 'se_ships_cdr_message' => $LNG['se_ships_cdr_message'], 'se_def_cdr_message' => $LNG['se_def_cdr_message'], 'se_ships_cdr' => $LNG['se_ships_cdr'], 'se_def_cdr' => $LNG['se_def_cdr'], 'se_noob_protect' => $LNG['se_noob_protect'], 'se_noob_protect3' => $LNG['se_noob_protect3'], 'se_noob_protect2' => $LNG['se_noob_protect2'], 'se_noob_protect_e2' => $LNG['se_noob_protect_e2'], 'se_noob_protect_e3' => $LNG['se_noob_protect_e3'], 'se_trader_head' => $LNG['se_trader_head'], 'se_trader_ships' => $LNG['se_trader_ships'], 'se_trader_charge' => $LNG['se_trader_charge'], 'se_news_head' => $LNG['se_news_head'], 'se_news_active' => $LNG['se_news_active'], 'se_news_info' => $LNG['se_news_info'], 'se_news' => $LNG['se_news'], 'se_news_limit' => $LNG['se_news_limit'], 'se_recaptcha_head' => $LNG['se_recaptcha_head'], 'se_recaptcha_active' => $LNG['se_recaptcha_active'], 'se_recaptcha_desc' => $LNG['se_recaptcha_desc'], 'se_recaptcha_public' => $LNG['se_recaptcha_public'], 'se_recaptcha_private' => $LNG['se_recaptcha_private'], 'se_smtp' => $LNG['se_smtp'], 'se_mail_active' => $LNG['se_mail_active'], 'se_mail_use' => $LNG['se_mail_use'], 'se_smail_path' => $LNG['se_smail_path'], 'se_smtp_info' => $LNG['se_smtp_info'], 'se_smtp_host' => $LNG['se_smtp_host'], 'se_smtp_host_info' => $LNG['se_smtp_host_info'], 'se_smtp_ssl' => $LNG['se_smtp_ssl'], 'se_smtp_ssl_info' => $LNG['se_smtp_ssl_info'], 'se_smtp_port' => $LNG['se_smtp_port'], 'se_smtp_port_info' => $LNG['se_smtp_port_info'], 'se_smtp_user' => $LNG['se_smtp_user'], 'se_smtp_pass' => $LNG['se_smtp_pass'], 'se_smtp_sendmail' => $LNG['se_smtp_sendmail'], 'se_smtp_sendmail_info' => $LNG['se_smtp_sendmail_info'], 'se_ftp' => $LNG['se_ftp'], 'se_ftp_info' => $LNG['se_ftp_info'], 'se_ftp_host' => $LNG['se_ftp_host'], 'se_ftp_user' => $LNG['se_ftp_user'], 'se_ftp_dir' => $LNG['se_ftp_dir'], 'se_ftp_dir_info' => $LNG['se_ftp_dir_info'], 'se_google' => $LNG['se_google'], 'se_google_active' => $LNG['se_google_active'], 'se_google_info' => $LNG['se_google_info'], 'se_google_key' => $LNG['se_google_key'], 'se_google_key_info' => $LNG['se_google_key_info'], 'se_bgm_login' => $LNG['se_bgm_login'], 'se_bgm_active' => $LNG['se_bgm_active'], 'se_bgm_info' => $LNG['se_bgm_info'], 'se_bgm_file' => $LNG['se_bgm_file'], 'se_bgm_file_info' => $LNG['se_bgm_file_info'], 'se_google_key_info' => $LNG['se_google_key_info'], 'se_save_parameters' => $LNG['se_save_parameters'], 'game_name' => $CONF['game_name'], 'game_speed' => $CONF['game_speed'] / 2500, 'fleet_speed' => $CONF['fleet_speed'] / 2500, 'resource_multiplier' => $CONF['resource_multiplier'], 'halt_speed' => $CONF['halt_speed'], 'forum_url' => $CONF['forum_url'], 'initial_fields' => $CONF['initial_fields'], 'metal_basic_income' => $CONF['metal_basic_income'], 'crystal_basic_income' => $CONF['crystal_basic_income'], 'deuterium_basic_income' => $CONF['deuterium_basic_income'], 'norio_basic_income' => $CONF['norio_basic_income'], 'game_disable' => $CONF['game_disable'], 'close_reason' => $CONF['close_reason'], 'debug' => $CONF['debug'], 'adm_attack' => $CONF['adm_attack'], 'defenses' => $CONF['Defs_Cdr'], 'shiips' => $CONF['Fleet_Cdr'], 'noobprot' => $CONF['noobprotection'], 'noobprot2' => $CONF['noobprotectiontime'], 'noobprot3' => $CONF['noobprotectionmulti'], 'mail_active' => $CONF['mail_active'], 'mail_use' => $CONF['mail_use'], 'smail_path' => $CONF['smail_path'], 'smtp_host' => $CONF['smtp_host'], 'smtp_port' => $CONF['smtp_port'], 'smtp_user' => $CONF['smtp_user'], 'smtp_pass' => $CONF['smtp_pass'], 'smtp_sendmail' => $CONF['smtp_sendmail'], 'smtp_ssl' => $CONF['smtp_ssl'], 'user_valid' => $CONF['user_valid'], 'newsframe' => $CONF['OverviewNewsFrame'], 'reg_closed' => $CONF['reg_closed'], 'NewsTextVal' => $CONF['OverviewNewsText'], 'capprivate' => $CONF['capprivate'], 'cappublic' => $CONF['cappublic'], 'capaktiv' => $CONF['capaktiv'], 'min_build_time' => $CONF['min_build_time'], 'ftp_server' => $CONF['ftp_server'], 'ftp_user_name' => $CONF['ftp_user_name'], 'ftp_user_pass' => str_pad('', strlen($CONF['ftp_user_pass']), 'x'), 'ftp_root_path' => $CONF['ftp_root_path'], 'ga_active' => $CONF['ga_active'], 'ga_key' => $CONF['ga_key'], 'bgm_active' => $CONF['bgm_active'], 'bgm_file' => $CONF['bgm_file'], 'trade_allowed_ships' => $CONF['trade_allowed_ships'], 'trade_charge' => $CONF['trade_charge'], 'Selector' => array('langs' => $LANG->getAllowedLangs(false), 'mail' => $LNG['se_mail_sel'], 'encry' => array('' => $LNG['se_smtp_ssl_1'], 'ssl' => $LNG['se_smtp_ssl_2'], 'tls' => $LNG['se_smtp_ssl_3'])), 'lang' => $CONF['lang']));
$template->show('adm/ConfigBody.tpl');
}
示例4: save_f_method
function save_f_method($method)
{
global $dbprefix, $SQL, $config;
if (!get_config('upg_f_method')) {
return add_config('upg_f_method', $method);
} else {
return update_config('upg_f_method', $method);
}
}
示例5: ShowFacebookPage
function ShowFacebookPage()
{
global $CONF, $LNG;
if ($_POST) {
$CONF['fb_on'] = isset($_POST['fb_on']) && $_POST['fb_on'] == 'on' && !empty($_POST['fb_skey']) && !empty($_POST['fb_apikey']) ? 1 : 0;
$CONF['fb_apikey'] = request_var('fb_apikey', '');
$CONF['fb_skey'] = request_var('fb_skey', '');
update_config(array('fb_on' => $CONF['fb_on'], 'fb_apikey' => $CONF['fb_apikey'], 'fb_skey' => $CONF['fb_skey']), true);
}
$template = new template();
$template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'fb_info' => $LNG['fb_info'], 'fb_secrectkey' => $LNG['fb_secrectkey'], 'fb_api_key' => $LNG['fb_api_key'], 'fb_active' => $LNG['fb_active'], 'fb_settings' => $LNG['fb_settings'], 'fb_on' => $CONF['fb_on'], 'fb_apikey' => $CONF['fb_apikey'], 'fb_skey' => $CONF['fb_skey'], 'fb_curl' => function_exists('curl_init') ? 1 : 0, 'fb_curl_info' => function_exists('curl_init') ? $LNG['fb_curl_yes'] : $LNG['fb_curl_no']));
$template->show('adm/FacebookPage.tpl');
}
示例6: ShowStatsPage
function ShowStatsPage()
{
global $LNG, $CONF;
if ($_POST) {
$CONF['stat_settings'] = request_var('stat_settings', 0);
$CONF['stat'] = request_var('stat', 0);
$CONF['stat_update_time'] = request_var('stat_update_time', 0);
$CONF['stat_level'] = request_var('stat_level', 0);
update_config(array('stat_settings' => $CONF['stat_settings'], 'stat' => $CONF['stat'], 'stat_update_time' => $CONF['stat_update_time'], 'stat_level' => $CONF['stat_level']), true);
}
$template = new template();
$template->assign_vars(array('stat_level' => $CONF['stat_level'], 'stat_update_time' => $CONF['stat_update_time'], 'stat' => $CONF['stat'], 'stat_settings' => $CONF['stat_settings'], 'timeact' => date('d. M y H:i:s T', $CONF['stat_last_update']), 'cs_timeact_1' => $LNG['cs_timeact_1'], 'cs_access_lvl' => $LNG['cs_access_lvl'], 'cs_points_to_zero' => $LNG['cs_points_to_zero'], 'cs_time_between_updates' => $LNG['cs_time_between_updates'], 'cs_point_per_resources_used' => $LNG['cs_point_per_resources_used'], 'cs_title' => $LNG['cs_title'], 'cs_banner_time_between_updates' => $LNG['cs_banner_time_between_updates'], 'cs_banner_title' => $LNG['cs_banner_title'], 'cs_resources' => $LNG['cs_resources'], 'cs_minutes' => $LNG['cs_minutes'], 'cs_save_changes' => $LNG['cs_save_changes'], 'Selector' => array(1 => $LNG['cs_yes'], 2 => $LNG['cs_no_view'], 0 => $LNG['cs_no'])));
$template->show('adm/StatsPage.tpl');
}
示例7: ShowStatUpdatePage
function ShowStatUpdatePage()
{
global $LNG;
require_once ROOT_PATH . 'includes/classes/class.statbuilder.php';
$stat = new statbuilder();
$result = $stat->MakeStats();
$memory_p = str_replace(array("%p", "%m"), $result['memory_peak'], $LNG['sb_top_memory']);
$memory_e = str_replace(array("%e", "%m"), $result['end_memory'], $LNG['sb_final_memory']);
$memory_i = str_replace(array("%i", "%m"), $result['initial_memory'], $LNG['sb_start_memory']);
$stats_end_time = sprintf($LNG['sb_stats_update'], $result['totaltime']);
$stats_sql = sprintf($LNG['sb_sql_counts'], $result['sql_count']);
update_config(array('stat_last_update' => $result['stats_time']), true);
$template = new template();
$template->message($LNG['sb_stats_updated'] . $stats_end_time . $memory_i . $memory_e . $memory_p . $stats_sql, false, 0, true);
}
示例8: ShowModulePage
function ShowModulePage()
{
global $CONF, $LNG;
if ($_GET['mode']) {
$CONF['moduls'][request_var('id', 0)] = $_GET['mode'] == 'aktiv' ? 1 : 0;
update_config('moduls', implode(";", $CONF['moduls']));
$CONF['moduls'] = explode(";", $CONF['moduls']);
}
foreach ($LNG['modul'] as $ID => $Name) {
$Modules[$ID] = array('name' => $Name, 'state' => $CONF['moduls'][$ID]);
}
$template = new template();
$template->page_header();
$template->assign_vars(array('Modules' => $Modules, 'mod_module' => $LNG['mod_module'], 'mod_info' => $LNG['mod_info'], 'mod_active' => $LNG['mod_active'], 'mod_deactive' => $LNG['mod_deactive'], 'mod_change_active' => $LNG['mod_change_active'], 'mod_change_deactive' => $LNG['mod_change_deactive']));
$template->show('adm/ModulePage.tpl');
}
示例9: ShowModulePage
function ShowModulePage()
{
global $CONF, $LNG;
if ($_GET['mode']) {
$CONF['moduls'][request_var('id', 0)] = $_GET['mode'] == 'aktiv' ? 1 : 0;
update_config(array('moduls' => implode(";", $CONF['moduls']), false, $_SESSION['adminuni']));
$CONF['moduls'] = explode(";", $CONF['moduls']);
}
$IDs = range(0, 40);
foreach ($IDs as $ID => $Name) {
$Modules[$ID] = array('name' => $LNG['modul'][$ID], 'state' => isset($CONF['moduls'][$ID]) ? $CONF['moduls'][$ID] : 1);
}
$template = new template();
$template->assign_vars(array('Modules' => $Modules, 'mod_module' => $LNG['mod_module'], 'mod_info' => $LNG['mod_info'], 'mod_active' => $LNG['mod_active'], 'mod_deactive' => $LNG['mod_deactive'], 'mod_change_active' => $LNG['mod_change_active'], 'mod_change_deactive' => $LNG['mod_change_deactive']));
$template->show('adm/ModulePage.tpl');
}
示例10: ShowConfigstatAdmin
function ShowConfigstatAdmin($user)
{
global $lang, $db, $displays;
if ($user['authlevel'] < 3) {
die($displays->message($lang['not_enough_permissions']));
}
if ($_POST['save'] == $lang['cs_save_changes']) {
if (isset($_POST['stat']) && $_POST['stat'] != $db->game_config['stat']) {
update_config('stat', $_POST['stat']);
$db->game_config['stat'] = $_POST['stat'];
}
if (isset($_POST['stat_level']) && is_numeric($_POST['stat_level']) && $_POST['stat_level'] != $db->game_config['stat_level']) {
update_config('stat_level', $_POST['stat_level']);
$db->game_config['stat_level'] = $_POST['stat_level'];
}
if (isset($_POST['stat_flying']) && $_POST['stat_flying'] != $db->game_config['stat_flying']) {
update_config('stat_flying', $_POST['stat_flying']);
$db->game_config['stat_flying'] = $_POST['stat_flying'];
}
if (isset($_POST['stat_settings']) && is_numeric($_POST['stat_settings']) && $_POST['stat_settings'] != $db->game_config['stat_settings']) {
update_config('stat_settings', $_POST['stat_settings']);
$db->game_config['stat_settings'] = $_POST['stat_settings'];
}
if (isset($_POST['stat_amount']) && is_numeric($_POST['stat_amount']) && $_POST['stat_amount'] != $db->game_config['stat_amount'] && $_POST['stat_amount'] >= 10) {
update_config('stat_amount', $_POST['stat_amount']);
$db->game_config['stat_amount'] = $_POST['stat_amount'];
}
if (isset($_POST['stat_update_time']) && is_numeric($_POST['stat_update_time']) && $_POST['stat_update_time'] != $db->game_config['stat_update_time']) {
update_config('stat_update_time', $_POST['stat_update_time']);
$db->game_config['stat_update_time'] = $_POST['stat_update_time'];
}
$displays->message("Configuaracion de estadisticas Guardadas", "admin.php?page=configstat");
} else {
$selected = "selected=\"selected\"";
$stat = $db->game_config['stat'] == 1 ? 'sel_sta1' : 'sel_sta0';
$lang[$stat] = $selected;
$stat_fly = $db->game_config['stat_flying'] == 1 ? 'sel_sf1' : 'sel_sf0';
$lang[$stat_fly] = $selected;
$lang['stat_level'] = $db->game_config['stat_level'];
$lang['stat_settings'] = $db->game_config['stat_settings'];
$lang['stat_amount'] = $db->game_config['stat_amount'];
$lang['stat_update_time'] = $db->game_config['stat_update_time'];
$displays->assignContent('adm/configstats_body');
$displays->display();
}
}
示例11: ShowStatbuilderAdmin
function ShowStatbuilderAdmin($user)
{
global $lang, $svn_root, $db, $phpEx, $displays;
include $svn_root . 'includes/pages/admin/statfunctions.' . $phpEx;
if ($user['authlevel'] < 2) {
die($displays->message($lang['not_enough_permissions']));
}
$stats = new statfunction();
$result = $stats->MakeStats();
$memory_p = str_replace(array("%p", "%m"), $result['memory_peak'], $lang['sb_top_memory']);
$memory_e = str_replace(array("%e", "%m"), $result['end_memory'], $lang['sb_final_memory']);
$memory_i = str_replace(array("%i", "%m"), $result['initial_memory'], $lang['sb_start_memory']);
$stats_end_time = str_replace("%t", $result['totaltime'], $lang['sb_stats_update']);
$stats_block = str_replace("%n", $result['amount_per_block'], $lang['sb_users_per_block']);
update_config('stat_last_update', $result['stats_time']);
$using_flying = $game_config['stat_flying'] == 1 ? $lang['sb_using_fleet_array'] : $lang['sb_using_fleet_query'];
$displays->message($lang['sb_stats_updated'] . $stats_end_time . $memory_i . $memory_e . $memory_p . $stats_block . $using_flying);
}
示例12: ShowOverviewAdmin
function ShowOverviewAdmin($user)
{
global $lang, $db, $svn_root, $displays;
if ($user['authlevel'] < 1) {
die($displays->message($lang['not_enough_permissions']));
}
if (file_exists($svn_root . 'install/') && defined('IN_ADMIN')) {
$Message .= "<font color=\"red\">" . $lang['ow_install_file_detected'] . "</font><br/><br/>";
$error++;
}
if (@fopen($svn_root . "config.php", "a")) {
$Message .= "<font color=\"red\">" . $lang['ow_config_file_writable'] . "</font><br/><br/>";
$error++;
}
$Errors = $db->query("SELECT COUNT(*) AS `errors` FROM {{table}};", 'errors', true);
if ($Errors['errors'] != 0) {
$Message .= "<font color=\"red\">" . $lang['ow_database_errors'] . "</font><br/><br/>";
$error++;
}
update_config("update_version", time());
include $svn_root . 'includes/functions/CheckVersion.php';
$time_ini = microtime(true);
$updates = new Update_version();
$updates->check_ult_modificacion();
$updates->check_version();
$time_fin = microtime(true);
//$versionerror=Checkversion();
if ($updates->errors > 0) {
if ($updates->versioncreditos) {
$error++;
$Message .= "<font color=\"red\">" . $updates->versioncreditos . "</font><br/><br/>";
} elseif ($updates->mensajeversion) {
$Message .= "<font color=\"red\">" . $updates->mensajeversion . "</font><br/><br/>";
$error++;
}
}
if ($error != 0) {
$lang['error_message'] = $Message;
} else {
$lang['error_message'] = $lang['ow_none'];
}
$displays->assignContent('adm/overview_body', $topnav = true, $menu = true, $admin = true);
$displays->display();
}
示例13: ShowTeamspeakPage
function ShowTeamspeakPage()
{
global $CONF, $LNG;
if ($_POST) {
$CONF['ts_modon'] = isset($_POST['ts_on']) && $_POST['ts_on'] == 'on' ? 1 : 0;
$CONF['ts_server'] = request_var('ts_ip', '');
$CONF['ts_tcpport'] = request_var('ts_tcp', 0);
$CONF['ts_udpport'] = request_var('ts_udp', 0);
$CONF['ts_timeout'] = request_var('ts_to', 0);
$CONF['ts_version'] = request_var('ts_v', 0);
$CONF['ts_login'] = request_var('ts_login', '');
$CONF['ts_password'] = request_var('ts_password', '', true);
$CONF['ts_cron_interval'] = request_var('ts_cron', 0);
update_config(array('ts_timeout' => $CONF['ts_timeout'], 'ts_modon' => $CONF['ts_modon'], 'ts_server' => $CONF['ts_server'], 'ts_tcpport' => $CONF['ts_tcpport'], 'ts_udpport' => $CONF['ts_udpport'], 'ts_version' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron_interval' => $CONF['ts_cron_interval']), true);
}
$template = new template();
$template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_sq_login' => $LNG['ts_login'], 'ts_sq_pass' => $LNG['ts_pass'], 'ts_lng_cron' => $LNG['ts_cron'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron' => $CONF['ts_cron_interval']));
$template->show('adm/TeamspeakPage.tpl');
}
示例14: ShowFacebookPage
function ShowFacebookPage()
{
global $CONF, $LNG;
if ($_POST) {
if (isset($_POST['fb_on']) && $_POST['fb_on'] == 'on' && !empty($_POST['fb_skey']) && !empty($_POST['fb_apikey'])) {
$CONF['fb_on'] = 1;
} else {
$CONF['fb_on'] = 0;
}
$CONF['fb_apikey'] = request_var('fb_apikey', '');
$CONF['fb_skey'] = request_var('fb_skey', '');
update_config('fb_on', $CONF['fb_on']);
update_config('fb_apikey', $CONF['fb_apikey']);
update_config('fb_skey', $CONF['fb_skey']);
}
$template = new template();
$template->page_header();
$template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'fb_info' => $LNG['fb_info'], 'fb_secrectkey' => $LNG['fb_secrectkey'], 'fb_api_key' => $LNG['fb_api_key'], 'fb_active' => $LNG['fb_active'], 'fb_settings' => $LNG['fb_settings'], 'fb_on' => $CONF['fb_on'], 'fb_apikey' => $CONF['fb_apikey'], 'fb_skey' => $CONF['fb_skey']));
$template->show('adm/FacebookPage.tpl');
}
示例15: dirname
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
$page['title'] = _('Configuration of trigger displaying options');
$page['file'] = 'adm.triggerdisplayoptions.php';
$page['hist_arg'] = array();
require_once dirname(__FILE__) . '/include/page_header.php';
$fields = array('problem_unack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'problem_ack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'ok_unack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'ok_ack_color' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'problem_unack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'problem_ack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_unack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_ack_style' => array(T_ZBX_INT, O_OPT, null, IN('1'), null), 'ok_period' => array(T_ZBX_INT, O_OPT, null, null, 'isset({save})'), 'blink_period' => array(T_ZBX_INT, O_OPT, null, null, 'isset({save})'), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_refresh' => array(T_ZBX_INT, O_OPT, null, null, null));
check_fields($fields);
if (isset($_REQUEST['save'])) {
$configs = array('ok_period' => get_request('ok_period'), 'blink_period' => get_request('blink_period'), 'problem_unack_color' => get_request('problem_unack_color'), 'problem_ack_color' => get_request('problem_ack_color'), 'ok_unack_color' => get_request('ok_unack_color'), 'ok_ack_color' => get_request('ok_ack_color'), 'problem_unack_style' => get_request('problem_unack_style', 0), 'problem_ack_style' => get_request('problem_ack_style', 0), 'ok_unack_style' => get_request('ok_unack_style', 0), 'ok_ack_style' => get_request('ok_ack_style', 0));
$result = update_config($configs);
show_messages($result, _('Configuration updated'), _('Cannot update configuration'));
}
$form = new CForm();
$form->cleanItems();
$cmbConf = new CComboBox('configDropDown', 'adm.triggerdisplayoptions.php', 'redirect(this.options[this.selectedIndex].value);');
$cmbConf->addItems(array('adm.gui.php' => _('GUI'), 'adm.housekeeper.php' => _('Housekeeping'), 'adm.images.php' => _('Images'), 'adm.iconmapping.php' => _('Icon mapping'), 'adm.regexps.php' => _('Regular expressions'), 'adm.macros.php' => _('Macros'), 'adm.valuemapping.php' => _('Value mapping'), 'adm.workingtime.php' => _('Working time'), 'adm.triggerseverities.php' => _('Trigger severities'), 'adm.triggerdisplayoptions.php' => _('Trigger displaying options'), 'adm.other.php' => _('Other')));
$form->addItem($cmbConf);
$cnf_wdgt = new CWidget();
$cnf_wdgt->addPageHeader(_('CONFIGURATION OF ZABBIX'), $form);
$data = array();
$data['form_refresh'] = get_request('form_refresh', 0);
// form has been submitted
if ($data['form_refresh']) {
$data['ok_period'] = get_request('ok_period');
$data['blink_period'] = get_request('blink_period');