本文整理汇总了PHP中CStringHelper::isPlural方法的典型用法代码示例。如果您正苦于以下问题:PHP CStringHelper::isPlural方法的具体用法?PHP CStringHelper::isPlural怎么用?PHP CStringHelper::isPlural使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStringHelper
的用法示例。
在下文中一共展示了CStringHelper::isPlural方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: timeLapse
/**
*
* @param JDate $date
*
*/
public static function timeLapse($date)
{
$now = new JDate();
$dateDiff = CTimeHelper::timeDifference($date->toUnix(), $now->toUnix());
if ($dateDiff['days'] > 0) {
$lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['days']) ? 'CC LAPSED DAY MANY' : 'CC LAPSED DAY', $dateDiff['days']);
} elseif ($dateDiff['hours'] > 0) {
$lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['hours']) ? 'CC LAPSED HOUR MANY' : 'CC LAPSED HOUR', $dateDiff['hours']);
} elseif ($dateDiff['minutes'] > 0) {
$lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['minutes']) ? 'CC LAPSED MINUTE MANY' : 'CC LAPSED MINUTE', $dateDiff['minutes']);
} else {
$lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['seconds']) ? 'CC LAPSED SECOND MANY' : 'CC LAPSED SECOND', $dateDiff['seconds']);
}
return $lapse;
}
示例2: cAvatarTooltip
/**
* Return avatar tooltip title
* @todo: this is perfect candidate for caching
*
* @param row user object
*/
function cAvatarTooltip(&$row)
{
$friendsModel = CFactory::getModel('friends');
$userModel = CFactory::getModel('user');
$user = CFactory::getUser($row->id);
$numFriends = $user->getFriendCount();
if ($user->isOnline()) {
$isOnline = '<img style="vertical-align:middle;padding: 0px 4px;" src="' . JURI::base() . 'components/com_community/assets/status_online.png" />' . JText::_('CC ONLINE');
} else {
$isOnline = '<img style="vertical-align:middle;padding: 0px 4px;" src="' . JURI::base() . 'components/com_community/assets/status_offline.png" />' . JText::_('CC OFFLINE');
}
CFactory::load('helpers', 'string');
$html = $row->getDisplayName() . '::';
$html .= $user->getStatus() . '<br/>';
$html .= '<hr noshade="noshade" height="1"/>';
$html .= $isOnline . ' | <img style="vertical-align:middle;padding: 0px 4px;" src="' . JURI::base() . 'components/com_community/assets/default-favicon.png" />' . JText::sprintf(CStringHelper::isPlural($numFriends) ? 'CC FRIENDS COUNT MANY' : 'CC FRIENDS COUNT', $numFriends);
return htmlentities($html, ENT_COMPAT, 'UTF-8');
}
示例3: timeLapse
/**
*
* @param JDate $date
*
*/
public static function timeLapse($date)
{
$now = new JDate();
$dateDiff = CTimeHelper::timeDifference($date->toUnix(), $now->toUnix());
if ($dateDiff['days'] > 0) {
$lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['days']) ? 'COM_COMMUNITY_LAPSED_DAY_MANY' : 'COM_COMMUNITY_LAPSED_DAY', $dateDiff['days']);
} elseif ($dateDiff['hours'] > 0) {
$lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['hours']) ? 'COM_COMMUNITY_LAPSED_HOUR_MANY' : 'COM_COMMUNITY_LAPSED_HOUR', $dateDiff['hours']);
} elseif ($dateDiff['minutes'] > 0) {
$lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['minutes']) ? 'COM_COMMUNITY_LAPSED_MINUTE_MANY' : 'COM_COMMUNITY_LAPSED_MINUTE', $dateDiff['minutes']);
} else {
if ($dateDiff['seconds'] == 0) {
$lapse = JText::_("COM_COMMUNITY_ACTIVITIES_MOMENT_AGO");
} else {
$lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['seconds']) ? 'COM_COMMUNITY_LAPSED_SECOND_MANY' : 'COM_COMMUNITY_LAPSED_SECOND', $dateDiff['seconds']);
}
}
return $lapse;
}
示例4: display
function display($data = null)
{
$mainframe = JFactory::getApplication();
$document =& JFactory::getDocument();
$model = CFactory::getModel('search');
$members = $model->getPeople();
// Prepare feeds
// $document->setTitle($title);
foreach ($members as $member) {
$user = CFactory::getUser($member->id);
$friendCount = JText::sprintf(CStringHelper::isPlural($user->getFriendCount()) ? 'CC FRIENDS COUNT MANY' : 'CC FRIENDS COUNT', $user->getFriendCount());
$item = new JFeedItem();
$item->title = $user->getDisplayName();
$item->link = CRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id);
$item->description = '<img src="' . $user->getThumbAvatar() . '" alt="" /> ' . $friendCount;
$item->date = '';
// Make sure url is absolute
$item->description = JString::str_ireplace('href="/', 'href="' . JURI::base(), $item->description);
$document->addItem($item);
}
}
示例5:
</form>
<?php
}
if (!empty($search)) {
?>
<div class="cSearch-Result">
<p>
<span>
<?php
echo JText::sprintf('COM_COMMUNITY_SEARCH_RESULT', $search);
?>
</span>
<span class="cFloat-R">
<?php
echo JText::sprintf(CStringHelper::isPlural($videosCount) ? 'COM_COMMUNITY_VIDEOS_SEARCH_RESULT_TOTAL_MANY' : 'COM_COMMUNITY_VIDEOS_SEARCH_RESULT_TOTAL', $videosCount);
?>
</span>
</p>
<?php
echo $videosHTML;
?>
<?php
if (!empty($pagination)) {
?>
<div class="cPagination">
<?php
echo $pagination;
?>
示例6:
<?php
}
?>
<?php
echo $sortings;
?>
<div class="joms-gap"></div>
<?php
if ($events) {
?>
<div class="joms-alert joms-alert--info">
<?php
echo JText::sprintf(CStringHelper::isPlural($count) ? 'COM_COMMUNITY_EVENTS_INVITATION_COUNT_MANY' : 'COM_COMMUNITY_EVENTS_INVITATION_COUNT_SINGLE', $count);
?>
</div>
<ul class="joms-list--card">
<?php
for ($i = 0; $i < count($events); $i++) {
$event =& $events[$i];
$user = CFactory::getUser($event->creator);
$isGroup = false;
if ($event->type == 'group' && $event->contentid) {
$isGroup = true;
$groupModel = CFactory::getModel('groups');
$groupName = $groupModel->getGroupName($event->contentid);
$groupLink = CRoute::_('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $event->contentid);
}
示例7: defined
* @license GNU/GPL, see LICENSE.php
*
*/
defined('_JEXEC') or die;
?>
<?php
echo $sortings;
?>
<div id="community-events-wrap">
<?php
if ($events) {
?>
<div>
<?php
echo JText::sprintf(CStringHelper::isPlural($count) ? 'CC MY EVENTS INVITATION COUNT MANY' : 'CC MY EVENTS INVITATION COUNT', $count);
?>
</div>
<?php
for ($i = 0; $i < count($events); $i++) {
$event =& $events[$i];
?>
<div class="community-events-results-item" id="events-invite-<?php
echo $event->id;
?>
">
<div class="community-events-results-left">
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id);
?>
"><img class="avatar" src="<?php
示例8:
?>
" class="joms-alert--info">
<h4 class="joms-alert__head">
<?php
echo JText::sprintf('COM_COMMUNITY_GROUPS_INVITATION', $join);
?>
</h4>
<div class="joms-alert__body">
<div class="joms-alert__content">
<?php
echo JText::sprintf('COM_COMMUNITY_GROUPS_YOU_INVITED', $join);
?>
<span>
<?php
echo JText::sprintf(CStringHelper::isPlural($friendsCount) ? 'COM_COMMUNITY_GROUPS_FRIEND' : 'COM_COMMUNITY_GROUPS_FRIEND_MANY', $friendsCount);
?>
</span>
</div>
<div class="joms-alert__actions">
<a href="javascript:void(0);"
onclick="jax.call('community','groups,ajaxRejectInvitation','<?php
echo $group->id;
?>
');" class="joms-button--neutral joms-button--small">
<?php
echo JText::_('COM_COMMUNITY_EVENTS_REJECT');
?>
</a>
<a href="javascript:void(0);"
onclick="jax.call('community','groups,ajaxAcceptInvitation','<?php
示例9:
<?php
if ($config->get('creatediscussion')) {
?>
<li>
<svg class="joms-icon" viewBox="0 0 18 18">
<use xlink:href="<?php
echo CRoute::getURI();
?>
#joms-icon-bubbles"/>
</svg>
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussions&groupid=' . $group->id);
?>
">
<?php
echo JText::sprintf(CStringHelper::isPlural($group->discusscount) ? 'COM_COMMUNITY_GROUPS_DISCUSSION_COUNT_MANY' : 'COM_COMMUNITY_GROUPS_DISCUSSION_COUNT', $group->discusscount);
?>
<a/>
</li>
<?php
}
?>
<?php
if ($showVideo) {
?>
<li>
<svg class="joms-icon" viewBox="0 0 16 16">
<use xlink:href="<?php
echo CRoute::getURI();
?>
#joms-icon-film"/>
示例10:
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=groups&task=viewmembers&groupid=' . $group->id);
?>
"><?php
echo JText::sprintf(CStringHelper::isPlural($group->membercount) ? 'CC MEMBERS COUNT MANY' : 'CC MEMBERS COUNT', $group->membercount);
?>
</a>
</span>
<span class="icon-discuss" style="margin-right: 5px;">
<?php
echo JText::sprintf(CStringHelper::isPlural($group->discusscount) ? 'CC GROUP DISCUSS COUNT MANY' : 'CC GROUP DISCUSS COUNT', $group->discusscount);
?>
</span>
<span class="icon-wall" style="margin-right: 5px;">
<?php
echo JText::sprintf(CStringHelper::isPlural($group->wallcount) ? 'CC GROUP WALL COUNT MANY' : 'CC GROUP WALL COUNT', $group->wallcount);
?>
</span>
<?php
if ($isCommunityAdmin && $showFeatured) {
if (!in_array($group->id, $featuredList)) {
?>
<span class="icon-addfeatured" style="margin-right: 5px;">
<a onclick="joms.featured.add('<?php
echo $group->id;
?>
','groups');" href="javascript:void(0);">
<?php
echo JText::_('CC MAKE FEATURED');
?>
</a>
示例11:
</div><!--action-button-->
<!--VIDEO PLAYER-->
<div class="video-player">
<?php
echo $video->getPlayerHTML();
?>
</div>
<!--end: VIDEO PLAYER-->
<div class="cLayout">
<div class="cSidebar">
<div class="hits">
<strong>
<?php
if (CStringHelper::isPlural($video->getHits())) {
echo JText::sprintf('COM_COMMUNITY_VIDEOS_HITS_COUNT', $video->getHits());
} else {
echo JText::sprintf('COM_COMMUNITY_VIDEOS_HITS_COUNT_SINGULAR', $video->getHits());
}
?>
</strong>
</div>
<div id="like-container">
<?php
echo $likesHTML;
?>
</div><!--like-container-->
示例12: defined
* @subpackage Template
* @copyright (C) 2008 by Slashes & Dots Sdn Bhd - All rights reserved!
* @license GNU/GPL, see LICENSE.php
*
* @param groups Array Array of groups object
* @param total integer total number of groups
* @param user CFactory User object
*/
defined('_JEXEC') or die;
?>
<div class="appsBoxTitle"><?php
echo JText::_('CC PROFILE GROUPS');
?>
</div>
<div class="small"><?php
echo JText::sprintf(CStringHelper::isPlural($total) ? 'CC GROUPS COUNT MANY' : 'CC GROUPS COUNT', $total);
?>
</div>
<ul class="friend-right-info">
<?php
for ($i = 0; $i < 12 && $i < count($groups); $i++) {
$row =& $groups[$i];
?>
<li>
<a href="<?php
echo $row->link;
?>
">
<img title="<?php
echo $this->escape($row->name);
?>
示例13:
</td>
<?php
}
?>
<td align="center" valign="top" style="width: 20%">
<div class="number">
<?php
if (!$totalactivities == '' or $totalactivities > 0) {
echo $totalactivities;
} else {
echo 0;
}
?>
</div>
<div class="text"><?php
echo JText::sprintf(CStringHelper::isPlural($totalactivities) ? 'COM_COMMUNITY_ACTIVITIES' : 'COM_COMMUNITY_ACTIVITY');
?>
</div>
</td>
</tr>
</table>
<?php
echo $about;
?>
<div class="cModule" style="clear: left; padding-top: 20px">
<h3><?php
echo JText::sprintf('COM_COMMUNITY_FRONTPAGE_RECENT_ACTIVITIES');
示例14: inviteend
/**
*
*/
public function inviteend()
{
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
// If $_POST['ids'] contains value, FB connect has successfully send some invite
if ($jinput->get('ids', NULL, 'NONE') != null) {
$mainframe->enqueueMessage(JText::sprintf(CStringHelper::isPlural(count($_POST['ids'])) ? 'COM_COMMUNITY_INVITE_EMAIL_SENT_MANY' : 'COM_COMMUNITY_INVITE_EMAIL_SENT', count($_POST['ids'])));
}
// Queue the message back.
// This method is similar to $mainframe->redirect();
$_messageQueue = $mainframe->getMessageQueue();
if (count($_messageQueue)) {
$session = JFactory::getSession();
$session->set('application.queue', $_messageQueue);
}
echo '<script>window.opener.location.reload();</script>';
echo '<script>window.close();</script>';
exit;
}
示例15:
</div>
<div class="joms-stream__meta">
<a class="joms-stream__user" href="<?php
echo CUrlHelper::userLink($user->id);
?>
"><?php
echo $user->getDisplayName();
?>
</a>
<?php
// If we're using new stream style or has old style data (which contains {multiple} )
if ($act->params->get('style') == COMMUNITY_STREAM_STYLE || strpos($act->title, '{multiple}')) {
// New style
$count = $act->params->get('count', $act->params->get('count', 1));
if (CStringHelper::isPlural($count)) {
if ($act->groupid) {
$group = JTable::getInstance('Group', 'CTable');
$group->load($act->groupid);
$this->set('group', $group);
echo JText::sprintf('COM_COMMUNITY_ACTIVITY_GROUP_PHOTOS_UPLOAD_TITLE', $count, CUrlHelper::groupLink($group->id), CStringHelper::escape($group->name));
} else {
echo JText::sprintf('COM_COMMUNITY_ACTIVITY_PHOTO_UPLOAD_TITLE_MANY', $count, $album->getURI(), CStringHelper::escape($album->name));
}
} else {
if ($act->groupid) {
$group = JTable::getInstance('Group', 'CTable');
$group->load($act->groupid);
$this->set('group', $group);
echo JText::sprintf('COM_COMMUNITY_ACTIVITY_GROUP_PHOTO_UPLOAD_TITLE', CUrlHelper::groupLink($group->id), CStringHelper::escape($group->name));
} else {