本文整理汇总了PHP中template::show方法的典型用法代码示例。如果您正苦于以下问题:PHP template::show方法的具体用法?PHP template::show怎么用?PHP template::show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类template
的用法示例。
在下文中一共展示了template::show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowTopKB
/**
_ \_/ |\ | /¯¯\ \ / /\ |¯¯) |_¯ \ / /¯¯\ | | |´¯|¯` | /¯¯\ |\ |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 ShowTopKB()
{
global $USER, $PLANET, $LNG, $UNI, $db, $LANG;
$mode = request_var('mode', '');
$template = new template();
switch ($mode) {
case "showkb":
$template->isPopup(true);
$LANG->includeLang(array('FLEET'));
$ReportID = request_var('rid', '');
if (file_exists(ROOT_PATH . 'raports/topkb_' . $ReportID . '.php')) {
require_once ROOT_PATH . 'raports/topkb_' . $ReportID . '.php';
$RaportRAW = $db->uniquequery("SELECT `angreifer`, `defender` FROM " . TOPKB . " WHERE `rid` = '" . $db->sql_escape($ReportID) . "';");
}
foreach ($LNG['tech_rc'] as $id => $s_name) {
$ship[] = "[ship[" . $id . "]]";
$shipname[] = $s_name;
}
$template->assign_vars(array('attacker' => $RaportRAW['angreifer'], 'defender' => $RaportRAW['defender'], 'report' => $raport));
$template->show("topkb_report.tpl");
break;
default:
$PlanetRess = new ResourceUpdate();
$PlanetRess->CalcResource();
$PlanetRess->SavePlanetToDB();
$top = $db->query("SELECT * FROM " . TOPKB . " WHERE `universe` = '" . $UNI . "' ORDER BY gesamtunits DESC LIMIT 100;");
while ($data = $db->fetch_array($top)) {
$TopKBList[] = array('result' => $data['fleetresult'], 'time' => date(TDFORMAT, $data['time']), 'units' => pretty_number($data['gesamtunits']), 'rid' => $data['rid'], 'attacker' => $data['angreifer'], 'defender' => $data['defender'], 'result' => $data['fleetresult']);
}
$db->free_result($top);
$template->assign_vars(array('tkb_units' => $LNG['tkb_units'], 'tkb_datum' => $LNG['tkb_datum'], 'tkb_owners' => $LNG['tkb_owners'], 'tkb_platz' => $LNG['tkb_platz'], 'tkb_top' => $LNG['tkb_top'], 'tkb_gratz' => $LNG['tkb_gratz'], 'tkb_legende' => $LNG['tkb_legende'], 'tkb_gewinner' => $LNG['tkb_gewinner'], 'tkb_verlierer' => $LNG['tkb_verlierer'], 'TopKBList' => $TopKBList));
$template->show("topkb_overview.tpl");
break;
}
}
示例2: ShowFleetShortcuts
function ShowFleetShortcuts()
{
global $USER, $LNG, $db;
$a = request_var('a', '');
$mode = request_var('mode', '');
$template = new template();
$template->page_header();
$template->page_footer();
if ($mode == "add") {
if ($_POST) {
$name = request_var('n', $LNG['fl_anonymous']);
$gala = request_var('g', 0);
$sys = request_var('s', 0);
$plan = request_var('p', 0);
$type = request_var('t', 0);
$USER['fleet_shortcut'] .= $name . ',' . $gala . ',' . $sys . ',' . $plan . ',' . $type . "\r\n";
$db->query("UPDATE " . USERS . " SET `fleet_shortcut` = '" . $USER['fleet_shortcut'] . "' WHERE `id` = '" . $USER['id'] . "';");
redirectTo("game." . PHP_EXT . "?page=shortcuts");
}
$template->assign_vars(array('fl_shortcut_add_title' => $LNG['fl_shortcut_add_title'], 'fl_clean' => $LNG['fl_clean'], 'fl_register_shorcut' => $LNG['fl_register_shorcut'], 'fl_back' => $LNG['fl_back'], 'typeselector' => array(1 => $LNG['fl_planet'], 2 => $LNG['fl_debris'], 3 => $LNG['fl_moon'])));
$template->show("fleet_shortcuts_add.tpl");
} elseif (is_numeric($a)) {
$scarray = explode("\r\n", $USER['fleet_shortcut']);
$r = explode(",", $scarray[$a]);
if ($_POST) {
if ($_POST['delete']) {
unset($scarray[$a]);
} else {
$r[0] = request_var('n', '');
$r[1] = request_var('g', 0);
$r[2] = request_var('s', 0);
$r[3] = request_var('p', 0);
$r[4] = request_var('t', 0);
$scarray[$a] = implode(",", $r);
}
$USER['fleet_shortcut'] = implode("\r\n", $scarray);
$db->query("UPDATE " . USERS . " SET fleet_shortcut='" . $USER['fleet_shortcut'] . "' WHERE id=" . $USER['id'] . ";");
exit(redirectTo("game." . PHP_EXT . "?page=shortcuts"));
}
if (empty($USER['fleet_shortcut'])) {
redirectTo("game." . PHP_EXT . "?page=shortcuts");
}
$template->assign_vars(array('fl_back' => $LNG['fl_back'], 'fl_shortcut_edition' => $LNG['fl_shortcut_edition'], 'fl_reset_shortcut' => $LNG['fl_reset_shortcut'], 'fl_register_shorcut' => $LNG['fl_register_shorcut'], 'fl_dlte_shortcut' => $LNG['fl_dlte_shortcut'], 'typeselector' => array(1 => $LNG['fl_planet'], 2 => $LNG['fl_debris'], 3 => $LNG['fl_moon']), 'name' => $r[0], 'galaxy' => $r[1], 'system' => $r[2], 'planet' => $r[3], 'type' => $r[4], 'id' => $a));
$template->show("fleet_shortcuts_edit.tpl");
} else {
$scarray = explode("\r\n", $USER['fleet_shortcut']);
foreach ($scarray as $b) {
if (empty($b)) {
continue;
}
$c = explode(',', $b);
$ShortCuts[] = array('name' => $c[0], 'galaxy' => $c[1], 'system' => $c[2], 'planet' => $c[3], 'type' => $c[4]);
}
$template->assign_vars(array('ShortCuts' => $ShortCuts, 'fl_back' => $LNG['fl_back'], 'fl_planet_shortcut' => $LNG['fl_planet_shortcut'], 'fl_moon_shortcut' => $LNG['fl_moon_shortcut'], 'fl_debris_shortcut' => $LNG['fl_debris_shortcut'], 'fl_no_shortcuts' => $LNG['fl_no_shortcuts'], 'fl_shortcuts' => $LNG['fl_shortcuts'], 'fl_shortcut_add' => $LNG['fl_shortcut_add']));
$template->show("fleet_shortcuts.tpl");
}
}
示例3: ShowVertify
function ShowVertify()
{
global $CONF, $LNG;
$EXT = explode("|", HTTP::_GP("ext", ""));
$action = HTTP::_GP("action", "");
$file = HTTP::_GP("file", "");
$template = new template();
switch ($action) {
case 'check':
$REV = explode(".", Config::get("VERSION"));
$REV = $REV[2];
$ch = curl_init();
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_URL, 'http://2moons.googlecode.com/svn-history/r' . $REV . '/trunk/' . $file);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_USERAGENT, "2Moons Update API");
curl_setopt($ch, CURLOPT_CRLF, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$FILE = curl_exec($ch);
$SVNHASH = crc32(preg_replace(array("/(\r\n)|(\r)/", '/(\\/\\*[\\d\\D]*?\\*\\/)/', '/\\$I' . 'd[^\\$]+\\$/'), array("\n", '', ''), $FILE));
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == 404) {
echo 4;
exit;
}
if (curl_errno($ch)) {
echo 3;
exit;
}
curl_close($ch);
$FILE2 = file_get_contents(ROOT_PATH . $file);
$LOCALHASH = crc32(preg_replace(array("/(\r\n)|(\r)/", '/(\\/\\*[\\d\\D]*?\\*\\/)/', '/\\$I' . 'd[^\\$]+\\$/'), array("\n", '', ''), $FILE2));
if ($SVNHASH == $LOCALHASH) {
echo 1;
exit;
} else {
echo 2;
exit;
}
exit;
break;
case 'vertify':
$template->loadscript('vertify.js');
$template->show("VertifyPageResult.tpl");
exit;
break;
case 'getFileList':
echo json_encode(array_merge(dir_tree('./', $EXT, false), dir_tree('chat/', $EXT), dir_tree('includes/', $EXT), dir_tree('includes/', $EXT), dir_tree('language/', $EXT), dir_tree('scripts/', $EXT), dir_tree('styles/', $EXT)));
exit;
break;
}
$template->show("VertifyPage.tpl");
}
示例4: ShowMenuPage
/**
_ \_/ |\ | /¯¯\ \ / /\ |¯¯) |_¯ \ / /¯¯\ | | |´¯|¯` | /¯¯\ |\ |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 ShowMenuPage()
{
global $USER, $LNG, $db;
$template = new template();
$template->assign_vars(array('mu_game_info' => $LNG['mu_game_info'], 'mu_settings' => $LNG['mu_settings'], 'mu_ts_options' => $LNG['mu_ts_options'], 'mu_fb_options' => $LNG['mu_fb_options'], 'mu_module' => $LNG['mu_module'], 'mu_user_logs' => $LNG['mu_user_logs'], 'mu_optimize_db' => $LNG['mu_optimize_db'], 'mu_stats_options' => $LNG['mu_stats_options'], 'mu_chat' => $LNG['mu_chat'], 'mu_update' => $LNG['mu_update'], 'mu_general' => $LNG['mu_general'], 'new_creator_title' => $LNG['new_creator_title'], 'mu_add_delete_resources' => $LNG['mu_add_delete_resources'], 'mu_ban_options' => $LNG['mu_ban_options'], 'mu_users_settings' => $LNG['mu_users_settings'], 'mu_tools' => $LNG['mu_tools'], 'mu_manual_points_update' => $LNG['mu_manual_points_update'], 'mu_global_message' => $LNG['mu_global_message'], 'mu_md5_encripter' => $LNG['mu_md5_encripter'], 'mu_mpu_confirmation' => $LNG['mu_mpu_confirmation'], 'mu_observation' => $LNG['mu_observation'], 'mu_connected' => $LNG['mu_connected'], 'mu_support' => $LNG['mu_support'], 'mu_vaild_users' => $LNG['mu_vaild_users'], 'mu_active_planets' => $LNG['mu_active_planets'], 'mu_flying_fleets' => $LNG['mu_flying_fleets'], 'mu_news' => $LNG['mu_news'], 'mu_user_list' => $LNG['mu_user_list'], 'mu_planet_list' => $LNG['mu_planet_list'], 'mu_moon_list' => $LNG['mu_moon_list'], 'mu_mess_list' => $LNG['mu_mess_list'], 'mu_info_account_page' => $LNG['mu_info_account_page'], 'mu_multiip_page' => $LNG['mu_multiip'], 'mu_search_page' => $LNG['mu_search_page'], 'mu_mod_update' => $LNG['mu_mod_update'], 'mu_clear_cache' => $LNG['mu_clear_cache'], 'supportticks' => $db->countquery("SELECT COUNT(*) FROM " . SUPP . " WHERE `universe` = '" . $_SESSION['adminuni'] . "' AND (`status` = '1' OR `status` = '3');")));
$template->show('adm/ShowMenuPage.tpl');
}
示例5: ShowMenuPage
/**
* 2Moons
* Copyright (C) 2012 Jan Kröpke
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* 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, see <http://www.gnu.org/licenses/>.
*
* @package 2Moons
* @author Jan Kröpke <info@2moons.cc>
* @copyright 2012 Jan Kröpke <info@2moons.cc>
* @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
* @version 1.7.3 (2013-05-19)
* @info $Id: ShowMenuPage.php 2632 2013-03-18 19:05:14Z slaver7 $
* @link http://2moons.cc/
*/
function ShowMenuPage()
{
global $USER;
$template = new template();
$template->assign_vars(array('supportticks' => $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM " . TICKETS . " WHERE universe = " . $_SESSION['adminuni'] . " AND status = 0;")));
$template->show('ShowMenuPage.tpl');
}
示例6: ShowChatConfigPage
function ShowChatConfigPage()
{
global $LNG, $USER;
$CONF = Config::getAll(NULL, 1);
if (!empty($_POST)) {
$config_before = array('chat_closed' => $CONF['chat_closed'], 'chat_allowchan' => $CONF['chat_allowchan'], 'chat_allowmes' => $CONF['chat_allowmes'], 'chat_allowdelmes' => $CONF['chat_allowdelmes'], 'chat_logmessage' => $CONF['chat_logmessage'], 'chat_nickchange' => $CONF['chat_nickchange'], 'chat_botname' => $CONF['chat_botname'], 'chat_channelname' => $CONF['chat_channelname']);
$chat_allowchan = isset($_POST['chat_allowchan']) && $_POST['chat_allowchan'] == 'on' ? 1 : 0;
$chat_allowmes = isset($_POST['chat_allowmes']) && $_POST['chat_allowmes'] == 'on' ? 1 : 0;
$chat_allowdelmes = isset($_POST['chat_allowdelmes']) && $_POST['chat_allowdelmes'] == 'on' ? 1 : 0;
$chat_logmessage = isset($_POST['chat_logmessage']) && $_POST['chat_logmessage'] == 'on' ? 1 : 0;
$chat_nickchange = isset($_POST['chat_nickchange']) && $_POST['chat_nickchange'] == 'on' ? 1 : 0;
$chat_closed = isset($_POST['chat_closed']) && $_POST['chat_closed'] == 'on' ? 1 : 0;
$chat_channelname = HTTP::_GP('chat_channelname', '', true);
$chat_botname = HTTP::_GP('chat_botname', '', true);
$config_after = array('chat_closed' => $chat_closed, 'chat_allowchan' => $chat_allowchan, 'chat_allowmes' => $chat_allowmes, 'chat_allowdelmes' => $chat_allowdelmes, 'chat_logmessage' => $chat_logmessage, 'chat_nickchange' => $chat_nickchange, 'chat_botname' => $chat_botname, 'chat_channelname' => $chat_channelname);
Config::update($config_after);
$CONF = Config::getAll(NULL, 1);
$LOG = new Log(3);
$LOG->target = 3;
$LOG->old = $config_before;
$LOG->new = $config_after;
$LOG->save();
}
$template = new template();
$template->assign_vars(array('chat_closed' => $CONF['chat_closed'], 'chat_allowchan' => $CONF['chat_allowchan'], 'chat_allowmes' => $CONF['chat_allowmes'], 'chat_logmessage' => $CONF['chat_logmessage'], 'chat_nickchange' => $CONF['chat_nickchange'], 'chat_botname' => $CONF['chat_botname'], 'chat_channelname' => $CONF['chat_channelname'], 'se_server_parameters' => $LNG['se_server_parameters'], 'se_save_parameters' => $LNG['se_save_parameters'], 'ch_closed' => $LNG['ch_closed'], 'ch_allowchan' => $LNG['ch_allowchan'], 'ch_allowmes' => $LNG['ch_allowmes'], 'ch_allowdelmes' => $LNG['ch_allowdelmes'], 'ch_logmessage' => $LNG['ch_logmessage'], 'ch_nickchange' => $LNG['ch_nickchange'], 'ch_botname' => $LNG['ch_botname'], 'ch_channelname' => $LNG['ch_channelname']));
$template->show('ChatConfigBody.tpl');
}
示例7: 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');
}
示例8: ShowChatConfigPage
function ShowChatConfigPage()
{
global $LNG;
$config = Config::get(Universe::getEmulated());
if (!empty($_POST)) {
$config_before = array('chat_closed' => $config->chat_closed, 'chat_allowchan' => $config->chat_allowchan, 'chat_allowmes' => $config->chat_allowmes, 'chat_allowdelmes' => $config->chat_allowdelmes, 'chat_logmessage' => $config->chat_logmessage, 'chat_nickchange' => $config->chat_nickchange, 'chat_botname' => $config->chat_botname, 'chat_channelname' => $config->chat_channelname);
$chat_allowchan = isset($_POST['chat_allowchan']) && $_POST['chat_allowchan'] == 'on' ? 1 : 0;
$chat_allowmes = isset($_POST['chat_allowmes']) && $_POST['chat_allowmes'] == 'on' ? 1 : 0;
$chat_allowdelmes = isset($_POST['chat_allowdelmes']) && $_POST['chat_allowdelmes'] == 'on' ? 1 : 0;
$chat_logmessage = isset($_POST['chat_logmessage']) && $_POST['chat_logmessage'] == 'on' ? 1 : 0;
$chat_nickchange = isset($_POST['chat_nickchange']) && $_POST['chat_nickchange'] == 'on' ? 1 : 0;
$chat_closed = isset($_POST['chat_closed']) && $_POST['chat_closed'] == 'on' ? 1 : 0;
$chat_channelname = HTTP::_GP('chat_channelname', '', true);
$chat_botname = HTTP::_GP('chat_botname', '', true);
$config_after = array('chat_closed' => $chat_closed, 'chat_allowchan' => $chat_allowchan, 'chat_allowmes' => $chat_allowmes, 'chat_allowdelmes' => $chat_allowdelmes, 'chat_logmessage' => $chat_logmessage, 'chat_nickchange' => $chat_nickchange, 'chat_botname' => $chat_botname, 'chat_channelname' => $chat_channelname);
foreach ($config_after as $key => $value) {
$config->{$key} = $value;
}
$config->save();
$LOG = new Log(3);
$LOG->target = 3;
$LOG->old = $config_before;
$LOG->new = $config_after;
$LOG->save();
}
$template = new template();
$template->assign_vars(array('chat_closed' => $config->chat_closed, 'chat_allowchan' => $config->chat_allowchan, 'chat_allowmes' => $config->chat_allowmes, 'chat_logmessage' => $config->chat_logmessage, 'chat_nickchange' => $config->chat_nickchange, 'chat_botname' => $config->chat_botname, 'chat_channelname' => $config->chat_channelname, 'se_server_parameters' => $LNG['se_server_parameters'], 'se_save_parameters' => $LNG['se_save_parameters'], 'ch_closed' => $LNG['ch_closed'], 'ch_allowchan' => $LNG['ch_allowchan'], 'ch_allowmes' => $LNG['ch_allowmes'], 'ch_allowdelmes' => $LNG['ch_allowdelmes'], 'ch_logmessage' => $LNG['ch_logmessage'], 'ch_nickchange' => $LNG['ch_nickchange'], 'ch_botname' => $LNG['ch_botname'], 'ch_channelname' => $LNG['ch_channelname']));
$template->show('ChatConfigBody.tpl');
}
示例9: ShowOverviewPage
/**
* 2Moons
* Copyright (C) 2012 Jan Kröpke
*
* For the full copyright and license information, please view the LICENSE
*
* @package 2Moons
* @author Jan Kröpke <info@2moons.cc>
* @copyright 2012 Jan Kröpke <info@2moons.cc>
* @licence MIT
* @version 1.7.2 (2013-03-18)
* @info $Id$
* @link http://2moons.cc/
*/
function ShowOverviewPage()
{
global $LNG, $USER;
$Message = array();
if ($USER['authlevel'] >= AUTH_ADM) {
if (file_exists(ROOT_PATH . 'update.php')) {
$Message[] = sprintf($LNG['ow_file_detected'], 'update.php');
}
if (file_exists(ROOT_PATH . 'webinstall.php')) {
$Message[] = sprintf($LNG['ow_file_detected'], 'webinstall.php');
}
if (file_exists('includes/ENABLE_INSTALL_TOOL')) {
$Message[] = sprintf($LNG['ow_file_detected'], 'includes/ENABLE_INSTALL_TOOL');
}
if (!is_writable(ROOT_PATH . 'cache')) {
$Message[] = sprintf($LNG['ow_dir_not_writable'], 'cache');
}
if (!is_writable('includes')) {
$Message[] = sprintf($LNG['ow_dir_not_writable'], 'includes');
}
}
$template = new template();
$template->assign_vars(array('ow_none' => $LNG['ow_none'], 'ow_overview' => $LNG['ow_overview'], 'ow_welcome_text' => $LNG['ow_welcome_text'], 'ow_credits' => $LNG['ow_credits'], 'ow_special_thanks' => $LNG['ow_special_thanks'], 'ow_translator' => $LNG['ow_translator'], 'ow_proyect_leader' => $LNG['ow_proyect_leader'], 'ow_support' => $LNG['ow_support'], 'ow_title' => $LNG['ow_title'], 'ow_forum' => $LNG['ow_forum'], 'ow_donate' => $LNG['ow_donate'], 'Messages' => $Message, 'date' => date('m\\_Y', TIMESTAMP)));
$template->show('OverviewBody.tpl');
}
示例10: ShowRecordsPage
function ShowRecordsPage()
{
global $USER, $PLANET, $LNG, $resource, $db, $CONF, $UNI;
$PlanetRess = new ResourceUpdate();
$PlanetRess->CalcResource();
$PlanetRess->SavePlanetToDB();
$template = new template();
$Records = new records();
$RecordsArray = $Records->GetRecords($UNI);
foreach ($RecordsArray as $ElementID => $ElementIDArray) {
if ($ElementID >= 1 && $ElementID <= 39 || $ElementID == 44) {
$Builds[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
} elseif ($ElementID >= 41 && $ElementID <= 99 && $ElementID != 44) {
$MoonsBuilds[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
} elseif ($ElementID >= 101 && $ElementID <= 199) {
$Techno[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
} elseif ($ElementID >= 201 && $ElementID <= 399) {
$Fleet[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
} elseif ($ElementID >= 401 && $ElementID <= 599) {
$Defense[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
}
}
$Records = array($LNG['rec_build'] => $Builds, $LNG['rec_specb'] => $MoonsBuilds, $LNG['rec_techn'] => $Techno, $LNG['rec_fleet'] => $Fleet, $LNG['rec_defes'] => $Defense);
$template->assign_vars(array('Records' => $Records, 'update' => sprintf($LNG['rec_last_update_on'], date(TDFORMAT, $CONF['stat_last_update'])), 'level' => $LNG['rec_level'], 'player' => $LNG['rec_playe']));
$template->show("records_overview.tpl");
}
示例11: ShowInformationPage
function ShowInformationPage()
{
global $db, $LNG, $CONF;
$template = new template();
$template->assign_vars(array('info_information' => $LNG['info_information'], 'info' => $_SERVER['SERVER_SOFTWARE'], 'vPHP' => PHP_VERSION, 'vAPI' => PHP_SAPI, 'vGame' => $CONF['VERSION'], 'vMySQLc' => $db->getVersion(), 'vMySQLs' => $db->getServerVersion(), 'root' => $_SERVER['SERVER_NAME'], 'gameroot' => $_SERVER['SERVER_NAME'] . str_replace('/admin.php', '', $_SERVER['PHP_SELF']), 'json' => function_exists('json_encode') ? 'Si' : 'No', 'bcmath' => extension_loaded('bcmath') ? 'Si' : 'No', 'curl' => extension_loaded('curl') ? 'Si' : 'No', 'browser' => $_SERVER['HTTP_USER_AGENT'], 'safemode' => ini_get('safe_mode') ? 'Si' : 'No', 'memory' => ini_get('memory_limit')));
$template->show('adm/ShowInformationPage.tpl');
}
示例12: ShowDisclamerPage
function ShowDisclamerPage()
{
global $LNG, $USER;
$CONF = Config::getAll(NULL, $_SESSION['adminuni']);
if (!empty($_POST)) {
$config_before = array('disclamerAddress' => $CONF['disclamerAddress'], 'disclamerPhone' => $CONF['disclamerPhone'], 'disclamerMail' => $CONF['disclamerMail'], 'disclamerNotice' => $CONF['disclamerNotice']);
$disclamerAddress = HTTP::_GP('disclamerAddress', '', true);
$disclamerPhone = HTTP::_GP('disclamerPhone', '', true);
$disclamerMail = HTTP::_GP('disclamerMail', '', true);
$disclamerNotice = HTTP::_GP('disclamerNotice', '', true);
$config_after = array('disclamerAddress' => $disclamerAddress, 'disclamerPhone' => $disclamerPhone, 'disclamerMail' => $disclamerMail, 'disclamerNotice' => $disclamerNotice);
Config::update($config_after);
$CONF = Config::getAll(NULL, $_SESSION['adminuni']);
$LOG = new Log(3);
$LOG->target = 5;
$LOG->old = $config_before;
$LOG->new = $config_after;
$LOG->save();
}
$template = new template();
$template->loadscript('../base/jquery.autosize-min.js');
$template->execscript('$(\'textarea\').autosize();');
$template->assign_vars(array('disclamerAddress' => $CONF['disclamerAddress'], 'disclamerPhone' => $CONF['disclamerPhone'], 'disclamerMail' => $CONF['disclamerMail'], 'disclamerNotice' => $CONF['disclamerNotice'], 'se_server_parameters' => $LNG['mu_disclamer'], 'se_save_parameters' => $LNG['se_save_parameters'], 'se_disclamerAddress' => $LNG['se_disclamerAddress'], 'se_disclamerPhone' => $LNG['se_disclamerPhone'], 'se_disclamerMail' => $LNG['se_disclamerMail'], 'se_disclamerNotice' => $LNG['se_disclamerNotice']));
$template->show('DisclamerConfigBody.tpl');
}
示例13: ShowFleetTraderPage
/**
_ \_/ |\ | /¯¯\ \ / /\ |¯¯) |_¯ \ / /¯¯\ | | |´¯|¯` | /¯¯\ |\ |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 ShowFleetTraderPage()
{
global $USER, $PLANET, $LNG, $CONF, $pricelist, $resource;
$PlanetRess = new ResourceUpdate();
$PlanetRess->CalcResource();
$CONF['trade_allowed_ships'] = explode(',', $CONF['trade_allowed_ships']);
$ID = request_var('id', 0);
if (!empty($ID) && in_array($ID, $CONF['trade_allowed_ships'])) {
$Count = max(min(request_var('count', '0'), $PLANET[$resource[$ID]]), 0);
$PLANET['metal'] = bcadd($PLANET['metal'], bcmul($Count, bcmul($pricelist[$ID]['metal'], (double) (1 - $CONF['trade_charge']))));
$PLANET['crystal'] = bcadd($PLANET['crystal'], bcmul($Count, bcmul($pricelist[$ID]['crystal'], (double) (1 - $CONF['trade_charge']))));
$PLANET['deuterium'] = bcadd($PLANET['deuterium'], bcmul($Count, bcmul($pricelist[$ID]['deuterium'], (double) (1 - $CONF['trade_charge']))));
$PLANET['norio'] = bcadd($PLANET['norio'], bcmul($Count, bcmul($pricelist[$ID]['norio'], (double) (1 - $CONF['trade_charge']))));
$USER['darkmatter'] = bcadd($USER['darkmatter'], bcmul($Count, bcmul($pricelist[$ID]['darkmatter'], (double) (1 - $CONF['trade_charge']))));
$PlanetRess->Builded[$ID] = bcadd(bcmul('-1', $Count), $PlanetRess->Builded[$ID]);
}
$PlanetRess->SavePlanetToDB();
$template = new template();
$template->loadscript('fleettrader.js');
$template->execscript('updateVars();');
$Cost = array();
foreach ($CONF['trade_allowed_ships'] as $ID) {
$Cost[$ID] = array($PLANET[$resource[$ID]], $pricelist[$ID]['metal'], $pricelist[$ID]['crystal'], $pricelist[$ID]['deuterium'], $pricelist[$ID]['darkmatter'], $pricelist[$ID]['norio']);
}
$template->assign_vars(array('tech' => $LNG['tech'], 'ft_head' => $LNG['ft_head'], 'ft_count' => $LNG['ft_count'], 'ft_max' => $LNG['ft_max'], 'ft_total' => $LNG['ft_total'], 'ft_charge' => $LNG['ft_charge'], 'ft_absenden' => $LNG['ft_absenden'], 'trade_allowed_ships' => $CONF['trade_allowed_ships'], 'CostInfos' => json_encode($Cost), 'Charge' => $CONF['trade_charge']));
$template->show("fleettrader_overview.tpl");
}
示例14: ShowFleetsConfPage
function ShowFleetsConfPage()
{
global $LNG;
$CONF = Config::getAll(NULL, 1);
if (!empty($_POST)) {
$pay_before = array('fleetconf' => $CONF['fleetconf']);
$fleetconf = TIMESTAMP + $_POST['days'] * 24 * 60 * 60;
$pay_after = array('fleetconf' => $fleetconf);
Config::update($pay_after, 1);
$CONF = Config::getAll(NULL, 1);
$LOG = new Log(3);
$LOG->target = 1;
$LOG->old = $pay_before;
$LOG->new = $pay_after;
$LOG->save();
require_once 'includes/functions/BBCode.php';
$Time = TIMESTAMP;
$Message = '<span class="admin">All promotional fleets and defence have been unlocked until ' . date("d.m.Y - H:i:s", $CONF['fleetconf']) . '. - <a href="?page=shipyard&mode=fleet">Fleet</a> - <a href="?page=shipyard&mode=defence">Defence</a>';
$From = '<span class="admin">"Antimatter"</span>';
$pmSubject = '<span class="admin">"Purchase Bonus"</span>';
$pmMessage = '<span class="admin">' . bbcode($Message) . '</span>';
$USERS = $GLOBALS['DATABASE']->query("SELECT `id`, `username` FROM " . USERS . " WHERE `universe` = '1';");
while ($UserData = $GLOBALS['DATABASE']->fetch_array($USERS)) {
$sendMessage = str_replace('{USERNAME}', $UserData['username'], $pmMessage);
SendSimpleMessage($UserData['id'], $USER['id'], TIMESTAMP, 50, $From, $pmSubject, $sendMessage);
}
}
$template = new template();
$template->assign_vars(array('fleetconf' => $CONF['fleetconf'], 'bonus_next_active' => $CONF['fleetconf'] > TIMESTAMP ? $CONF['fleetconf'] - TIMESTAMP : 0, 'bonus_next_active_timer' => $CONF['fleetconf'] > TIMESTAMP ? date("d.m.Y H:i:s", $CONF['fleetconf']) : 0));
$template->show('fleetconf.tpl');
}
示例15: ShowDisclamerPage
function ShowDisclamerPage()
{
global $LNG;
$config = Config::get(Universe::getEmulated());
if (!empty($_POST)) {
$config_before = array('disclamerAddress' => $config->disclamerAddress, 'disclamerPhone' => $config->disclamerPhone, 'disclamerMail' => $config->disclamerMail, 'disclamerNotice' => $config->disclamerNotice);
$disclaimerAddress = HTTP::_GP('disclaimerAddress', '', true);
$disclaimerPhone = HTTP::_GP('disclaimerPhone', '', true);
$disclaimerMail = HTTP::_GP('disclaimerMail', '', true);
$disclaimerNotice = HTTP::_GP('disclaimerNotice', '', true);
$config_after = array('disclamerAddress' => $disclaimerAddress, 'disclamerPhone' => $disclaimerPhone, 'disclamerMail' => $disclaimerMail, 'disclamerNotice' => $disclaimerNotice);
foreach ($config_after as $key => $value) {
$config->{$key} = $value;
}
$config->save();
$LOG = new Log(3);
$LOG->target = 5;
$LOG->old = $config_before;
$LOG->new = $config_after;
$LOG->save();
}
$template = new template();
$template->loadscript('../base/jquery.autosize-min.js');
$template->execscript('$(\'textarea\').autosize();');
$template->assign_vars(array('disclaimerAddress' => $config->disclamerAddress, 'disclaimerPhone' => $config->disclamerPhone, 'disclaimerMail' => $config->disclamerMail, 'disclaimerNotice' => $config->disclamerNotice, 'se_server_parameters' => $LNG['mu_disclaimer'], 'se_save_parameters' => $LNG['se_save_parameters'], 'se_disclaimerAddress' => $LNG['se_disclaimerAddress'], 'se_disclaimerPhone' => $LNG['se_disclaimerPhone'], 'se_disclaimerMail' => $LNG['se_disclaimerMail'], 'se_disclaimerNotice' => $LNG['se_disclaimerNotice']));
$template->show('DisclamerConfigBody.tpl');
}