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


PHP Config::getAll方法代码示例

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


在下文中一共展示了Config::getAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CreateOnePlanetRecord

/**
 *  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: CreateOnePlanetRecord.php 2640 2013-03-23 19:23:26Z slaver7 $
 * @link http://2moons.cc/
 */
function CreateOnePlanetRecord($Galaxy, $System, $Position, $Universe, $PlanetOwnerID, $PlanetName, $HomeWorld = false, $AuthLevel = 0, $Iron, $Gold, $Crystal, $Elyrium, $iPlanetCount)
{
    global $LNG;
    $CONF = Config::getAll(NULL, $Universe);
    if (Config::get('max_galaxy') < $Galaxy || 1 > $Galaxy) {
        throw new Exception("Access denied for CreateOnePlanetRecord.php.<br>Try to create a planet at position:" . $Galaxy . ":" . $System . ":" . $Position);
    }
    if (Config::get('max_system') < $System || 1 > $System) {
        throw new Exception("Access denied for CreateOnePlanetRecord.php.<br>Try to create a planet at position:" . $Galaxy . ":" . $System . ":" . $Position);
    }
    if (Config::get('max_planets') < $Position || 1 > $Position) {
        throw new Exception("Access denied for CreateOnePlanetRecord.php.<br>Try to create a planet at position:" . $Galaxy . ":" . $System . ":" . $Position);
    }
    if (CheckPlanetIfExist($Galaxy, $System, $Position, $Universe)) {
        return false;
    }
    $tp = 0;
    if ($iPlanetCount >= 3) {
        $tp = 1;
    }
    $FieldFactor = Config::get('planet_factor');
    require 'includes/PlanetData.php';
    $Pos = ceil($Position / (Config::get('max_planets') / count($PlanetData)));
    $TMax = $PlanetData[$Pos]['temp'];
    $TMin = $TMax - 40;
    $Fields = $PlanetData[$Pos]['fields'] * Config::get('planet_factor');
    $Types = $PlanetData[$Pos]['image'];
    $Name = !empty($PlanetName) ? $GLOBALS['DATABASE']->sql_escape($PlanetName) : $LNG['type_planet'][1];
    $GLOBALS['DATABASE']->query("INSERT INTO " . PLANETS . " SET\n\t\t\t\tname = '" . $Name . "',\n\t\t\t\tuniverse = " . $Universe . ",\n\t\t\t\tid_owner = " . $PlanetOwnerID . ",\n\t\t\t\tgalaxy = " . $Galaxy . ",\n\t\t\t\tsystem = " . $System . ",\n\t\t\t\tplanet = " . $Position . ",\n\t\t\t\tlast_update = " . TIMESTAMP . ",\n\t\t\t\tplanet_type = '1',\n\t\t\t\tcolo_metal = " . $Iron . ",\n\t\t\t\tcolo_crystal = " . $Gold . ",\n\t\t\t\tcolo_deut = " . $Crystal . ",\n\t\t\t\tcolo_elyrium = " . $Elyrium . ",\n\t\t\t\tteleport_portal = " . $tp . ",\n\t\t\t\timage = '" . $Types . "',\n\t\t\t\tdiameter = " . floor(1000 * sqrt($Fields)) . ",\n\t\t\t\tfield_max = " . ($HomeWorld ? Config::get('initial_fields') : floor($Fields)) . ",\n\t\t\t\ttemp_min = " . $TMin . ",\n\t\t\t\ttemp_max = " . $TMax . ",\n\t\t\t\tmetal = " . Config::get('metal_start') . ",\n\t\t\t\tmetal_perhour = " . Config::get('metal_basic_income') . ",\n\t\t\t\tcrystal = " . Config::get('crystal_start') . ",\n\t\t\t\tcrystal_perhour = " . Config::get('crystal_basic_income') . ",\n\t\t\t\tdeuterium = " . Config::get('deuterium_start') . ",\n\t\t\t\tdeuterium_perhour = " . Config::get('deuterium_basic_income') . ",\n\t\t\t\telyrium = " . Config::get('deuterium_start') . ",\n\t\t\t\telyrium_perhour = " . Config::get('deuterium_basic_income') . ";");
    return $GLOBALS['DATABASE']->GetInsertID();
}
开发者ID:fuding,项目名称:Antaris,代码行数:56,代码来源:CreateOnePlanetRecord.php

示例2: 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

示例3: 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

示例4: run

 function run()
 {
     $CONF = Config::getAll(NULL, ROOT_UNI);
     if ($CONF['birthday_event'] < TIMESTAMP) {
         $totalPremiums = $GLOBALS['DATABASE']->query("SELECT `id`, `lang` FROM " . USERS . " WHERE date_of_birth < " . TIMESTAMP . " AND date_of_birth != '0' AND year = '2015';");
         $langObjects = array();
         while ($xy = $GLOBALS['DATABASE']->fetch_array($totalPremiums)) {
             if (!isset($langObjects[$xy['lang']])) {
                 $langObjects[$xy['lang']] = new Language($xy['lang']);
                 $langObjects[$xy['lang']]->includeData(array('L18N', 'INGAME', 'TECH', 'CUSTOM'));
             }
             $LNG = $langObjects[$xy['lang']];
             $message = '<div class="citation">
     <div class="guillemet ouvrir">«</div>
     <div class="guillemet fermer">»</div>
     <ul style="text-align : left;">
     ' . $LNG['ls_eventcron_12'] . '
     </ul>
 </div>';
             SendSimpleMessage($xy['id'], 0, TIMESTAMP, 7, sprintf($LNG['ls_eventcron_10'], $this->getUsernames($xy['id'])), $LNG['ls_eventcron_11'], $message);
             $GLOBALS['DATABASE']->query("UPDATE " . USERS . " SET year = '2016' where `id` = '" . $xy['id'] . "';");
         }
         $newevkaka = TIMESTAMP + 5 * 60;
         $GLOBALS['DATABASE']->query("UPDATE " . CONFIG . " SET birthday_event = '" . $newevkaka . "' where `uni` = '" . $UNI . "';");
     }
 }
开发者ID:fuding,项目名称:Antaris,代码行数:26,代码来源:BirthdayCronJob.class.php

示例5: run

 function run()
 {
     $CONF = Config::getAll(NULL, ROOT_UNI);
     $unis = array_keys(Config::getAll(NULL));
     $GLOBALS['DATABASE']->query("LOCK TABLES " . ALLIANCE . " WRITE, " . ALLIANCE_REQUEST . " WRITE,\n\t\t\t\t\t\t\t\t\t" . BUDDY . " WRITE, " . CONFIG . " WRITE, " . FLEETS . " WRITE, " . FLEETS_EVENT . " WRITE, \n\t\t\t\t\t\t\t\t\t" . NOTES . " WRITE, " . MESSAGES . " WRITE, " . PLANETS . " WRITE, \n\t\t\t\t\t\t\t\t\t" . RW . " WRITE, " . SESSION . " WRITE, " . STATPOINTS . " WRITE, \n\t\t\t\t\t\t\t\t\t" . TOPKB . " WRITE, " . TOPKB_USERS . " WRITE, " . USERS . " WRITE;");
     //Delete old messages
     $del_before = TIMESTAMP - $CONF['del_oldstuff'] * 86400;
     $del_inactive = TIMESTAMP - $CONF['del_user_automatic'] * 86400;
     $del_deleted = TIMESTAMP - $CONF['del_user_manually'] * 86400;
     $GLOBALS['DATABASE']->multi_query("DELETE FROM " . MESSAGES . " WHERE `message_time` < '" . $del_before . "';\n\t\t\t\t\t\t  DELETE FROM " . ALLIANCE . " WHERE `ally_members` = '0';\n\t\t\t\t\t\t  DELETE FROM " . PLANETS . " WHERE `destruyed` < " . TIMESTAMP . " AND `destruyed` != 0;\n\t\t\t\t\t\t  DELETE FROM " . SESSION . " WHERE `lastonline` < '" . (TIMESTAMP - SESSION_LIFETIME) . "';\n\t\t\t\t\t\t  DELETE FROM " . FLEETS_EVENT . " WHERE fleetID NOT IN (SELECT fleet_id FROM " . FLEETS . ");\n\t\t\t\t\t\t  UPDATE " . USERS . " SET `email_2` = `email` WHERE `setmail` < '" . TIMESTAMP . "';");
     $ChooseToDelete = $GLOBALS['DATABASE']->query("SELECT `id` FROM `" . USERS . "` WHERE `authlevel` = '" . AUTH_USR . "' AND ((`db_deaktjava` != 0 AND `db_deaktjava` < '" . $del_deleted . "')" . ($del_inactive == TIMESTAMP ? "" : " OR `onlinetime` < '" . $del_inactive . "'") . ");");
     if (isset($ChooseToDelete)) {
         include_once 'includes/functions/DeleteSelectedUser.php';
         while ($delete = $GLOBALS['DATABASE']->fetch_array($ChooseToDelete)) {
             DeleteSelectedUser($delete['id']);
         }
     }
     $GLOBALS['DATABASE']->free_result($ChooseToDelete);
     foreach ($unis as $uni) {
         $battleHallLowest = $GLOBALS['DATABASE']->getFirstCell("SELECT units FROM " . TOPKB . " WHERE `universe` = " . $uni . " ORDER BY units DESC LIMIT 99,1;");
         if (isset($battleHallLowest)) {
             $GLOBALS['DATABASE']->query("DELETE " . TOPKB . ", " . TOPKB_USERS . " FROM " . TOPKB . " INNER JOIN " . TOPKB_USERS . " USING (rid) WHERE `universe` = " . $uni . " AND `units` < " . $battleHallLowest . ";");
         }
     }
     $GLOBALS['DATABASE']->query("DELETE FROM " . RW . " WHERE `time` < " . $del_before . " AND `rid` NOT IN (SELECT `rid` FROM " . TOPKB . ");");
     $GLOBALS['DATABASE']->query("UNLOCK TABLES;");
 }
开发者ID:fuding,项目名称:Antaris,代码行数:27,代码来源:CleanerCronjob.class.php

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

示例7: CreateOnePlanetRecord

/**
 *  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: CreateOnePlanetRecord.php 2640 2013-03-23 19:23:26Z slaver7 $
 * @link http://2moons.cc/
 */
function CreateOnePlanetRecord($Galaxy, $System, $Position, $Universe, $PlanetOwnerID, $PlanetName = '', $HomeWorld = false, $AuthLevel = 0)
{
    global $LNG;
    $CONF = Config::getAll(NULL, $Universe);
    if (Config::get('max_galaxy') < $Galaxy || 1 > $Galaxy) {
        throw new Exception("Access denied for CreateOnePlanetRecord.php.<br>Try to create a planet at position:" . $Galaxy . ":" . $System . ":" . $Position);
    }
    if (Config::get('max_system') < $System || 1 > $System) {
        throw new Exception("Access denied for CreateOnePlanetRecord.php.<br>Try to create a planet at position:" . $Galaxy . ":" . $System . ":" . $Position);
    }
    if (Config::get('max_planets') < $Position || 1 > $Position) {
        throw new Exception("Access denied for CreateOnePlanetRecord.php.<br>Try to create a planet at position:" . $Galaxy . ":" . $System . ":" . $Position);
    }
    if (CheckPlanetIfExist($Galaxy, $System, $Position, $Universe)) {
        return false;
    }
    $FieldFactor = Config::get('planet_factor');
    require_once 'includes/PlanetDataBis.php';
    // teste
    $PlanetData = array(1 => array('temp' => mt_rand(220, 260), 'fields' => mt_rand(385, 498), 'image' => array('trocken' => mt_rand(1, 10), 'wuesten' => mt_rand(1, 4))), 2 => array('temp' => mt_rand(170, 210), 'fields' => mt_rand(387, 500), 'image' => array('trocken' => mt_rand(1, 10), 'wuesten' => mt_rand(1, 4))), 3 => array('temp' => mt_rand(120, 160), 'fields' => mt_rand(488, 527), 'image' => array('trocken' => mt_rand(1, 10), 'wuesten' => mt_rand(1, 4))), 4 => array('temp' => mt_rand(70, 110), 'fields' => mt_rand(513, 593), 'image' => array('dschjungel' => mt_rand(1, 10))), 5 => array('temp' => mt_rand(60, 100), 'fields' => mt_rand(538, 600), 'image' => array('dschjungel' => mt_rand(1, 10))), 6 => array('temp' => mt_rand(50, 90), 'fields' => mt_rand(538, 616), 'image' => array('dschjungel' => mt_rand(1, 10))), 7 => array('temp' => mt_rand(40, 80), 'fields' => mt_rand(531, 663), 'image' => array('normaltemp' => mt_rand(1, 7))), 8 => array('temp' => mt_rand(30, 70), 'fields' => mt_rand(559, 636), 'image' => array('normaltemp' => mt_rand(1, 7))), 9 => array('temp' => mt_rand(20, 60), 'fields' => mt_rand(551, 628), 'image' => array('normaltemp' => mt_rand(1, 7), 'wasser' => mt_rand(1, 9))), 10 => array('temp' => mt_rand(10, 50), 'fields' => mt_rand(544, 614), 'image' => array('normaltemp' => mt_rand(1, 7), 'wasser' => mt_rand(1, 9))), 11 => array('temp' => mt_rand(0, 40), 'fields' => mt_rand(538, 594), 'image' => array('normaltemp' => mt_rand(1, 7), 'wasser' => mt_rand(1, 9))), 12 => array('temp' => mt_rand(-10, 30), 'fields' => mt_rand(526, 561), 'image' => array('normaltemp' => mt_rand(1, 7), 'wasser' => mt_rand(1, 9))), 13 => array('temp' => mt_rand(-50, -10), 'fields' => mt_rand(499, 511), 'image' => array('eis' => mt_rand(1, 10))), 14 => array('temp' => mt_rand(-90, -50), 'fields' => mt_rand(471, 483), 'image' => array('eis' => mt_rand(1, 10))), 15 => array('temp' => mt_rand(-130, -90), 'fields' => mt_rand(445, 464), 'image' => array('eis' => mt_rand(1, 10))));
    // fim teste
    $Pos = ceil($Position / (Config::get('max_planets') / count($PlanetData)));
    $TMax = $PlanetData[$Pos]['temp'];
    $TMin = $TMax - 40;
    $Fields = $PlanetData[$Pos]['fields'] * Config::get('planet_factor');
    $Types = array_keys($PlanetData[$Pos]['image']);
    $Type = $Types[array_rand($Types)];
    $Class = $Type . 'planet' . ($PlanetData[$Pos]['image'][$Type] < 10 ? '0' : '') . $PlanetData[$Pos]['image'][$Type];
    $Name = !empty($PlanetName) ? $GLOBALS['DATABASE']->sql_escape($PlanetName) : $LNG['type_planet'][1];
    $GLOBALS['DATABASE']->query("INSERT INTO " . PLANETS . " SET\n\t\t\t\tname = '" . $Name . "',\n\t\t\t\tuniverse = " . $Universe . ",\n\t\t\t\tid_owner = " . $PlanetOwnerID . ",\n\t\t\t\tgalaxy = " . $Galaxy . ",\n\t\t\t\tsystem = " . $System . ",\n\t\t\t\tplanet = " . $Position . ",\n\t\t\t\tlast_update = " . TIMESTAMP . ",\n\t\t\t\tplanet_type = '1',\n\t\t\t\timage = '" . $Class . "',\n\t\t\t\tdiameter = " . floor(1000 * sqrt($Fields)) . ",\n\t\t\t\tfield_max = " . ($HomeWorld ? Config::get('initial_fields') : floor($Fields)) . ",\n\t\t\t\ttemp_min = " . $TMin . ",\n\t\t\t\ttemp_max = " . $TMax . ",\n\t\t\t\tplanet_protection = '0',\n\t\t\t\tmetal = " . Config::get('metal_start') . ",\n\t\t\t\tmetal_perhour = " . Config::get('metal_basic_income') . ",\n\t\t\t\tcrystal = " . Config::get('crystal_start') . ",\n\t\t\t\tcrystal_perhour = " . Config::get('crystal_basic_income') . ",\n\t\t\t\tdeuterium = " . Config::get('deuterium_start') . ",\n\t\t\t\tdeuterium_perhour = " . Config::get('deuterium_basic_income') . ";");
    return $GLOBALS['DATABASE']->GetInsertID();
}
开发者ID:joancefet,项目名称:Beta7,代码行数:57,代码来源:CreateOnePlanetRecord.php

示例8: getItems

 /**
  * {@inheritdoc}
  */
 public function getItems()
 {
     $output = [];
     foreach ($this->config->getAll() as $option) {
         foreach ($option['types'] as $type) {
             if ($type['disabled']) {
                 continue;
             }
             /** @var \Magento\Catalog\Api\Data\ProductCustomOptionTypeInterface $optionType */
             $optionType = $this->factory->create();
             $optionType->setLabel(__($type['label']))->setCode($type['name'])->setGroup(__($option['label']));
             $output[] = $optionType;
         }
     }
     return $output;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:19,代码来源:TypeList.php

示例9: run

 function run()
 {
     $CONF = Config::getAll(NULL, ROOT_UNI);
     if ($CONF['asteroid_event'] < TIMESTAMP) {
         $GLOBALS['DATABASE']->query("DELETE FROM " . PLANETS . " where `id_owner` = '" . Asteroid_Id . "' AND `id` != '706' ;");
         $galaxy = 1;
         $system = $this->randRange(1, 500, 50);
         foreach ($system as $System_Element) {
             $planets = rand(1, 10);
             $cautare = $GLOBALS['DATABASE']->query("SELECT *FROM " . PLANETS . " where `galaxy` = '" . $galaxy . "' and `system` = '" . $System_Element . "' and `planet` = '" . $planets . "' AND `universe` = '1';");
             if ($GLOBALS['DATABASE']->numRows($cautare) == 0) {
                 $metal_rand = rand(1, Config::get('asteroid_metal'));
                 $crystal_rand = rand(1, Config::get('asteroid_crystal'));
                 $deuterium_rand = rand(1, Config::get('asteroid_deuterium'));
                 $GLOBALS['DATABASE']->query("INSERT INTO " . PLANETS . "(`name`,`id_owner`,`universe`,`galaxy`,`system`,`planet`,`planet_type`,`image`,`diameter`,`der_metal`,`der_crystal`,`der_deuterium`,`last_update`) \n\t\tVALUES('Asteroid','" . Asteroid_Id . "','1','" . $galaxy . "','" . $System_Element . "','" . $planets . "','1','asteroid','9800','" . $metal_rand . "','" . $crystal_rand . "','" . $deuterium_rand . "','" . TIMESTAMP . "');");
             }
         }
         $totalPremiums = $GLOBALS['DATABASE']->query("SELECT `id`, `lang` FROM " . USERS . ";");
         $langObjects = array();
         while ($xy = $GLOBALS['DATABASE']->fetch_array($totalPremiums)) {
             if (!isset($langObjects[$xy['lang']])) {
                 $langObjects[$xy['lang']] = new Language($xy['lang']);
                 $langObjects[$xy['lang']]->includeData(array('L18N', 'INGAME', 'TECH', 'CUSTOM'));
             }
             $LNG = $langObjects[$xy['lang']];
             $message = '<div style="text-align:justify;">' . $LNG['sys_asteroid_3'] . '</div><div class="citation"><div class="guillemet ouvrir"></div><div class="guillemet fermer"></div><ul style="text-align : left;">' . $LNG['sys_asteroid_4'] . '</ul></div><div class="explication_utilisateur">' . $LNG['ls_fts_colo_9'] . '</div>';
             SendSimpleMessage($xy['id'], 0, TIMESTAMP, 7, $LNG['sys_asteroid_1'], $LNG['sys_asteroid_2'], $message);
         }
         $newevkaka = TIMESTAMP + 5 * 60;
         $GLOBALS['DATABASE']->query("UPDATE " . CONFIG . " SET asteroid_event = '" . $newevkaka . "' where `uni` = '1';");
     }
 }
开发者ID:joancefet,项目名称:Beta7,代码行数:32,代码来源:AsteroidCronJob.class.php

示例10: ShowTeamspeakPage

function ShowTeamspeakPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
    if ($_POST) {
        $config_before = 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']);
        $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);
        Config::update($config_after);
        $GLOBALS['DATABASE']->query("UPDATE " . CRONJOBS . " SET isActive = " . $ts_modon . ", `lock` = NULL, nextTime = 0 WHERE name = 'teamspeak';");
        $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
        $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' => $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('TeamspeakPage.tpl');
}
开发者ID:fuding,项目名称:Antaris,代码行数:29,代码来源:ShowTeamspeakPage.php

示例11: ShowPaybonusPage

function ShowPaybonusPage()
{
    global $LNG;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $pay_before = array('bonus_button' => $CONF['bonus_button'], 'academy_bonus' => $CONF['academy_bonus'], 'premium' => $CONF['premium'], 'stardust_bonus' => $CONF['stardust_bonus'], 'purchase_bonus' => $CONF['purchase_bonus'], 'purchase_bonus_timer' => $CONF['purchase_bonus_timer'], 'cosmonaute' => $CONF['cosmonaute'], 'fleetconf' => $CONF['fleetconf'], 'new_year' => $CONF['new_year']);
        $purchase_bonus = $_POST['percent'];
        $academy_bonus = $_POST['academy_bonus'];
        $bonus_button = $_POST['bonus_button'];
        $premium = $_POST['premium'];
        $stardust_bonus = $_POST['stardust_bonus'];
        $stardust_bonus = $_POST['stardust_bonus'];
        $fleetconf = isset($_POST['fleetconf']) && $_POST['fleetconf'] == 'on' ? 1 : 0;
        $cosmonaute = isset($_POST['cosmonaute']) && $_POST['cosmonaute'] == 'on' ? 1 : 0;
        $new_year = isset($_POST['new_year']) && $_POST['new_year'] == 'on' ? 1 : 0;
        $purchase_bonus_timer = TIMESTAMP + $_POST['days'] * 24 * 60 * 60;
        $pay_after = array('bonus_button' => $bonus_button, 'academy_bonus' => $academy_bonus, 'premium' => $premium, 'stardust_bonus' => $stardust_bonus, 'purchase_bonus' => $purchase_bonus, 'purchase_bonus_timer' => $purchase_bonus_timer, 'fleetconf' => $fleetconf, 'cosmonaute' => $cosmonaute, 'new_year' => $new_year);
        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();
    }
    $template = new template();
    $template->assign_vars(array('academy_bonus' => $CONF['academy_bonus'], 'cosmonaute' => $CONF['cosmonaute'], 'new_year' => $CONF['new_year'], 'bonus_button' => $CONF['bonus_button'], 'fleetconf' => $CONF['fleetconf'], 'premium' => $CONF['premium'], 'stardust_bonus' => $CONF['stardust_bonus'], 'purchase_bonus' => $CONF['purchase_bonus'], 'purchase_bonus_timer' => $CONF['purchase_bonus_timer'], 'bonus_next_active' => $CONF['purchase_bonus_timer'] > TIMESTAMP ? $CONF['purchase_bonus_timer'] - TIMESTAMP : 0, 'bonus_next_active_timer' => $CONF['purchase_bonus_timer'] > TIMESTAMP ? date("d.m.Y H:i:s", $CONF['purchase_bonus_timer']) : 0));
    $template->show('paybonus.tpl');
}
开发者ID:Decoder1978,项目名称:Xterium,代码行数:29,代码来源:ShowPaybonusPage.php

示例12: onChat

 public function onChat(PlayerChatEvent $event)
 {
     $this->plugin->event = $event;
     $extensions = $this->getAllExtensions();
     foreach ($extensions as $get) {
         if ($this->plugin->getServer()->getPluginManager()->getPlugin($get) && method_exists($this->plugin->getServer()->getPluginManager()->getPlugin($get), "onRegisterPrefix")) {
             $this->plugin->getServer()->getPluginManager()->getPlugin($get)->onRegisterPrefix();
         }
     }
     // ===========
     //	Format
     // ===========
     $this->plugin->replaceTag("{WORLD}", $event->getPlayer()->getLevel()->getName());
     //Level Tag
     $this->plugin->replaceTag("{PLAYER}", $event->getPlayer()->getName());
     //Player Tag
     $this->plugin->replaceTag("{PREFIX}", $this->plugin->getConfig()->get("prefix"));
     //Prefix Tag
     $this->plugin->replaceTag("{SUFFIX}", $this->plugin->getConfig()->get("suffix"));
     //Suffix Tag
     $this->plugin->replaceTag("{MESSAGE}", $event->getMessage());
     //Message Tag
     //Custom tags
     $tags = new Config($this->plugin->getDataFolder() . "tags.yml", Config::YAML);
     foreach ($tags->getAll() as $tag => $value) {
         $this->plugin->replaceTag("{" . strtoupper($tag) . "}", $value);
     }
     $event->setFormat($this->getFormattedMessage($this->plugin->getConfig()->get("chat-format")));
     // ===========
     //	Player Mute
     // ===========
     $mhut = $event->getRecipients();
     for ($lol = 0; $i < count($mhut); $lol++) {
         if (isset($this->leave[$mhut[$lol]->getName()])) {
             unset($mhut[$lol]);
         }
     }
     $event->setRecipients($mhut);
     $allowChat = $this->plugin->getConfig()->get("disablechat");
     if ($allowChat) {
         $event->setCancelled(true);
         return;
     }
     if (!$allowChat || $allowChat == null) {
         $player = $event->getPlayer();
         $perm = "chatmute";
         if ($player->isPermissionSet($perm)) {
             $event->setCancelled(true);
             return;
         }
         $format = $this->getFormattedMessage($player, $event->getMessage());
         $config_node = $this->plugin->getConfig()->get("enable-formatter");
         if (isset($config_node) and $config_node === true) {
             $event->setFormat($format);
         }
         return;
     }
 }
开发者ID:AndreyNazarchuk,项目名称:Collection-Plugins-PocketMine-Prax,代码行数:58,代码来源:EventListener.php

示例13: show

 function show()
 {
     global $LNG;
     $referralID = HTTP::_GP('ref', 0);
     if (!empty($referralID)) {
         $this->redirectTo('promo.php?referralID=' . $referralID);
     }
     $universeSelect = array();
     $uniAllConfig = Config::getAll('universe');
     foreach ($uniAllConfig as $uniID => $uniConfig) {
         $universeSelect[$uniID] = $uniConfig['uni_name'] . ($uniConfig['game_disable'] == 0 ? t('uni_closed') : '');
     }
     $Code = HTTP::_GP('code', 0);
     $loginCode = false;
     if (isset($LNG['login_error_' . $Code])) {
         $loginCode = $LNG['login_error_' . $Code];
     }
     $referralUniversum = 0;
     $referralUserID = 0;
     if (Config::get('ref_active')) {
         $referralUserID = HTTP::_GP('ref', 0);
         if (!empty($referralUserID)) {
             $referralUniversum = $GLOBALS['DATABASE']->getFirstRow("SELECT universe FROM " . USERS . " WHERE id = " . $referralUserID . ";");
             if (!isset($referralUniversum)) {
                 $referralUniversum = 0;
                 $referralUserID = 0;
             }
         }
     }
     $newsResult = $GLOBALS['DATABASE']->query("SELECT id, date, title, text, user, catID FROM " . NEWS . " ORDER BY id DESC;");
     $newsList = array();
     while ($newsRow = $GLOBALS['DATABASE']->fetchArray($newsResult)) {
         $newsList[] = array('id' => $newsRow['id'], 'title' => $newsRow['title'], 'from' => t('news_from', _date(t('php_tdformat'), $newsRow['date']), $newsRow['user']), 'text' => substr($newsRow['text'], 0, 160) . "...", 'date' => _date($LNG['php_tdformat'], $newsRow['date'], $newsRow['user']), 'image' => 'images/' . $newsRow['catID'] . '.jpg');
     }
     $topicsResult = $GLOBALS['DATABASE']->query("SELECT tid, title, last_post, topic_firstpost, title_seo FROM forum_topics WHERE tdelete_time = '0' ORDER BY last_post DESC LIMIT 5;");
     $topicsList = array();
     while ($topicsRow = $GLOBALS['DATABASE']->fetchArray($topicsResult)) {
         $topicsList[] = array('id' => $topicsRow['tid'], 'title' => $topicsRow['title'], 'topic_firstpost' => $topicsRow['topic_firstpost'], 'title_seo' => $topicsRow['title_seo'], 'date' => _date($LNG['php_tdformat'], $topicsRow['last_post'], 1));
     }
     $uniResult = $GLOBALS['DATABASE']->query("SELECT users_amount, COUNT(DISTINCT inac.id) as inactive, COUNT(planet.id) as planet\n\tFROM " . CONFIG . " conf\n\tLEFT JOIN " . USERS . " as inac ON uni = inac.universe AND inac.onlinetime < " . (TIMESTAMP - INACTIVE) . "\n\tLEFT JOIN " . PLANETS . " as planet ON uni = planet.universe\n\tGROUP BY conf.uni, inac.universe, planet.universe\n\tORDER BY uni ASC;");
     while ($uniRow = $GLOBALS['DATABASE']->fetch_array($uniResult)) {
         $users_amount = $uniRow['users_amount'];
         $active = $uniRow['users_amount'] - $uniRow['inactive'];
     }
     $uniInfo = $GLOBALS['DATABASE']->query("SELECT users_amount, COUNT(DISTINCT inac.id) as inactive, COUNT(planet.id) as planet\n\tFROM " . CONFIG . " conf\n\tLEFT JOIN " . USERS . " as inac ON uni = inac.universe AND inac.register_time > " . (TIMESTAMP - 30 * 24 * 60 * 60) . "\n\tLEFT JOIN " . PLANETS . " as planet ON uni = planet.universe\n\tGROUP BY conf.uni, inac.universe, planet.universe\n\tORDER BY uni ASC;");
     while ($uniRaw = $GLOBALS['DATABASE']->fetch_array($uniInfo)) {
         $users_amount = $uniRaw['users_amount'];
         $new_member = $uniRaw['inactive'];
     }
     $uniHof = $GLOBALS['DATABASE']->query("SELECT COUNT(rid) as inactive\n\tFROM " . TOPKB . " WHERE time > " . (TIMESTAMP - 24 * 60 * 60) . "\n\tORDER BY units DESC LIMIT 100;");
     while ($uniHaf = $GLOBALS['DATABASE']->fetch_array($uniHof)) {
         $total_hof = $uniHaf['inactive'];
     }
     $this->assign(array('referralUserID' => $referralUserID, 'referralUniversum' => $referralUniversum, 'universeSelect' => $universeSelect, 'topicsList' => $topicsList, 'code' => $loginCode, 'descHeader' => t('loginWelcome', Config::get('game_name')), 'descText' => t('loginServerDesc', Config::get('game_name')), 'newsList' => $newsList, 'users_amount' => $users_amount, 'active' => $active, 'new_member' => $new_member, 'total_hof' => $total_hof, 'loginInfo' => t('loginInfo', '<a href="index.php?page=rules">' . t('menu_rules') . '</a>')));
     $this->render('page.index.default.tpl');
 }
开发者ID:Decoder1978,项目名称:Xterium,代码行数:56,代码来源:ShowIndexPage.class.php

示例14: show

 function show()
 {
     $universeSelect = array();
     $uniAllConfig = Config::getAll('universe');
     foreach ($uniAllConfig as $uniID => $uniConfig) {
         $universeSelect[$uniID] = $uniConfig['uni_name'];
     }
     $this->assign(array('universeSelect' => $universeSelect));
     $this->render('page.lostPassword.default.tpl');
 }
开发者ID:fuding,项目名称:Antaris,代码行数:10,代码来源:ShowLostPasswordPage.class.php

示例15: initializeConfig

 /**
  * @return void
  */
 protected function initializeConfig()
 {
     Config::importFile('init.php');
     $path = ConfigFileFullPathBuilder::build('env.php');
     if (file_exists($path)) {
         Config::importFile($path);
     }
     foreach (Config::getAll('php') as $key => $value) {
         ini_set($key, $value);
     }
 }
开发者ID:hyperframework,项目名称:hyperframework,代码行数:14,代码来源:App.php


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