function getObjectInfo($id, $language = null)
 {
     $info = new JCommentsObjectInfo();
     $routerHelper = JPATH_SITE . '/components/com_joomleague/helpers/route.php';
     if (is_file($routerHelper)) {
         require_once $routerHelper;
         $db = JFactory::getDBO();
         $query = "SELECT m.id as matchid,\r\n\t\t\t\t\t\t\t\tt1.short_name t1name,\r\n\t\t\t\t\t\t\t\tt2.short_name t2name,\r\n\t\t\t\t\t\t\t\tm.projectteam1_id,\r\n\t\t\t\t\t\t\t\tm.projectteam2_id,\r\n\t\t\t\t\t\t\t\tm.team1_result,\r\n\t\t\t\t\t\t\t\tm.team2_result,\r\n\t\t\t\t\t\t\t\tm.modified_by,\r\n\t\t\t\t\t\t\t\tr.project_id,\r\n\t\t\t\t\t\t\t\tp.name as projectname" . " FROM #__joomleague_match as m" . " LEFT JOIN #__joomleague_round as r ON r.id=m.round_id" . " INNER JOIN #__joomleague_project_team AS pt1 ON m.projectteam1_id=pt1.id" . " INNER JOIN #__joomleague_project_team AS pt2 ON m.projectteam2_id=pt2.id" . " INNER JOIN #__joomleague_team AS t1 ON pt1.team_id=t1.id" . " INNER JOIN #__joomleague_team AS t2 ON pt2.team_id=t2.id" . " INNER JOIN #__joomleague_project AS p ON pt1.project_id=p.id" . " WHERE m.id = " . $id;
         $db->setQuery($query);
         $row = $db->loadObject();
         if (!empty($row)) {
             $info->title = $row->projectname . " " . $row->t1name . " vs. " . $row->t2name;
             $info->userid = $row->modified_by;
             $info->link = JRoute::_(JoomleagueHelperRoute::getNextMatchRoute($row->project_id, $row->matchid));
         }
     }
     return $info;
 }
		</tr>
		<?php 
}
?>
	<!-- Next Match-->
	<?php 
if ($this->match->new_match_id > 0) {
    ?>
		<tr>
			<td colspan="3" >
				<span class="label"><?php 
    echo JText::_('COM_JOOMLEAGUE_MATCHREPORT_NEW_MATCH');
    ?>
</span>
				<span><?php 
    echo JHTML::link(JoomleagueHelperRoute::getNextMatchRoute($this->project->id, $this->match->new_match_id), $this->newmatchtext);
    ?>
</span>
			</td>
		</tr>
		<?php 
}
?>
	
	<!-- Date -->
	<?php 
if ($this->config['show_match_date'] == 1) {
    if ($this->match->match_date > 0) {
        ?>
            <tr>
                <td colspan="3" >
 function getScoreLink($game, $project)
 {
     if (isset($game->team1_result) || $game->alt_decision) {
         return JoomleagueHelperRoute::getMatchReportRoute($project->slug, $game->id);
     } else {
         return JoomleagueHelperRoute::getNextMatchRoute($project->slug, $game->id);
     }
 }
                    $link = JoomleagueHelperRoute::getNextMatchRoute($this->project->slug, $match->id) . '#comments';
                }
                $viewComment = JHTML::link($link, $href_text);
                echo $viewComment;
            } else {
                $imgTitle = JText::_('COM_JOOMLEAGUE_TEAMPLAN_COMMENTS_COUNT_NOCOMMENT');
                if ($this->config['show_comments_count'] == 1) {
                    $href_text = JHTML::image(JURI::root() . 'media/com_joomleague/jl_images/discuss.gif', $imgTitle, array(' title' => $imgTitle, ' border' => 0, ' style' => 'vertical-align: middle'));
                } elseif ($this->config['show_comments_count'] == 2) {
                    $href_text = '<span title="' . $imgTitle . '">(' . $count . ')</span>';
                }
                //Link
                if (isset($match->team1_result)) {
                    $link = JoomleagueHelperRoute::getMatchReportRoute($this->project->slug, $match->id) . '#comments';
                } else {
                    $link = JoomleagueHelperRoute::getNextMatchRoute($this->project->slug, $match->id) . '#comments';
                }
                $viewComment = JHTML::link($link, $href_text);
                echo $viewComment;
            }
            ?>
</td>
		<?php 
        }
        ?>
	</tr>
	<?php 
        if ($hasEvents) {
            ?>
	<!-- Show icon for editing events in edit mode -->
	<tr class="events <?php 
             case 2:
                 // Link to Match report
                 $title = str_replace("%TEAMHOME%", $this->teams[$result->projectteam1_id]->name, JText::_('COM_JOOMLEAGUE_FORCED_MATCH_REPORT_FORM'));
                 $title = str_replace("%TEAMGUEST%", $this->teams[$result->projectteam2_id]->name, $title);
                 break;
             default:
                 break;
         }
         if ($result->cancel) {
             $picture = 'images/com_joomleague/database/events/' . $this->project->fs_sport_type_name . '/away.gif';
             $title = $result->cancel_reason;
             $desc = JoomleagueHelper::getPictureThumb($picture, $title, 16, 16, 99);
             $match_result = JHTML::link($link, $desc);
             $new_match = "";
             if ($result->new_match_id > 0) {
                 $link = JoomleagueHelperRoute::getNextMatchRoute($this->project->id, $result->new_match_id);
                 $picture = 'media/com_joomleague/jl_images/bullet_black.png';
                 $desc = JoomleagueHelper::getPictureThumb($picture, $title, 16, 16, 99);
                 $new_match = JHTML::link($link, $desc);
             }
             $match_result .= $new_match;
         } else {
             $picture = 'media/com_joomleague/jl_images/bullet_black.png';
             $desc = JoomleagueHelper::getPictureThumb($picture, $title, 16, 16, 99);
             $match_result = JHTML::link($link, $desc);
         }
     }
 } elseif ($e1 != "" && $e2 != "") {
     // result without match report
     if ($this->config['highlight_fav_team'] != 2 || !in_array($team_row->id, $this->favteams) && !in_array($team_col->id, $this->favteams)) {
         $resultStr = $e1 . $this->overallconfig['seperator'] . $e2 . $ResultType;
 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;
 }
Esempio n. 7
0
 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;
 }