本文整理汇总了PHP中Functions_Lib::prep_url方法的典型用法代码示例。如果您正苦于以下问题:PHP Functions_Lib::prep_url方法的具体用法?PHP Functions_Lib::prep_url怎么用?PHP Functions_Lib::prep_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Functions_Lib
的用法示例。
在下文中一共展示了Functions_Lib::prep_url方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build_page
/**
* method build_page
* param
* return main method, loads everything
*/
private function build_page()
{
$parse = $this->_lang;
$parse['alert'] = '';
$error = '';
if (isset($_POST['save'])) {
if (isset($_POST['premium_url']) && !empty($_POST['premium_url'])) {
Functions_Lib::update_config('premium_url', Functions_Lib::prep_url($_POST['premium_url']));
} else {
$error .= $this->_lang['pr_error_url'];
}
if (isset($_POST['trader_darkmatter']) && $_POST['trader_darkmatter'] > 0) {
Functions_Lib::update_config('trader_darkmatter', $_POST['trader_darkmatter']);
} else {
$error .= $this->_lang['pr_error_trader'];
}
if ($error != '') {
$parse['alert'] = Administration_Lib::save_message('warning', $error);
} else {
$parse['alert'] = Administration_Lib::save_message('ok', $this->_lang['pr_all_ok_message']);
}
}
$parse['premium_url'] = Functions_Lib::read_config('premium_url');
$parse['trader_darkmatter'] = Functions_Lib::read_config('trader_darkmatter');
parent::$page->display(parent::$page->parse_template(parent::$page->get_template('adm/premium_view'), $parse));
}
示例2: ally_block
/**
* method ally_block
* param
* return ally link and information for the current planet
*/
private function ally_block()
{
$parse = '';
$add = '';
if ($this->_row_data['user_ally_id'] != 0) {
if ($this->_row_data['ally_members'] > 1) {
$add = $this->_lang['gl_member_add'];
}
$parse = $this->_lang;
$parse['alliance_name'] = str_replace("'", "\\'", htmlspecialchars($this->_row_data['alliance_name'], ENT_COMPAT));
$parse['ally_members'] = $this->_row_data['ally_members'];
$parse['add'] = $add;
$parse['ally_id'] = $this->_row_data['user_ally_id'];
if ($this->_row_data['alliance_web'] != '') {
$web_url = Functions_Lib::set_url(Functions_Lib::prep_url($this->_row_data['alliance_web']), '', $this->_lang['gl_alliance_web_page'], 'target="_new"');
$parse['web'] = '</tr><tr>';
$parse['web'] .= '<td>' . str_replace('"', '', $web_url) . '</td>';
}
if ($this->_current_user['user_ally_id'] == $this->_row_data['user_ally_id']) {
$parse['tag'] = '<span class="allymember">' . $this->_row_data['alliance_tag'] . '</span>';
} else {
$parse['tag'] = $this->_row_data['alliance_tag'];
}
}
return $parse;
}
示例3: run_validations
/**
* method run_validations
* param
* return Run validations before insert data into the configuration file, if some data is not correctly validated it's not inserted.
*/
private function run_validations()
{
/*
* SERVER SETTINGS
*/
// NAME
if (isset($_POST['game_logo']) && $_POST['game_logo'] != '') {
$this->_game_config['game_logo'] = $_POST['game_logo'];
}
// LOGO
if (isset($_POST['game_name']) && $_POST['game_name'] != '') {
$this->_game_config['game_name'] = $_POST['game_name'];
}
// LANGUAGE
if (isset($_POST['language'])) {
$this->_game_config['lang'] = $_POST['language'];
} else {
$this->_game_config['lang'];
}
// GENERAL RATE
if (isset($_POST['game_speed']) && is_numeric($_POST['game_speed'])) {
$this->_game_config['game_speed'] = 2500 * $_POST['game_speed'];
}
// SPEED OF FLEET
if (isset($_POST['fleet_speed']) && is_numeric($_POST['fleet_speed'])) {
$this->_game_config['fleet_speed'] = 2500 * $_POST['fleet_speed'];
}
// SPEED OF PRODUCTION
if (isset($_POST['resource_multiplier']) && is_numeric($_POST['resource_multiplier'])) {
$this->_game_config['resource_multiplier'] = $_POST['resource_multiplier'];
}
// ADMIN EMAIL CONTACT
if (isset($_POST['admin_email']) && $_POST['admin_email'] != '' && Functions_Lib::valid_email($_POST['admin_email'])) {
$this->_game_config['admin_email'] = $_POST['admin_email'];
}
// FORUM LINK
if (isset($_POST['forum_url']) && $_POST['forum_url'] != '') {
$this->_game_config['forum_url'] = Functions_Lib::prep_url($_POST['forum_url']);
}
// ACTIVATE SERVER
if (isset($_POST['closed']) && $_POST['closed'] == 'on') {
$this->_game_config['game_enable'] = 1;
} else {
$this->_game_config['game_enable'] = 0;
}
// OFF-LINE MESSAGE
if (isset($_POST['close_reason']) && $_POST['close_reason'] != '') {
$this->_game_config['close_reason'] = addslashes($_POST['close_reason']);
}
// SSL ENABLED
if (isset($_POST['ssl_enabled']) && $_POST['ssl_enabled'] == 'on') {
$this->_game_config['ssl_enabled'] = 1;
} else {
$this->_game_config['ssl_enabled'] = 0;
}
/*
* DATE AND TIME PARAMETERS
*/
// SHORT DATE
if (isset($_POST['date_time_zone']) && $_POST['date_time_zone'] != '') {
$this->_game_config['date_time_zone'] = $_POST['date_time_zone'];
}
if (isset($_POST['date_format']) && $_POST['date_format'] != '') {
$this->_game_config['date_format'] = $_POST['date_format'];
}
// EXTENDED DATE
if (isset($_POST['date_format_extended']) && $_POST['date_format_extended'] != '') {
$this->_game_config['date_format_extended'] = $_POST['date_format_extended'];
}
/*
* SEVERAL PARAMETERS
*/
// PROTECTION
if (isset($_POST['adm_attack']) && $_POST['adm_attack'] == 'on') {
$this->_game_config['adm_attack'] = 1;
} else {
$this->_game_config['adm_attack'] = 0;
}
// DEBUG MODE
if (isset($_POST['debug']) && $_POST['debug'] == 'on') {
$this->_game_config['debug'] = 1;
} else {
$this->_game_config['debug'] = 0;
}
// SHIPS TO DEBRIS
if (isset($_POST['Fleet_Cdr']) && is_numeric($_POST['Fleet_Cdr'])) {
if ($_POST['Fleet_Cdr'] < 0) {
$this->_game_config['fleet_cdr'] = 0;
$Number2 = 0;
} else {
$this->_game_config['fleet_cdr'] = $_POST['Fleet_Cdr'];
$Number2 = $_POST['Fleet_Cdr'];
}
}
// DEFENSES TO DEBRIS
//.........这里部分代码省略.........
示例4: web_block
/**
* method image_block
* param $alliance_web
* return shows the web block, if any
*/
private function web_block($alliance_web)
{
if ($alliance_web != '') {
$alliance_web = Functions_Lib::prep_url($alliance_web);
$alliance_web = Functions_Lib::set_url($alliance_web, '', $alliance_web, 'target="_blank"');
} else {
$alliance_web = '-';
}
return '<tr><th>' . $this->_lang['al_web_text'] . '</th><th>' . $alliance_web . '</th></tr>';
}