0 Пользователей и 1 Гость просматривают эту тему.
  • 22 Ответов
  • 1729 Просмотров
*

Геныч

  • Захожу иногда
  • 287
  • 9 / 0
Продолжаем осваивать JL 2.0  !  ^-^

Возник очередной вопрос. Когда публикуется календарь матчей турнира, то указывается (разумеется, если это необходимо), дата и время начала каждого матча. В случае, если расписание фиксированное (то есть даты и время начала известны заранее), это нормально. Но если "плавающее", когда очередные игры назначаются, к примеру, каждую неделю, то возникают проблемы.

Конечно, можно "очистить" окошечко формы с датой-временем, удалив цифры. Но после сохранения они возвращаются к тем, что заданы по умолчанию. Именно то, что задано по умолчанию, и отображается в календаре. Хотя, до того момента, пока игра не назначена должно "отображаться" пустое место.

Время убрать никак не удается, потому что при создании нового проекта это обязательный параметр.

Очевидно, надо копаться в коде файлов фронтэнда. Ни у кого нет мыслей, как прописать это условие - например, запретить вывод даты/времени, если не заполнено поле "стадион" - то есть, если значение ячейки playground_id равно NULL? За вывод расписания матчей отвечает файл default_plan.php:

Код
<?php defined('_JEXEC') or die('Restricted access');

if ($this->config['show_comments_count'] == 1 || $this->config['show_comments_count'] == 2)
{
$plugin = JoomleagueHelper::getCommentsIntegrationPlugin();

$pluginParams = is_object($plugin)? new JParameter($plugin->params) : new JParameter('');
$separate_comments = $pluginParams->get( 'separate_comments', 0 );
}
?>
<a name="jl_top" id="jl_top"></a>
<?php
if (!empty($this->matches))
{
$teamid=JRequest::getInt('tid');
$nbcols = 0;
?>

<table class='fixtures'>
<thead>
<tr class="sectiontableheader">
<?php
if ($this->config['show_events'])
{
?>
<th>&nbsp;</th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_matchday'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_MATCHDAY'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_match_number'])
{
?>
<th><?php echo '&nbsp;'.JText::_('NUM').'&nbsp;'; ?></th>
<?php
$nbcols++;
}
?>

<?php
if (($this->project->project_type=='DIVISIONS_LEAGUE') && ($this->config['show_division']))
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_DIVISION'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if (($this->config['show_playground'] || $this->config['show_playground_alert']))
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_PLAYGROUND'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_date'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_EDIT_DATE'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_time'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_EDIT_TIME'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_time_present'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_TIME_PRESENT'); ?></th>
<?php
$nbcols++;
}

switch ($this->config['result_style'])
{
case 1 :

// Show home team marker
echo '<th class="right">';
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_HOME_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_AWAY_TEAM');
}
$nbcols++;
echo '</th>';

// Create space for logo home team
if ($this->config['show_logo_small'])
{
echo '<th class="right">&nbsp;</th>';
$nbcols++;
}

// Create room for the score to be displayed
echo '<th>'.JText::_('COM_JOOMLEAGUE_TEAMPLAN_RESULT').'</th>';
$nbcols++;

// Create space for logo guest team
if ($this->config['show_logo_small'])
{
echo '<th class="left">&nbsp;</th>';
$nbcols++;
}

// Show guest team marker
echo '<th class="left">';
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_AWAY_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_HOME_TEAM');
}
$nbcols++;
echo '</th>';
break;
default :
case 0 :

// Show home team marker
echo '<th class="right">';
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_HOME_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_AWAY_TEAM');
}
$nbcols++;
echo '</th>';

// Create space for logo home team
if ($this->config['show_logo_small'])
{
echo '<th class="right">&nbsp;</th>';
$nbcols++;
}

echo '<th>&nbsp;</th>';
$nbcols++;

// Create space for logo guest team
if ($this->config['show_logo_small'])
{
echo '<th class="left">&nbsp;</th>';
$nbcols++;
}

echo '<th class="left">';
// Show guest team marker
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_AWAY_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_HOME_TEAM');
}
$nbcols++;
echo '</th>';

echo '<th class="center">'.JText::_('COM_JOOMLEAGUE_TEAMPLAN_RESULT').'</th>';
$nbcols++;
break;
}
?>

<?php
if ($this->config['show_referee'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_REFEREE'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if (($this->config['show_thumbs_picture']) & ($teamid>0))
{
?>
<th>&nbsp;</th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_matchreport_column'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_MATCHREPORT_PAGE_TITLE'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_attendance_column'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_ATTENDANCE'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if (($this->config['show_comments_count'] == 1 || $this->config['show_comments_count'] == 2) && class_exists('JCommentsModel'))
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_COMMENTS'); ?></th>
<?php
$nbcols++;
}
?>
</tr>
</thead>
<?php

$k = 0;
$counter = 1;
$round_date = '';

foreach($this->matches as $match)
{
$hometeam=$this->teams[$match->projectteam1_id];
$home_projectteam_id=$hometeam->projectteamid;

$guestteam=$this->teams[$match->projectteam2_id];
$guest_projectteam_id=$guestteam->projectteamid;

$class=($k==0)? $this->config['style_class1'] : $this->config['style_class2'];

if ($match->team1==$this->favteams)
{
$highlight="highlight";
}
else
{
$highlight=$class;
}

if (!empty($this->ptid))
{
$home=$hometeam->name;
if ($match->team1==$this->ptid)
{
$home=sprintf('%s',$hometeam->name);
}
}
else
{
$home=$hometeam->name;
if ($match->team2)
{
$home=sprintf('%s',$hometeam->name);
}
}

if (!empty($this->ptid))
{
$away=$guestteam->name;
if ($match->team2==$this->ptid)
{
$away=sprintf('%s',$guestteam->name);
}
}
else
{
$away=$guestteam->name;
if ($match->team2)
{
$away=sprintf('%s',$guestteam->name);
}
}

$homeclub=$hometeam->club_id;
$awayclub=$guestteam->club_id;

$favStyle = '';
if ($this->config['highlight_fav'] == 1 && !$teamid) {
$isFavTeam = in_array($hometeam->id,$this->favteams)? 1 : in_array($guestteam->id, $this->favteams);
if ( $isFavTeam && $this->project->fav_team_highlight_type == 1 )
{
if( trim( $this->project->fav_team_color )!= "" )
{
$color = trim($this->project->fav_team_color);
}
$format = "%s";
$favStyle = ' style="';
$favStyle .= ($this->project->fav_team_text_bold != '')? 'font-weight:bold;' : '';
$favStyle .= (trim($this->project->fav_team_text_color)!= '')? 'color:'.trim($this->project->fav_team_text_color).';' : '';
$favStyle .= ($color != '')? 'background-color:' . $color . ';' : '';
if ($favStyle != ' style="')
{
 $favStyle .= '"';
}
else {
 $favStyle = '';
}

}
}

?>
<tr class="<?php echo $highlight; ?>"<?php echo $favStyle; ?>>
                <?php
// start events
if ($this->config['show_events'])
{
?>
<td width='5' class='ko'>
<?php
  $events = $this->model->getMatchEvents($match->id);
  $subs = $this->model->getMatchSubstitutions($match->id);

if ($this->config['use_tabs_events']) {
   $hasEvents = (count($events) + count($subs) > 0 && $this->config['show_events']);
} else {
   //no subs are shown when not using tabs for displaying events so don't check for that
   $hasEvents = (count($events) > 0 && $this->config['show_events']);
}

if ($hasEvents)
{
$link = "javascript:void(0);";
$img = JHtml::image('media/com_joomleague/jl_images/events.png', 'events.png');
$params = array("title"   => JText::_('COM_JOOMLEAGUE_TEAMPLAN_EVENTS'),
"onclick" => 'switchMenu(\'info'.$match->id.'\');return false;');
echo JHtml::link($link,$img,$params);
}
?>
</td>
<?php
}
else
{
$hasEvents = false;
}
// end events
?>

<?php
if ($this->config['show_matchday'])
{
?>
<td width='5%'>
<?php
$link=JoomleagueHelperRoute::getResultsRoute($this->project->slug,$match->roundid);
echo JHtml::link($link,$match->roundcode);
?>
</td>
<?php
}
?>

<?php
if ($this->config['show_match_number'])
{
?>
   <td>
<?php if (empty($match->match_number)){$match->match_number='-';} echo $match->match_number; ?>
   </td>
<?php
}
if (($this->project->project_type=='DIVISIONS_LEAGUE') && ($this->config['show_division']))
{
?>
   <td>
<?php echo JoomleagueHelperHtml::showDivisonRemark($hometeam,$guestteam,$this->config); ?>
   </td>
<?php
}
if (($this->config['show_playground'] || $this->config['show_playground_alert']))
{
?>
   <td>
<?php JoomleagueHelperHtml::showMatchPlayground($match); ?>
   </td>
<?php
}
/*
echo JoomleagueModelTeamPlan::showPlayground( $hometeam,
$guestteam,
$match,
$this->config['show_playground_alert'],
$this->config['show_playground'],
$match->project_id);
*/
?>

<?php
if ($this->config['show_date'])
{
?>
<td width="10%"><?php
if (!strstr($match->match_date,"0000-00-00"))
{
echo JHtml::date($match->match_date,
JText::_('COM_JOOMLEAGUE_GLOBAL_CALENDAR_DATE'),
$this->overallconfig['time_zone']);
}
else
{
echo "&nbsp;";
}
?>
</td>
<?php
}
?>

<?php
if ($this->config['show_time'])
{
?>
<td width="10%"><?php echo JoomleagueHelperHtml::showMatchTime( $match,
$this->config,
$this->overallconfig,
$this->project); ?></td>
<?php
}
?>

<?php
if ($this->config['show_time_present'])
{
?>
<td width='10%'><?php if (empty($match->time_present)){$match->time_present='-';} echo $match->time_present; ?></td>
<?php
}
?>

<?php
// Define some variables which will be used
$teamA = '';
$teamB = '';
$score = "";

// Check if the home and guest team should be switched arround
if ($this->config['switch_home_guest']) {
$class1 = 'left';
$class2 = 'right';
} else {
$class1 = 'right';
$class2 = 'left';
}
if ($this->config['show_teamplan_link']) {
$homelink=JoomleagueHelperRoute::getTeamPlanRoute($this->project->slug,$hometeam->team_slug);
$awaylink=JoomleagueHelperRoute::getTeamPlanRoute($this->project->slug,$guestteam->team_slug);
} else {
$homelink = null;
$awaylink = null;
}
$isFavTeam = in_array($hometeam->id,$this->favteams);
$home = JoomleagueHelper::formatTeamName($hometeam, "g".$match->id."t".$hometeam->id, $this->config, $isFavTeam, $homelink);

$teamA .= '<td class="'.$class1.'">'.$home.'</td>';

// Check if the user wants to show the club logo or country flag
switch ($this->config['show_logo_small'])
{
case 1 :
{
$teamA .= '<td class="'.$class1.'">';
$teamA .= ' '.JoomleagueModelProject::getClubIconHtml($hometeam,1);
$teamA .= '</td>';

$teamB .= '<td class="'.$class2.'">';
$teamB .= JoomleagueModelProject::getClubIconHtml($guestteam,1).' ';
$teamB .= '</td>';
}
break;

case 2 :
{
$teamA .= '<td class="'.$class1.'">';
$teamA .= Countries::getCountryFlag($hometeam->country);
$teamA .= '</td>';

$teamB .= '<td class="'.$class2.'">';
$teamB .= Countries::getCountryFlag($guestteam->country);
$teamB .= '</td>';
}
break;

case 3:
{
$teamA .= '<td class="'.$class1.'">';
$teamA .= JoomleagueHelper::getPictureThumb($hometeam->picture,
$hometeam->name,
$this->config['team_picture_width'],
$this->config['team_picture_height'],1);

$teamA .= '</td>';

$teamB .= '<td class="'.$class2.'">';
$teamB .= JoomleagueHelper::getPictureThumb($guestteam->picture,
$guestteam->name,
$this->config['team_picture_width'],
$this->config['team_picture_height'],1);
$teamB .= '</td>';
}
break;
}

$seperator ='<td width="10">'.$this->config['seperator'].'</td>';

$isFavTeam = in_array($guestteam->id, $this->favteams);
$away = JoomleagueHelper::formatTeamName($guestteam,"g".$match->id."t".$guestteam->id,$this->config, $isFavTeam, $awaylink);

$teamB .= '<td class="'.$class2.'">'.$away.'</td>';

if (!$match->cancel)
{

            // In case show_part_results is true, then first check if the part results are available;
            // 'No part results available' occurs when teamX_result_split ONLY consists of zero or more ";"
            // (zero for projects with a single playing period, one or more for projects with two or more playing periods)
            $team1_result_split_present = preg_match('/^;*$/', $match->team1_result_split) == 0;
            $team2_result_split_present = preg_match('/^;*$/', $match->team2_result_split) == 0;

            if ($this->config['switch_home_guest'])
                {
if (isset($match->team1_result) && isset($match->team2_result)) {
     $result='<strong>'.$match->team2_result.'&nbsp;'.$this->config['seperator'].'&nbsp;'.$match->team1_result.'</strong>';
                    } else {
     $result='_&nbsp;'.$this->config['seperator'].'&nbsp;_';
                    }

                    $part_results_left = explode(";", $match->team2_result_split);
                    $part_results_right = explode(";", $match->team1_result_split);

                    $leftResultOT = $match->team2_result_ot;
                    $rightResultOT = $match->team1_result_ot;
                    $leftResultSO = $match->team2_result_so;
                    $rightResultSO = $match->team1_result_so;
                    $leftResultDEC = $match->team2_result_decision;
                    $rightResultDEC = $match->team1_result_decision;
                }
                else
                {
if (isset($match->team1_result) && isset($match->team2_result)) {
     $result='<strong>'.$match->team1_result.'&nbsp;'.$this->config['seperator'].'&nbsp;'.$match->team2_result.'</strong>';
                    } else {
     $result='_&nbsp;'.$this->config['seperator'].'&nbsp;_';
                    }

                    $part_results_left = explode(";", $match->team1_result_split);
                    $part_results_right = explode(";", $match->team2_result_split);

                    $rightResultOT = $match->team2_result_ot;
                    $leftResultOT = $match->team1_result_ot;
                    $rightResultSO = $match->team2_result_so;
                    $leftResultSO = $match->team1_result_so;
                    $rightResultDEC = $match->team2_result_decision;
                    $leftResultDEC = $match->team1_result_decision;
                }

            $SOTresult = '';
            $SOTtolltip = '';

            switch ($match->match_result_type)
            {
                case 2 :
                    {
                        if ($this->config['result_style']==1){
                            $result .= '<br />';
                        } else {
                            $result .= ' ';
                        }
                        $result .= '('.JText::_('COM_JOOMLEAGUE_RESULTS_SHOOTOUT');
                        $result .= ')';

                        if (isset($leftResultOT))
                            {
                                        $OTresultS = $leftResultOT . '&nbsp;' . $this->config['seperator'] . '&nbsp;' . $rightResultOT;
                                        $SOTresult .= '<br /><span class="hasTip" title="' . JText::_('COM_JOOMLEAGUE_RESULTS_OVERTIME2').'::' . $OTresultS . '" >' . $OTresultS . '</span>';
                                        $SOTtolltip = ' | ' . $OTresultS;
                            }
                        if (isset($leftResultSO))
                            {
                                        $SOresultS = $leftResultSO . '&nbsp;' . $this->config['seperator'] . '&nbsp;' . $rightResultSO;
                                        $SOTresult .= '<br /><span class="hasTip" title="' . JText::_('COM_JOOMLEAGUE_RESULTS_SHOOTOUT2').'::' . $SOresultS . '" >' . $SOresultS . '</span>';
                                        $SOTtolltip = ' | ' . $SOresultS;
                            }
                    }
                    break;

                case 1 :
                    {
                        if ($this->config['result_style']==1){
                            $result .= '<br />';
                        }else{
                            $result .= ' ';
                        }

                        $result .= '('.JText::_('COM_JOOMLEAGUE_RESULTS_OVERTIME');
                        $result .= ')';

                        if (isset($leftResultOT))
                            {
                                        $OTresultS = $leftResultOT . '&nbsp;' . $this->config['seperator'] . '&nbsp;' . $rightResultOT;
                                        $SOTresult .= '<br /><span class="hasTip" title="' . JText::_('COM_JOOMLEAGUE_RESULTS_OVERTIME2').'::' . $OTresultS . '" >' . $OTresultS . '</span>';
                                        $SOTtolltip = ' | ' . $OTresultS ;
                            }
                    }
                    break;
            }

            //Link
            if (isset($match->team1_result))
                {
                    $link=JoomleagueHelperRoute::getMatchReportRoute($this->project->slug,$match->id);
            } else {
                    $link=JoomleagueHelperRoute::getNextMatchRoute($this->project->slug,$match->id);
                }

            $ResultsTooltipTitle = $result;

            if ($this->config['results_linkable']==1) {
$result = JHtml::link($link,$result);
   }

            $ResultsTooltipTp = '( ';
            $PartResult = '';

            if ($team1_result_split_present && $team2_result_split_present)
            {
            //Part results
            if (!is_array($part_results_left))  { $part_results_left = array($part_results_left); }
            if (!is_array($part_results_right)) { $part_results_right = array($part_results_right); }

            for ($i = 0; $i < count($part_results_left); $i++)
            {
                if (isset($part_results_left[$i]))
                    {
                                $resultS = $part_results_left[$i] . '&nbsp;' . $this->config['seperator'] . '&nbsp;' . $part_results_right[$i];
                                $whichPeriod = $i + 1;
                                $PartResult .= '<br /><span class="hasTip" title="' . JText::sprintf( 'COM_JOOMLEAGUE_NPART',  "$whichPeriod")  .'::' . $resultS . '" >' . $resultS . '</span>';
                                if ($i != 0) {
                                $ResultsTooltipTp .= ' | ' . $resultS;
                                } else {
                                $ResultsTooltipTp .= $resultS;
                                }
                    }
            }
            }

            $ResultsTooltipTp .= $SOTtolltip . ' )';

            if ($team1_result_split_present && $team2_result_split_present)
            {
                if ($this->config['show_part_results'])
                    {
                        $result .= $PartResult . $SOTresult;
                    }
                else
                    {
                        //No need to show a tooltip if the parts are shown anyways
                        $result = '<span class="hasTip" title="' .$ResultsTooltipTitle . '::' . $ResultsTooltipTp . '" >' . $result . '</span>';
                    }
            }

            if ($match->alt_decision)
            {
                $result='<b style="color:red;">';
                $result .= $leftResultDEC.'&nbsp;'.$this->config['seperator'].'&nbsp;'.$rightResultDEC;
                $result .= '</b>';

            }

$score = "<td align='center'>".$result.'</td>';
}
else
{
$score='<td>'.JText::_($match->cancel_reason).'</td>';
}

switch ($this->config['result_style'])
{
case 1 :
{
if ($this->config['switch_home_guest'])
{
echo $teamB.$score.$teamA;
}
else
{
echo $teamA.$score.$teamB;
}
}
break;

default;
case 0 :
{
if ($this->config['switch_home_guest'])
{
echo $teamB.$seperator.$teamA.$score;
}
else
{
echo $teamA.$seperator.$teamB.$score;
}
}
break;
}
?>

<?php
if ($this->config['show_referee'])
{
?>
<td><?php
if ((isset($match->referees)) && (count($match->referees)>0))
{
if ($this->project->teams_as_referees)
{
$output='';
$toolTipTitle=JText::_('COM_JOOMLEAGUE_TEAMPLAN_REF_TOOLTIP');
$toolTipText='';

for ($i=0; $i<count($match->referees); $i++)
{
if ($match->referees[$i]->referee_name != '')
{
$output .= $match->referees[$i]->referee_name;
$toolTipText .= $match->referees[$i]->referee_name.'&lt;br /&gt;';
}
else
{
$output .= '-';
$toolTipText .= '-&lt;br /&gt;';
}
}
if ($this->config['show_referee']==1)
{
echo $output;
}
elseif ($this->config['show_referee']==2)
{
?>
<span class='hasTip' title='<?php echo $toolTipTitle; ?> :: <?php echo $toolTipText; ?>'>
<img src='<?php echo JUri::root(); ?>media/com_joomleague/jl_images/icon-16-Referees.png' alt='' title='' /> </span>
<?php
}
}
else
{
$output='';
$toolTipTitle=JText::_('COM_JOOMLEAGUE_TEAMPLAN_REF_TOOLTIP');
$toolTipText='';

for ($i=0; $i<count($match->referees); $i++)
{
if ($match->referees[$i]->referee_lastname != '' && $match->referees[$i]->referee_firstname)
{
$output .= '<span class="hasTip" title="'.JText::_('COM_JOOMLEAGUE_TEAMPLAN_REF_FUNCTION').'::'.$match->referees[$i]->referee_position_name.'">';
$ref=$match->referees[$i]->referee_lastname. ','.$match->referees[$i]->referee_firstname;
$toolTipText .= $ref.' ('.$match->referees[$i]->referee_position_name.')'.'&lt;br /&gt;';
if ($this->config['show_referee_link'])
{
$link=JoomleagueHelperRoute::getRefereeRoute($this->project->slug,$match->referees[$i]->referee_id,3);
$ref=JHtml::link($link,$ref);
}
$output .= $ref;
$output .= '</span>';

if (($i + 1) < count($match->referees))
{
$output .= ' - ';
}
}
else
{
$output .= '-';
}
}

if ($this->config['show_referee']==1)
{
echo $output;
}
elseif ($this->config['show_referee']==2)
{
?> <span class='hasTip'
title='<?php echo $toolTipTitle; ?> :: <?php echo $toolTipText; ?>'>
<img
src='<?php echo JUri::root(); ?>media/com_joomleague/jl_images/icon-16-Referees.png'
alt='' title='' /> </span> <?php
}
}
}
else
{
echo '-';
}
?></td>
<?php
}
?>

<?php if (($this->config['show_thumbs_picture']) & ($teamid>0)): ?>
<td><?php echo JoomleagueHelperHtml::getThumbUpDownImg($match, $this->ptid); ?></td>
<?php endif; ?>

<?php
if ($this->config['show_matchreport_column'])
{
?>
<td><?php
if (!$match->cancel) {
if (isset($match->team1_result))
{
if ($this->config['show_matchreport_image']) {
$href_text = JHtml::image($this->config['matchreport_image'], JText::_('COM_JOOMLEAGUE_TEAMPLAN_VIEW_MATCHREPORT'));
} else {
$href_text = JText::_('COM_JOOMLEAGUE_TEAMPLAN_VIEW_MATCHREPORT');
}

$link=JoomleagueHelperRoute::getMatchReportRoute($this->project->slug,$match->id);
$viewReport=JHtml::link($link, $href_text);
echo $viewReport;
}
else
{
if ($this->config['show_matchreport_image']) {
$href_text = JHtml::image($this->config['matchpreview_image'], JText::_('COM_JOOMLEAGUE_TEAMPLAN_VIEW_MATCHPREVIEW'));
} else {
$href_text = JText::_('COM_JOOMLEAGUE_TEAMPLAN_VIEW_MATCHPREVIEW');
}
$link=JoomleagueHelperRoute::getNextMatchRoute($this->project->slug,$match->id);
$viewPreview=JHtml::link($link, $href_text);
echo $viewPreview;
}
}
?></td>
<?php
}
?>

<?php
if ($this->config['show_attendance_column'])
{
?>
<td class="center"><?php if ($match->crowd == 0){$match->crowd='';} echo $match->crowd; ?></td>
<?php
}
?>

<?php
if (($this->config['show_comments_count'] == 1 || $this->config['show_comments_count'] == 2) && class_exists('JCommentsModel'))
{
?>
<td class="center"><?php


if ($separate_comments) {
// Comments integration trigger when separate_comments in plugin is set to yes/1
if (isset($match->team1_result))
{
$joomleage_comments_object_group = 'com_joomleague_matchreport';
}
else {
$joomleage_comments_object_group = 'com_joomleague_nextmatch';
}
}
else {
// Comments integration trigger when separate_comments in plugin is set to no/0
$joomleage_comments_object_group = 'com_joomleague';
}

$options = array();
$options['object_id'] = (int) $match->id;
$options['object_group'] = $joomleage_comments_object_group;
$options['published'] = 1;

$count = JCommentsModel::getCommentsCount($options);

if ($count == 1) {
$imgTitle = $count.' '.JText::_('COM_JOOMLEAGUE_TEAMPLAN_COMMENTS_COUNT_SINGULAR');
if ($this->config['show_comments_count'] == 1) {
$href_text = JHtml::image('media/com_joomleague/jl_images/discuss_active.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;
}
elseif ($count > 1) {
$imgTitle = $count.' '.JText::_('COM_JOOMLEAGUE_TEAMPLAN_COMMENTS_COUNT_PLURAL');
if ($this->config['show_comments_count'] == 1) {
$href_text = JHtml::image('media/com_joomleague/jl_images/discuss_active.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;
}
else {
$imgTitle = JText::_('COM_JOOMLEAGUE_TEAMPLAN_COMMENTS_COUNT_NOCOMMENT');
if ($this->config['show_comments_count'] == 1) {
$href_text = JHtml::image('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 echo ($k == 0)? '' : 'alt'; ?>">
<td colspan="<?php echo $nbcols; ?>">
<div id="info<?php echo $match->id; ?>" style="display: none;">
<table class="matchreport">
<tr>
<td><?php
echo $this->showEventsContainerInResults(
$match,
$this->projectevents,
$events,
$subs,
$this->config );
?></td>
</tr>
</table>
</div>
</td>
</tr>
<?php
}

$k = 1 - $k;
$counter++;
}
?>
</table>
<?php
}
else
{
?>
<h3><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_NO_MATCHES'); ?></h3>
<?php
}
?>
« Последнее редактирование: 02.11.2013, 14:08:57 от Геныч »
*

tranceRoller

  • Захожу иногда
  • 452
  • 37 / 0
Вместо этого:
Код
<?php
if ($this->config['show_date'])
{
?>
<td width="10%"><?php
if (!strstr($match->match_date,"0000-00-00"))
{
echo JHtml::date($match->match_date,
JText::_('COM_JOOMLEAGUE_GLOBAL_CALENDAR_DATE'),
$this->overallconfig['time_zone']);
}
else
{
echo "&nbsp;";
}
?>
</td>
<?php
}
?>

<?php
if ($this->config['show_time'])
{
?>
<td width="10%"><?php echo JoomleagueHelperHtml::showMatchTime( $match,
$this->config,
$this->overallconfig,
$this->project); ?></td>
<?php
}
?>
Ставим это:
Код
<?php
if ($this->config['show_date'])
{
?>
<td width="10%"><?php
if (!strstr($match->match_date,"0000-00-00" && JoomleagueHelperHtml::showMatchPlayground($match){))
{
echo JHtml::date($match->match_date,
JText::_('COM_JOOMLEAGUE_GLOBAL_CALENDAR_DATE'),
$this->overallconfig['time_zone']);
}
else
{
echo "&nbsp;";
}
?>
</td>
<?php }
}
?>

<?php
if ($this->config['show_time'])
{
?>
<td width="10%"><?php
if (JoomleagueHelperHtml::showMatchPlayground($match)){
echo JoomleagueHelperHtml::showMatchTime( $match,
$this->config,
$this->overallconfig,
$this->project);
} else {
echo "&nbsp;";
}?></td>
<?php
}
?>
« Последнее редактирование: 02.11.2013, 20:09:58 от tranceRoller »
*

Геныч

  • Захожу иногда
  • 287
  • 9 / 0
Спасибо, направление понял. Единственное, пока не разобрался с кодом. Выдает Parse error: syntax error, unexpected '{' in для строчки

Код
if (!strstr($match->match_date,"0000-00-00" && JoomleagueHelperHtml::showMatchPlayground($match){))
*

tranceRoller

  • Захожу иногда
  • 452
  • 37 / 0
Моя поспешность, извините.
Надо так:
Код
if (!strstr($match->match_date,"0000-00-00") && JoomleagueHelperHtml::showMatchPlayground($match))
*

Геныч

  • Захожу иногда
  • 287
  • 9 / 0
Широко все-таки в JL поле для деятельности :)

Выдается та же самая ошибка (Parse error: syntax error, unexpected '{' in), только ее место сместилось в самый конец файла, то есть в родном коде (указывает на самую первую фигурную скобку):

Код
}
else
{
?>
<h3><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_NO_MATCHES'); ?></h3>
<?php
}
?>
*

tranceRoller

  • Захожу иногда
  • 452
  • 37 / 0
Непонятно. Поделитесь файлом. Посмотрю.
*

Геныч

  • Захожу иногда
  • 287
  • 9 / 0
Спасибо. Вопрос решен, а итоговый вариант (код - ниже) просто летает :)

Код
<?php defined('_JEXEC') or die('Restricted access');

if ($this->config['show_comments_count'] == 1 || $this->config['show_comments_count'] == 2)
{
$plugin = JoomleagueHelper::getCommentsIntegrationPlugin();

$pluginParams = is_object($plugin)? new JParameter($plugin->params) : new JParameter('');
$separate_comments = $pluginParams->get( 'separate_comments', 0 );
}
?>
<a name="jl_top" id="jl_top"></a>
<?php
if (!empty($this->matches))
{
$teamid=JRequest::getInt('tid');
$nbcols = 0;
?>

<table class='fixtures'>
<thead>
<tr class="sectiontableheader">
<?php
if ($this->config['show_events'])
{
?>
<th>&nbsp;</th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_matchday'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_MATCHDAY'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_match_number'])
{
?>
<th><?php echo '&nbsp;'.JText::_('NUM').'&nbsp;'; ?></th>
<?php
$nbcols++;
}
?>

<?php
if (($this->project->project_type=='DIVISIONS_LEAGUE') && ($this->config['show_division']))
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_DIVISION'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if (($this->config['show_playground'] || $this->config['show_playground_alert']))
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_PLAYGROUND'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_date'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_EDIT_DATE'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_time'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_EDIT_TIME'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_time_present'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_TIME_PRESENT'); ?></th>
<?php
$nbcols++;
}

switch ($this->config['result_style'])
{
case 1 :

// Show home team marker
echo '<th class="right">';
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_HOME_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_AWAY_TEAM');
}
$nbcols++;
echo '</th>';

// Create space for logo home team
if ($this->config['show_logo_small'])
{
echo '<th class="right">&nbsp;</th>';
$nbcols++;
}

// Create room for the score to be displayed
echo '<th>'.JText::_('COM_JOOMLEAGUE_TEAMPLAN_RESULT').'</th>';
$nbcols++;

// Create space for logo guest team
if ($this->config['show_logo_small'])
{
echo '<th class="left">&nbsp;</th>';
$nbcols++;
}

// Show guest team marker
echo '<th class="left">';
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_AWAY_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_HOME_TEAM');
}
$nbcols++;
echo '</th>';
break;
default :
case 0 :

// Show home team marker
echo '<th class="right">';
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_HOME_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_AWAY_TEAM');
}
$nbcols++;
echo '</th>';

// Create space for logo home team
if ($this->config['show_logo_small'])
{
echo '<th class="right">&nbsp;</th>';
$nbcols++;
}

echo '<th>&nbsp;</th>';
$nbcols++;

// Create space for logo guest team
if ($this->config['show_logo_small'])
{
echo '<th class="left">&nbsp;</th>';
$nbcols++;
}

echo '<th class="left">';
// Show guest team marker
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_AWAY_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_HOME_TEAM');
}
$nbcols++;
echo '</th>';

echo '<th class="center">'.JText::_('COM_JOOMLEAGUE_TEAMPLAN_RESULT').'</th>';
$nbcols++;
break;
}
?>

<?php
if ($this->config['show_referee'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_REFEREE'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if (($this->config['show_thumbs_picture']) & ($teamid>0))
{
?>
<th>&nbsp;</th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_matchreport_column'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_MATCHREPORT_PAGE_TITLE'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if ($this->config['show_attendance_column'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_ATTENDANCE'); ?></th>
<?php
$nbcols++;
}
?>

<?php
if (($this->config['show_comments_count'] == 1 || $this->config['show_comments_count'] == 2) && class_exists('JCommentsModel'))
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_COMMENTS'); ?></th>
<?php
$nbcols++;
}
?>
</tr>
</thead>
<?php

$k = 0;
$counter = 1;
$round_date = '';

foreach($this->matches as $match)
{
$hometeam=$this->teams[$match->projectteam1_id];
$home_projectteam_id=$hometeam->projectteamid;

$guestteam=$this->teams[$match->projectteam2_id];
$guest_projectteam_id=$guestteam->projectteamid;

$class=($k==0)? $this->config['style_class1'] : $this->config['style_class2'];

if ($match->team1==$this->favteams)
{
$highlight="highlight";
}
else
{
$highlight=$class;
}

if (!empty($this->ptid))
{
$home=$hometeam->name;
if ($match->team1==$this->ptid)
{
$home=sprintf('%s',$hometeam->name);
}
}
else
{
$home=$hometeam->name;
if ($match->team2)
{
$home=sprintf('%s',$hometeam->name);
}
}

if (!empty($this->ptid))
{
$away=$guestteam->name;
if ($match->team2==$this->ptid)
{
$away=sprintf('%s',$guestteam->name);
}
}
else
{
$away=$guestteam->name;
if ($match->team2)
{
$away=sprintf('%s',$guestteam->name);
}
}

$homeclub=$hometeam->club_id;
$awayclub=$guestteam->club_id;

$favStyle = '';
if ($this->config['highlight_fav'] == 1 && !$teamid) {
$isFavTeam = in_array($hometeam->id,$this->favteams)? 1 : in_array($guestteam->id, $this->favteams);
if ( $isFavTeam && $this->project->fav_team_highlight_type == 1 )
{
if( trim( $this->project->fav_team_color )!= "" )
{
$color = trim($this->project->fav_team_color);
}
$format = "%s";
$favStyle = ' style="';
$favStyle .= ($this->project->fav_team_text_bold != '')? 'font-weight:bold;' : '';
$favStyle .= (trim($this->project->fav_team_text_color)!= '')? 'color:'.trim($this->project->fav_team_text_color).';' : '';
$favStyle .= ($color != '')? 'background-color:' . $color . ';' : '';
if ($favStyle != ' style="')
{
  $favStyle .= '"';
}
else {
  $favStyle = '';
}

}
}

?>
<tr class="<?php echo $highlight; ?>"<?php echo $favStyle; ?>>
                <?php
// start events
if ($this->config['show_events'])
{
?>
<td width='5' class='ko'>
<?php
  $events = $this->model->getMatchEvents($match->id);
  $subs = $this->model->getMatchSubstitutions($match->id);

if ($this->config['use_tabs_events']) {
    $hasEvents = (count($events) + count($subs) > 0 && $this->config['show_events']);
} else {
    //no subs are shown when not using tabs for displaying events so don't check for that
    $hasEvents = (count($events) > 0 && $this->config['show_events']);
}

if ($hasEvents)
{
$link = "javascript:void(0);";
$img = JHtml::image('media/com_joomleague/jl_images/events.png', 'events.png');
$params = array("title"   => JText::_('COM_JOOMLEAGUE_TEAMPLAN_EVENTS'),
"onclick" => 'switchMenu(\'info'.$match->id.'\');return false;');
echo JHtml::link($link,$img,$params);
}
?>
</td>
<?php
}
else
{
$hasEvents = false;
}
// end events
?>

<?php
if ($this->config['show_matchday'])
{
?>
<td width='5%'>
<?php
$link=JoomleagueHelperRoute::getResultsRoute($this->project->slug,$match->roundid);
echo JHtml::link($link,$match->roundcode);
?>
</td>
<?php
}
?>

<?php
if ($this->config['show_match_number'])
{
?>
    <td>
<?php if (empty($match->match_number)){$match->match_number='-';} echo $match->match_number; ?>
    </td>
<?php
}
if (($this->project->project_type=='DIVISIONS_LEAGUE') && ($this->config['show_division']))
{
?>
    <td>
<?php echo JoomleagueHelperHtml::showDivisonRemark($hometeam,$guestteam,$this->config); ?>
    </td>
<?php
}
if (($this->config['show_playground'] || $this->config['show_playground_alert']))
{
?>
    <td>
<?php JoomleagueHelperHtml::showMatchPlayground($match); ?>
    </td>
<?php
}
/*
echo JoomleagueModelTeamPlan::showPlayground( $hometeam,
$guestteam,
$match,
$this->config['show_playground_alert'],
$this->config['show_playground'],
$match->project_id);
*/
?>

<?php
if ($this->config['show_date'])
{
?>
<td width="10%"><?php
if (!strstr($match->match_date,"0000-00-00") && $match->playground_name)
{
echo JHtml::date($match->match_date,
JText::_('COM_JOOMLEAGUE_GLOBAL_CALENDAR_DATE'),
$this->overallconfig['time_zone']);
}
else
{
echo "&nbsp;";
}
?>
</td>
<?php
}
?>

<?php
if ($this->config['show_time'])
{
?>
<td width="10%"><?php
if ($match->playground_name)
{
echo JoomleagueHelperHtml::showMatchTime( $match,
$this->config,
$this->overallconfig,
$this->project);
}
else
{
echo "&nbsp;";
}
?></td>
<?php
}
?>

<?php
if ($this->config['show_time_present'])
{
?>
<td width='10%'><?php if (empty($match->time_present)){$match->time_present='-';} echo $match->time_present; ?></td>
<?php
}
?>

<?php
// Define some variables which will be used
$teamA = '';
$teamB = '';
$score = "";

// Check if the home and guest team should be switched arround
if ($this->config['switch_home_guest']) {
$class1 = 'left';
$class2 = 'right';
} else {
$class1 = 'right';
$class2 = 'left';
}
if ($this->config['show_teamplan_link']) {
$homelink=JoomleagueHelperRoute::getTeamPlanRoute($this->project->slug,$hometeam->team_slug);
$awaylink=JoomleagueHelperRoute::getTeamPlanRoute($this->project->slug,$guestteam->team_slug);
} else {
$homelink = null;
$awaylink = null;
}
$isFavTeam = in_array($hometeam->id,$this->favteams);
$home = JoomleagueHelper::formatTeamName($hometeam, "g".$match->id."t".$hometeam->id, $this->config, $isFavTeam, $homelink);

$teamA .= '<td class="'.$class1.'">'.$home.'</td>';

// Check if the user wants to show the club logo or country flag
switch ($this->config['show_logo_small'])
{
case 1 :
{
$teamA .= '<td class="'.$class1.'">';
$teamA .= ' '.JoomleagueModelProject::getClubIconHtml($hometeam,1);
$teamA .= '</td>';

$teamB .= '<td class="'.$class2.'">';
$teamB .= JoomleagueModelProject::getClubIconHtml($guestteam,1).' ';
$teamB .= '</td>';
}
break;

case 2 :
{
$teamA .= '<td class="'.$class1.'">';
$teamA .= Countries::getCountryFlag($hometeam->country);
$teamA .= '</td>';

$teamB .= '<td class="'.$class2.'">';
$teamB .= Countries::getCountryFlag($guestteam->country);
$teamB .= '</td>';
}
break;

case 3:
{
$teamA .= '<td class="'.$class1.'">';
$teamA .= JoomleagueHelper::getPictureThumb($hometeam->picture,
$hometeam->name,
$this->config['team_picture_width'],
$this->config['team_picture_height'],1);

$teamA .= '</td>';

$teamB .= '<td class="'.$class2.'">';
$teamB .= JoomleagueHelper::getPictureThumb($guestteam->picture,
$guestteam->name,
$this->config['team_picture_width'],
$this->config['team_picture_height'],1);
$teamB .= '</td>';
}
break;
}

$seperator ='<td width="10">'.$this->config['seperator'].'</td>';

$isFavTeam = in_array($guestteam->id, $this->favteams);
$away = JoomleagueHelper::formatTeamName($guestteam,"g".$match->id."t".$guestteam->id,$this->config, $isFavTeam, $awaylink);

$teamB .= '<td class="'.$class2.'">'.$away.'</td>';

if (!$match->cancel)
{

            // In case show_part_results is true, then first check if the part results are available;
            // 'No part results available' occurs when teamX_result_split ONLY consists of zero or more ";"
            // (zero for projects with a single playing period, one or more for projects with two or more playing periods)
            $team1_result_split_present = preg_match('/^;*$/', $match->team1_result_split) == 0;
            $team2_result_split_present = preg_match('/^;*$/', $match->team2_result_split) == 0;

            if ($this->config['switch_home_guest'])
                {
if (isset($match->team1_result) && isset($match->team2_result)) {
      $result='<strong>'.$match->team2_result.'&nbsp;'.$this->config['seperator'].'&nbsp;'.$match->team1_result.'</strong>';
                    } else {
      $result='_&nbsp;'.$this->config['seperator'].'&nbsp;_';
                    }

                    $part_results_left = explode(";", $match->team2_result_split);
                    $part_results_right = explode(";", $match->team1_result_split);

                    $leftResultOT = $match->team2_result_ot;
                    $rightResultOT = $match->team1_result_ot;
                    $leftResultSO = $match->team2_result_so;
                    $rightResultSO = $match->team1_result_so;
                    $leftResultDEC = $match->team2_result_decision;
                    $rightResultDEC = $match->team1_result_decision;
                }
                else
                {
if (isset($match->team1_result) && isset($match->team2_result)) {
      $result='<strong>'.$match->team1_result.'&nbsp;'.$this->config['seperator'].'&nbsp;'.$match->team2_result.'</strong>';
                    } else {
      $result='_&nbsp;'.$this->config['seperator'].'&nbsp;_';
                    }

                    $part_results_left = explode(";", $match->team1_result_split);
                    $part_results_right = explode(";", $match->team2_result_split);

                    $rightResultOT = $match->team2_result_ot;
                    $leftResultOT = $match->team1_result_ot;
                    $rightResultSO = $match->team2_result_so;
                    $leftResultSO = $match->team1_result_so;
                    $rightResultDEC = $match->team2_result_decision;
                    $leftResultDEC = $match->team1_result_decision;
                }

            $SOTresult = '';
            $SOTtolltip = '';

            switch ($match->match_result_type)
            {
                case 2 :
                    {
                        if ($this->config['result_style']==1){
                            $result .= '<br />';
                        } else {
                            $result .= ' ';
                        }
                        $result .= '('.JText::_('COM_JOOMLEAGUE_RESULTS_SHOOTOUT');
                        $result .= ')';

                        if (isset($leftResultOT))
                            {
                                        $OTresultS = $leftResultOT . '&nbsp;' . $this->config['seperator'] . '&nbsp;' . $rightResultOT;
                                        $SOTresult .= '<br /><span class="hasTip" title="' . JText::_('COM_JOOMLEAGUE_RESULTS_OVERTIME2').'::' . $OTresultS . '" >' . $OTresultS . '</span>';
                                        $SOTtolltip = ' | ' . $OTresultS;
                            }
                        if (isset($leftResultSO))
                            {
                                        $SOresultS = $leftResultSO . '&nbsp;' . $this->config['seperator'] . '&nbsp;' . $rightResultSO;
                                        $SOTresult .= '<br /><span class="hasTip" title="' . JText::_('COM_JOOMLEAGUE_RESULTS_SHOOTOUT2').'::' . $SOresultS . '" >' . $SOresultS . '</span>';
                                        $SOTtolltip = ' | ' . $SOresultS;
                            }
                    }
                    break;

                case 1 :
                    {
                        if ($this->config['result_style']==1){
                            $result .= '<br />';
                        }else{
                            $result .= ' ';
                        }

                        $result .= '('.JText::_('COM_JOOMLEAGUE_RESULTS_OVERTIME');
                        $result .= ')';

                        if (isset($leftResultOT))
                            {
                                        $OTresultS = $leftResultOT . '&nbsp;' . $this->config['seperator'] . '&nbsp;' . $rightResultOT;
                                        $SOTresult .= '<br /><span class="hasTip" title="' . JText::_('COM_JOOMLEAGUE_RESULTS_OVERTIME2').'::' . $OTresultS . '" >' . $OTresultS . '</span>';
                                        $SOTtolltip = ' | ' . $OTresultS ;
                            }
                    }
                    break;
            }

            //Link
            if (isset($match->team1_result))
                {
                    $link=JoomleagueHelperRoute::getMatchReportRoute($this->project->slug,$match->id);
            } else {
                    $link=JoomleagueHelperRoute::getNextMatchRoute($this->project->slug,$match->id);
                }

            $ResultsTooltipTitle = $result;

            if ($this->config['results_linkable']==1) {
$result = JHtml::link($link,$result);
    }

            $ResultsTooltipTp = '( ';
            $PartResult = '';

            if ($team1_result_split_present && $team2_result_split_present)
            {
            //Part results
            if (!is_array($part_results_left))  { $part_results_left = array($part_results_left); }
            if (!is_array($part_results_right)) { $part_results_right = array($part_results_right); }

            for ($i = 0; $i < count($part_results_left); $i++)
            {
                if (isset($part_results_left[$i]))
                    {
                                $resultS = $part_results_left[$i] . '&nbsp;' . $this->config['seperator'] . '&nbsp;' . $part_results_right[$i];
                                $whichPeriod = $i + 1;
                                $PartResult .= '<br /><span class="hasTip" title="' . JText::sprintf( 'COM_JOOMLEAGUE_NPART',  "$whichPeriod")  .'::' . $resultS . '" >' . $resultS . '</span>';
                                if ($i != 0) {
                                $ResultsTooltipTp .= ' | ' . $resultS;
                                } else {
                                $ResultsTooltipTp .= $resultS;
                                }
                    }
            }
            }

            $ResultsTooltipTp .= $SOTtolltip . ' )';

            if ($team1_result_split_present && $team2_result_split_present)
            {
                if ($this->config['show_part_results'])
                    {
                        $result .= $PartResult . $SOTresult;
                    }
                else
                    {
                        //No need to show a tooltip if the parts are shown anyways
                        $result = '<span class="hasTip" title="' .$ResultsTooltipTitle . '::' . $ResultsTooltipTp . '" >' . $result . '</span>';
                    }
            }

            if ($match->alt_decision)
            {
                $result='<b style="color:red;">';
                $result .= $leftResultDEC.'&nbsp;'.$this->config['seperator'].'&nbsp;'.$rightResultDEC;
                $result .= '</b>';

            }

$score = "<td align='center'>".$result.'</td>';
}
else
{
$score='<td>'.JText::_($match->cancel_reason).'</td>';
}

switch ($this->config['result_style'])
{
case 1 :
{
if ($this->config['switch_home_guest'])
{
echo $teamB.$score.$teamA;
}
else
{
echo $teamA.$score.$teamB;
}
}
break;

default;
case 0 :
{
if ($this->config['switch_home_guest'])
{
echo $teamB.$seperator.$teamA.$score;
}
else
{
echo $teamA.$seperator.$teamB.$score;
}
}
break;
}
?>

<?php
if ($this->config['show_referee'])
{
?>
<td><?php
if ((isset($match->referees)) && (count($match->referees)>0))
{
if ($this->project->teams_as_referees)
{
$output='';
$toolTipTitle=JText::_('COM_JOOMLEAGUE_TEAMPLAN_REF_TOOLTIP');
$toolTipText='';

for ($i=0; $i<count($match->referees); $i++)
{
if ($match->referees[$i]->referee_name != '')
{
$output .= $match->referees[$i]->referee_name;
$toolTipText .= $match->referees[$i]->referee_name.'&lt;br /&gt;';
}
else
{
$output .= '-';
$toolTipText .= '-&lt;br /&gt;';
}
}
if ($this->config['show_referee']==1)
{
echo $output;
}
elseif ($this->config['show_referee']==2)
{
?>
<span class='hasTip' title='<?php echo $toolTipTitle; ?> :: <?php echo $toolTipText; ?>'>
<img src='<?php echo JUri::root(); ?>media/com_joomleague/jl_images/icon-16-Referees.png' alt='' title='' /> </span>
<?php
}
}
else
{
$output='';
$toolTipTitle=JText::_('COM_JOOMLEAGUE_TEAMPLAN_REF_TOOLTIP');
$toolTipText='';

for ($i=0; $i<count($match->referees); $i++)
{
if ($match->referees[$i]->referee_lastname != '' && $match->referees[$i]->referee_firstname)
{
$output .= '<span class="hasTip" title="'.JText::_('COM_JOOMLEAGUE_TEAMPLAN_REF_FUNCTION').'::'.$match->referees[$i]->referee_position_name.'">';
$ref=$match->referees[$i]->referee_lastname. ','.$match->referees[$i]->referee_firstname;
$toolTipText .= $ref.' ('.$match->referees[$i]->referee_position_name.')'.'&lt;br /&gt;';
if ($this->config['show_referee_link'])
{
$link=JoomleagueHelperRoute::getRefereeRoute($this->project->slug,$match->referees[$i]->referee_id,3);
$ref=JHtml::link($link,$ref);
}
$output .= $ref;
$output .= '</span>';

if (($i + 1) < count($match->referees))
{
$output .= ' - ';
}
}
else
{
$output .= '-';
}
}

if ($this->config['show_referee']==1)
{
echo $output;
}
elseif ($this->config['show_referee']==2)
{
?> <span class='hasTip'
title='<?php echo $toolTipTitle; ?> :: <?php echo $toolTipText; ?>'>
<img
src='<?php echo JUri::root(); ?>media/com_joomleague/jl_images/icon-16-Referees.png'
alt='' title='' /> </span> <?php
}
}
}
else
{
echo '-';
}
?></td>
<?php
}
?>

<?php if (($this->config['show_thumbs_picture']) & ($teamid>0)): ?>
<td><?php echo JoomleagueHelperHtml::getThumbUpDownImg($match, $this->ptid); ?></td>
<?php endif; ?>

<?php
if ($this->config['show_matchreport_column'])
{
?>
<td><?php
if (!$match->cancel) {
if (isset($match->team1_result))
{
if ($this->config['show_matchreport_image']) {
$href_text = JHtml::image($this->config['matchreport_image'], JText::_('COM_JOOMLEAGUE_TEAMPLAN_VIEW_MATCHREPORT'));
} else {
$href_text = JText::_('COM_JOOMLEAGUE_TEAMPLAN_VIEW_MATCHREPORT');
}

$link=JoomleagueHelperRoute::getMatchReportRoute($this->project->slug,$match->id);
$viewReport=JHtml::link($link, $href_text);
echo $viewReport;
}
else
{
if ($this->config['show_matchreport_image']) {
$href_text = JHtml::image($this->config['matchpreview_image'], JText::_('COM_JOOMLEAGUE_TEAMPLAN_VIEW_MATCHPREVIEW'));
} else {
$href_text = JText::_('COM_JOOMLEAGUE_TEAMPLAN_VIEW_MATCHPREVIEW');
}
$link=JoomleagueHelperRoute::getNextMatchRoute($this->project->slug,$match->id);
$viewPreview=JHtml::link($link, $href_text);
echo $viewPreview;
}
}
?></td>
<?php
}
?>

<?php
if ($this->config['show_attendance_column'])
{
?>
<td class="center"><?php if ($match->crowd == 0){$match->crowd='';} echo $match->crowd; ?></td>
<?php
}
?>

<?php
if (($this->config['show_comments_count'] == 1 || $this->config['show_comments_count'] == 2) && class_exists('JCommentsModel'))
{
?>
<td class="center"><?php


if ($separate_comments) {
// Comments integration trigger when separate_comments in plugin is set to yes/1
if (isset($match->team1_result))
{
$joomleage_comments_object_group = 'com_joomleague_matchreport';
}
else {
$joomleage_comments_object_group = 'com_joomleague_nextmatch';
}
}
else {
// Comments integration trigger when separate_comments in plugin is set to no/0
$joomleage_comments_object_group = 'com_joomleague';
}

$options = array();
$options['object_id'] = (int) $match->id;
$options['object_group'] = $joomleage_comments_object_group;
$options['published'] = 1;

$count = JCommentsModel::getCommentsCount($options);

if ($count == 1) {
$imgTitle = $count.' '.JText::_('COM_JOOMLEAGUE_TEAMPLAN_COMMENTS_COUNT_SINGULAR');
if ($this->config['show_comments_count'] == 1) {
$href_text = JHtml::image('media/com_joomleague/jl_images/discuss_active.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;
}
elseif ($count > 1) {
$imgTitle = $count.' '.JText::_('COM_JOOMLEAGUE_TEAMPLAN_COMMENTS_COUNT_PLURAL');
if ($this->config['show_comments_count'] == 1) {
$href_text = JHtml::image('media/com_joomleague/jl_images/discuss_active.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;
}
else {
$imgTitle = JText::_('COM_JOOMLEAGUE_TEAMPLAN_COMMENTS_COUNT_NOCOMMENT');
if ($this->config['show_comments_count'] == 1) {
$href_text = JHtml::image('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 echo ($k == 0)? '' : 'alt'; ?>">
<td colspan="<?php echo $nbcols; ?>">
<div id="info<?php echo $match->id; ?>" style="display: none;">
<table class="matchreport">
<tr>
<td><?php
echo $this->showEventsContainerInResults(
$match,
$this->projectevents,
$events,
$subs,
$this->config );
?></td>
</tr>
</table>
</div>
</td>
</tr>
<?php
}

$k = 1 - $k;
$counter++;
}
?>
</table>
<?php
}
else
{
?>
<h3><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_NO_MATCHES'); ?></h3>
<?php
}
?>
*

Геныч

  • Захожу иногда
  • 287
  • 9 / 0
Все работает как часы. Но небольшая проблема в том, что в графе "Тур" (matchday) отображается именно номер тура - так, как он записан в базе (1, 2, 3, 4, 5...). В круговом турнире это не особенно важно. А когда начались игры плей-офф, о странно видеть, как вместо "1/16" отображается, скажем "6". То есть, надо, чтобы вместо номера тура отображалось его название. В админке такого выбора нет.

В общем случае решение понятно: надо в нижеприведенном коде поменять COM_JOOMLEAGUE_TEAMPLAN_MATCHDAY на нужную переменную. Только какая нужная?

Код
<?php
if ($this->config['show_matchday'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_MATCHDAY'); ?></th>
*

papa_aa

  • Осваиваюсь на форуме
  • 33
  • 0 / 0
Все работает как часы. Но небольшая проблема в том, что в графе "Тур" (matchday) отображается именно номер тура - так, как он записан в базе (1, 2, 3, 4, 5...). В круговом турнире это не особенно важно. А когда начались игры плей-офф, о странно видеть, как вместо "1/16" отображается, скажем "6". То есть, надо, чтобы вместо номера тура отображалось его название. В админке такого выбора нет.

В общем случае решение понятно: надо в нижеприведенном коде поменять COM_JOOMLEAGUE_TEAMPLAN_MATCHDAY на нужную переменную. Только какая нужная?

Код
<?php
if ($this->config['show_matchday'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_MATCHDAY'); ?></th>
Спасибо Вам Геныч за правильные вопросы, а то блин у меня пока руки ни как не дойдут их то же озвучить. Надеюсь тут помогут люди в решение такой ситуации, а то слишком часто такая проблема встречаться.
*

Геныч

  • Захожу иногда
  • 287
  • 9 / 0
Честно говоря, чем больше окунаешься в JL 2.0, тем больше возникает вопросов. Поневоле задумаешься - может не стоит так тщательно пились сейчас, а подождать рабочей версии? Глядишь, к новому году осчастливят :)
Хотя, по большому счету, само ядро JL более менее работает (тестовый сайт худо-бедно функционирует) уже неделю. Гораздо больше вопросов вызывают модули, особенно матчи/результаты. Казалось, что проще - нужно отобразить пять последних (самых последних) матча, сыгранных к настоящему времени. Так ведь вывести подобное не получается :)
*

papa_aa

  • Осваиваюсь на форуме
  • 33
  • 0 / 0
Но небольшая проблема в том, что в графе "Тур" (matchday) отображается именно номер тура - так, как он записан в базе (1, 2, 3, 4, 5...). В круговом турнире это не особенно важно. А когда начались игры плей-офф, о странно видеть, как вместо "1/16" отображается, скажем "6". То есть, надо, чтобы вместо номера тура отображалось его название. В админке такого выбора нет.

В общем случае решение понятно: надо в нижеприведенном коде поменять COM_JOOMLEAGUE_TEAMPLAN_MATCHDAY на нужную переменную. Только какая нужная?

Код
<?php
if ($this->config['show_matchday'])
{
?>
<th><?php echo JText::_('COM_JOOMLEAGUE_TEAMPLAN_MATCHDAY'); ?></th>
Скажите пожалуйста удалось решить эту задачу? а то же очень нужно отображение "1/16" отображается, скажем "6"
*

Геныч

  • Захожу иногда
  • 287
  • 9 / 0
Нет, пока решить не удалось. Пока приходится "просто" скрывать туры - то есть, не отображать их совсем.
*

Роман

  • Осваиваюсь на форуме
  • 20
  • 0 / 0
Здравствуйте! очень нужна ваша помощь! У меня Joomla 2.5 установил себе joomleague 2.0 (вроде) всё добавил, но не могу привязать игрока к команде, игрок создаётся, а к команде привязываться не хочет, такая ошибка Игрок (персона) сохранён - Ошибка добавления в команду определённого турнира Ребята, одна надежда на вас, я уже всё облазил...  Мой сайт fifacup.pro Ребята, может быть не в тему, но очень нужна помощь... Могу оплатить помощь
*

Геныч

  • Захожу иногда
  • 287
  • 9 / 0
То есть, игроки есть в базе, опубликованы?
Можно посмотреть на скрин с ошибкой?
*

Роман

  • Осваиваюсь на форуме
  • 20
  • 0 / 0
То есть, игроки есть в базе, опубликованы?
Можно посмотреть на скрин с ошибкой?

да сейчас вышлю
*

Геныч

  • Захожу иногда
  • 287
  • 9 / 0
Судя по всему, здесь ошибка в ID Проекта-Команды. А может, и баг программы. Но зачем таким способом? Есть же более простой вариант:

Проект / команды. И в списке команд добавляем "оптом": первая иконка (красная) с людьми - это игроки, вторая (зеленая) - руководство/тренеры.

« Последнее редактирование: 11.12.2013, 13:52:01 от Геныч »
*

Роман

  • Осваиваюсь на форуме
  • 20
  • 0 / 0
Судя по всему, здесь ошибка в ID Проекта-Команды. А может, и баг программы. Но зачем таким способом? Есть же более простой вариант:

Проект / команды. И в списке команд добавляем "оптом": первая иконка (красная) с людьми - это игроки, вторая (зеленая) - руководство/тренеры.



у меня вообще нет такого...
*

Роман

  • Осваиваюсь на форуме
  • 20
  • 0 / 0
Судя по всему, здесь ошибка в ID Проекта-Команды. А может, и баг программы. Но зачем таким способом? Есть же более простой вариант:

Проект / команды. И в списке команд добавляем "оптом": первая иконка (красная) с людьми - это игроки, вторая (зеленая) - руководство/тренеры.




сорри, нашел
*

Роман

  • Осваиваюсь на форуме
  • 20
  • 0 / 0
Судя по всему, здесь ошибка в ID Проекта-Команды. А может, и баг программы. Но зачем таким способом? Есть же более простой вариант:

Проект / команды. И в списке команд добавляем "оптом": первая иконка (красная) с людьми - это игроки, вторая (зеленая) - руководство/тренеры.


Геныч, Вы вообще шарите в этом компоненте?? Хорошо?? Мне нужна помощь, подсказки... конечно не за бесплатно... Если желаете переговаривать, мой скайп roman100058
*

Роман

  • Осваиваюсь на форуме
  • 20
  • 0 / 0
Судя по всему, здесь ошибка в ID Проекта-Команды. А может, и баг программы. Но зачем таким способом? Есть же более простой вариант:

Проект / команды. И в списке команд добавляем "оптом": первая иконка (красная) с людьми - это игроки, вторая (зеленая) - руководство/тренеры.



я вас добавил в скайп, а вы на связь не выходите...
*

Геныч

  • Захожу иногда
  • 287
  • 9 / 0
*

Роман

  • Осваиваюсь на форуме
  • 20
  • 0 / 0
Ответил в личку.
не открываются сообщения в личке... не могу их прочитать
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Некорректное отображение кол-ва событий - модуль eventsranking

Автор RootZ

Ответов: 8
Просмотров: 4484
Последний ответ 02.11.2019, 08:48:57
от вуглускр
Отображение лидеров в модулях eventsranking и statranking

Автор DragonbyKuzya

Ответов: 0
Просмотров: 1849
Последний ответ 20.05.2019, 11:42:41
от DragonbyKuzya
Отображение сыгранных минут в ростере

Автор Геныч

Ответов: 6
Просмотров: 2385
Последний ответ 22.02.2019, 10:07:50
от вуглускр
Проблема с результатами матчей в teamplan

Автор apugachev86

Ответов: 0
Просмотров: 1551
Последний ответ 09.10.2015, 13:27:50
от apugachev86
Запретить отображение конкретного дивизиона?

Автор Геныч

Ответов: 2
Просмотров: 1833
Последний ответ 15.05.2015, 12:30:57
от Геныч