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

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Time that the matches start or finish

  1. #1
    Junior Member
    Join Date
    Aug 2015
    Posts
    13

    Time that the matches start or finish

    Hi support,

    We just installed the Master-League Pro edition and we are trying to get accustomed to the software. We have two problems with the time that the match starts or finishes.

    In the frontend:

    For example, we created a match to begin at 12:35, but the users were allowed to post their predictions even after that time has passed (i.e. even after 12:35).

    In the backend:
    After the match ended we navigated to the "add score" section but we faced the notification "No ended matches found". So we had to navigate to the "Edit matches" and select the matches as finished. Even then, the "add score" section was displaying the notification "No ended matches found". Therefore, we posted the score through the "Edit matches" section as well.

    Can you check it please?

    Regards,

    Dan G

  2. #2
    Junior Member
    Join Date
    Aug 2015
    Posts
    13
    This is a kind reminder for the above.

  3. #3
    Administrator
    Join Date
    Jul 2015
    Posts
    65
    It seems that your server is running on different timezone, you can edit the timezone with PHP.ini file

    create a `php.ini` file in your root directory and add the following line

    date.timezone = "Europe/Berlin"

    but instead the "Europe/Berlin" you will have to add your timezone,
    you can find all the available timezones here

    http://php.net/manual/en/timezones.php

  4. #4
    Junior Member
    Join Date
    Aug 2015
    Posts
    13
    Dear Kostas,

    Thank you for the prompt response. We created a php.ini file and placed it in /public_html (using a Go Daddy host). Then we killed PHP processes from the CPanel but the problem is not solved. We even contacted Go Daddy support and they told us that we can change the timezone only through php coding. Please help.

    Regards,

    Dan G

  5. #5
    Administrator
    Join Date
    Jul 2015
    Posts
    65
    Ok one other way to change your timezone is through the .htaccess file , add the following line in your .htaccess file (if it not exists create it)

    SetEnv TZ Europe/Berlin

    if this way won't work too, you will have to add the code into the component files, that will look like this :

    Code:
    <?php
    date_default_timezone_set('Europe/Berlin');
    
    you can find all the available timezones here : http://php.net/manual/en/timezones.php

  6. #6
    Junior Member
    Join Date
    Aug 2015
    Posts
    13
    Dear Kostas,

    The change in the .htaccess did not work either.

    We then inserted the code into the masterleaguepro.php just right after the "<?php" and the problem was solved for the first point:
    "In the frontend:
    For example, we created a match to begin at 12:35, but the users were allowed to post their predictions even after that time has passed (i.e. even after 12:35). "

    The second point was not solved.
    "In the backend:
    After the match ended we navigated to the "add score" section but we faced the notification "No ended matches found". So we had to navigate to the "Edit matches" and select the matches as finished. Even then, the "add score" section was displaying the notification "No ended matches found". Therefore, we posted the score through the "Edit matches" section as well. "

    Do you mean to insert the "date_default_timezone_set('Europe/Berlin');" code in every php file of the component? We tried it for the playerprediction.php, matchresults.php and the matches.php but the second problem was not solved. Please let us know which php files are affected in order to insert the code.

    Regards,

    Dan G

  7. #7
    Administrator
    Join Date
    Jul 2015
    Posts
    65
    For the backend you will have to add the timezone code into the file <joomla path>/administrator/com_masterleaguepro/models/addscore.php

    after the line
    Code:
    public function getMatches(){
    we will fix the issue in next updates and the timezone would be set from the Joomla Global Configurations

  8. #8
    Junior Member
    Join Date
    Aug 2015
    Posts
    13
    Dear Kostas,

    Thank you very much. This is working for the backend as well. There is another issue that we noticed right now after the above two issues have been fixed.

    Once the match is finished, we can see the finished match in the "match results" tab and we can add a score through the back end "add scores" feature. Once we add a score, the "match results" tab is updated with the score, the "standings" tab is updated with the points earned by the user, BUT once we click on a user's name from the "standings" tab the finished match is not displayed in the user's predictions for the matchday (it has 3 hours difference - timezone problem once again).

    It seems that we need to change the timezone for the player predictions page as well. We tried to insert the "date_default_timezone_set('Europe/Berlin');" code in the playerprediction.php in the root/component/com_masterleaguepro/models and in the playerpredictions/php in the root/administrator/component/com_masterleaguepro/models but no luck solving the problem. Please let us know where we have to insert the code.

    Regards,

    Dan G

  9. #9
    Administrator
    Join Date
    Jul 2015
    Posts
    65
    The user prediction history is not related with the time, there should be another issue , but it seems you are using the altered code that display matches even if user has not predicted those matches from this thread http://www.multihosting.com/support/...n-results-page

    you will have to change the

    CURRENT_TIMESTAMP() , because it is a database function , so it uses the server's timezone

    so at the file
    <joomla directory>/components/com_masterleaguepro/models/playerprediction.php line 39

    change the line

    " WHERE m.matchday_id = ".$matchday." AND m.match_start_time < CURRENT_TIMESTAMP() ";

    TO

    " WHERE m.matchday_id = ".$matchday." AND m.match_start_time < ".date("Y-m-d H:i:s");

    now the time will be provided via PHP function to the database query

  10. #10
    Junior Member
    Join Date
    Aug 2015
    Posts
    13
    Dear Kostas,

    We put the code:
    " WHERE m.matchday_id = ".$matchday." AND m.match_start_time < ".date("Y-m-d H:i:s");

    But we receive the following error:
    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '19:44:06' at line 1 SQL=SELECT m.match_start_time,th.name as home,ta.name as away,m.home_score,m.away_score,pp.home_prediction, pp.away_prediction,pp.points FROM `jos_masterleaguepro_match` m INNER JOIN `jos_masterleaguepro_teams` th ON th.id=m.home_team INNER JOIN `jos_masterleaguepro_teams` ta ON ta.id=m.away_team LEFT JOIN `jos_masterleaguepro_player_prediction` pp ON pp.match_id=m.id AND pp.user_id=473 WHERE m.matchday_id = 5 AND m.match_start_time < 2015-09-01 19:44:06

    Please help.

    Regards,

    Dan G

Page 1 of 2 12 LastLast

Posting Permissions

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