Hello,
the championship point reward system is not configurable from the administration panel in the current version. Currently it is set to (group phase, 5 for win, 3 for draw, -1 for lose, and for KO, 5 for win , 3 for draw and 0 for lose)
you can change this in file
<joomla directory>/admin/components/com_masterleaguepro/models/minileaguescore.php
around line 132
Code:
" SELECT mu.group_id,md.id as matchday,u.username,t.user_id,((t.correct_score*2)+(t.correct_result*3)+(t.incorrect_result*-1)) as points,(t.correct_result+t.incorrect_result) as matches,t.correct_score as win,t.correct_result-t.correct_score as draw,t.incorrect_result as lose,((t.correct_score*10+t.correct_result)/(t.correct_result+t.incorrect_result)) as rating, ".
for example if you want to have a reward system 10 win , 5draw , 0 lose your code will look like this
Code:
" SELECT mu.group_id,md.id as matchday,u.username,t.user_id,((t.correct_score*5)+(t.correct_result*5)+(t.incorrect_result*0)) as points,(t.correct_result+t.incorrect_result) as matches,t.correct_score as win,t.correct_result-t.correct_score as draw,t.incorrect_result as lose,((t.correct_score*10+t.correct_result)/(t.correct_result+t.incorrect_result)) as rating, ".
the value next to the t.correct_score is the extra points you get if you predict the exact score (users that predict the exact score they predict the result too so they will get points from the t.correct_result too)
the value next to the t.correct_result is the extra points you get if you predict the result
the value next to the t.incorrect_result is the points you get if your prediction was not correct
around line 183 is the code for the KO phase
Code:
" ((z.correct_score*3)+(z.correct_result*2)+(z.incorrect_result*0)) as points, ".
the same logic is applied here
if the rewards are not 5-3-0 (win,lose,draw) then you will have to change the code in the file
<joomla directory>/components/com_masterleaguepro/views/playerprediction/tmpl/default.php
around line 286
Code:
if($item->start_date<=date("Y-m-d H:i:s")){
if(isset($item->home_score)&&isset($item->away_score)&&$item->home_score!=""&&$item->away_score!=""){
if($item->home_score==$item->home_prediction&&$item->away_score==$item->away_prediction){
echo "5";
$totalPoints=$totalPoints+5;
}else if(
($item->home_score>$item->away_score&&$item->home_prediction>$item->away_prediction) ||
($item->home_score<$item->away_score&&$item->home_prediction<$item->away_prediction) ||
($item->home_score==$item->away_score&&$item->home_prediction==$item->away_prediction)
){
echo "3";
$totalPoints=$totalPoints+3;
}else{
echo "0";
}
}else{
echo "0";
}
}else{
echo "0";
}
to replace values that begin with REPLACE_ text with your desired values
Code:
if($item->start_date<=date("Y-m-d H:i:s")){
if(isset($item->home_score)&&isset($item->away_score)&&$item->home_score!=""&&$item->away_score!=""){
if($item->home_score==$item->home_prediction&&$item->away_score==$item->away_prediction){
echo "REPLACE_WIN_POINTS";
$totalPoints=$totalPoints+REPLACE_WIN_POINTS;
}else if(
($item->home_score>$item->away_score&&$item->home_prediction>$item->away_prediction) ||
($item->home_score<$item->away_score&&$item->home_prediction<$item->away_prediction) ||
($item->home_score==$item->away_score&&$item->home_prediction==$item->away_prediction)
){
echo "REPLACE_DRAW_POINTS";
$totalPoints=$totalPoints+REPLACE_DRAW_POINTS;
}else{
echo "REPLACE_LOSE_POINTS";
}
}else{
echo "0";
}
}else{
echo "0";
}