本文整理汇总了PHP中XenForo_Template_Helper_Core::numberFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Template_Helper_Core::numberFormat方法的具体用法?PHP XenForo_Template_Helper_Core::numberFormat怎么用?PHP XenForo_Template_Helper_Core::numberFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Template_Helper_Core
的用法示例。
在下文中一共展示了XenForo_Template_Helper_Core::numberFormat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionWithdraw
public function actionWithdraw()
{
$visitor = XenForo_Visitor::getInstance();
$xenOptions = XenForo_Application::getOptions();
if (!$visitor->hasPermission('thAffiliatePermissions', 'earnAffiliatePoints') || !$xenOptions->th_affiliate_enableAffiliatePoints) {
return $this->responseNoPermission();
}
if ($this->isConfirmedPost()) {
$amount = $this->_input->filterSingle('amount', XenForo_Input::FLOAT);
if ($amount < $xenOptions->th_affiliate_minWithdraw) {
return $this->responseError(new XenForo_Phrase('th_you_must_withdraw_at_least_x_affiliate', array('amount' => XenForo_Template_Helper_Core::numberFormat($xenOptions->th_affiliate_minWithdraw, 2))));
}
if ($amount > $visitor['affiliate_points']) {
return $this->responseError(new XenForo_Phrase('th_you_do_not_have_enough_points_affiliate', array('amount' => XenForo_Template_Helper_Core::numberFormat($xenOptions->th_affiliate_minWithdraw, 2))));
}
$newPoints = $visitor['affiliate_points'] - $amount;
$userWriter = XenForo_DataWriter::create('XenForo_DataWriter_User');
$userWriter->setExistingData(XenForo_Visitor::getUserId());
$userWriter->set('affiliate_points', $newPoints);
$userWriter->save();
$withdrawalWriter = XenForo_DataWriter::create('ThemeHouse_Affiliate_DataWriter_Withdraw');
$withdrawalWriter->set('user_id', XenForo_Visitor::getUserId());
$withdrawalWriter->set('amount', $amount);
$withdrawalWriter->save();
return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, XenForo_Link::buildPublicLink('affiliate'), new XenForo_Phrase('th_your_withdrawal_request_has_been_submitted_affiliate'));
} else {
$viewParams = array();
return $this->responseView('ThemeHouse_Affiliate_ViewPublic_Affiliate_Withdraw', 'th_withdraw_affiliate', $viewParams);
}
}
示例2: extraPrepareTitle
public function extraPrepareTitle(array $widget)
{
if (empty($widget['title'])) {
return new XenForo_Phrase('wf_online_users');
}
$preparedTitle = parent::extraPrepareTitle($widget);
if ($preparedTitle instanceof XenForo_Phrase) {
$onlineUsers = $this->_getOnlineUsers();
$params = $preparedTitle->getParams();
foreach ($onlineUsers as $key => $value) {
if (is_numeric($value)) {
$params[$key] = XenForo_Template_Helper_Core::numberFormat($value);
}
}
$preparedTitle->setParams($params);
}
return $preparedTitle;
}
示例3: foreach
';
foreach ($postrating_ratings_out as $id => $rating) {
$__compilerVar2 .= '
<li>
';
if ($rating['name']) {
if ($rating['sprite_mode']) {
$__compilerVar2 .= '<img src="styles/default/xenforo/clear.png" alt="' . htmlspecialchars($rating['title'], ENT_QUOTES, 'UTF-8') . '" title="' . htmlspecialchars($rating['title'], ENT_QUOTES, 'UTF-8') . '" style="background: url(\'styles/dark/ratings/' . htmlspecialchars($rating['name'], ENT_QUOTES, 'UTF-8') . '\') no-repeat ' . htmlspecialchars($rating['sprite_params']['x'], ENT_QUOTES, 'UTF-8') . 'px ' . htmlspecialchars($rating['sprite_params']['y'], ENT_QUOTES, 'UTF-8') . 'px; width: ' . htmlspecialchars($rating['sprite_params']['w'], ENT_QUOTES, 'UTF-8') . 'px; height: ' . htmlspecialchars($rating['sprite_params']['h'], ENT_QUOTES, 'UTF-8') . 'px;" />';
} else {
$__compilerVar2 .= '<img src="styles/dark/ratings/' . htmlspecialchars($rating['name'], ENT_QUOTES, 'UTF-8') . '" alt="' . htmlspecialchars($rating['title'], ENT_QUOTES, 'UTF-8') . '" title="' . htmlspecialchars($rating['title'], ENT_QUOTES, 'UTF-8') . '" />';
}
}
if (!$postrating_ratings_lots || !$rating['name']) {
$__compilerVar2 .= ' ' . htmlspecialchars($rating['title'], ENT_QUOTES, 'UTF-8') . ' ';
}
$__compilerVar2 .= ' x <strong>' . XenForo_Template_Helper_Core::numberFormat($rating['count'], '0') . '</strong>
</li>
';
}
$__compilerVar2 .= '
';
if (trim($__compilerVar2) !== '') {
$__compilerVar1 .= '
' . $__compilerVar2 . '
';
if ($postrating_can_list) {
$__compilerVar1 .= '
<li> <a href="' . XenForo_Template_Helper_Core::link('posts/ratings', $post, array()) . '" class="dark_postrating_list OverlayTrigger" data-cacheOverlay="false">' . 'List' . '</a></li>
';
}
$__compilerVar1 .= '
示例4: htmlspecialchars
<input type="hidden" name="_xfToken" value="' . htmlspecialchars($visitor['csrf_token_page'], ENT_QUOTES, 'UTF-8') . '" />
</form>
';
} else {
$__compilerVar2 .= '
<div class="rating ';
if ($xenOptions['threadrating_greyedout']) {
$__compilerVar2 .= 'tr_greyedout';
}
$__compilerVar2 .= '">
<dl>
<dt class="prompt muted">' . $prompt . '</dt>
<dd>
<span class="ratings" title="' . XenForo_Template_Helper_Core::numberFormat($__compilerVar1, '2') . '">
<span class="star ' . ($__compilerVar1 >= 1 ? 'Full' : '') . (($__compilerVar1 >= 0.5 and $__compilerVar1 < 1) ? 'Half' : '') . '"></span
><span class="star ' . ($__compilerVar1 >= 2 ? 'Full' : '') . (($__compilerVar1 >= 1.5 and $__compilerVar1 < 2) ? 'Half' : '') . '"></span
><span class="star ' . ($__compilerVar1 >= 3 ? 'Full' : '') . (($__compilerVar1 >= 2.5 and $__compilerVar1 < 3) ? 'Half' : '') . '"></span
><span class="star ' . ($__compilerVar1 >= 4 ? 'Full' : '') . (($__compilerVar1 >= 3.5 and $__compilerVar1 < 4) ? 'Half' : '') . '"></span
><span class="star ' . ($__compilerVar1 >= 5 ? 'Full' : '') . (($__compilerVar1 >= 4.5 and $__compilerVar1 < 5) ? 'Half' : '') . '"></span>
</span>
<span class="RatingValue"><span class="Number" itemprop="average">' . htmlspecialchars($__compilerVar1, ENT_QUOTES, 'UTF-8') . '</span>/<span itemprop="best">5</span>,</span>
';
if ($threadrating['whoRated'] and $controllerName == 'XenForo_ControllerPublic_Thread' and $thread['thread_rate_count'] > 0) {
$__compilerVar2 .= '
<a href="' . XenForo_Template_Helper_Core::link('threads/whoRated', $thread, array()) . '" title="' . 'Who has rated this thread?' . '" class="OverlayTrigger"><span class="Hint">' . $hint . '</span></a>
';
} else {
$__compilerVar2 .= '
示例5:
</dl>
<dl>
<dt>' . 'Total Categories' . ':</dt>
<dd>' . XenForo_Template_Helper_Core::numberFormat($sidebar['stats']['categories'], '0') . '</dd>
</dl>
<dl>
<dt>' . 'Total Comments' . ':</dt>
<dd>' . XenForo_Template_Helper_Core::numberFormat($sidebar['stats']['comments'], '0') . '</dd>
</dl>
<dl>
<dt>' . 'Total Likes' . ':</dt>
<dd>' . XenForo_Template_Helper_Core::numberFormat($sidebar['stats']['likes'], '0') . '</dd>
</dl>
<dl>
<dt>' . 'Total Views' . ':</dt>
<dd>' . XenForo_Template_Helper_Core::numberFormat($sidebar['stats']['views'], '0') . '</dd>
</dl>
</div>
</div>
</div>
';
$__output .= $__compilerVar9;
unset($__compilerVar9);
$__output .= '
';
$__compilerVar14 = '';
$__compilerVar14 .= '<div class="medioCopy copyright muted">
<a href="http://xenforo.com/community/resources/97/">XenMedio</a>
© Jason Axelrod from <a href="http://8wayrun.com/">8WAYRUN.COM</a>
</div>';
示例6: array
<div class="member">
';
if ($friend['user_id']) {
$__compilerVar4 .= '
<h3 class="username">' . XenForo_Template_Helper_Core::callHelper('usernamehtml', array($friend, '', true, array('class' => 'StatusTooltip' . ($noOverlay ? ' NoOverlay' : ''), 'title' => XenForo_Template_Helper_Core::callHelper('snippet', array('0' => $friend['status'], '1' => '0', '2' => array('stripPlainTag' => '1')))))) . '</h3>
';
$__compilerVar5 = '';
$__compilerVar5 .= '<div class="userInfo">
<div class="userBlurb dimmed">' . XenForo_Template_Helper_Core::callHelper('userBlurb', array('0' => $friend)) . '</div>
<dl class="userStats pairsInline">
<dt title="' . 'Total messages posted by ' . htmlspecialchars($friend['username'], ENT_QUOTES, 'UTF-8') . '' . '">' . 'Bài viết' . ':</dt> <dd>' . XenForo_Template_Helper_Core::numberFormat($friend['message_count'], '0') . '</dd>
<dt title="' . 'Number of times something posted by ' . htmlspecialchars($friend['username'], ENT_QUOTES, 'UTF-8') . ' has been \'liked\'' . '">' . 'Đã được thích' . ':</dt> <dd>' . XenForo_Template_Helper_Core::numberFormat($friend['like_count'], '0') . '</dd>
<dt>' . 'Điểm thành tích' . ':</dt> <dd title="' . 'Điểm thành tích' . '">' . XenForo_Template_Helper_Core::numberFormat($friend['trophy_points'], '0') . '</dd>
</dl>
</div>
';
$__compilerVar4 .= $this->callTemplateHook('dark_member_list_info', $__compilerVar5, array('user' => $friend));
unset($__compilerVar5);
$__compilerVar4 .= '
';
} else {
if ($guestHtml) {
$__compilerVar4 .= '
<h3 class="username guest dimmed">' . $guestHtml . '</h3>
';
} else {
$__compilerVar4 .= '
<h3 class="username guest dimmed">' . 'Khách' . '</h3>
示例7: array
$__compilerVar18 = '';
if ($visitor['user_id']) {
$__compilerVar18 .= '
';
$this->addRequiredExternal('css', 'unread_posts_count');
$__compilerVar18 .= '
';
$unread = '';
$__compilerVar19 = '';
$unread .= $this->callTemplateCallback('UnreadPostCount_Callback', 'getUnreadCount', $__compilerVar19, array());
unset($__compilerVar19);
$__compilerVar18 .= '
<span class="postItemCount' . ($unread ? ' alert' : '') . '">
' . XenForo_Template_Helper_Core::numberFormat($unread, '0') . '
</span>
';
}
$__compilerVar17 .= $__compilerVar18;
unset($__compilerVar18);
$__compilerVar17 .= '</a></li>
';
$__compilerVar16 .= $this->callTemplateHook('navigation_tabs_forums', $__compilerVar17, array());
unset($__compilerVar17);
$__compilerVar16 .= '
</ul>
</div>
</li>
';
}
示例8: foreach
if ($report_data['results']['search']['data']) {
$__output .= '
<div class="keywordList section discussionList">
<dl class="sectionHeaders">
<dd class="main">' . 'Site Search Phrase' . ($report_data['results']['search']['sampled_data'] ? ' ' . '(sampled data!!!)' : '') . '</dd>
<dd>' . 'Total Searches' . '</dd>
</dl>
';
foreach ($report_data['results']['search']['data'] as $keywords) {
$__output .= '
<dl>
<li class="primaryContent">
<dd>' . htmlspecialchars($keywords['term'], ENT_QUOTES, 'UTF-8') . '</dd>
<dd>' . XenForo_Template_Helper_Core::numberFormat($keywords['total'], '0') . '</dd>
</li>
</dl>
';
}
$__output .= '
</div>
';
}
$__output .= '
<script>
$(document).ready(function(){
示例9: array
<a href="' . XenForo_Template_Helper_Core::link('resources/download', $resource, array('version' => $resource['current_version_id'])) . '" class="inner">
';
if ($resource['canDownload']) {
$__compilerVar2 .= 'Download Now';
} else {
$__compilerVar2 .= 'Download Not Available';
}
$__compilerVar2 .= '
';
if ($resource['download_url']) {
$__compilerVar2 .= '
<small class="minorText">' . 'Via external site' . '</small>
';
} else {
$__compilerVar2 .= '
<small class="minorText">' . XenForo_Template_Helper_Core::numberFormat($resource['attachment']['file_size'], 'size') . ' .' . htmlspecialchars($resource['attachment']['extension'], ENT_QUOTES, 'UTF-8') . '</small>
';
}
$__compilerVar2 .= '
</a>
</label></li>
';
}
}
$__compilerVar2 .= '
';
$__compilerVar3 = '';
$__compilerVar2 .= $this->callTemplateHook('resource_view_header_after_resource_buttons', $__compilerVar3, array());
unset($__compilerVar3);
$__compilerVar2 .= '
示例10: array
<?php
if (!class_exists('XenForo_Application', false)) {
die;
}
$__output = '';
$__output .= '<div class="pairsJustified">
<dl class="discussionCount"><dt>' . 'Đề tài thảo luận' . ':</dt>
<dd>' . XenForo_Template_Helper_Core::numberFormat($boardTotals['discussions'], '0') . '</dd></dl>
<dl class="messageCount"><dt>' . 'Bài viết' . ':</dt>
<dd>' . XenForo_Template_Helper_Core::numberFormat($boardTotals['messages'], '0') . '</dd></dl>
<dl class="memberCount"><dt>' . 'Thành viên' . ':</dt>
<dd>' . XenForo_Template_Helper_Core::numberFormat($boardTotals['users'], '0') . '</dd></dl>
<dl><dt>' . 'Thành viên mới nhất' . ':</dt>
<dd>' . XenForo_Template_Helper_Core::callHelper('usernamehtml', array($boardTotals['latestUser'], '', false, array())) . '</dd></dl>
<!-- slot: forum_stats_extra -->
</div>';
示例11: array
$__compilerVar18 .= '
<article>' . $templateHtml . '</article>
';
$__output .= $this->callTemplateHook('pagenode_container_article', $__compilerVar18, array());
unset($__compilerVar18);
$__output .= '
<div class="bottomContent">
';
if ($page['log_visits']) {
$__output .= '
<div class="pageCounter">
<dl class="pairsInline pageStats">
<dt>' . 'Published' . ':</dt> <dd>' . XenForo_Template_Helper_Core::date($page['publish_date'], '') . '</dd>
<dt>' . 'Page views' . ':</dt> <dd>' . XenForo_Template_Helper_Core::numberFormat($page['view_count'], '0') . '</dd>
</dl>
</div>
';
}
$__output .= '
';
$__compilerVar19 = '';
$__compilerVar19 .= XenForo_Template_Helper_Core::link('canonical:pages', $page, array());
$__compilerVar20 = '';
$__compilerVar21 = '';
$__compilerVar21 .= '
';
$__compilerVar22 = '';
$__compilerVar22 .= '
示例12: array
';
}
$__output .= '
';
if ($AjaxChatOnline['recordsUnseen']) {
$__output .= '
<li class="moreLink">... <a href="' . XenForo_Template_Helper_Core::link('chat/online', false, array()) . '" title="' . 'See all visitors' . '" class="OverlayTrigger">' . 'and ' . XenForo_Template_Helper_Core::numberFormat($AjaxChatOnline['recordsUnseen'], '0') . ' more' . '</a></li>
';
}
$__output .= '
</ol>
';
}
$__output .= '
<div class="footnote">
';
if ($AjaxChatOnline['guests']) {
$__output .= '
' . 'online_now_x_members_y_guests_z' . '
';
} else {
$__output .= '
' . 'Online now: ' . XenForo_Template_Helper_Core::numberFormat($AjaxChatOnline['total'], '0') . ' member(s).' . '
';
}
$__output .= '
</div>
</div>
</div>
<!-- end block: sidebar_online_users -->';
示例13: array
$__output .= '
<a href="' . XenForo_Template_Helper_Core::link('attachments', $attachment, array()) . '" target="_blank"><img
src="' . htmlspecialchars($attachment['thumbnailUrl'], ENT_QUOTES, 'UTF-8') . '" alt="' . htmlspecialchars($attachment['filename'], ENT_QUOTES, 'UTF-8') . '" /></a>
';
} else {
$__output .= '
<a href="' . XenForo_Template_Helper_Core::link('attachments', $attachment, array()) . '" target="_blank" class="genericAttachment"></a>
';
}
}
$__output .= '
</div>
<div class="attachmentInfo pairsJustified">
<h6 class="filename"><a href="' . XenForo_Template_Helper_Core::link('attachments', $attachment, array()) . '" target="_blank">' . htmlspecialchars($attachment['filename'], ENT_QUOTES, 'UTF-8') . '</a></h6>
<dl><dt>' . 'File size' . ':</dt> <dd>' . XenForo_Template_Helper_Core::numberFormat($attachment['file_size'], 'size') . '</dd></dl>
<dl><dt>' . 'Views' . ':</dt> <dd>' . XenForo_Template_Helper_Core::numberFormat($attachment['view_count'], '0') . '</dd></dl>
</div>
</div>
</li>
';
}
$__output .= '
</ol>
<div><label class="muted"><input type="checkbox" id="selectAllAttachment" /> <i>' . 'Select All' . '</i></label></div>
<fieldset>
<dl class="ctrlUnit">
<dt style="width: 0px;"></dt>
<dd style="width: 90%;">
<label for="ctrl_use_existing">
<input type="radio" name="target_album" value="existing" class="Disabler" id="ctrl_use_existing" />
' . 'Add to an existing album' . '
示例14: array
' . XenForo_Template_Helper_Core::callHelper('avatarhtml', array($user, false, array('user' => '$user', 'size' => 's', 'class' => $noOverlay ? 'NoOverlay' : ''), '')) . '
<div class="member">
';
if ($user['user_id']) {
$__output .= '
<h3 class="username">' . XenForo_Template_Helper_Core::callHelper('usernamehtml', array($user, '', true, array('class' => 'StatusTooltip' . ($noOverlay ? ' NoOverlay' : ''), 'title' => XenForo_Template_Helper_Core::string('censor', array('0' => htmlspecialchars($user['status'], ENT_QUOTES, 'UTF-8')))))) . '</h3>
<div class="userInfo">
<div class="userBlurb dimmed">' . XenForo_Template_Helper_Core::callHelper('userBlurb', array('0' => $user)) . '</div>
<dl class="userStats pairsInline">
<dt title="' . 'Total messages posted by ' . htmlspecialchars($user['username'], ENT_QUOTES, 'UTF-8') . '' . '">' . htmlspecialchars($topUsers['month_str'], ENT_QUOTES, 'UTF-8') . ': ' . 'Bài viết' . ':</dt> <dd>' . XenForo_Template_Helper_Core::numberFormat($user['messages_delta'], '0') . '</dd>
<dt title="' . 'Number of times something posted by ' . htmlspecialchars($user['username'], ENT_QUOTES, 'UTF-8') . ' has been \'liked\'' . '">' . 'Đã được thích' . ':</dt> <dd>' . XenForo_Template_Helper_Core::numberFormat($user['likes_delta'], '0') . '</dd>
</dl>
</div>
';
} else {
$__output .= '
<h3 class="username guest dimmed">' . 'Khách' . '</h3>
';
}
$__output .= '
';
$__compilerVar2 = '';
$__compilerVar2 .= $contentTemplate;
示例15: htmlspecialchars
<div class="listBlockInner">
<h3 class="title">
';
if ($showCheckbox) {
$__output .= '<input type="checkbox" name="playlist_ids[]" value="' . htmlspecialchars($playlist['playlist_id'], ENT_QUOTES, 'UTF-8') . '" autocomplete="off" /> ';
}
$__output .= '<a
href="' . XenForo_Template_Helper_Core::link('gallery/my-playlists', $playlist, array()) . '">' . htmlspecialchars($playlist['title'], ENT_QUOTES, 'UTF-8') . '</a>
</h3>
<div class="playlistDetails muted">' . XenForo_Template_Helper_Core::callHelper('usernamehtml', array($playlist, '', false, array())) . ',
<a href="' . XenForo_Template_Helper_Core::link('gallery/my-playlists', $playlist, array()) . '" class="faint">' . XenForo_Template_Helper_Core::callHelper('datetimehtml', array($playlist['added_date'], array('time' => htmlspecialchars($playlist['added_date'], ENT_QUOTES, 'UTF-8')))) . '</a>
<a href="' . XenForo_Template_Helper_Core::link('gallery/my-playlists/delete', $playlist, array()) . '" class="OverlayTrigger item delete">' . 'Delete' . '</a>
<a href="' . XenForo_Template_Helper_Core::link('gallery/my-playlists/edit', $playlist, array()) . '" class="OverlayTrigger item edit">' . 'Edit' . '</a>
</div>
<div class="tagLine">
' . htmlspecialchars($playlist['description'], ENT_QUOTES, 'UTF-8') . '
</div>
</div>
</div>
<div class="listBlock playlistStats">
<div class="listBlockInner">
<div class="pairsJustified">
<dl><dt>' . 'Content Counts' . ':</dt> <dd>' . XenForo_Template_Helper_Core::numberFormat($playlist['content_count'], '0') . '</dd></dl>
<dl><dt>' . 'Updated' . ':</dt> <dd><a href="' . XenForo_Template_Helper_Core::link('playlist/my-playlists', $playlist, array()) . '" class="concealed">' . XenForo_Template_Helper_Core::callHelper('datetimehtml', array($playlist['updated_date'], array('time' => htmlspecialchars($playlist['updated_date'], ENT_QUOTES, 'UTF-8')))) . '</a></dd></dl>
</div>
</div>
</div>
</li>
';
$this->addRequiredExternal('css', 'sonnb_xengallery_myplaylist_index');