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


PHP Neuron_Core_Tools::getInput方法代码示例

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


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

示例1: setSettings

 public function setSettings()
 {
     $text = Neuron_Core_Text::__getInstance();
     $login = Neuron_Core_Login::__getInstance();
     if ($login->isLogin()) {
         $player = Neuron_GameServer::getPlayer();
         $pos = $player->getPreferences();
         $pos = $pos['minimapPosition'];
     } else {
         $pos = Neuron_Core_Tools::getInput('_COOKIE', COOKIE_PREFIX . 'prefMP', 'int', 0);
     }
     if ($pos == 4) {
         $this->setPosition('auto', 'auto', '0px', '0px');
     } elseif ($pos == 2) {
         $this->setPosition('0px', '32px', 'auto', 'auto');
     } elseif ($pos == 3) {
         $this->setPosition('auto', '32px', '0px', 'auto');
     } else {
         $this->setPosition('0px', 'auto', 'auto', '0px');
     }
     if ($pos != 5) {
         $this->setType('panel');
     } else {
         // Movable ;-)
         $this->setPosition('0px', 'auto', 'auto', '0px');
         //$this->setOnResize ('onResizeMiniMap');
     }
     // Window settings
     $this->setSize('200px', '150px');
     $this->setTitle('Mini Map');
     $this->setClass('minimap');
     $this->setType('panel');
     $this->setAllowOnlyOnce();
     $this->setPool('minimap');
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:35,代码来源:MiniMap.php

示例2: getBody

 public function getBody()
 {
     $myself = Neuron_GameServer::getPlayer();
     if (!$myself->isAdmin()) {
         return '<p>You are not allowed to execute the commands. Only admins are.</p>';
     }
     // Check for input
     $record = Neuron_Core_Tools::getInput('_GET', 'id', 'int');
     $action = Neuron_Core_Tools::getInput('_GET', 'action', 'varchar');
     if ($record && $action) {
         $this->processAction($record, $action == 'accept');
     }
     $page = new Neuron_Core_Template();
     $db = Neuron_DB_Database::getInstance();
     $list = $db->query("\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM\n\t\t\t\tn_mod_actions\n\t\t\tWHERE\n\t\t\t\tma_processed = 0\n\t\t\tORDER BY\n\t\t\t\tma_date ASC\n\t\t");
     foreach ($list as $v) {
         $params = json_decode($v['ma_data'], true);
         $target = false;
         if (isset($params['plid'])) {
             $target = Neuron_GameServer::getPlayer($params['plid']);
         }
         $actor = Neuron_GameServer::getPlayer($v['ma_plid']);
         $page->addListValue('actions', array('date' => $v['ma_date'], 'action' => $v['ma_action'], 'target' => $target ? $target->getDisplayName() : null, 'actor' => $actor ? $actor->getDisplayName() : null, 'reason' => !empty($v['ma_reason']) ? Neuron_Core_Tools::output_text($v['ma_reason']) : null, 'accept_url' => self::getUrl('execute', array('id' => $v['ma_id'], 'action' => 'accept')), 'deny_url' => self::getUrl('execute', array('id' => $v['ma_id'], 'action' => 'deny'))));
     }
     return $page->parse('pages/admin/execute/list.phpt');
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:26,代码来源:Execute.php

示例3: register

 private function register()
 {
     $player = Neuron_GameServer::getPlayer();
     if (!$player) {
         echo '<p>Please login.</p>';
         return;
     }
     $name = Neuron_Core_Tools::getInput('_POST', 'name', 'varchar');
     $developer = Neuron_Core_Tools::getInput('_POST', 'developer', 'varchar');
     $email = Neuron_Core_Tools::getInput('_POST', 'email', 'email');
     $user_id = $player->getId();
     $page = new Neuron_Core_Template();
     if ($name && $developer) {
         $consumer = array('requester_name' => $developer, 'requester_email' => $email);
         // Register the consumer
         $store = Neuron_Auth_OAuthStore::getStore();
         $key = $store->updateConsumer($consumer, $user_id);
         // Get the complete consumer from the store
         $consumer = $store->getConsumer($key, $user_id);
         // Some interesting fields, the user will need the key and secret
         $page->set('app_data', array('Consumer ID' => $consumer['id'], 'Consumer Key' => $consumer['consumer_key'], 'Consumer secret' => $consumer['consumer_secret']));
         return $page->parse('oauth/information.phpt');
     } else {
         return $page->parse('oauth/register.phpt');
     }
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:26,代码来源:OAuth.php

示例4: getBody

 public function getBody()
 {
     $timeframe = Neuron_Core_Tools::getInput('_GET', 'timeframe', 'int', 60 * 60 * 48);
     $db = Neuron_DB_Database::__getInstance();
     $page = new Neuron_Core_Template();
     $page->set('timeframe', $timeframe);
     // Fetch all doubles
     $data = $db->query("\n\t\t\tSELECT\n\t\t\t\tn_login_log.l_ip,\n\t\t\t\t\n\t\t\t\tGROUP_CONCAT(DISTINCT n_login_log.l_plid) AS plids,\n\t\t\t\tGROUP_CONCAT(DISTINCT n_players.nickname) AS nicknames,\n\t\t\t\t\n\t\t\t\tGROUP_CONCAT(c.pac_plid1) AS cleared_1,\n\t\t\t\tGROUP_CONCAT(c.pac_plid2) AS cleared_2,\n\t\t\t\tGROUP_CONCAT(c.pac_reason) AS cleared_reason,\n\t\t\t\t\n\t\t\t\tCOUNT(DISTINCT l_plid) AS aantal\n\t\t\tFROM\n\t\t\t\tn_login_log\n\t\t\tLEFT JOIN\n\t\t\t\tn_players ON n_login_log.l_plid = n_players.plid\n\t\t\tLEFT JOIN\n\t\t\t\tn_players_admin_cleared c ON (c.pac_plid1 = n_login_log.l_plid OR c.pac_plid2 = n_login_log.l_plid)\n\t\t\tWHERE\n\t\t\t\tn_login_log.l_datetime > FROM_UNIXTIME(" . (NOW - $timeframe) . ") AND\n\t\t\t\tn_players.isPlaying = 1\n\t\t\tGROUP BY\n\t\t\t\tl_ip\n\t\t\tHAVING\n\t\t\t\taantal > 1\n\t\t");
     foreach ($data as $row) {
         $plids = explode(',', $row['plids']);
         $nicknames = explode(',', $row['nicknames']);
         // Check clearances.
         $clearances = $this->getClearancesFromRow($row);
         $players = array();
         $combinedlogs = "";
         foreach ($plids as $k => $v) {
             $players[] = array('id' => $plids[$k], 'name' => isset($nicknames[$k]) ? $nicknames[$k] : 'no-nickname-set', 'url' => $this->getUrl('user', array('id' => $plids[$k])), 'logs_url' => $this->getUrl('gamelogs', array('players' => $plids[$k])));
             $combinedlogs .= $plids[$k] . "|";
         }
         // Check for cleared accounts
         $allcleared = true;
         foreach ($players as $k => $v) {
             $players[$k]['cleared'] = $this->isCleared($clearances, $v, $players);
             if ($allcleared && !$players[$k]['cleared']) {
                 $allcleared = false;
             }
         }
         $combinedlogs = substr($combinedlogs, 0, -1);
         $page->addListValue('players', array('ip' => $row['l_ip'], 'players' => $players, 'combined_logs_url' => $this->getUrl('gamelogs', array('players' => $combinedlogs)), 'clearmultis' => $this->getUrl('clearmultis', array('players' => $combinedlogs)), 'cleared' => $allcleared, 'amount' => $row['aantal']));
     }
     $page->usortList('players', array($this, 'sortcompare'));
     return $page->parse('pages/admin/multis.phpt');
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:33,代码来源:Multis.php

示例5: getBody

 public function getBody()
 {
     $player = Neuron_GameServer::getPlayer(Neuron_Core_Tools::getInput('_GET', 'id', 'int'));
     $statistics = $player->getStatistics();
     $out = $this->linearArray($statistics);
     $page = new Neuron_Core_Template();
     $page->set('statistics', $out);
     return $page->parse('gameserver/pages/statistics.phpt');
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:9,代码来源:Statistics.php

示例6: getBody

 public function getBody()
 {
     $village = Neuron_Core_Tools::getInput('_GET', 'village', 'int');
     $village = Dolumar_Players_Village::getVillage($village);
     $body = '<h2>' . $village->getName() . '</h2>';
     $location = $village->buildings->getTownCenterLocation();
     //$url = ABSOLUTE_URL . '#' . $location[0] . ',' . $location[1];
     $url = $this->getUrl('Playerprofile', array('plid' => $village->getOwner()->getId()));
     header('Location: ' . $url);
     return $body;
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:11,代码来源:Villageprofile.php

示例7: sendNotification

function sendNotification($id, $sender, $public)
{
    echo '<h1>';
    echo $sender ? 'With sender' : 'Without sender';
    echo ' and ';
    echo $public ? 'public' : 'private';
    echo '</h1>';
    $player = Dolumar_Players_Player::getFromId($id);
    $other = Dolumar_Players_Player::getFromId(Neuron_Core_Tools::getInput('_GET', 'from', 'int', 1));
    if ($sender) {
        echo '<p>Message was sent from ' . $other->getNickname() . '.</p>';
    }
    $player->sendNotification('test', 'system', array('target' => $other, 'defender' => $other->getMainVillage(), 'pl_defender' => $other, 'village' => $player->getMainVillage(), 'player' => $player), $sender ? $other : null, $public);
    echo '<p style="color: green;">A notification has been sent to user ' . $player->getName() . '.</p>';
}
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:15,代码来源:notification.php

示例8: getOuterBody

 public function getOuterBody()
 {
     $username = Neuron_Core_Tools::getInput('_POST', 'username', 'varchar');
     $password = Neuron_Core_Tools::getInput('_POST', 'password', 'varchar');
     $page = new Neuron_Core_Template();
     if ($username && $password) {
         $chk = $this->login->login($username, $password, false);
         if ($chk) {
             $url = $this->getUrl('index');
             header('Location: ' . $url);
             return '<p>Welcome! Click <a href="' . $url . '">here</a> to continue.</p>';
         } else {
             $page->set('error', $this->login->getError());
         }
     }
     $page->set('action', '');
     return $page->parse('pages/login.phpt');
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:18,代码来源:Login.php

示例9: getBody

 public function getBody()
 {
     $unit = $this->getParameter(2);
     switch ($unit) {
         case 'units':
             return $this->getUnitStats();
             break;
         case 'equipment':
             return $this->getEquipmentStats();
             break;
         case 'effects':
             return $this->getEffectStats();
             break;
     }
     $module = Neuron_Core_Tools::getInput('_REQUEST', 'module', 'varchar');
     $data = explode('/', $module);
     var_dump($data);
     return '<p>Report not found: ' . $unit . '</p>';
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:19,代码来源:Report.php

示例10: getBody

 public function getBody()
 {
     $player = Neuron_GameServer::getPlayer();
     if (!$player->isModerator()) {
         return '<p>You don\'t have the rights to access the player logs.</p>';
     }
     $page = new Neuron_Core_Template();
     // Let's find the players
     $input = Neuron_Core_Tools::getInput('_GET', 'players', 'varchar');
     $playerids = explode('|', $input);
     $players = array();
     $villages = array();
     $ids = array();
     $i = 0;
     foreach ($playerids as $v) {
         $player = Neuron_GameServer::getPlayer($v);
         if ($player) {
             $players[] = $player;
             $villages = array_merge($villages, $player->getVillages());
             $ids[$player->getId()] = $i;
             $page->addListValue('players', array('key' => $i, 'id' => $player->getId(), 'name' => $player->getName(), 'url' => $this->getUrl('user', array('id' => $player->getId()))));
             $i++;
         }
     }
     $pageid = max(0, intval(Neuron_Core_Tools::getInput('_GET', 'page', 'int', 1)) - 1);
     $objLogs = Dolumar_Players_Logs::getInstance();
     $logs = $objLogs->getLogs($villages, $pageid * 250, 250, 'DESC');
     foreach ($logs as $v) {
         $player = Dolumar_Players_Village::getFromId($v['village'])->getOwner();
         // Check if this is an important log.
         $bImportant = $this->isImportantLog($players, $v);
         $page->addListValue('logs', array('action' => $objLogs->getLogText($v, false), 'date' => date(DATETIME, $v['timestamp']), 'player' => $player->getName(), 'url' => $this->getUrl('user', array('id' => $player->getId())), 'key' => $ids[$player->getId()], 'important' => $bImportant ? 'important' : null));
     }
     $page->set('page', $pageid + 1);
     if (count($logs) == 250) {
         $page->set('nextpage', $this->getUrl('gamelogs', array('players' => $input, 'page' => $pageid + 2)));
     }
     if ($pageid > 0) {
         $page->set('previouspage', $this->getUrl('gamelogs', array('players' => $input, 'page' => $pageid)));
     }
     return $page->parse('pages/admin/gamelogs.phpt');
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:42,代码来源:Gamelogs.php

示例11: getBody

 public function getBody()
 {
     $timeframe = Neuron_Core_Tools::getInput('_GET', 'timeframe', 'int', 60 * 60 * 48);
     $page = new Neuron_Core_Template();
     $page->set('timeframe', $timeframe);
     $objLogs = Dolumar_Players_Logs::getInstance();
     $objLogs->setTimeInterval(NOW - $timeframe, NOW);
     $pageid = Neuron_Core_Tools::getInput('_GET', 'page', 'int', 1);
     $limit = Neuron_Core_Tools::splitInPages($page, $objLogs->getSuspiciousLogsCounter(), $pageid, self::SUSPICIOUS_TRANSACTIONS_PERPAGE, 7, array('timeframe' => $timeframe), 'multis');
     //print_r ($limit);
     //$logs = $objLogs->getSuspiciousLogs ();
     $logs = $objLogs->getSuspiciousLogs($limit['start'], $limit['perpage'], 'DESC');
     foreach ($logs as $v) {
         $player = Dolumar_Players_Village::getFromId($v['village'])->getOwner();
         $page->addListValue('logs', array('action' => $objLogs->getLogText($v, false), 'date' => date(DATETIME, $v['timestamp']), 'player' => $player->getDisplayName()));
     }
     // Output the shizzle
     $html = $page->parse('dolumar/pages/admin/multis/dangeroustransactions.phpt');
     $html .= parent::getBody();
     return $html;
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:21,代码来源:Multis.php

示例12: getBody

 public function getBody()
 {
     $db = Neuron_DB_Database::getInstance();
     $data = $db->query("\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM\n\t\t\t\tn_players\n\t\t\tWHERE\n\t\t\t\tpremiumEndDate > FROM_UNIXTIME('" . NOW . "')\n\t\t");
     $refund = Neuron_Core_Tools::getInput('_GET', 'refund', 'int');
     $refund = $refund == 1;
     $page = new Neuron_Core_Template();
     foreach ($data as $v) {
         $player = Neuron_GameServer::getPlayer($v['plid'], $v);
         $date = $player->getPremiumEndDate();
         $diff = $date - NOW;
         $amounts = ceil($diff / (60 * 60 * 24 * 15));
         $credits = $amounts * PREMIUM_COST_CREDITS;
         if ($refund) {
             $amref = $player->refundCredits($credits, 'premium account refund');
         } else {
             $amref = false;
         }
         $page->addListValue('players', array('name' => $player->getDisplayName(), 'enddate' => date('d m Y H:i:s', $date), 'credits' => $credits, 'refunded' => $amref));
     }
     return $page->parse('pages/admin/premium/premium.phpt');
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:22,代码来源:Premium.php

示例13: checkIfLoggedIn

 private function checkIfLoggedIn()
 {
     if ($this->isChecked) {
         return;
     }
     $this->isChecked = true;
     /* Check for login */
     $uid = Neuron_Core_Tools::getInput('_SESSION', 'plid', 'int', false);
     $logout = Neuron_Core_Tools::getInput('_GET', 'logout', 'bool', false);
     //$uid = 1;
     /* Check for logout */
     if ($logout) {
         $this->logout();
     } elseif ($uid) {
         $this->uid = $uid;
     } else {
         // setcookie ('dolumar_plid'.$this->level, $this->uid, time () + COOKIE_LIFETIME, '/');
         // setcookie ('dolumar_pass'.$this->level, $user->getPasswordHash (), time () + COOKIE_LIFETIME, '/');
         // Check for cookies
         $user = Neuron_Core_Tools::getInput('_COOKIE', 'dolumar_plid' . $this->level, 'int', false);
         $pass = Neuron_Core_Tools::getInput('_COOKIE', 'dolumar_pass' . $this->level, 'md5', false);
         if ($user && $pass) {
             // Check details
             $objUser = Neuron_GameServer::getPlayer($user);
             // Check password
             if ($objUser->getPasswordHash() == $pass) {
                 $this->doLogin($objUser, true);
             } else {
                 // Remove the cookies
                 $this->removeCookies();
             }
         }
     }
     if ($this->registerRefresh) {
         $this->processLastRefresh();
     }
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:37,代码来源:Login.php

示例14: getBody

 public function getBody()
 {
     $myself = Neuron_GameServer::getPlayer();
     if (!$myself->isAdmin()) {
         return '<p>You are not allowed to execute the commands. Only admins are.</p>';
     }
     $page = new Neuron_Core_Template();
     $login = Neuron_Core_Login::getInstance();
     if (!$login->isLogin()) {
         $userid = 0;
     } else {
         $userid = $login->getUserId();
     }
     $text = Neuron_Core_Text::getInstance();
     $content = array();
     foreach ($text->getLanguages() as $v) {
         $page->addListValue('languages', $v);
         $content[$v] = array('title' => Neuron_Core_Tools::getInput('_POST', 'title_' . $v, 'varchar'), 'description' => Neuron_Core_Tools::getInput('_POST', 'description_' . $v, 'varchar'));
     }
     if (isset($_FILES['imagefile'])) {
         $im = $this->getImageFromInput($_FILES['imagefile']);
         if ($im) {
             $new = $this->getGeneratedImage($im);
             if (!is_dir(PUBLIC_PATH . 'signs/')) {
                 mkdir(PUBLIC_PATH . 'signs/');
                 chmod(PUBLIC_PATH . 'signs/', 0755);
             }
             $filename = $userid . '_' . date('dmYHis') . '.png';
             imagepng($new, PUBLIC_PATH . 'signs/' . $filename);
             chmod(PUBLIC_PATH . 'signs/' . $filename, 0755);
             $db = Neuron_DB_Database::getInstance();
             $db->query("\n\t\t\t\t\tINSERT INTO\n\t\t\t\t\t\tplayers_tiles\n\t\t\t\t\tSET\n\t\t\t\t\t\tt_userid = " . intval($userid) . ",\n\t\t\t\t\t\tt_imagename = 'signs/" . $db->escape($filename) . "',\n\t\t\t\t\t\tt_isPublic = 1,\n\t\t\t\t\t\tt_description = '{$db->escape(json_encode($content))}'\n\t\t\t\t");
         }
     }
     return $page->parse('dolumar/pages/admin/bonusbuilding/bonusbuilding.phpt');
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:36,代码来源:Bonusbuilding.php

示例15: getBody

 public function getBody()
 {
     $page = new Neuron_Core_Template();
     // Let's find the players
     $input = Neuron_Core_Tools::getInput('_GET', 'players', 'varchar');
     $playerids = explode('|', $input);
     $page->set('action_url', $this->getUrl('clearmultis', array('players' => $input)));
     $players = array();
     $ids = array();
     $i = 0;
     foreach ($playerids as $v) {
         $player = $this->getPlayer($v);
         if ($player) {
             $players[] = $player;
             $page->addListValue('players', array('id' => $player->getId(), 'name' => $player->getDisplayName()));
         }
     }
     $this->process($players);
     $clearances = $this->getClearances($players);
     foreach ($clearances as $v) {
         $page->addListValue('clearances', array('player1' => $this->getPlayerName($v['player1']), 'player2' => $this->getPlayerName($v['player2']), 'remove_url' => $this->getUrl('clearmultis', array('players' => $input, 'remove' => $v['id'])), 'reason' => $v['reason']));
     }
     return $page->parse('pages/admin/clearmultis/clearmultis.phpt');
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:24,代码来源:Clearmultis.php


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