function getMatches($month, $year) { $livescore = $this->params->get('livescore', ''); $joomleague = $this->params->get('joomleague', ''); $caldates = array(); $caldates['start'] = date("{$year}-{$month}-01 00:00:00"); $caldates['end'] = date("{$year}-{$month}-31 23:59:59"); $jlrows = array(); $lsrows = array(); $usejevents = $this->params->get('jevents', 0); //$user = JFactory::getUser(); //if ($user->id == 62) $usejevents = 1; if ($usejevents == 1) { $day = 0; require_once dirname(__FILE__) . DS . 'connectors' . DS . 'jevents.php'; JEventsConnector::getEntries($caldates, $this->params, $this->matches); } require_once dirname(__FILE__) . DS . 'connectors' . DS . $joomleague . '.php'; $this->params->prefix = $this->prefix; JoomleagueConnector::getEntries($caldates, $this->params, $this->matches); if ($livescore != '') { require_once dirname(__FILE__) . DS . 'connectors' . DS . 'livescore.php'; $this->params->prefix = $this->params->get('prefix_livescore', ''); LivescoreConnector::getMatches($caldates, $this->params, $this->matches); } $matches = $this->sortArray($this->matches, 'asc', 'date'); $this->matches = $matches; return $matches; }
function formatMatches($rows, &$matches) { $newrows = array(); $teamnames = $this->xparams->get('team_names', 'short_name'); $teams = JoomleagueConnector::getTeamsFromMatches($rows); $teams[0]->name = $teams[0]->{$teamnames} = $teams[0]->logo_small = $teams[0]->logo_middle = $teams[0]->logo_big = ''; foreach ($rows as $key => $row) { $newrows[$key]['type'] = 'jlm'; $newrows[$key]['homepic'] = isset($teams[$row->matchpart1]) ? JoomleagueConnector::buildImage($teams[$row->matchpart1]) : ''; $newrows[$key]['awaypic'] = isset($teams[$row->matchpart2]) ? JoomleagueConnector::buildImage($teams[$row->matchpart2]) : ''; $newrows[$key]['date'] = JoomleagueHelper::getMatchStartTimestamp($row); $newrows[$key]['result'] = !is_null($row->matchpart1_result) ? $row->matchpart1_result . ':' . $row->matchpart2_result : '-:-'; $newrows[$key]['headingtitle'] = parent::jl_utf8_convert($row->name . '-' . $row->roundname, 'iso-8859-1', 'utf-8'); $newrows[$key]['homename'] = isset($teams[$row->matchpart1]) ? JoomleagueConnector::formatTeamName($teams[$row->matchpart1]) : 'n/a'; $newrows[$key]['awayname'] = isset($teams[$row->matchpart2]) ? JoomleagueConnector::formatTeamName($teams[$row->matchpart2]) : 'n/a'; $newrows[$key]['matchcode'] = $row->matchcode; $newrows[$key]['project_id'] = $row->project_id; $matches[] = $newrows[$key]; if (isset($teams[$row->matchpart1])) { parent::addTeam($row->matchpart1, parent::jl_utf8_convert($teams[$row->matchpart1]->name, 'iso-8859-1', 'utf-8'), $newrows[$key]['homepic']); } if (isset($teams[$row->matchpart2])) { parent::addTeam($row->matchpart2, parent::jl_utf8_convert($teams[$row->matchpart2]->name, 'iso-8859-1', 'utf-8'), $newrows[$key]['awaypic']); } } return $newrows; }
function formatMatches($rows, &$matches) { $newrows = array(); $teamnames = $this->xparams->get('team_names', 'short_name'); $teams = JoomleagueConnector::getTeamsFromMatches($rows); $teams[0] = new stdclass(); $teams[0]->name = $teams[0]->{$teamnames} = $teams[0]->logo_small = $teams[0]->logo_middle = $teams[0]->logo_big = ''; foreach ($rows as $key => $row) { $newrows[$key]['type'] = 'jlm'; $newrows[$key]['homepic'] = JoomleagueConnector::buildImage($teams[$row->projectteam1_id]); $newrows[$key]['awaypic'] = JoomleagueConnector::buildImage($teams[$row->projectteam2_id]); $newrows[$key]['date'] = JoomleagueHelper::getMatchStartTimestamp($row); //$newrows[$key]['result'] = (!is_null($row->matchpart1_result)) ? $row->matchpart1_result . ':' . $row->matchpart2_result : '-:-'; $newrows[$key]['result'] = !is_null($row->team1_result) ? $row->team1_result . ':' . $row->team2_result : '-:-'; $newrows[$key]['headingtitle'] = parent::jl_utf8_convert($row->name . '-' . $row->roundname, 'iso-8859-1', 'utf-8'); $newrows[$key]['homename'] = JoomleagueConnector::formatTeamName($teams[$row->projectteam1_id]); $newrows[$key]['awayname'] = JoomleagueConnector::formatTeamName($teams[$row->projectteam2_id]); $newrows[$key]['matchcode'] = $row->matchcode; $newrows[$key]['project_id'] = $row->project_id; // insert matchdetaillinks $newrows[$key]['link'] = JoomleagueHelperRoute::getNextMatchRoute($row->project_id, $row->matchcode); $matches[] = $newrows[$key]; parent::addTeam($row->projectteam1_id, parent::jl_utf8_convert($teams[$row->projectteam1_id]->name, 'iso-8859-1', 'utf-8'), $newrows[$key]['homepic']); parent::addTeam($row->projectteam2_id, parent::jl_utf8_convert($teams[$row->projectteam2_id]->name, 'iso-8859-1', 'utf-8'), $newrows[$key]['awaypic']); } return $newrows; }
function formatMatches($rows, &$matches) { $newrows = array(); $teamnames = $this->xparams->get('team_names', 'short_name'); $teams = JoomleagueConnector::getTeamsFromMatches($rows); $teams[0] = new stdclass(); $teams[0]->name = $teams[0]->{$teamnames} = $teams[0]->logo_small = $teams[0]->logo_middle = $teams[0]->logo_big = ''; /* echo 'function formatMatches array teams<br>'; echo '<pre>'; print_r($teams); echo '</pre>'; */ /* echo 'function formatMatches array rows<br>'; echo '<pre>'; print_r($rows); echo '</pre>'; */ /* echo 'function formatMatches array matches<br>'; echo '<pre>'; print_r($matches); echo '</pre>'; */ foreach ($rows as $key => $row) { $newrows[$key]['type'] = 'jlm'; //$newrows[$key]['homepic'] = JoomleagueConnector::buildImage($teams[$row->matchpart1]); //$newrows[$key]['awaypic'] = JoomleagueConnector::buildImage($teams[$row->matchpart2]); $newrows[$key]['homepic'] = JoomleagueConnector::buildImage($teams[$row->projectteam1_id]); $newrows[$key]['awaypic'] = JoomleagueConnector::buildImage($teams[$row->projectteam2_id]); $newrows[$key]['date'] = $row->match_date; //$newrows[$key]['result'] = (!is_null($row->matchpart1_result)) ? $row->matchpart1_result . ':' . $row->matchpart2_result : '-:-'; $newrows[$key]['result'] = !is_null($row->team1_result) ? $row->team1_result . ':' . $row->team2_result : '-:-'; $newrows[$key]['headingtitle'] = parent::jl_utf8_convert($row->name . '-' . $row->roundname, 'iso-8859-1', 'utf-8'); //$newrows[$key]['homename'] = JoomleagueConnector::formatTeamName($teams[$row->matchpart1]); //$newrows[$key]['awayname'] = JoomleagueConnector::formatTeamName($teams[$row->matchpart2]); $newrows[$key]['homename'] = JoomleagueConnector::formatTeamName($teams[$row->projectteam1_id]); $newrows[$key]['awayname'] = JoomleagueConnector::formatTeamName($teams[$row->projectteam2_id]); $newrows[$key]['matchcode'] = $row->matchcode; $newrows[$key]['project_id'] = $row->project_id; // insert matchdetaillinks //$newrows[$key]['link'] = 'index.php?option=com_joomleague&view=nextmatch&p='.$row->project_id.'&mid='.$row->matchcode; $newrows[$key]['link'] = JoomleagueHelperRoute::getNextMatchRoute($row->project_id, $row->matchcode); $matches[] = $newrows[$key]; //parent::addTeam($row->matchpart1, parent::jl_utf8_convert ($teams[$row->matchpart1]->name, 'iso-8859-1', 'utf-8'), $newrows[$key]['homepic']); //parent::addTeam($row->matchpart2, parent::jl_utf8_convert ($teams[$row->matchpart2]->name, 'iso-8859-1', 'utf-8'),$newrows[$key]['awaypic']); parent::addTeam($row->projectteam1_id, parent::jl_utf8_convert($teams[$row->projectteam1_id]->name, 'iso-8859-1', 'utf-8'), $newrows[$key]['homepic']); parent::addTeam($row->projectteam2_id, parent::jl_utf8_convert($teams[$row->projectteam2_id]->name, 'iso-8859-1', 'utf-8'), $newrows[$key]['awaypic']); /* echo 'function formatMatches projectteam1_id<br>'; echo $row->projectteam1_id.'-'.$teams[$row->projectteam1_id]->name.'<br>'; echo $row->projectteam2_id.'-'.$teams[$row->projectteam2_id]->name.'<br>'; */ } return $newrows; }
function getMatches($month, $year) { $livescore = $this->params->get('livescore', ''); $joomleague = $this->params->get('joomleague', ''); $caldates = array(); $caldates['start'] = date("{$year}-{$month}-01 00:00:00"); $caldates['end'] = date("{$year}-{$month}-31 23:59:59"); $jlrows = array(); $lsrows = array(); $usejevents = $this->params->get('jevents', 0); if ($usejevents == 1) { $day = 0; require_once dirname(__FILE__) . '/connectors/jevents.php'; JEventsConnector::getEntries($caldates, $this->params, $this->matches); } require_once dirname(__FILE__) . '/connectors/' . $joomleague . '.php'; $this->params->prefix = $this->prefix; // @todo Check! $entries = new JoomleagueConnector($this->params); $entries->getEntries($caldates, $this->params, $this->matches); /* JoomleagueConnector::getEntries($caldates, $this->params, $this->matches); */ if ($livescore != '') { require_once dirname(__FILE__) . '/connectors/livescore.php'; $this->params->prefix = $this->params->get('prefix_livescore', ''); LivescoreConnector::getMatches($caldates, $this->params, $this->matches); } $matches = $this->sortArray($this->matches, 'asc', 'date'); $this->matches = $matches; return $matches; }