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


PHP Neuron_Core_Tools::output_text方法代码示例

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


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

示例1: getContent

 public function getContent()
 {
     $me = Neuron_GameServer::getPlayer();
     $text = Neuron_Core_Text::__getInstance();
     $text->setFile('unit');
     $text->setSection('equipment');
     if ($this->village && $this->village->isActive() && $this->village->getOwner() && $this->village->getOwner()->getId() == $me->getId()) {
         $page = new Neuron_Core_Template();
         $page->set('noItems', $text->get('noItems'));
         $page->set('available', $text->get('available'));
         $page->set('total', $text->get('total'));
         $equipment = $this->village->getEquipment();
         $yourEquipment = array();
         foreach ($equipment as $type => $items) {
             if (count($items) > 0) {
                 $yourEquipment[$type] = array('type' => $text->get($type, 'types', 'equipment'), 'items' => array());
                 foreach ($items as $item) {
                     $yourEquipment[$type]['items'][] = array($item->getName(true), $item->getAvailableAmount(), $item->getAmount(), Neuron_Core_Tools::output_text($item->getStats_text()));
                 }
             }
         }
         $page->set('equipment', $yourEquipment);
         return $page->parse('equipment.tpl');
     } else {
         return '<p class="false">' . $text->get('login', 'login', 'account') . '</p>';
     }
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:27,代码来源:Equipment.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: getEquipmentStats

 private function getEquipmentStats()
 {
     $equipment = Dolumar_Players_Equipment::getAllEquipment();
     $types = array();
     foreach ($equipment as $v) {
         $type = $v->getItemType();
         if (!isset($types[$type])) {
             $types[$type] = array();
         }
         $types[$type][] = $v;
     }
     $html = '<div class="equipment-report fancybox">';
     foreach ($types as $type => $data) {
         $this->sortLogables($data);
         $html .= '<div class="equipment-type">';
         $html .= '<h2>' . $type . '</h2>';
         foreach ($data as $equipment) {
             $html .= '<div class="equipment">';
             $html .= '<h3>' . $equipment->getName() . ' (' . $equipment->getCategory() . ')</h3>';
             for ($i = 1; $i <= Dolumar_Players_Village_Equipment::EQUIPMENT_MAX_LEVEL; $i++) {
                 $equipment->setLevel($i);
                 $html .= '<div class="equipment-level">';
                 $html .= '<h4>' . $i . ': ' . $equipment->getName() . '</h4>';
                 $html .= Neuron_Core_Tools::output_text($equipment->getStats_text());
                 $html .= '<p class="equipment-costs"><span class="stat-title">Cost: </span>' . $equipment->getCraftCost_text() . '</p>';
                 $html .= '</div>';
             }
             $html .= '</div>';
         }
         $html .= '</div><div class="clearer"></div>';
     }
     return $html . '</div>';
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:33,代码来源:Report.php

示例4: getCustomContent

 public function getCustomContent($input)
 {
     $data = $this->getData();
     if (!$data) {
         return null;
     }
     $content = json_decode($data['t_description'], true);
     return Neuron_Core_Tools::output_text($this->getTranslatedContent($content, 'description'));
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:9,代码来源:BonusBuilding.php

示例5: getContent

 public function getContent()
 {
     $player = Neuron_GameServer::getPlayer();
     if ($player && $player->isPlaying()) {
         $page = new Neuron_Core_Template();
         // Check for welcome message
         if (isset($_SESSION['welcome_html'])) {
             $page->set('welcome', $_SESSION['welcome_html']);
         }
         $server = Neuron_GameServer_Server::getInstance();
         $txt = $server->getText('headline');
         $page->set('headline', isset($txt) ? Neuron_Core_Tools::output_text($txt) : null);
         $page->set('nickname', $player->getDisplayName());
         $page->set('isPremium', $player->isPremium());
         $page->set('date', date(DATE, $player->getPremiumEndDate()));
         $page->set('isFreePremium', !$player->isProperPremium());
         $msg = Neuron_GameServer_Mappers_CachedChatMapper::getInstance();
         $messages = $msg->countUnreadMessages($player);
         $page->set('inbox', $messages);
         $clans = $player->getClans();
         $page->set('hasclan', count($clans) > 0);
         if (count($clans) > 0) {
             $objlogs = Dolumar_Players_ClanLogs::getInstance();
             $objlogs->clearMyVillages();
             foreach ($player->getVillages() as $village) {
                 $objlogs->addMyVillage($village);
             }
             $logs = $objlogs->getClanLogs($clans, 0, 3);
             foreach ($logs as $v) {
                 $page->addListValue('logs', array('date' => date(DATETIME, $v['timestamp']), 'text' => $objlogs->getLogText($v)));
             }
         }
         // Fetch thze news
         if (defined('GAMENEWS_RSS_URL')) {
             $text = Neuron_Core_Text::getInstance();
             $localized_link = str_replace('{lang}', $text->getCurrentLanguage(), GAMENEWS_RSS_URL);
             $rss = new Neuron_Core_RSSParser($localized_link);
             $rss->setCache(Neuron_Core_Cache::getInstance('newsfeed/'));
             foreach ($rss->getItems(3) as $v) {
                 $page->addListValue('gamenews', array('date' => $v['date'] ? date(DATETIME, $v['date']) : null, 'title' => $v['title'], 'url' => $v['url']));
             }
         }
         return $page->parse('dolumar/welcome/welcome.phpt');
     }
     return false;
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:46,代码来源:Welcome.php

示例6: getMessage

 private function getMessage($input, $page)
 {
     $player = Neuron_GameServer::getPlayer();
     if (!$input['pg_read']) {
         $db = Neuron_DB_Database::getInstance();
         $db->query("\n\t\t\t\tUPDATE\n\t\t\t\t\tn_players_guide\n\t\t\t\tSET\n\t\t\t\t\tpg_read = '1'\n\t\t\t\tWHERE\n\t\t\t\t\tpg_id = {$input['pg_id']}\n\t\t\t");
     }
     $qdata = Neuron_GameServer_LogSerializer::decode($input['pg_data']);
     $data = array();
     foreach ($qdata as $k => $v) {
         $data[$k] = $v->getName();
     }
     // Add some extra fields
     $data['player'] = $player->getName();
     $text = Neuron_Core_Text::getInstance();
     $txt = $text->getTemplate(self::TEMPLATE_PATH . $input['pg_template'], $data);
     return array('html' => Neuron_Core_Tools::output_text($txt), 'class' => $this->getClassname($input['pg_character'], $input['pg_mood']), 'highlight' => $input['pg_highlight'], 'record' => $input['pg_id']);
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:18,代码来源:Guide.php

示例7: getCraftItem

 private function getCraftItem($id, $input)
 {
     $db = Neuron_Core_Database::__getInstance();
     // Check if this building is crafting already
     $l = $db->select('villages_items', array('i_id'), "i_bid = '" . $this->getId() . "' AND i_endCraft > '" . time() . "'");
     if (count($l) > 0) {
         $text = Neuron_Core_Text::__getInstance();
         $page = new Neuron_Core_Template();
         $page->set('working', $text->get('working', 'crafting', 'buildings'));
         $page->set('toReturn', $text->getClickTo($text->get('toReturn', 'crafting', 'buildings')));
         return $page->parse('buildings/working.tpl');
     } else {
         $equipment = $this->getCraftableItems();
         // Search for key
         $key = false;
         $equips = $this->getCraftableItems();
         foreach ($equips as $k => $v) {
             if ($v->getId() == $id) {
                 $key = $k;
             }
         }
         if ($key !== false) {
             $item = $equips[$key];
             $text = Neuron_Core_Text::__getInstance();
             $text->setFile('buildings');
             $text->setSection('crafting');
             // Check for input
             if (isset($input['amount']) && is_numeric($input['amount'])) {
                 $aantal = abs(floor($input['amount']));
                 $cost = $item->getCraftCost($this->getVillage(), $aantal);
                 // Remove resources
                 if ($this->getVillage()->resources->takeResourcesAndRunes($cost)) {
                     $this->getVillage()->craftEquipment($this, $item, $item->getCraftDuration($this->getVillage(), $aantal), $aantal);
                     //return $this->getOverview ();
                     return '<p>' . $text->get('done') . '</p>';
                 } else {
                     $error = $text->get('noResources');
                 }
             }
             $page = new Neuron_Core_Template();
             // Get max craftable
             $player = $this->getVillage()->getOwner();
             if ($player->isPremium()) {
                 $page->set('maxcraftable', Neuron_Core_Tools::putIntoText($text->get('maxcraftable'), array('amount' => $this->calculateMaxCraftable($item), 'items' => $item->getName(true))));
             }
             if (isset($error)) {
                 $page->set('error', $error);
             }
             $page->set('title', $text->get('title'));
             $page->set('amount', $text->get('amount'));
             $page->set('submit', $text->get('submit'));
             $page->set('itemId', $item->getId());
             $page->set('section', 'crafting');
             $page->set('cost', $this->getCost($item));
             $page->set('duration', Neuron_Core_Tools::putIntoText($text->get('duration'), array($item->getName(), Neuron_Core_Tools::getDuration($item->getCraftDuration($this->getVillage())))));
             $page->set('stats', Neuron_Core_Tools::output_text($item->getStats_text(), false));
             $page->set('about', Neuron_Core_Tools::putIntoText($text->get('craft'), array($item->getName(true))));
             $page->set('return', $text->getClickTo($text->get('toReturn')));
             return $page->parse('buildings/crafting.tpl');
         } else {
             return $this->getOverview();
         }
     }
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:64,代码来源:Crafting.php

示例8: sendNewsletter

 public function sendNewsletter($newsletter, $data)
 {
     $text = Neuron_Core_Text::getInstance();
     $credits = Neuron_GameServer_Credits::getPureCreditsObject();
     $plaintext = $text->getTemplate('newsletters/' . $newsletter, $data);
     $subject = Neuron_Core_Tools::putIntoText($text->get($newsletter, 'subjects', 'newsletters'), $data);
     // Now put it in html
     $page = new Neuron_Core_Template();
     $page->set('subject', $subject);
     $page->set('content', Neuron_Core_Tools::output_text($plaintext));
     $content = $page->parse('mailtemplate.phpt');
     //echo $page->parse ('mailtemplate.phpt');
     //exit;
     $credits->sendNewsletter($subject, $content, $plaintext, 'en');
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:15,代码来源:Server.php

示例9: htmlentities

<?php

$input = Neuron_Core_Tools::getInput('_POST', 'bbcode', 'varchar');
?>

<h2>Input</h2>
<form method="post">
	<fieldset>
		<ol>
			<li>
				<label>BBCode:</label>
				<textarea name="bbcode" cols="100" rows="20"><?php 
echo $input;
?>
</textarea>
			</li>
			
			<li>
				<button type="submit"><span>Submit</span></button>
			</li>
		</ol>
	</fieldset>
</form>

<h2>Output</h2>
<?php 
echo '<pre>' . htmlentities(Neuron_Core_Tools::output_text($input)) . '</pre>';
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:27,代码来源:bbcode.php

示例10: getOverview

 private function getOverview($clan)
 {
     $_SESSION['clan_overview_lastrefresh'] = time();
     // Change the title
     $text = Neuron_Core_Text::__getInstance();
     $this->setTitle($text->get('clan', 'menu', 'main') . ': ' . Neuron_Core_Tools::output_varchar($clan->getName()));
     $page = new Neuron_Core_Template();
     // Check for errors
     $error = $clan->getError();
     if (isset($error)) {
         $page->set('error', $text->get($error, 'errors', 'clan'));
     }
     $myself = Neuron_GameServer::getPlayer();
     $canJoin = $myself && !$clan->isMember($myself);
     $canLeave = $myself && $clan->isMember($myself);
     $page->setTextSection('overview', 'clan');
     $page->set('clanname', Neuron_Core_Tools::output_varchar($clan->getName()));
     $page->set('clanid', $clan->getId());
     foreach ($clan->getMembers() as $v) {
         $status = $clan->getMemberStatus($v);
         $page->addListValue('members', array('id' => $v->getId(), 'name' => Neuron_Core_Tools::output_varchar($v->getNickname()), 'status' => $status, 'status_t' => $text->get($status, 'roles', 'clan'), 'online' => $v->isOnline() ? 'online' : 'offline'));
     }
     // Check if it's possible to join
     $page->set('canJoin', $canJoin);
     $page->set('canLeave', $canLeave);
     $page->set('canGovern', $clan->isLeader($myself));
     $desc = $clan->getDescription();
     if (!empty($desc)) {
         $page->set('description', Neuron_Core_Tools::output_text($desc));
     }
     return $page->parse('clan/overview.phpt');
 }
开发者ID:Toxicat,项目名称:dolumar,代码行数:32,代码来源:Clan.php

示例11: parseNewFile

 private static function parseNewFile($file)
 {
     $text = Neuron_Core_Text::__getInstance();
     $params1 = 'api.php?action=query&prop=revisions&rvprop=timestamp|user|comment|content&format=php&titles=';
     $params2 = 'api.php?action=query&prop=imageinfo&iiprop=url&format=php&titles=';
     $url = WIKI_GUIDE_URL . $params1 . urlencode($file);
     // Load file from wiki
     $wiki = file_get_contents($url);
     $wiki = unserialize($wiki);
     // Get the real content
     $content = Neuron_Core_Tools::getArrayFirstValue($wiki['query']['pages']);
     if (!isset($content[1]['revisions'])) {
         return false;
     } else {
         $content = Neuron_Core_Tools::getArrayFirstValue($content[1]['revisions']);
         $content = $content[1]['*'];
         // Search for thze images
         $images = array();
         //[[Image:Voorbeeld.png]]
         // Replace external links
         $images = array();
         preg_match_all("/\\[\\[Image:([^|]*?)]]/si", $content, $images, PREG_PATTERN_ORDER);
         // Fetch all image infos
         $imageOut = array();
         foreach ($images[1] as $k => $v) {
             $imgs = WIKI_GUIDE_URL . $params2 . 'Image:' . addslashes($v);
             $imgdata = unserialize(file_get_contents($imgs));
             $imgdata = Neuron_Core_Tools::getArrayFirstValue($imgdata['query']['pages']);
             if (isset($imgdata[1]['imageinfo'])) {
                 $sUrl = WIKI_GUIDE_URL . substr($imgdata[1]['imageinfo'][0]['url'], 1);
                 $content = str_replace($images[0][$k], '***img***' . $sUrl . '***/img***', $content);
             }
         }
         // Replace external links
         $content = preg_replace('/([^\\[]{1})' . '\\[' . '([^ \\]]+)' . '\\]' . '([^\\]]{1})' . '/si', '\\1[url]\\2[/url]\\3', $content);
         $content = preg_replace('/([^\\[]{1})' . '\\[' . '([^ \\]]+)' . ' ([^\\]]+)' . '\\]' . '([^\\]]{1})' . '/si', '\\1[url=\\2]\\3[/url]\\4', $content);
         // Replace code
         $content = str_replace('<code>', '[code]', $content);
         $content = str_replace('</code>', '[/code]', $content);
         $content = str_replace('***img***', '[img align="left"]', $content);
         $content = str_replace('***/img***', '[/img]', $content);
         // Replace headers
         $content = preg_replace("/====([^|]*?)====/si", "[h4]\\1[/h4]", $content);
         $content = preg_replace("/===([^|]*?)===/si", "[h3]\\1[/h3]", $content);
         $content = preg_replace("/==([^|]*?)==/si", "[h2]\\1[/h2]", $content);
         $content = html_entity_decode($content, ENT_NOQUOTES, 'UTF-8');
         $content = preg_replace("/\\[\\[([^|]*?)]]/si", '[action title="\\1" data="{\'page\':\\1\'}"]\\1[/action]', $content);
         $content = preg_replace("/\\[\\[([^|\\[]*?)\\|([^|\\]]*?)\\]\\]/si", '[action title="\\2" data="{\'page\':\'\\1\'}"]\\2[/action]', $content);
         $content = Neuron_Core_Tools::output_text($content);
         return $content;
     }
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:52,代码来源:Wiki.php

示例12: getRefresh

 public function getRefresh()
 {
     $db = Neuron_Core_Database::__getInstance();
     $input = $this->getRequestData();
     if (!isset($input['channel'])) {
         $this->switchChannel($this->getDefaultChannel());
     } else {
         $this->channel = intval($input['channel']);
     }
     $data = $this->getRequestData();
     $newStuff = $data['lastMessage'];
     $maxtime = NOW + 25;
     // Check for new messages
     $messages = $this->getLastMessages($newStuff);
     if ($messages === false) {
         return;
     }
     // Close the session (lock)
     session_write_close();
     // Only use persistent connection if we also use memcache
     // Otherwise it would stress out the database
     $usePersistence = self::USE_PERSISTENT_CONNECTIONS && defined('MEMCACHE_IP');
     // Sleep until there are messages
     if ($usePersistence) {
         while (count($messages) == 0 && time() < $maxtime) {
             // Check again
             $messages = $this->getLastMessages($newStuff);
             if ($messages === false) {
                 return;
             }
             // Sleep half a second
             //usleep (500);
             usleep(0.5 * 1000000);
         }
     } else {
         $messages = $this->getLastMessages($newStuff);
         if ($messages == false) {
             return;
         }
     }
     // Debug check
     if (count($messages) == 0) {
         return;
     }
     $page = new Neuron_Core_Template();
     $i = 0;
     $login = Neuron_Core_Login::__getInstance();
     $plid = $login->isLogin() ? $login->getUserId() : 0;
     $player = Neuron_GameServer::getPlayer();
     foreach ($messages as $v) {
         $sender = Neuron_GameServer::getPlayer($v['plid']);
         $biggest = $v['msgId'];
         if ($player && $player->isIgnoring($v['plid'])) {
             continue;
         }
         $i++;
         $sTarget = null;
         $iTarget = null;
         $message = $v['msg'];
         /*
         	const CHAT_GROUP_ALL = 0;
         	const CHAT_GROUP_USER = 1;
         	const CHAT_GROUP_CLAN = 2;
         */
         switch ($v['target_group']) {
             case self::CHAT_GROUP_USER:
                 $sClassname = 'message';
                 $sTarget = Dolumar_Players_Player::getFromId($v['target_id'])->getDisplayName();
                 $iTarget = $v['target_id'];
                 break;
             case self::CHAT_GROUP_CLAN:
                 $sClassname = 'clan';
                 break;
             case self::CHAT_GROUP_ALL:
             default:
                 switch ($v['mtype']) {
                     case self::CHAT_CLASS_ME:
                         $sClassname = 'all me';
                         break;
                     case self::CHAT_CLASS_REGULAR:
                     default:
                         $sClassname = 'all';
                         break;
                 }
                 break;
         }
         $page->addListValue('msgs', array('message' => Neuron_Core_Tools::output_text($message, true, true, false, false), 'date' => date(self::DATE_FORMAT, $v['datum']), 'nickname' => $sender->getDisplayName(), 'plid' => $v['plid'], 'class' => $sClassname, 'target' => $sTarget, 'targetId' => $iTarget, 'isMine' => $v['plid'] == $plid));
     }
     if ($i > 0) {
         // Shouldn't ever be true... but well, just to be sure.
         if ($biggest > $this->objCache->getCache($this->sCacheKey)) {
             $this->objCache->setCache($this->sCacheKey, $biggest);
         }
         $this->addHtmlToElement('chatdiv', $page->parse('chatmsgs.tpl'), 'bottom');
     }
     if ($biggest > $newStuff) {
         $this->updateRequestData(array('lastMessage' => $biggest, 'channel' => $this->channel));
     }
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:99,代码来源:OldChat.php

示例13: getList

 function getList($topic)
 {
     global $fdb;
     global $scopeBuster;
     $input = $scopeBuster->input;
     safen($topic);
     global $theNumbers;
     if (isset($input['pageNumber'])) {
         $pageno = intval($input['pageNumber']);
     } else {
         $pageno = 1;
     }
     $rows_per_page = 15;
     $dbquery = $fdb->x("SELECT COUNT(*) FROM `forum_posts` WHERE `topic_id`='{$topic}'");
     $dbquery = array_pop($dbquery);
     $numrows = array_pop($dbquery);
     $lastpage = ceil($numrows / $rows_per_page);
     if ($pageno < 1) {
         $pageno = 1;
     } elseif ($pageno > $lastpage) {
         $pageno = $lastpage;
     }
     $theNumbers->start = 0;
     $theNumbers->last = $lastpage;
     $theNumbers->curpage = $pageno;
     $flim = $pageno - 1 < 0 ? 0 : $pageno - 1;
     $limIns = 'LIMIT ' . $flim * $rows_per_page . ',' . $rows_per_page;
     //$limIns = '';
     $result = $fdb->x("\n\t\t\tSELECT\n\t\t\t\t`ID`,\n\t\t\t\t`number`,\n\t\t\t\t`poster_id`,\n\t\t\t\t`created`,\n\t\t\t\t`edited_time`,\n\t\t\t\t`edits`,\n\t\t\t\t`edit_by`,\n\t\t\t\t`post_content`\n\t\t\tFROM\n\t\t\t\t`forum_posts`\n\t\t\tWHERE\n\t\t\t\t`topic_id`='{$topic}'\n\t\t\tORDER BY\n\t\t\t\tID ASC\n\t\t\t{$limIns}\n\t\t");
     $final = array();
     foreach ($result as $res) {
         $final[] = array('ID' => $res['ID'], 'poster' => getName($res['poster_id']), 'posterID' => $res['poster_id'], 'created' => date(DATETIME, $res['created']), 'editedTime' => date(DATETIME, $res['edited_time']), 'number' => $res['number'], 'edits' => $res['edits'], 'editBy' => getName($res['edit_by']), 'content' => Neuron_Core_Tools::output_text($res['post_content']), 'canEdit' => $this->master->isMod == true || $this->master->userID == $res['poster_id'] && $this->master->userID != 0);
     }
     ksort($final);
     return $final;
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:36,代码来源:Forum.php

示例14: getUserOverview

 private function getUserOverview(Neuron_GameServer_Player $objUser)
 {
     $admin = Neuron_GameServer::getPlayer();
     $page = new Neuron_Core_Template();
     $page->set('username', Neuron_Core_Tools::output_varchar($objUser->getName()));
     $page->set('email', $objUser->getEmail());
     $page->set('registration', date('d/m/Y H:i:s', $objUser->getCreationDate()));
     $page->set('lastrefresh', date('d/m/Y H:i:s', $objUser->getLastRefresh()));
     $page->set('premiumend', date('d/m/Y H:i:s', $objUser->getPremiumEndDate()));
     foreach ($objUser->getVillages() as $v) {
         $page->addListValue('villages', array('village' => Neuron_Core_Tools::output_varchar($v->getName()), 'url' => ABSOLUTE_URL . '#' . implode($v->buildings->getTownCenterLocation(), ',')));
     }
     $page->set('reset_url', $this->getUrl('user', array('id' => $objUser->getId(), 'action' => 'reset')));
     if ($admin->isModerator()) {
         $page->set('logs_url', $this->getUrl('gamelogs', array('players' => $objUser->getId())));
         $page->set('contact_url', $this->getUrl('messages', array('view' => 'write', 'target' => $objUser->getNickname())));
     }
     if ($admin->isAdmin()) {
         if (isset($_POST['admin_status'])) {
             $status = Neuron_Core_Tools::getInput('_POST', 'admin_status', 'int');
             $objUser->setAdminStatus($status);
         }
         $page->set('admin_action', $this->getUrl('user', array('id' => $objUser->getId())));
         $modes = array();
         foreach ($objUser->getAdminModes() as $k => $v) {
             if ($k < $admin->getAdminStatus()) {
                 $modes[$k] = $v;
             }
         }
         $page->set('admin_modes', $modes);
     }
     $page->set('adminmode', $objUser->getAdminStatus());
     $page->set('adminmodestring', $objUser->getAdminStatusString());
     $page->set('banoptions', array(300 => '5 minutes', 1800 => '30 minutes', 3600 => '1 hour', 21600 => '6 hours', 86400 => '1 day', 604800 => '1 week', 1209600 => '2 weeks', 2678400 => '1 month', 31536000 => '1 year'));
     $this->addBans($page, $objUser);
     $data = $this->getModeratorHistory($objUser);
     foreach ($data as $v) {
         if (!$v['isProcessed']) {
             $status = 'pending';
         } elseif ($v['isExecuted']) {
             $status = 'approved';
         } else {
             $status = 'declined';
         }
         $reason = Neuron_Core_Tools::output_text($v['reason']);
         $rcheck = strip_tags($reason);
         $rcheck = trim($rcheck);
         $page->addListValue('history', array('date' => date(DATETIME, $v['date']), 'action' => $v['action'], 'reason' => !empty($rcheck) ? $reason : null, 'admin' => $v['admin']->getDisplayName(), 'isExecuted' => $v['isExecuted'], 'isProcessed' => $v['isProcessed'], 'status' => $status));
     }
     $openids = $objUser->getOpenIDs();
     foreach ($openids as $v) {
         $page->addListValue('openids', array('url' => $v));
     }
     if (Neuron_GameServer::getPlayer()->getAdminStatus() >= 9) {
         $page->set('refundcredits', $this->getUrl('user', array('id' => $objUser->getId())));
         $credits = Neuron_Core_Tools::getInput('_POST', 'refundcredits', 'int');
         $reason = Neuron_Core_Tools::getInput('_POST', 'refundreason', 'varchar');
         if ($credits && $reason) {
             if ($this->refundCredits($objUser, $credits, $reason)) {
                 $page->set('refunddone', true);
             }
         }
     }
     return $page->parse('pages/admin/user/overview.phpt');
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:65,代码来源:User.php


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