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 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; }