本文整理汇总了PHP中JoomleagueHelper::getMatchEndTimestamp方法的典型用法代码示例。如果您正苦于以下问题:PHP JoomleagueHelper::getMatchEndTimestamp方法的具体用法?PHP JoomleagueHelper::getMatchEndTimestamp怎么用?PHP JoomleagueHelper::getMatchEndTimestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoomleagueHelper
的用法示例。
在下文中一共展示了JoomleagueHelper::getMatchEndTimestamp方法的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 );
}