当前位置: 首页>>代码示例>>PHP>>正文


PHP template::assign_vars方法代码示例

本文整理汇总了PHP中template::assign_vars方法的典型用法代码示例。如果您正苦于以下问题:PHP template::assign_vars方法的具体用法?PHP template::assign_vars怎么用?PHP template::assign_vars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在template的用法示例。


在下文中一共展示了template::assign_vars方法的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;
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:51,代码来源:ShowTopKB.php

示例2: ShowNewsPage

function ShowNewsPage()
{
    global $LNG, $USER;
    if ($_GET['action'] == 'send') {
        $edit_id = HTTP::_GP('id', 0);
        $title = $GLOBALS['DATABASE']->sql_escape(HTTP::_GP('title', '', true));
        $text = $GLOBALS['DATABASE']->sql_escape(HTTP::_GP('text', '', true));
        $query = $_GET['mode'] == 2 ? "INSERT INTO " . NEWS . " (`id` ,`user` ,`date` ,`title` ,`text`) VALUES ( NULL , '" . $USER['username'] . "', '" . TIMESTAMP . "', '" . $title . "', '" . $text . "');" : "UPDATE " . NEWS . " SET `title` = '" . $title . "', `text` = '" . $text . "', `date` = '" . TIMESTAMP . "' WHERE `id` = '" . $edit_id . "' LIMIT 1;";
        $GLOBALS['DATABASE']->query($query);
    } elseif ($_GET['action'] == 'delete' && isset($_GET['id'])) {
        $GLOBALS['DATABASE']->query("DELETE FROM " . NEWS . " WHERE `id` = '" . HTTP::_GP('id', 0) . "';");
    }
    $query = $GLOBALS['DATABASE']->query("SELECT * FROM " . NEWS . " ORDER BY id ASC");
    while ($u = $GLOBALS['DATABASE']->fetch_array($query)) {
        $NewsList[] = array('id' => $u['id'], 'title' => $u['title'], 'date' => _date($LNG['php_tdformat'], $u['date'], $USER['timezone']), 'user' => $u['user'], 'confirm' => sprintf($LNG['nws_confirm'], $u['title']));
    }
    $template = new template();
    if ($_GET['action'] == 'edit' && isset($_GET['id'])) {
        $News = $GLOBALS['DATABASE']->getFirstRow("SELECT id, title, text FROM " . NEWS . " WHERE id = '" . $GLOBALS['DATABASE']->sql_escape($_GET['id']) . "';");
        $template->assign_vars(array('mode' => 1, 'nws_head' => sprintf($LNG['nws_head_edit'], $News['title']), 'news_id' => $News['id'], 'news_title' => $News['title'], 'news_text' => $News['text']));
    } elseif ($_GET['action'] == 'create') {
        $template->assign_vars(array('mode' => 2, 'nws_head' => $LNG['nws_head_create']));
    }
    $template->assign_vars(array('NewsList' => $NewsList, 'button_submit' => $LNG['button_submit'], 'nws_total' => sprintf($LNG['nws_total'], count($NewsList)), 'nws_news' => $LNG['nws_news'], 'nws_id' => $LNG['nws_id'], 'nws_title' => $LNG['nws_title'], 'nws_date' => $LNG['nws_date'], 'nws_from' => $LNG['nws_from'], 'nws_del' => $LNG['nws_del'], 'nws_create' => $LNG['nws_create'], 'nws_content' => $LNG['nws_content']));
    $template->show('NewsPage.tpl');
}
开发者ID:tatarysh,项目名称:2Moons,代码行数:26,代码来源:ShowNewsPage.php

示例3: 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");
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:57,代码来源:ShowFleetShortcuts.php

示例4: ShowTeamspeakPage

function ShowTeamspeakPage()
{
    global $LNG;
    $config = Config::get(Universe::getEmulated());
    if ($_POST) {
        $config_before = array('ts_timeout' => $config->ts_timeout, 'ts_modon' => $config->ts_modon, 'ts_server' => $config->ts_server, 'ts_tcpport' => $config->ts_tcpport, 'ts_udpport' => $config->ts_udpport, 'ts_version' => $config->ts_version, 'ts_login' => $config->ts_login, 'ts_password' => $config->ts_password, 'ts_cron_interval' => $config->ts_cron_interval);
        $ts_modon = isset($_POST['ts_on']) && $_POST['ts_on'] == 'on' ? 1 : 0;
        $ts_server = HTTP::_GP('ts_ip', '');
        $ts_tcpport = HTTP::_GP('ts_tcp', 0);
        $ts_udpport = HTTP::_GP('ts_udp', 0);
        $ts_timeout = HTTP::_GP('ts_to', 0);
        $ts_version = HTTP::_GP('ts_v', 0);
        $ts_login = HTTP::_GP('ts_login', '');
        $ts_password = HTTP::_GP('ts_password', '', true);
        $ts_cron_interval = HTTP::_GP('ts_cron', 0);
        $config_after = array('ts_timeout' => $ts_timeout, 'ts_modon' => $ts_modon, 'ts_server' => $ts_server, 'ts_tcpport' => $ts_tcpport, 'ts_udpport' => $ts_udpport, 'ts_version' => $ts_version, 'ts_login' => $ts_login, 'ts_password' => $ts_password, 'ts_cron_interval' => $ts_cron_interval);
        foreach ($config_after as $key => $value) {
            $config->{$key} = $value;
        }
        $config->save();
        $sql = "UPDATE %%CRONJOBS%%\n\t\tSET isActive = :isActive, `lock` = NULL, nextTime = 0\n\t\tWHERE name = 'teamspeak';";
        Database::get()->update($sql, array(':isActive' => $ts_modon));
        $LOG = new Log(3);
        $LOG->target = 4;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $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' => $config->ts_timeout, 'ts_on' => $config->ts_modon, 'ts_ip' => $config->ts_server, 'ts_tcp' => $config->ts_tcpport, 'ts_udp' => $config->ts_udpport, 'ts_v' => $config->ts_version, 'ts_login' => $config->ts_login, 'ts_password' => $config->ts_password, 'ts_cron' => $config->ts_cron_interval));
    $template->show('TeamspeakPage.tpl');
}
开发者ID:bergi9,项目名称:2Moons,代码行数:32,代码来源:ShowTeamspeakPage.php

示例5: ShowSendMessagesPage

function ShowSendMessagesPage()
{
    global $USER, $LNG, $db;
    if ($_GET['mode'] == 'send') {
        switch ($USER['authlevel']) {
            case AUTH_MOD:
                $color = 'yellow';
                break;
            case AUTH_OPS:
                $color = 'skyblue';
                break;
            case AUTH_ADM:
                $color = 'red';
                break;
        }
        $Subject = makebr(request_var('subject', '', true));
        $Message = makebr(request_var('text', '', true));
        if (!empty($Message) && !empty($Subject)) {
            require_once ROOT_PATH . 'includes/functions/BBCode.php';
            $Time = TIMESTAMP;
            $From = '<span style="color:' . $color . ';">' . $LNG['user_level'][$USER['authlevel']] . ' ' . $USER['username'] . '</span>';
            $Subject = '<span style="color:' . $color . ';">' . $Subject . '</span>';
            $Message = '<span style="color:' . $color . ';font-weight:bold;">' . bbcode($Message) . '</span>';
            SendSimpleMessage(0, $USER['id'], TIMESTAMP, 50, $From, $Subject, $Message, 0, $_SESSION['adminuni']);
            $db->query("UPDATE " . USERS . " SET `new_gmessage` = `new_gmessage` + '1', `new_message` = `new_message` + '1' WHERE `universe` = '" . $_SESSION['adminuni'] . "';");
            exit($LNG['ma_message_sended']);
        } else {
            exit($LNG['ma_subject_needed']);
        }
    }
    $template = new template();
    $template->assign_vars(array('mg_empty_text' => $LNG['mg_empty_text'], 'ma_subject' => $LNG['ma_subject'], 'ma_none' => $LNG['ma_none'], 'ma_message' => $LNG['ma_message'], 'ma_send_global_message' => $LNG['ma_send_global_message'], 'ma_characters' => $LNG['ma_characters'], 'button_submit' => $LNG['button_submit']));
    $template->show('adm/SendMessagesPage.tpl');
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:34,代码来源:ShowSendMessagesPage.php

示例6: ShowMultiIPPage

function ShowMultiIPPage()
{
    global $LNG;
    switch ($_GET['action']) {
        case 'known':
            $GLOBALS['DATABASE']->query("INSERT INTO " . MULTI . " SET userID = " . (int) $_GET['id'] . ";");
            HTTP::redirectTo("admin.php?page=multiips");
            break;
        case 'unknown':
            $GLOBALS['DATABASE']->query("DELETE FROM " . MULTI . " WHERE userID = " . (int) $_GET['id'] . ";");
            HTTP::redirectTo("admin.php?page=multiips");
            break;
    }
    $Query = $GLOBALS['DATABASE']->query("SELECT id, username, email, register_time, onlinetime, user_lastip, IFNULL(multiID, 0) as isKnown FROM " . USERS . " LEFT JOIN " . MULTI . " ON userID = id WHERE `universe` = '" . Universe::getEmulated() . "' AND user_lastip IN (SELECT user_lastip FROM " . USERS . " WHERE `universe` = '" . Universe::getEmulated() . "' GROUP BY user_lastip HAVING COUNT(*)>1) ORDER BY user_lastip, id ASC;");
    $IPs = array();
    while ($Data = $GLOBALS['DATABASE']->fetch_array($Query)) {
        if (!isset($IPs[$Data['user_lastip']])) {
            $IPs[$Data['user_lastip']] = array();
        }
        $Data['register_time'] = _date($LNG['php_tdformat'], $Data['register_time']);
        $Data['onlinetime'] = _date($LNG['php_tdformat'], $Data['onlinetime']);
        $IPs[$Data['user_lastip']][$Data['id']] = $Data;
    }
    $template = new template();
    $template->assign_vars(array('multiGroups' => $IPs));
    $template->show('MultiIPs.tpl');
}
开发者ID:tatarysh,项目名称:2Moons,代码行数:27,代码来源:ShowMultiIPPage.php

示例7: ShowVoucherPage

function ShowVoucherPage()
{
    global $LNG, $USER;
    $template = new template();
    if ($_GET['mode'] == 'delete' && !empty($_GET['i'])) {
        //delete an entry
        $GLOBALS['DATABASE']->query("DELETE from `uni1_reward` where `rewardId` = " . $GLOBALS['DATABASE']->sql_escape($_GET['i']) . " ;");
        $template->message("Voucher Code deleted");
        die;
    }
    if ($_POST) {
        $SQL = "";
        foreach ($_POST as $key => $value) {
            $SQL .= "'" . $value . "',";
        }
        $SQL = substr($SQL, 0, -1);
        $GLOBALS['DATABASE']->query("INSERT INTO `uni1_reward` VALUES (NULL," . $SQL . ");");
        $template->message("Voucher Added");
        die;
    }
    $AllVouchers = array();
    $GetAll = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_reward` ;");
    if ($GLOBALS['DATABASE']->numRows($GetAll) > 0) {
        while ($x = $GLOBALS['DATABASE']->fetch_array($GetAll)) {
            $AllVouchers[] = $x;
        }
    }
    $template->assign_vars(array('AllVouchers' => $AllVouchers));
    $template->show('VoucherEditor.tpl');
}
开发者ID:Decoder1978,项目名称:Xterium,代码行数:30,代码来源:ShowVoucherPage.php

示例8: ShowFlyingFleetPage

function ShowFlyingFleetPage()
{
    global $LNG;
    $id = HTTP::_GP('id', 0);
    if (!empty($id)) {
        $lock = HTTP::_GP('lock', 0);
        $GLOBALS['DATABASE']->query("UPDATE " . FLEETS . " SET `fleet_busy` = '" . $lock . "' WHERE `fleet_id` = '" . $id . "' AND `fleet_universe` = '" . Universe::getEmulated() . "';");
        $SQL = $lock == 0 ? "NULL" : "'ADM_LOCK'";
        $GLOBALS['DATABASE']->query("UPDATE " . FLEETS_EVENT . " SET `lock` = " . $SQL . " WHERE `fleetID` = " . $id . ";");
    }
    $orderBy = "fleet_id";
    $fleetResult = $GLOBALS['DATABASE']->query("SELECT \n\tfleet.*,\n\tevent.`lock`,\n\tCOUNT(event.fleetID) as error,\n\tpstart.name as startPlanetName,\n\tptarget.name as targetPlanetName,\n\tustart.username as startUserName,\n\tutarget.username as targetUserName,\n\tacs.name as acsName\n\tFROM " . FLEETS . " fleet\n\tLEFT JOIN " . FLEETS_EVENT . " event ON fleetID = fleet_id\n\tLEFT JOIN " . PLANETS . " pstart ON pstart.id = fleet_start_id\n\tLEFT JOIN " . PLANETS . " ptarget ON ptarget.id = fleet_end_id\n\tLEFT JOIN " . USERS . " ustart ON ustart.id = fleet_owner\n\tLEFT JOIN " . USERS . " utarget ON utarget.id = fleet_target_owner\n\tLEFT JOIN " . AKS . " acs ON acs.id = fleet_group\n\tWHERE fleet_universe = " . Universe::getEmulated() . "\n\tGROUP BY event.fleetID\n\tORDER BY " . $orderBy . ";");
    $FleetList = array();
    while ($fleetRow = $GLOBALS['DATABASE']->fetch_array($fleetResult)) {
        $shipList = array();
        $shipArray = array_filter(explode(';', $fleetRow['fleet_array']));
        foreach ($shipArray as $ship) {
            $shipDetail = explode(',', $ship);
            $shipList[$shipDetail[0]] = $shipDetail[1];
        }
        $FleetList[] = array('fleetID' => $fleetRow['fleet_id'], 'lock' => !empty($fleetRow['lock']), 'count' => $fleetRow['fleet_amount'], 'error' => !$fleetRow['error'], 'ships' => $shipList, 'state' => $fleetRow['fleet_mess'], 'starttime' => _date($LNG['php_tdformat'], $fleetRow['start_time'], $USER['timezone']), 'arrivaltime' => _date($LNG['php_tdformat'], $fleetRow['fleet_start_time'], $USER['timezone']), 'stayhour' => round(($fleetRow['fleet_end_stay'] - $fleetRow['fleet_start_time']) / 3600), 'staytime' => $fleetRow['fleet_start_time'] !== $fleetRow['fleet_end_stay'] ? _date($LNG['php_tdformat'], $fleetRow['fleet_end_stay'], $USER['timezone']) : 0, 'endtime' => _date($LNG['php_tdformat'], $fleetRow['fleet_end_time'], $USER['timezone']), 'missionID' => $fleetRow['fleet_mission'], 'acsID' => $fleetRow['fleet_group'], 'acsName' => $fleetRow['acsName'], 'startUserID' => $fleetRow['fleet_owner'], 'startUserName' => $fleetRow['startUserName'], 'startPlanetID' => $fleetRow['fleet_start_id'], 'startPlanetName' => $fleetRow['startPlanetName'], 'startPlanetGalaxy' => $fleetRow['fleet_start_galaxy'], 'startPlanetSystem' => $fleetRow['fleet_start_system'], 'startPlanetPlanet' => $fleetRow['fleet_start_planet'], 'startPlanetType' => $fleetRow['fleet_start_type'], 'targetUserID' => $fleetRow['fleet_target_owner'], 'targetUserName' => $fleetRow['targetUserName'], 'targetPlanetID' => $fleetRow['fleet_end_id'], 'targetPlanetName' => $fleetRow['targetPlanetName'], 'targetPlanetGalaxy' => $fleetRow['fleet_end_galaxy'], 'targetPlanetSystem' => $fleetRow['fleet_end_system'], 'targetPlanetPlanet' => $fleetRow['fleet_end_planet'], 'targetPlanetType' => $fleetRow['fleet_end_type'], 'resource' => array(901 => $fleetRow['fleet_resource_metal'], 902 => $fleetRow['fleet_resource_crystal'], 903 => $fleetRow['fleet_resource_deuterium'], 921 => $fleetRow['fleet_resource_darkmatter']));
    }
    $GLOBALS['DATABASE']->free_result($fleetResult);
    $template = new template();
    $template->assign_vars(array('FleetList' => $FleetList));
    $template->show('FlyingFleetPage.tpl');
}
开发者ID:tatarysh,项目名称:2Moons,代码行数:27,代码来源:ShowFlyingFleetPage.php

示例9: 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");
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:26,代码来源:ShowRecordsPage.php

示例10: 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');
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:7,代码来源:ShowInformationPage.php

示例11: 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');
}
开发者ID:fuding,项目名称:Antaris,代码行数:25,代码来源:ShowDisclamerPage.php

示例12: 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");
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:43,代码来源:ShowFleetTraderPage.php

示例13: 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');
}
开发者ID:Decoder1978,项目名称:Xterium,代码行数:31,代码来源:ShowFleetsConfPage.php

示例14: 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');
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:23,代码来源:ShowMenuPage.php

示例15: ShowIndexPage

/**
 _  \_/ |\ | /¯¯\ \  / /\    |¯¯) |_¯ \  / /¯¯\ |  |   |´¯|¯` | /¯¯\ |\ |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 ShowIndexPage()
{
    global $CONF, $LNG;
    $template = new template();
    $template->assign_vars(array('game_name' => $CONF['game_name'], 'adm_cp_title' => $LNG['adm_cp_title']));
    $template->display('adm/ShowIndexPage.tpl');
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:23,代码来源:ShowIndexPage.php


注:本文中的template::assign_vars方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。