本文整理汇总了PHP中CStringHelper::isSingular方法的典型用法代码示例。如果您正苦于以下问题:PHP CStringHelper::isSingular方法的具体用法?PHP CStringHelper::isSingular怎么用?PHP CStringHelper::isSingular使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStringHelper
的用法示例。
在下文中一共展示了CStringHelper::isSingular方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
// echo $event->getCategoryName();
?>
<?php
echo $event->location;
?>
</div>
<!-- <div class="eventTime"><?php
echo JText::sprintf('COM_COMMUNITY_EVENTS_DURATION', JHTML::_('date', $event->startdate, JText::_('DATE_FORMAT_LC2')), JHTML::_('date', $event->enddate, JText::_('DATE_FORMAT_LC2')));
?>
</div> -->
<div class="cThumb-Members">
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=events&task=viewguest&groupid=' . $group->id . '&eventid=' . $event->id . '&type=' . COMMUNITY_EVENT_STATUS_ATTEND);
?>
"><?php
echo JText::sprintf(!CStringHelper::isSingular($event->confirmedcount) ? 'COM_COMMUNITY_EVENTS_MANY_GUEST_COUNT' : 'COM_COMMUNITY_EVENTS_GUEST_COUNT', $event->confirmedcount);
?>
</a>
</div>
</div>
</div>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
<div class="cEmpty"><?php
echo JText::_('COM_COMMUNITY_EVENTS_NOT_CREATED');
示例2:
echo $event->location;
?>
</a>
</li>
<li>
<svg class="joms-icon" viewBox="0 0 16 16">
<use xlink:href="<?php
echo CRoute::getURI();
?>
#joms-icon-user"/>
</svg>
<a href="<?php
echo $event->getGuestLink(COMMUNITY_EVENT_STATUS_ATTEND);
?>
"><?php
echo JText::sprintf(!CStringHelper::isSingular($event->getMembersCount(COMMUNITY_EVENT_STATUS_ATTEND)) ? 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_MANY_NUMBER' : 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_NUMBER', $event->getMembersCount(COMMUNITY_EVENT_STATUS_ATTEND));
?>
</a>
</li>
<li>
<div class="joms-gap"></div>
<svg class="joms-icon" viewBox="0 0 16 16">
<use xlink:href="<?php
echo CRoute::getURI();
?>
#joms-icon-clock"/>
</svg>
<small><?php
echo JText::sprintf('COM_COMMUNITY_EVENTS_DURATION', JHTML::_('date', $event->startdate, JText::_('DATE_FORMAT_LC3')), JHTML::_('date', $event->enddate, JText::_('DATE_FORMAT_LC3')));
?>
</small>
示例3: _getEventsHTML
function _getEventsHTML($createEvents, $rows, $user, $config, $totalEvents, $creatable)
{
ob_start();
?>
<?php
if ($rows) {
?>
<ul class="joms-list--event">
<?php
foreach ($rows as $row) {
$event = JTable::getInstance('Event', 'CTable');
$event->load($row->id);
$creator = CFactory::getUser($event->creator);
// Get the formated date & time
$format = $config->get('eventshowampm') ? JText::_('COM_COMMUNITY_DATE_FORMAT_LC2_12H') : JText::_('COM_COMMUNITY_DATE_FORMAT_LC2_24H');
$startdatehtml = CTimeHelper::getFormattedTime($event->startdate, $format);
$enddatehtml = CTimeHelper::getFormattedTime($event->enddate, $format);
?>
<li class="joms-media--event" title="<?php
echo CStringHelper::escape($event->summary);
?>
">
<div class="joms-media__calendar">
<span class="month"><?php
echo CEventHelper::formatStartDate($event, JText::_('M'));
?>
</span>
<span class="date"><?php
echo CEventHelper::formatStartDate($event, JText::_('d'));
?>
</span>
</div>
<div class="joms-media__body">
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id);
?>
"><?php
echo $event->title;
?>
</a>
<span class="joms-block"><?php
echo $event->location;
?>
</span>
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=events&task=viewguest&eventid=' . $event->id . '&type=' . COMMUNITY_EVENT_STATUS_ATTEND);
?>
"><?php
echo JText::sprintf(!CStringHelper::isSingular($event->confirmedcount) ? 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_MANY' : 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT', $event->confirmedcount);
?>
</a>
</div>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
<div><?php
echo JText::_('PLG_EVENTS_NO_EVENTS_CREATED_BY_THE_USER_YET');
?>
</div>
<?php
}
?>
<small>
<?php
if ($creatable) {
?>
<a class="joms-button--link" href="<?php
echo CRoute::_('index.php?option=com_community&view=events&task=create');
?>
"><?php
echo JText::_('COM_COMMUNITY_EVENTS_CREATE');
?>
</a>
<?php
}
?>
<a class="joms-button--link" href="<?php
echo CRoute::_('index.php?option=com_community&view=events');
?>
"><?php
echo JText::_('COM_COMMUNITY_EVENTS_ALL_EVENTS') . ' (' . $totalEvents . ')';
?>
</a>
</small>
<?php
$content = ob_get_contents();
ob_end_clean();
return $content;
}
示例4: _getMyGroupsHTML
public function _getMyGroupsHTML($userid = null)
{
$document = JFactory::getDocument();
$is_rtl = $document->direction == 'rtl' ? 'dir="rtl"' : '';
$html = '';
$groupsModel = CFactory::getModel('groups');
$my = CFactory::getUser($userid);
$user = CFactory::getRequestUser();
$this->loadUserParams();
$params = $user->getParams();
// site visitor
$relation = 10;
// site members
if ($my->id != 0) {
$relation = 20;
}
// friends
if (CFriendsHelper::isConnected($my->id, $user->id)) {
$relation = 30;
}
// mine
if (COwnerHelper::isMine($my->id, $user->id)) {
$relation = 40;
}
if ($relation >= $params->get('privacyGroupsView')) {
// count the groups
$groups = $groupsModel->getGroups($user->id, 'latest', false);
$total = count($groups);
if ($this->params->get('hide_empty', 0) && !$total) {
return '';
}
$count = $this->userparams->get('count', $this->params->get('count', 10));
$groupsModel->setState('limit', $count);
$groups = $groupsModel->getGroups($user->id, 'latest', false);
if ($groups) {
shuffle($groups);
}
ob_start();
?>
<?php
if ($groups) {
$i = 0;
?>
<?php
foreach ($groups as $group) {
if ($i >= $count) {
break;
}
$table = JTable::getInstance('Group', 'CTable');
$table->load($group->id);
if ($table->unlisted && !$groupsModel->isMember($my->id, $table->id)) {
continue;
}
$i++;
?>
<div class="joms-stream__header">
<div class="joms-avatar--stream">
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=groups&groupid=' . $group->id . '&task=viewgroup');
?>
">
<img src="<?php
echo $table->getThumbAvatar();
?>
" alt="<?php
echo CStringHelper::escape($group->name);
?>
" >
</a>
</div>
<div class="joms-stream__meta">
<a class="joms-text--title" href="<?php
echo CRoute::_('index.php?option=com_community&view=groups&groupid=' . $group->id . '&task=viewgroup');
?>
">
<?php
echo $group->name;
?>
</a>
<a href="<?php
echo CRoute::_("index.php?option=com_community&view=groups&task=viewmembers&groupid=" . $group->id);
?>
" class="joms-block"><small>
<?php
echo JText::sprintf(!CStringHelper::isSingular($group->membercount) ? 'COM_COMMUNITY_GROUPS_MEMBERS_MANY' : 'COM_COMMUNITY_GROUPS_MEMBERS_SINGULAR', $group->membercount);
?>
</small></a>
</div>
</div>
<?php
}
?>
//.........这里部分代码省略.........
示例5:
</div>
<div class="joms-gap--small"></div>
<ul class="joms-list--inline">
<li>
<svg class="joms-icon" viewBox="0 0 16 16">
<use xlink:href="<?php
echo CRoute::getURI();
?>
#joms-icon-user"/>
</svg>
<a href="<?php
echo $event->getGuestLink(COMMUNITY_EVENT_STATUS_ATTEND);
?>
"><?php
$membercount = $event->getMembersCount(COMMUNITY_EVENT_STATUS_ATTEND);
echo JText::sprintf(!CStringHelper::isSingular($membercount) ? 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_MANY_NUMBER' : 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_NUMBER', $membercount);
?>
</a>
</li>
<?php
if ($event->permission == 1) {
?>
<li>
<svg class="joms-icon" viewBox="0 0 16 16">
<use xlink:href="<?php
echo CRoute::getURI();
?>
#joms-icon-lock"/>
</svg>
<?php
echo JText::_('COM_COMMUNITY_GROUPS_PRIVATE');
示例6:
echo CRoute::_('index.php?option=com_community&view=groups&groupid=' . $group->id . '&task=viewgroup');
?>
">
<?php
echo $group->name;
?>
</a>
<?php
if ($showTotal == 1) {
?>
<a href="<?php
echo CRoute::_("index.php?option=com_community&view=groups&task=viewmembers&groupid=" . $group->id);
?>
" class="joms-block"><small>
<?php
echo JText::sprintf(!CStringHelper::isSingular($group->totalMembers) ? 'MOD_ACTIVEGROUPS_MEMBER_MANY' : 'MOD_ACTIVEGROUPS_MEMBER', $group->totalMembers);
?>
</small></a>
<?php
}
?>
</div>
</div>
<?php
}
} else {
echo JText::_("MOD_ACTIVEGROUPS_NO_ACTIVE_GROUPS");
}
?>
示例7: isPlural
public static function isPlural($num)
{
return !CStringHelper::isSingular($num);
}
示例8:
<a href="<?php
echo $event->getGuestLink(COMMUNITY_EVENT_STATUS_ATTEND);
?>
"><?php
echo JText::sprintf(!CStringHelper::isSingular($event->getMembersCount(COMMUNITY_EVENT_STATUS_ATTEND)) ? 'COM_COMMUNITY_EVENTS_COUNT_MANY_PAST' : 'COM_COMMUNITY_EVENTS_COUNT_PAST', $event->getMembersCount(COMMUNITY_EVENT_STATUS_ATTEND));
?>
</a>
<?php
} else {
?>
<a href="<?php
echo $event->getGuestLink(COMMUNITY_EVENT_STATUS_ATTEND);
?>
"><?php
echo JText::sprintf(!CStringHelper::isSingular($event->getMembersCount(COMMUNITY_EVENT_STATUS_ATTEND)) ? 'COM_COMMUNITY_EVENTS_MANY_GUEST_COUNT' : 'COM_COMMUNITY_EVENTS_GUEST_COUNT', $event->getMembersCount(COMMUNITY_EVENT_STATUS_ATTEND));
?>
</a>
<?php
}
?>
</div>
<?php
if ($isCommunityAdmin && $showFeatured) {
if (!in_array($event->id, $featuredList)) {
?>
<div class="cIndex-Feature">
<a class="btn Icon"
onclick="joms.featured.add('<?php
示例9:
echo $data[0]->title;
?>
</a>
<small>
<?php
echo JText::_('COM_COMMUNITY_BY');
?>
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=profile&userid=' . $creator->id);
?>
"><?php
echo $creator->getDisplayName();
?>
</a>
<span class="joms-block"><?php
echo JText::sprintf(!CStringHelper::isSingular($data[0]->counter) ? 'MOD_LATESTDISC_REPLY_MANY' : 'MOD_LATESTDISC_REPLY', $data[0]->counter);
?>
</span>
</small>
</div>
</div>
<?php
}
}
?>
<?php
} else {
echo JText::_("MOD_LATESTDISC_NO_DISCUSSION");
}
?>
示例10:
echo $data[0]->title;
?>
</a>
<small>
<?php
echo JText::_('COM_COMMUNITY_BY');
?>
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=profile&userid=' . $creator->id);
?>
"><?php
echo $creator->getDisplayName();
?>
</a>
<span class="joms-block"><?php
echo JText::sprintf(!CStringHelper::isSingular($data[0]->counter) ? 'MOD_COMMUNITY_DISCUSSIONS_REPLY_MANY' : 'MOD_COMMUNITY_DISCUSSIONS_REPLY', $data[0]->counter);
?>
</span>
</small>
</div>
</div>
<?php
}
}
?>
<?php
} else {
echo JText::_("MOD_COMMUNITY_DISCUSSIONS_NO_DISCUSSION");
}
?>