本文整理汇总了PHP中Neuron_Core_Tools::output_varchar方法的典型用法代码示例。如果您正苦于以下问题:PHP Neuron_Core_Tools::output_varchar方法的具体用法?PHP Neuron_Core_Tools::output_varchar怎么用?PHP Neuron_Core_Tools::output_varchar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Neuron_Core_Tools
的用法示例。
在下文中一共展示了Neuron_Core_Tools::output_varchar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContent
public function getContent($msg = null, $failed = false)
{
$myself = Neuron_GameServer::getPlayer();
if (!$this->village->isActive() || $this->village->getOwner()->getId() != $myself->getId()) {
return false;
}
$page = new Neuron_Core_Template();
$page->setTextSection('formation', 'battle');
// Load battle slots
$slots = $this->village->getDefenseSlots();
// Load your units
$squads = $this->village->getSquads(false, false, false);
// See how much rows that is
$rows = $this->countRows($squads, $slots);
$page->set('rows', $rows);
$page->set('slots', $slots);
if (!empty($msg)) {
$page->set('message', $msg);
$page->set('error', $failed);
}
foreach ($squads as $v) {
if ($v->getUnitsAmount() > 0) {
$page->addListValue('squads', array('sName' => Neuron_Core_Tools::output_varchar($v->getName()), 'oUnits' => $v->getUnits(), 'id' => $v->getId()));
}
}
return $page->parse('battle/formation.phpt');
}
示例2: checkBuildings
function checkBuildings($buildings, $sQ, $i, $j, $tx, $ty)
{
global $output;
// Objects & buildings
if (isset($buildings[$tx]) && isset($buildings[$tx][$ty])) {
$loc = array();
foreach ($buildings[$tx][$ty] as $b) {
$displayobject = $b->getDisplayObject();
$offset = $displayobject->getOffset();
$title = Neuron_Core_Tools::output_varchar($b->getName());
$location = $b->getLocation();
if (!isset($loc[$location[0] . 'p' . $location[1]])) {
if (!isset($output['regions'][$sQ]['objects'][$i])) {
$output['regions'][$sQ]['objects'][$i] = array();
}
if (!isset($output['regions'][$sQ]['objects'][$i][$j])) {
$output['regions'][$sQ]['objects'][$i][$j] = array();
}
$id = time();
$output['regions'][$sQ]['objects'][$i][$j][] = array('tx' => $tx, 'ty' => $ty, 'id' => $id, 'i' => $i - $offset[0], 'j' => $j - $offset[1], 'm' => map_image_cache($displayobject), 'n' => $title, 's' => $b->getMapObjectStatus()->getArray(), 'c' => $b->getEvents('click'), 'z' => 0, 'd' => true);
$loc[$location[0] . 'p' . $location[1]] = true;
}
}
}
}
示例3: getForum
protected function getForum()
{
$requestData = $this->getRequestData();
if (isset($requestData['clan'])) {
$clan = new Dolumar_Players_Clan($requestData['clan']);
if ($clan) {
$login = Neuron_Core_Login::__getInstance();
if ($login->isLogin()) {
$me = Neuron_GameServer::getPlayer();
$isMember = $clan->isMember($me);
$isModerator = $clan->isModerator($me);
//__construct ($iForumType, $iForumId, $objUser = false, $bCanSeeAll = false, $bIsModerator = false)
$forum = new Neuron_Forum_Forum(1, $clan->getId(), $me, $isMember, $isModerator);
} else {
$forum = new Neuron_Forum_Forum(1, $clan->getId(), false, false, false);
}
// Fetch thze title
$text = Neuron_Core_Text::__getInstance();
$forum->setTitle(Neuron_Core_Tools::putIntoText($text->get('title', 'forum', 'clan'), array('clan' => Neuron_Core_Tools::output_varchar($clan->getName()))));
return $forum;
} else {
return false;
}
} else {
return false;
}
}
示例4: showRegisterForm
public function showRegisterForm($error = false)
{
$text = Neuron_Core_Text::__getInstance();
$text->setFile('account');
$text->setSection('register');
$page = new Neuron_Core_Template();
$page->setTextSection('register', 'account');
// Get invitation code
$data = $this->getInputData();
$page->set('invCode', isset($data['invCode']) ? $data['invCode'] : null);
// If an error has occured, add that
if ($error) {
$page->set('error', $text->get($error, 'errors'));
}
// Check for already found data
if (isset($data['username'])) {
$page->set('username_value', Neuron_Core_Tools::output_varchar($data['username']));
}
if (isset($data['email'])) {
$page->set('email_value', Neuron_Core_Tools::output_varchar($data['email']));
}
$page->set('register', $text->get('register'));
$page->set('submit', $text->get('submit'));
$page->set('email', $text->get('email'));
$page->set('username', $text->get('username'));
$page->set('password', $text->get('password'));
$page->set('password2', $text->get('password2'));
return $page->parse('register/register.tpl');
}
示例5: printResults
private function printResults($page, $query)
{
foreach ($query as $v) {
$displayname = Neuron_URLBuilder::getInstance()->getOpenUrl('PlayerProfile', Neuron_Core_Tools::output_varchar($v['nickname']), array('plid' => $v['plid']));
$villagename = Neuron_URLBuilder::getInstance()->getOpenUrl('VillageProfile', Neuron_Core_Tools::output_varchar($v['vname']), array('village' => $v['vid']));
$page->addListValue('results', array('id' => $v['plid'], 'nickname' => $v['nickname'], 'displayname' => $displayname, 'village' => $v['vname'], 'displayvillage' => $villagename, 'distance' => Neuron_Core_Tools::output_distance($v['distance']), 'networth' => $v['networth']));
}
}
示例6: getTitle
protected function getTitle()
{
$me = Neuron_GameServer::getPlayer();
if ($me && $this->building->getOwner()->getId() == $me->getId()) {
return $this->building->getName(false, true) . ' (' . Neuron_Core_Tools::output_varchar($this->building->getVillage()->getName()) . ')';
} else {
return $this->building->getName(false) . ' (' . Neuron_Core_Tools::output_varchar($this->building->getVillage()->getName()) . ')';
}
}
示例7: getContent
public function getContent()
{
//return $this->getCurrentResources ();
$data = $this->getRequestData();
$page = isset($data['page']) ? intval($data['page']) : 1;
$myself = Neuron_GameServer::getPlayer();
// Sort of config ;-)
$totalPages = 0;
if ($myself) {
$villages = $myself->getVillages();
$totalPages = count($villages);
}
$content = $this->getResourcesPage();
// Next & previous pages
$nextPage = $page + 1;
$previousPage = $page - 1;
if ($previousPage < 1) {
// Highest page id
$previousPage = $totalPages;
}
if ($nextPage > $totalPages) {
$nextPage = 1;
}
$text = Neuron_Core_Text::__getInstance();
$page = new Neuron_Core_Template();
$page->set('nextPage', $nextPage);
$page->set('previousPage', $previousPage);
$page->set('minimap', $text->get('minimap', 'menu', 'main'));
// Check for news messages
$hasMessages = false;
if ($myself) {
$mapper = Neuron_GameServer_Mappers_CachedChatMapper::getInstance();
$messages = $mapper->countUnreadMessages($myself);
$hasMessages = $messages > 0;
//return $messages;
// Get current village
$village = $myself->getCurrentVillage();
if ($village) {
$page->set('current_village', Neuron_Core_Tools::output_varchar($village->getName()));
$page->set('current_village_id', Neuron_Core_Tools::output_varchar($village->getId()));
}
}
$page->set('hasMessages', $hasMessages);
$page->set('inbox', $text->get('inbox', 'menu', 'main'));
$page->set('home', $text->get('home', 'menu', 'main'));
$page->set('homecors', $this->getHomeLocation());
$page->set('content', $content);
return $page->parse('newsbar.tpl');
}
示例8: setPlayer
protected function setPlayer()
{
$o = $this->getRequestData();
if (!isset($o['village']) && isset($o[0])) {
$o['village'] = $o[0];
} elseif (!isset($o['village'])) {
$o['village'] = null;
}
$village = Dolumar_Players_Village::getVillage($o['village']);
if ($village) {
$this->player = $village->getOwner();
$this->thisVillage = $village;
}
$this->setTitle(Neuron_Core_Tools::output_varchar($this->player->getNickname()));
}
示例9: setSettings
public function setSettings()
{
$text = Neuron_Core_Text::__getInstance();
$login = Neuron_Core_Login::__getInstance();
// Window settings
$this->setAllowOnlyOnce();
$data = $this->getRequestData();
$this->village = Dolumar_Players_Village::getMyVillage($data['vid']);
if ($login->isLogin() && $this->village && $this->village->isActive()) {
$this->setTitle($text->get('build', 'menu', 'main') . ' (' . Neuron_Core_Tools::output_varchar($this->village->getName()) . ')');
$this->setSize('290px', '300px');
} else {
$this->setTitle($text->get('build', 'menu', 'main'));
$this->setSize('250px', '150px');
}
}
示例10: setSettings
public function setSettings()
{
$text = Neuron_Core_Text::__getInstance();
$login = Neuron_Core_Login::__getInstance();
// Window settings
$this->setSize('250px', '245px');
$this->setAllowOnlyOnce();
$data = $this->getRequestData();
// Construct village
$this->village = Dolumar_Players_Village::getVillage($data['vid']);
if ($login->isLogin() && $this->village->isFound()) {
$this->setTitle($text->get('technologies', 'menu', 'main') . ' (' . Neuron_Core_Tools::output_varchar($this->village->getName()) . ')');
} else {
$this->village = false;
$this->setTitle($text->get('technologies', 'menu', 'main'));
}
}
示例11: getChooseUnit
protected function getChooseUnit($building)
{
$building = $this->village->buildings->getBuilding($building);
if (!$building instanceof $this->buildingType) {
return '<p>Invalid input: building not found.</p>';
}
// Count the thieves in this building
$allUnits = $building->getUnits();
$page = new Neuron_Core_Template();
$page->setTextSection('chooseUnit', 'thievery');
$units = array();
foreach ($allUnits as $v) {
$location = $v->getLocation();
$units[] = array('id' => $v->getId(), 'name' => $v->getName(false, true), 'location' => Neuron_Core_Tools::output_varchar($location->getName()), 'location_id' => $location->getId(), 'moving' => $v->isMoving() ? Neuron_Core_Tools::getCountdown($v->getArrivalDate()) : null);
}
$page->set('units', $units);
return $page->parse('thieves/chooseThief.phpt');
}
示例12: getCurrentUnits
private function getCurrentUnits($village)
{
$text = Neuron_Core_Text::__getInstance();
$text->setFile('unit');
$text->setSection('units');
//$units = $village->getDefendingUnits ();
$units = $village->getAllUnits();
$page = new Neuron_Core_Template();
// Print stat names
Dolumar_Units_Unit::printStatNames($page);
$page->set('noUnits', $text->get('noUnits'));
$page->set('about', $text->get('about'));
$page->set('villageId', $this->village->getId());
$page->set('squads', $text->getClickTo($text->get('toSquads')));
foreach ($units as $v) {
$page->addListValue('units', array('name' => Neuron_Core_Tools::output_varchar($v->getName()), 'stats' => $v->getStats($village), 'available' => $v->getAvailableAmount(), 'total' => $v->getTotalAmount(), 'consumption' => $v->getCurrentConsumption_text($village), 'type' => $v->getAttackType_text(), 'image' => $v->getImageUrl()));
}
$page->sortList('units');
return $page->parse('units.tpl');
}
示例13: setSettings
public function setSettings()
{
$text = Neuron_Core_Text::__getInstance();
$login = Neuron_Core_Login::__getInstance();
// Window settings
$this->setSize('250px', '350px');
$data = $this->getRequestData();
if (!isset($data['vid'])) {
$data['vid'] = 0;
}
$this->village = Dolumar_Players_Village::getMyVillage($data['vid']);
// Window settings
if ($login->isLogin() && $this->village->isFound() && $this->village->getOwner()->getId() == $login->getUserId()) {
$this->setTitle($text->get('overview', 'menu', 'main') . ' (' . Neuron_Core_Tools::output_varchar($this->village->getName()) . ')');
} else {
$this->setTitle($text->get('overview', 'menu', 'main'));
}
$this->setAllowOnlyOnce();
$this->setClassName('overview');
}
示例14: getContent
public function getContent()
{
$text = Neuron_Core_Text::getInstance();
$player = Neuron_GameServer::getPlayer();
if (!$player) {
return $this->throwError($text->get('login', 'login', 'account'));
}
$page = new Neuron_Core_Template();
$page->set('nickname', '');
// Ignore a player.
$input = $this->getInputData();
$nickname = isset($input['nickname']) ? $input['nickname'] : null;
if (!empty($nickname)) {
$target = Neuron_GameServer_Player::getFromName($nickname);
if ($target && $target->getId() == $player->getId()) {
$page->set('error', 'ignore_yourself');
} else {
if ($target) {
$player->setIgnoring($target);
} else {
$page->set('nickname', $nickname);
$page->set('error', 'player_not_found');
}
}
}
// Unignore a player
if (isset($input['unignore'])) {
$target = Neuron_GameServer::getPlayer($input['unignore']);
if ($target) {
$player->setIgnoring($target, false);
}
}
foreach ($player->getIgnoredPlayers() as $v) {
$page->addListValue('players', array('id' => $v->getId(), 'name' => Neuron_Core_Tools::output_varchar($v->getName())));
}
return $page->parse('gameserver/account/ignorelist.phpt');
}
示例15: requestClanPassword
protected function requestClanPassword($race, $objClan)
{
$data = $this->getInputData();
$page = new Neuron_Core_Template();
$page->set('wrongPass', isset($data['password']));
$page->set('race', $race);
$page->set('clan', $objClan->getId());
$page->set('clanname', Neuron_Core_Tools::output_varchar($objClan->getName()));
return $page->parse('gameserver/account/clanPassword.phpt');
}