当前位置: 首页>>代码示例>>PHP>>正文


PHP Events::getUpcomingEvents方法代码示例

本文整理汇总了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();
             }
         }
     }
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:52,代码来源:UpcomingController.php

示例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;
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:26,代码来源:IndexController.php

示例3: upcomingAction

 /** Render data for upcoming events
  * @access public
  * @return void
  */
 public function upcomingAction()
 {
     $this->view->events = $this->_events->getUpcomingEvents();
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:8,代码来源:EventsController.php

示例4: indexAction

 /** The index page for the admin section
  * @access public
  * @return void
  */
 public function indexAction()
 {
     $events = new Events();
     $this->view->events = $events->getUpcomingEvents();
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:9,代码来源:IndexController.php


注:本文中的Events::getUpcomingEvents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。