Radio Streaming - 50% Lifetime Discount with purchase of any Joomla Web Radio Addon. Discount Code: STR15-Z
See Radio Streaming Plans

Results 1 to 3 of 3

Thread: Championship predictions

  1. #1

    Championship predictions

    Hi,

    created the the groups for the championship and created the predictions. 2 players have put in their predictions and they are already showing some points without scores being inserted, why ?
    regards

  2. #2
    Administrator
    Join Date
    Jul 2015
    Posts
    65
    Hello,

    There was an issue when the player predicted a draw , in the application logic the match is draw even before it starts, you can change the code to handle this exception with the following code

    file : <joomla installation>/components/com_masterleaguepro/views/playerprediction/tmpl/default.php

    around line 285

    FROM :
    Code:
    <td><?php
    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";
    }
    ?></td>
    TO:
    Code:
    <td><?php
    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";
    }
    ?></td>

    the fix will be included in the next update

  3. #3
    Many thanks for the reply.

    I have changed the code and now all showing 0 points as it should.

    regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •