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


PHP JoomleagueHelper::getMatchTimezone方法代码示例

本文整理汇总了PHP中JoomleagueHelper::getMatchTimezone方法的典型用法代码示例。如果您正苦于以下问题:PHP JoomleagueHelper::getMatchTimezone方法的具体用法?PHP JoomleagueHelper::getMatchTimezone怎么用?PHP JoomleagueHelper::getMatchTimezone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JoomleagueHelper的用法示例。


在下文中一共展示了JoomleagueHelper::getMatchTimezone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display

 function display($tpl = null)
 {
     // Get a reference of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $project = $model->getProject();
     //$config		= $model->getTemplateConfig($this->getName());
     if (isset($project)) {
         $this->project = $project;
     }
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $this->overallconfig;
     $this->matches = $model->getMatches();
     $this->teams = $model->getTeamsFromMatches($this->matches);
     // load a class that handles ical formats.
     require_once JLG_PATH_SITE . DS . 'helpers' . DS . 'iCalcreator.class.php';
     // create a new calendar instance
     $v = new vcalendar();
     foreach ($this->matches as $match) {
         $hometeam = $this->teams[$match->team1];
         $home = sprintf('%s', $hometeam->name);
         $guestteam = $this->teams[$match->team2];
         $guest = sprintf('%s', $guestteam->name);
         $summary = $match->project_name . ': ' . $home . ' - ' . $guest;
         //  check if match gots a date, if not it will not be included in ical
         if ($match->match_date) {
             $totalMatchTime = isset($project) ? $project->halftime * ($project->game_parts - 1) + $project->game_regular_time : 90;
             $start = JoomleagueHelper::getMatchStartTimestamp($match, 'Y-m-d H:i:s');
             $end = JoomleagueHelper::getMatchEndTimestamp($match, $totalMatchTime, 'Y-m-d H:i:s');
             // check if exist a playground in match or team or club
             $stringlocation = '';
             $stringname = '';
             if (!empty($match->playground_id)) {
                 $stringlocation = $match->playground_address . ", " . $match->playground_zipcode . " " . $match->playground_city;
                 $stringname = $match->playground_name;
             } elseif (!empty($match->team_playground_id)) {
                 $stringlocation = $match->team_playground_address . ", " . $match->team_playground_zipcode . " " . $match->team_playground_city;
                 $stringname = $match->team_playground_name;
             } elseif (!empty($match->club_playground_id)) {
                 $stringlocation = $match->club_playground_address . ", " . $match->club_playground_zipcode . " " . $match->club_playground_city;
                 $stringname = $match->club_playground_name;
             }
             $location = $stringlocation;
             //if someone want to insert more in description here is the place
             $description = $stringname;
             // create an event and insert it in calendar
             $vevent = new vevent();
             $timezone = JoomleagueHelper::getMatchTimezone($match);
             $vevent->setProperty("dtstart", $start, array("TZID" => $timezone));
             $vevent->setProperty("dtend", $end, array("TZID" => $timezone));
             $vevent->setProperty('LOCATION', $location);
             $vevent->setProperty('summary', $summary);
             $vevent->setProperty('description', $description);
             $v->setComponent($vevent);
         }
     }
     $v->setProperty("X-WR-TIMEZONE", $timezone);
     $xprops = array("X-LIC-LOCATION" => $timezone);
     iCalUtilityFunctions::createTimezone($v, $timezone, $xprops);
     $v->returnCalendar();
     //$debugstr = $v->createCalendar();
     //echo "<pre>";
     //echo $debugstr;
     // exit before display
     //		parent::display( $tpl );
 }
开发者ID:Heart1010,项目名称:JoomLeague,代码行数:66,代码来源:view.html.php


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