Решение для Joomla 1.5 такое же, как для 0.93 (заимствовано выше)
1. В базе данных находим таблицу jos_joomleague_match, меняем типы полей team1_result и team2_result с значения float на значение varchar(2)
2. Открываем файл
/components/com_joomleague/helpers/ranking.php
, находим в нем функцию
и заменяем следующим кодом
function _collect($ptids = null)
{
$mode = $this->_mode;
$from = $this->_from;
$to = $this->_to;
$division = $this->_division;
$project = $this->_project->getProject();
$data = $this->_initData();
foreach ((array)$data->_matches as $match)
{
if ( !isset( $data->_teams[$match->projectteam1_id]) || $data->_teams[$match->projectteam1_id]->_is_in_score === 0
|| !isset( $data->_teams[$match->projectteam2_id]) || $data->_teams[$match->projectteam2_id]->_is_in_score === 0 )
{
continue;
}
if (!$this->_countGame($match, $from, $to, $ptids)) {
continue;
}
if($match->projectteam1_id==0 || $match->projectteam2_id==0) {
continue;
}
$homeId = $match->projectteam1_id;
$awayId = $match->projectteam2_id;
if ($mode == 0 || $mode == 1)
{
$home = &$data->_teams[$homeId];
}
else
{
$home = new JLGRankingTeam(0); //in that case, $data wont be affected
}
if ($mode == 0 || $mode == 2)
{
$away = &$data->_teams[$awayId];
}
else
{
$away = new JLGRankingTeam(0); //in that case, $data wont be affected
}
$shownegpoints = 1;
$decision = $match->decision;
if ($decision == 0)
{
$home_score=$match->home_score;
$away_score=$match->away_score;
$leg1=$match->l1;
$leg2=$match->l2;
}
else
{
$home_score=$match->home_score_decision;
$away_score=$match->away_score_decision;
$leg1=0;
$leg2=0;
}
$home->cnt_matches++;
$away->cnt_matches++;
$resultType = ($project->allow_add_time)? $match->match_result_type : 0;
$arr[0] = 0;
$arr[1] = 0;
$arr[2] = 0;
switch($resultType)
{
case 1: $arr = explode(",",$project->points_after_add_time);break;
case 2: $arr = explode(",",$project->points_after_penalty);break;
default: $arr = explode(",",$project->points_after_regular_time);break;
}
$win_points = (isset($arr[0]))? $arr[0] : 0;
$draw_points = (isset($arr[1]))? $arr[1] : 0;
$loss_points = (isset($arr[2]))? $arr[2] : 0;
if ($decision!=1 || ( $decision==1 && (isset($home_score) || isset($away_score))))
{
if ($decision!=1) {
if ( $home_score == "+" or $home_score == "-" or $away_score == "+" or $away_score == "-")
{
if ( $home_score == "+" and $away_score == "-" )
{
$home->cnt_won++;
$home->cnt_won_home++;
$home->sum_points += $win_points; //home_score can't be null...
$away->cnt_lost++;
$away->sum_points += ( $decision == 0 || isset($away_score)? $loss_points : 0);
if ( $shownegpoints==1)
{
$home->neg_points += $loss_points;
$away->neg_points += ( $decision == 0 || isset($away_score)? $win_points : 0);
}
}
else if ( $home_score == "-" and $away_score == "-" )
{
$home->cnt_lost++;
$home->cnt_lost_home++;
$home->sum_points += ( $decision == 0 || isset($home_score)? $loss_points : 0);
$away->cnt_lost++;
$away->sum_points += ( $decision == 0 || isset($away_score)? $loss_points : 0);
if ($shownegpoints==1)
{
$home->neg_points += $loss_points;
$away->neg_points += $loss_points;
}
}
else if ( $home_score == "-" and $away_score == "+")
{
$home->cnt_lost++;
$home->cnt_lost_home++;
$home->sum_points += ( $decision == 0 || isset($home_score)? $loss_points : 0);
$away->cnt_won++;
$away->sum_points += $win_points;
if ( $shownegpoints==1)
{
$home->neg_points += ( $decision == 0 || isset($home_score)? $win_points : 0);
$away->neg_points += $loss_points;
}
}
}
else if( $home_score > $away_score )
{
$home->cnt_won++;
$home->cnt_won_home++;
$home->sum_points += $win_points; //home_score can't be null...
$away->cnt_lost++;
$away->sum_points += ( $decision == 0 || isset($away_score)? $loss_points : 0);
if ( $shownegpoints == 1 )
{
$home->neg_points += $loss_points;
$away->neg_points += ( $decision == 0 || isset($away_score)? $win_points : 0);
}
}
else if ( $home_score == $away_score )
{
$home->cnt_draw++;
$home->cnt_draw_home++;
$home->sum_points += ( $decision == 0 || isset($home_score)? $draw_points : 0);
$away->cnt_draw++;
$away->sum_points += ( $decision == 0 || isset($away_score)? $draw_points : 0);
if ($shownegpoints==1)
{
$home->neg_points += ( $decision == 0 || isset($home_score)? ($win_points-$draw_points): 0); // bug fixed, timoline 250709
$away->neg_points += ( $decision == 0 || isset($away_score)? ($win_points-$draw_points) : 0);// ex. for soccer, your loss = 2 points not 1 point
}
}
else if ( $home_score < $away_score )
{
$home->cnt_lost++;
$home->cnt_lost_home++;
$home->sum_points += ( $decision == 0 || isset($home_score)? $loss_points : 0);
$away->cnt_won++;
$away->sum_points += $win_points;
if ( $shownegpoints==1)
{
$home->neg_points += ( $decision == 0 || isset($home_score)? $win_points : 0);
$away->neg_points += $loss_points;
}
}
}
/* bonus points */
$home->sum_points += $match->home_bonus;
$home->bonus_points += $match->home_bonus;
$away->sum_points += $match->away_bonus;
$away->bonus_points += $match->away_bonus;
/* goals for/against/diff */
$home->sum_team1_result += $home_score;
$home->sum_team2_result += $away_score;
$home->diff_team_results = $home->sum_team1_result - $home->sum_team2_result;
$home->sum_team1_legs += $leg1;
$home->sum_team2_legs += $leg2;
$home->diff_team_legs = $home->sum_team1_legs - $home->sum_team2_legs;
$away->sum_team1_result += $away_score;
$away->sum_team2_result += $home_score;
$away->diff_team_results = $away->sum_team1_result - $away->sum_team2_result;
$away->sum_team1_legs += $leg2;
$away->sum_team2_legs += $leg1;
$away->diff_team_legs = $away->sum_team1_legs - $away->sum_team2_legs;
$away->sum_away_for += $away_score;
}
else
{ //none of the 2 teams gets any points
if ($shownegpoints==1)
{
$home->neg_points += $loss_points;
$away->neg_points += $loss_points;
}
//old behaviour
if($match->team_won==0) {
$home->cnt_lost++;
$away->cnt_lost++;
//record a won on the home team
} else if($match->team_won==1) {
$home->cnt_won++;
$away->cnt_lost++;
//record a won on the away team
} else if($match->team_won==2) {
$home->cnt_lost++;
$away->cnt_won++;
//record a loss on both teams
} else if($match->team_won==3) {
$home->cnt_lost++;
$away->cnt_lost++;
//record a won on both teams
} else if($match->team_won==4) {
$home->cnt_won++;
$away->cnt_won++;
}
}
}
return $data->_teams;
}
Результат тот же что и в 0.93
- +/- Техническая победа/Техническийпроигрыш;
- -/+ Технический проигрыш/Техническая победа;
- -/- Технический проигрыш/Технический проигрыш;
Работоспособность способа проверялась на рабочем сайте