本文整理匯總了PHP中CTimeHelper::getTimezone方法的典型用法代碼示例。如果您正苦於以下問題:PHP CTimeHelper::getTimezone方法的具體用法?PHP CTimeHelper::getTimezone怎麽用?PHP CTimeHelper::getTimezone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CTimeHelper
的用法示例。
在下文中一共展示了CTimeHelper::getTimezone方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: viewevent
//.........這裏部分代碼省略.........
$myStatus = $event->getUserStatus($my->id);
$hasResponded = $myStatus == COMMUNITY_EVENT_STATUS_ATTEND || $myStatus == COMMUNITY_EVENT_STATUS_WONTATTEND || $myStatus == COMMUNITY_EVENT_STATUS_MAYBE;
// Get Bookmark HTML
CFactory::load('libraries', 'bookmarks');
$bookmarks = new CBookmarks(CRoute::getExternalURL('index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id));
$bookmarksHTML = $bookmarks->getHTML();
// Get Reporting HTML
CFactory::load('libraries', 'reporting');
$report = new CReportingLibrary();
$reportHTML = $report->getReportingHTML(JText::_('CC REPORT EVENT'), 'events,reportEvent', array($event->id));
// Get the Wall
CFactory::load('libraries', 'wall');
$wallContent = CWallLibrary::getWallContents('events', $event->id, $isAdmin, 10, 0, 'wall.content', 'events,events');
$wallCount = CWallLibrary::getWallCount('events', $event->id);
$viewAllLink = false;
if (JRequest::getVar('task', '', 'REQUEST') != 'app') {
$viewAllLink = CRoute::_('index.php?option=com_community&view=events&task=app&eventid=' . $event->id . '&app=walls');
}
$wallContent .= CWallLibrary::getViewAllLinkHTML($viewAllLink, $wallCount);
$wallForm = '';
if (!$config->get('lockeventwalls') || $config->get('lockeventwalls') && $isEventGuest && !$waitingApproval && $hasResponded || $isCommunityAdmin) {
$wallForm = CWallLibrary::getWallInputForm($event->id, 'events,ajaxSaveWall', 'events,ajaxRemoveWall');
}
// Construct the RVSP radio list
$arr = array(JHTML::_('select.option', COMMUNITY_EVENT_STATUS_ATTEND, JText::_('CC EVENT ACTION ATTEND')), JHTML::_('select.option', COMMUNITY_EVENT_STATUS_WONTATTEND, JText::_('CC EVENT ACTION DECLINE')), JHTML::_('select.option', COMMUNITY_EVENT_STATUS_MAYBE, JText::_('CC EVENT ACTION UNSURE')));
$status = $event->getMemberStatus($my->id);
$radioList = JHTML::_('select.radiolist', $arr, 'status', '', 'value', 'text', $status, false);
$unapprovedCount = $event->inviteRequestCount();
//...
$editEvent = JRequest::getVar('edit', false, 'GET');
$editEvent = $editEvent == 1 ? true : false;
// Am I invited in this event?
$isInvited = false;
$join = '';
$friendsCount = 0;
$isInvited = $eventModel->isInvitedMe(0, $my->id, $event->id);
// If I was invited, I want to know my invitation informations
if ($isInvited) {
$invitor = CFactory::getUser($isInvited[0]->invited_by);
$join = '<a href="' . CUrlHelper::userLink($invitor->id) . '">' . $invitor->getDisplayName() . '</a>';
// Get users friends in this group
$friendsCount = $eventModel->getFriendsCount($my->id, $event->id);
}
$friendsModel = CFactory::getModel('Friends');
$tmpFriends = $friendsModel->getFriends($my->id, 'name', false);
$friends = array();
for ($i = 0; $i < count($tmpFriends); $i++) {
$friend =& $tmpFriends[$i];
if (!$event->isMember($friend->id)) {
$friends[] = $friend;
}
}
unset($tmpFriends);
// Get like
CFactory::load('libraries', 'like');
$likes = new CLike();
$likesHTML = $likes->getHTML('events', $event->id, $my->id);
// Is this event is a past event?
$now = new JDate();
$isPastEvent = $event->getEndDate(false)->toMySQL() < $now->toMySQL(true) ? true : false;
// Output to template
$tmpl = new CTemplate();
CFactory::load('libraries', 'invitation');
$inviteHTML = CInvitation::getHTML($friends, 'events,inviteUsers', $event->id, CInvitation::SHOW_FRIENDS, CInvitation::HIDE_EMAIL);
$tmpl->setMetaTags('event', $event);
$tmpl->set('timezone', CTimeHelper::getTimezone($event->offset));
$tmpl->set('handler', $handler);
$tmpl->set('likesHTML', $likesHTML);
$tmpl->set('inviteHTML', $inviteHTML);
$tmpl->set('guestStatus', $event->getUserStatus($my->id));
$tmpl->set('event', $event);
$tmpl->set('radioList', $radioList);
$tmpl->set('bookmarksHTML', $bookmarksHTML);
$tmpl->set('reportHTML', $reportHTML);
$tmpl->set('isEventGuest', $isEventGuest);
$tmpl->set('isMine', $isMine);
$tmpl->set('isAdmin', $isAdmin);
$tmpl->set('isCommunityAdmin', $isCommunityAdmin);
$tmpl->set('unapproved', $unapprovedCount);
$tmpl->set('waitingApproval', $waitingApproval);
$tmpl->set('wallForm', $wallForm);
$tmpl->set('wallContent', $wallContent);
$tmpl->set('eventAdmins', $eventAdmins);
$tmpl->set('eventAdminsCount', $eventAdminsCount);
$tmpl->set('eventMembers', $eventMembers);
$tmpl->set('eventMembersCount', $eventMembersCount);
$tmpl->set('blockedMembers', $blockedMembers);
$tmpl->set('blockedMembersCount', $blockedMembersCount);
$tmpl->set('pendingMembers', $pendingMembers);
$tmpl->set('pendingMembersCount', $pendingMembersCount);
$tmpl->set('editEvent', $editEvent);
$tmpl->set('my', $my);
$tmpl->set('memberStatus', $myStatus);
$tmpl->set('waitingRespond', $waitingRespond);
$tmpl->set('isInvited', $isInvited);
$tmpl->set('join', $join);
$tmpl->set('friendsCount', $friendsCount);
$tmpl->set('isPastEvent', $isPastEvent);
echo $tmpl->fetch('events.viewevent');
}
示例2: defined
* @copyright (C) 2008 by Slashes & Dots Sdn Bhd - All rights reserved!
* @license GNU/GPL, see LICENSE.php
*
* @params isMine boolean is this group belong to me
* @params categories Array An array of categories object
* @params members Array An array of members object
* @params event Event A group object that has the property of a group
* @params wallForm string A html data that will output the walls form.
* @params wallContent string A html data that will output the walls data.
**/
defined('_JEXEC') or die;
$accessAllowed = ($memberStatus == COMMUNITY_EVENT_STATUS_INVITED || $memberStatus == COMMUNITY_EVENT_STATUS_ATTEND || $memberStatus == COMMUNITY_EVENT_STATUS_WONTATTEND || $memberStatus == COMMUNITY_EVENT_STATUS_MAYBE || !$event->permission) && $memberStatus != COMMUNITY_EVENT_STATUS_BLOCKED || $isCommunityAdmin;
$hasResponded = $memberStatus == COMMUNITY_EVENT_STATUS_ATTEND || $memberStatus == COMMUNITY_EVENT_STATUS_WONTATTEND || $memberStatus == COMMUNITY_EVENT_STATUS_MAYBE;
$creator = CFactory::getUser($event->creator);
$creatorUtcOffset = $creator->getUtcOffset();
$creatorUtcOffsetStr = CTimeHelper::getTimezone($creator->getTimezone());
?>
<div class="event">
<div class="page-actions">
<?php
echo $reportHTML;
?>
<?php
echo $bookmarksHTML;
?>
</div>
<!-- begin: .cLayout -->
<div class="cLayout clrfix">
示例3: cTimezoneIdentifier
/**
* Deprecated since 1.8
* Use CTimeHelper::getTimezone instead.
*/
function cTimezoneIdentifier($offset)
{
return CTimeHelper::getTimezone($offset);
}
示例4: viewevent
//.........這裏部分代碼省略.........
$allday = false;
if ($startDate->format('%Y-%m-%d') == $endDate->format('%Y-%m-%d') && $startDate->format('%H:%M:%S') == '00:00:00' && $endDate->format('%H:%M:%S') == '23:59:59') {
$format = JText::_('COM_COMMUNITY_EVENT_TIME_FORMAT_LC1');
$allday = true;
}
$event->startdateHTML = CTimeHelper::getFormattedTime($event->startdate, $format);
$event->enddateHTML = CTimeHelper::getFormattedTime($event->enddate, $format);
if (!isset($event->params)) {
$event->params = '';
}
$params = new CParameter($event->params);
$event->defaultCover = $event->isDefaultCover();
// Cover position.
$event->coverPostion = $params->get('coverPosition', '');
if (strpos($event->coverPostion, '%') === false) {
$event->coverPostion = 0;
}
// Find cover album and photo.
$event->coverAlbum = false;
$event->coverPhoto = false;
$album = JTable::getInstance('Album', 'CTable');
$albumId = $album->isCoverExist('event', $event->id);
if ($albumId) {
$album->load($albumId);
$event->coverAlbum = $albumId;
$event->coverPhoto = $album->photoid;
}
$inviteHTML = CInvitation::getHTML(null, 'events,inviteUsers', $event->id, CInvitation::SHOW_FRIENDS, CInvitation::SHOW_EMAIL);
$status = new CUserStatus($event->id, 'events');
$tmpl = new CTemplate();
$creator = new CUserStatusCreator('message');
$creator->title = $isMine ? JText::_('COM_COMMUNITY_STATUS') : JText::_('COM_COMMUNITY_MESSAGE');
$creator->html = $tmpl->fetch('status.message');
$status->addCreator($creator);
// Upgrade wall to stream @since 2.5
$event->upgradeWallToStream();
// Add custom stream
$streamHTML = $eventLib->getStreamHTML($event);
if ($event->getMemberStatus($my->id) == COMMUNITY_EVENT_STATUS_ATTEND) {
$RSVPmessage = JText::_('COM_COMMUNITY_EVENTS_ATTENDING_EVENT_MESSAGE');
} else {
if ($event->getMemberStatus($my->id) == COMMUNITY_EVENT_STATUS_WONTATTEND) {
$RSVPmessage = JText::_('COM_COMMUNITY_EVENTS_NOT_ATTENDING_EVENT_MESSAGE');
} else {
$RSVPmessage = JText::_('COM_COMMUNITY_EVENTS_NOT_RESPOND_RSVP_MESSAGE');
}
}
// Get recurring event series
$eventSeries = null;
$seriesCount = 0;
if ($event->isRecurring()) {
$advance = array('expired' => false, 'return' => 'object', 'limit' => COMMUNITY_EVENT_SERIES_LIMIT, 'exclude' => $event->id, 'published' => 1);
$tempseries = $eventModel->getEventChilds($event->parent, $advance);
foreach ($tempseries as $series) {
$table = JTable::getInstance('Event', 'CTable');
$table->bind($series);
$eventSeries[] = $table;
}
$seriesCount = $eventModel->getEventChildsCount($event->parent);
}
//pending request invitation guest
$pendingRequestGuests = $event->getMembers(COMMUNITY_EVENT_STATUS_REQUESTINVITE, 0, false, false);
// Pre-load multiple users at once
$tempUserInfo = array();
foreach ($pendingRequestGuests as $uid) {
$tempUserInfo[] = CFactory::getUser($uid->id);
}
$pendingRequestGuests = $tempUserInfo;
$featured = new CFeatured(FEATURED_EVENTS);
$featuredList = $featured->getItemIds();
// Get Attending Event Guests
$maybeList = $event->getMembers(COMMUNITY_EVENT_STATUS_MAYBE, 12, CC_RANDOMIZE);
$maybeCount = $event->getMembersCount(COMMUNITY_EVENT_STATUS_MAYBE);
$tempUserInfo = array();
foreach ($maybeList as $uid) {
$tempUserInfo[] = CFactory::getUser($uid->id);
}
$maybeList = $tempUserInfo;
$wontAttendList = $event->getMembers(COMMUNITY_EVENT_STATUS_WONTATTEND, 12, CC_RANDOMIZE);
$wontAttendCount = $event->getMembersCount(COMMUNITY_EVENT_STATUS_WONTATTEND);
$tempUserInfo = array();
foreach ($wontAttendList as $uid) {
$tempUserInfo[] = CFactory::getUser($uid->id);
}
$wontAttendList = $tempUserInfo;
//gets all the albums related to this photo
$photosModel = CFactory::getModel('photos');
$albums = $photosModel->getEventAlbums($event->id);
$totalPhotos = 0;
foreach ($albums as $album) {
$albumParams = new CParameter($album->params);
$totalPhotos = $totalPhotos + $albumParams->get('count');
}
//get total videos
$videosModel = CFactory::getModel('videos');
$videos = $videosModel->getEventVideos($eventid);
$totalVideos = count($videosModel->getEventVideos($eventid));
// Output to template
echo $tmpl->setMetaTags('event', $event)->set('status', $status)->set('albums', $albums)->set('videos', $videos)->set('pendingRequestGuests', $pendingRequestGuests)->set('streamHTML', $streamHTML)->set('timezone', CTimeHelper::getTimezone($event->offset))->set('handler', $handler)->set('isUserLiked', $isUserLiked)->set('totalLikes', $totalLikes)->set('inviteHTML', $inviteHTML)->set('guestStatus', $event->getUserStatus($my->id))->set('event', $event)->set('radioList', $radioList)->set('bookmarksHTML', $bookmarksHTML)->set('isLikeEnabled', $isLikeEnabled)->set('isEventGuest', $isEventGuest)->set('isMine', $isMine)->set('isAdmin', $isAdmin)->set('isCommunityAdmin', $isCommunityAdmin)->set('unapproved', $unapprovedCount)->set('waitingApproval', $waitingApproval)->set('wallContent', $wallContent)->set('eventMembers', $eventMembers)->set('eventMembersCount', $eventMembersCount)->set('editEvent', $editEvent)->set('my', $my)->set('creator', CFactory::getUser($event->creator))->set('memberStatus', $myStatus)->set('waitingRespond', $waitingRespond)->set('isInvited', $isInvited)->set('join', $join)->set('friendsCount', $friendsCount)->set('isPastEvent', $isPastEvent)->set('adminsList', $adminsList)->set('RSVPmessage', $RSVPmessage)->set('allday', $allday)->set('eventSeries', $eventSeries)->set('seriesCount', $seriesCount)->set('groupEventDetails', isset($groupEventDetails) ? $groupEventDetails : null)->set('featuredList', $featuredList)->set('photoPermission', $params->get('photopermission'))->set('videoPermission', $params->get('videopermission'))->set('showPhotos', $params->get('photopermission') != -1 && $config->get('enablephotos') && $config->get('eventphotos'))->set('showVideos', $params->get('videopermission') != -1 && $config->get('enablevideos') && $config->get('eventvideos'))->set('totalPhotos', $totalPhotos)->set('totalVideos', $totalVideos)->set('maybeList', $maybeList)->set('maybeCount', $maybeCount)->set('wontAttendList', $wontAttendList)->set('wontAttendCount', $wontAttendCount)->fetch('events/single');
}
示例5:
?>
</a>
</h3>
<div class="eventLocation"><?php
echo $this->escape($event->location);
?>
</div>
<div class="eventTime"><?php
echo JText::sprintf('CC EVENT TIME', JHTML::_('date', $event->startdate, JText::_('DATE_FORMAT_LC2')), JHTML::_('date', $event->enddate, JText::_('DATE_FORMAT_LC2')));
?>
</div>
<?php
if ($config->get('eventshowtimezone')) {
?>
<div class="eventTimezone small"><?php
echo CTimeHelper::getTimezone($event->getCreator()->getTimezone());
?>
</div>
<?php
}
?>
<div class="eventActions">
<span class="icon-group" style="margin-right: 5px;">
<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(cIsPlural($event->confirmedcount) ? 'CC GUESTS COUNT MANY' : 'CC GUESTS COUNT', $event->confirmedcount);
?>
</a>
</span>
示例6: viewevent
//.........這裏部分代碼省略.........
foreach ($eventMembers as $uid) {
$userids[] = $uid->id;
}
CFactory::loadUsers($userids);
for ($i = 0; $i < count($eventMembers); $i++) {
$row =& $eventMembers[$i];
$eventMembers[$i] = CFactory::getUser($row->id);
}
// Pre-load multiple users at once
$waitingApproval = $event->isPendingApproval($my->id);
$waitingRespond = false;
$myStatus = $event->getUserStatus($my->id);
$hasResponded = $myStatus == COMMUNITY_EVENT_STATUS_ATTEND || $myStatus == COMMUNITY_EVENT_STATUS_WONTATTEND || $myStatus == COMMUNITY_EVENT_STATUS_MAYBE;
// Get Bookmark HTML
CFactory::load('libraries', 'bookmarks');
$bookmarks = new CBookmarks(CRoute::getExternalURL('index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id));
$bookmarksHTML = $bookmarks->getHTML();
// Get Reporting HTML
CFactory::load('libraries', 'reporting');
$report = new CReportingLibrary();
$reportHTML = $report->getReportingHTML(JText::_('COM_COMMUNITY_EVENTS_REPORT'), 'events,reportEvent', array($event->id));
// Get the Wall
CFactory::load('libraries', 'wall');
$wallContent = CWallLibrary::getWallContents('events', $event->id, $isAdmin, 10, 0, 'wall.content', 'events,events');
$wallCount = CWallLibrary::getWallCount('events', $event->id);
$viewAllLink = false;
if (JRequest::getVar('task', '', 'REQUEST') != 'app') {
$viewAllLink = CRoute::_('index.php?option=com_community&view=events&task=app&eventid=' . $event->id . '&app=walls');
}
$wallContent .= CWallLibrary::getViewAllLinkHTML($viewAllLink, $wallCount);
$wallForm = '';
/*if( !$config->get('lockeventwalls')
|| ($config->get('lockeventwalls') && ($isEventGuest) && !($waitingApproval) && $hasResponded)
|| $isCommunityAdmin )
{
$wallForm = CWallLibrary::getWallInputForm( $event->id , 'events,ajaxSaveWall', 'events,ajaxRemoveWall' );
}*/
// Construct the RVSP radio list
$arr = array(JHTML::_('select.option', COMMUNITY_EVENT_STATUS_ATTEND, JText::_('COM_COMMUNITY_EVENTS_YES')), JHTML::_('select.option', COMMUNITY_EVENT_STATUS_WONTATTEND, JText::_('COM_COMMUNITY_EVENTS_NO')), JHTML::_('select.option', COMMUNITY_EVENT_STATUS_MAYBE, JText::_('COM_COMMUNITY_EVENTS_MAYBE')));
$status = $event->getMemberStatus($my->id);
$radioList = JHTML::_('select.radiolist', $arr, 'status', '', 'value', 'text', $status, false);
$unapprovedCount = $event->inviteRequestCount();
//...
$editEvent = JRequest::getVar('edit', false, 'GET');
$editEvent = $editEvent == 1 ? true : false;
// Am I invited in this event?
$isInvited = false;
$join = '';
$friendsCount = 0;
$isInvited = $eventModel->isInvitedMe(0, $my->id, $event->id);
// If I was invited, I want to know my invitation informations
if ($isInvited) {
$invitor = CFactory::getUser($isInvited[0]->invited_by);
$join = '<a href="' . CUrlHelper::userLink($invitor->id) . '">' . $invitor->getDisplayName() . '</a>';
// Get users friends in this group
$friendsCount = $eventModel->getFriendsCount($my->id, $event->id);
}
// Get like
CFactory::load('libraries', 'like');
$likes = new CLike();
$likesHTML = $likes->getHTML('events', $event->id, $my->id);
// Is this event is a past event?
$now = new JDate();
$isPastEvent = $event->getEndDate(false)->toMySQL() < $now->toMySQL(true) ? true : false;
// Get the formated date & time
$format = $config->get('eventshowampm') ? JText::_('COM_COMMUNITY_EVENTS_TIME_FORMAT_12HR') : JText::_('COM_COMMUNITY_EVENTS_TIME_FORMAT_24HR');
$startDate = $event->getStartDate(false);
$endDate = $event->getEndDate(false);
$allday = false;
if ($startDate->toFormat('%Y-%m-%d') == $endDate->toFormat('%Y-%m-%d') && $startDate->toFormat('%H:%M:%S') == '00:00:00' && $endDate->toFormat('%H:%M:%S') == '23:59:59') {
$format = JText::_('COM_COMMUNITY_EVENT_TIME_FORMAT_LC1');
$allday = true;
}
$event->startdateHTML = CTimeHelper::getFormattedTime($event->startdate, $format);
$event->enddateHTML = CTimeHelper::getFormattedTime($event->enddate, $format);
CFactory::load('libraries', 'invitation');
$inviteHTML = CInvitation::getHTML(null, 'events,inviteUsers', $event->id, CInvitation::SHOW_FRIENDS, CInvitation::SHOW_EMAIL);
CFactory::load('libraries', 'userstatus');
$status = new CUserStatus($event->id, 'events');
$tmpl = new CTemplate();
$creator = new CUserStatusCreator('message');
$creator->title = $isMine ? JText::_('COM_COMMUNITY_STATUS') : JText::_('COM_COMMUNITY_MESSAGE');
$creator->html = $tmpl->fetch('status.message');
$status->addCreator($creator);
// Upgrade wall to stream @since 2.5
$event->upgradeWallToStream();
// Add custom stream
$streamHTML = $eventLib->getStreamHTML($event);
if ($event->getMemberStatus($my->id) == COMMUNITY_EVENT_STATUS_ATTEND) {
$RSVPmessage = JText::_('COM_COMMUNITY_EVENTS_ATTENDING_EVENT_MESSAGE');
} else {
if ($event->getMemberStatus($my->id) == COMMUNITY_EVENT_STATUS_WONTATTEND) {
$RSVPmessage = JText::_('COM_COMMUNITY_EVENTS_NOT_ATTENDING_EVENT_MESSAGE');
} else {
$RSVPmessage = JText::_('COM_COMMUNITY_EVENTS_NOT_RESPOND_RSVP_MESSAGE');
}
}
// Output to template
echo $tmpl->setMetaTags('event', $event)->set('status', $status)->set('streamHTML', $streamHTML)->set('timezone', CTimeHelper::getTimezone($event->offset))->set('handler', $handler)->set('likesHTML', $likesHTML)->set('inviteHTML', $inviteHTML)->set('guestStatus', $event->getUserStatus($my->id))->set('event', $event)->set('radioList', $radioList)->set('bookmarksHTML', $bookmarksHTML)->set('reportHTML', $reportHTML)->set('isEventGuest', $isEventGuest)->set('isMine', $isMine)->set('isAdmin', $isAdmin)->set('isCommunityAdmin', $isCommunityAdmin)->set('unapproved', $unapprovedCount)->set('waitingApproval', $waitingApproval)->set('wallContent', $wallContent)->set('eventMembers', $eventMembers)->set('eventMembersCount', $eventMembersCount)->set('editEvent', $editEvent)->set('my', $my)->set('memberStatus', $myStatus)->set('waitingRespond', $waitingRespond)->set('isInvited', $isInvited)->set('join', $join)->set('friendsCount', $friendsCount)->set('isPastEvent', $isPastEvent)->set('adminsList', $adminsList)->set('RSVPmessage', $RSVPmessage)->set('allday', $allday)->fetch('events.viewevent');
}