本文整理汇总了PHP中Events::getUpcomingEvents方法的典型用法代码示例。如果您正苦于以下问题:PHP Events::getUpcomingEvents方法的具体用法?PHP Events::getUpcomingEvents怎么用?PHP Events::getUpcomingEvents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Events
的用法示例。
在下文中一共展示了Events::getUpcomingEvents方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
/** Render data for view on index action
*/
public function indexAction()
{
$format = $this->_getParam('format');
if (!isset($format)) {
$eventsList = new Events();
$eventsListed = $eventsList->getUpcomingEvents();
$calendar = new Calendar();
$lists = array();
foreach ($eventsListed as $value) {
$lists[] = $value['eventStartDate'];
}
$listedDates = $lists;
$calendar->highlighted_dates = $listedDates;
$first_day = $calendar->year . "-" . $calendar->month . "-01";
$prev_year = date("Y", strtotime("+2 month", strtotime($first_day)));
$prev_month = date("m", strtotime("+2 month", strtotime($first_day)));
$next_year = date("Y", strtotime("+1 month", strtotime($first_day)));
$next_month = date("m", strtotime("+1 month", strtotime($first_day)));
$url = $this->view->url(array('module' => 'events', 'controller' => 'upcoming', 'action' => 'index'), 'upcoming', true);
$calendar->formatted_link_to = $url . '/%Y-%m-%d';
$this->view->curr = $calendar->output_calendar();
$this->view->nextplusone = $calendar->output_calendar($prev_year, $prev_month);
$this->view->next = $calendar->output_calendar($next_year, $next_month);
$events = new Events();
if ($this->_getParam('date') == NULL) {
$this->view->events = $eventsList->getUpcomingEventsList();
$this->view->eventdate = Zend_Date::now()->toString('yyyy-MM-dd');
} else {
$this->view->events = $events->getEventbyDay($this->_getParam('date'));
$this->view->eventdate = $this->_getParam('date');
}
} else {
if ($format == 'xml' || $format == 'json') {
$this->_helper->layout->disableLayout();
$events = new Events();
$this->view->events = $events->getUpcomingEventsList();
} else {
if (in_array($format, array('rss', 'atom')) ? $format : 'rss') {
$events = new Events();
$events = $events->getUpcomingEventsList();
$feedArray = array('title' => 'Finds from the Scheme', 'link' => $this->view->CurUrl(), 'charset' => 'utf-8', 'description' => 'The latest Portable Antiquities Scheme events', 'author' => 'The Portable Antiquities Scheme', 'image' => Zend_Registry::get('siteurl') . '/images/logos/pas.gif', 'email' => 'info@finds.org.uk', 'copyright' => 'Creative Commons Licenced', 'generator' => 'The Scheme database powered by Zend Framework and Dan\'s magic', 'language' => 'en', 'entries' => array());
foreach ($events as $event) {
$feedArray['entries'][] = array('title' => $event['eventTitle'], 'link' => Zend_Registry::get('siteurl') . '/events/info/index/id/' . $event['id'], 'guid' => Zend_Registry::get('siteurl') . '/events/info/index/id/' . $event['id'], 'description' => strip_tags($event['eventDescription']), 'lastUpdate' => strtotime($event['updated']), 'content' => $event['eventDescription'], 'georss' => $event['latitude'] . ',' . $event['longitude']);
}
$feed = Zend_Feed::importArray($feedArray, $format);
$feed->send();
}
}
}
}
示例2: indexAction
/**
* Render data for view on index action
*/
function indexAction()
{
$this->view->headTitle('Events at the Scheme');
$content = new Content();
$this->view->contents = $content->getFrontContent('events');
$year = strftime("%Y", strtotime(Zend_Date::now()->toString('yyyy-MM-dd')));
$this->view->year = $year;
$adults = new Events();
$this->view->adults = $adults->getAttendanceAdults($year . '-01-01', $year . '-12-31');
$eventsList = new Events();
$eventsListed = $eventsList->getUpcomingEvents();
$calendar = new Calendar();
$lists = array();
foreach ($eventsListed as $value) {
$lists[] = $value['eventStartDate'];
}
$listedDates = $lists;
$calendar->highlighted_dates = $listedDates;
$url = $this->view->url(array('module' => 'events', 'controller' => 'upcoming', 'action' => 'index'), 'upcoming', true);
$calendar->formatted_link_to = $url . '/%Y-%m-%d';
$cal = '<div id="calendars" style="float:right;margin-top:100px;margin-left:10px;">' . $calendar->output_calendar() . '</div>';
$this->view->cal = $cal;
}
示例3: upcomingAction
/** Render data for upcoming events
* @access public
* @return void
*/
public function upcomingAction()
{
$this->view->events = $this->_events->getUpcomingEvents();
}
示例4: indexAction
/** The index page for the admin section
* @access public
* @return void
*/
public function indexAction()
{
$events = new Events();
$this->view->events = $events->getUpcomingEvents();
}