PDA

View Full Version : Prediction



3hills
17-07-2015, 01:07 PM
--------------------------------------------------
Topic Transfered from old forum
--------------------------------------------------
Hi,

I just want to find out if there is a way to let users only do predictions once per match, so that when their prediction is in, it is final?

Thank you
Regards

3hills
17-07-2015, 01:08 PM
--------------------------------------------------
Topic Transfered from old forum
--------------------------------------------------
Hello,

the system has a time schedule, which means that until that deadline, they can change their predictions.
Usually, most admins, set the time-deadline for each match, one (1) minute before kickoff.

Hope that answers your question.

3hills
17-07-2015, 01:08 PM
--------------------------------------------------
Topic Transfered from old forum
--------------------------------------------------
Ah ok, thank you for that.
That is fine then, as soon as the Matches start it will have ended.

Regards

3hills
17-07-2015, 01:08 PM
--------------------------------------------------
Topic Transfered from old forum
--------------------------------------------------
Hello,

the system has a time schedule, which means that until that deadline, they can change their predictions.
Usually, most admins, set the time-deadline for each match, one (1) minute before kickoff.

Hope that answers your question.

Where exactly it is possible to look this possibility (time schedule), in what file?

3hills
17-07-2015, 01:09 PM
--------------------------------------------------
Topic Transfered from old forum
--------------------------------------------------

Where exactly it is possible to look this possibility (time schedule), in what file?

you can take look at the file <joomla directory>/com_multileague/models/matches.php

the function getMatches() gets the matches that will be shown to the user view "matches" (the one that he makes predictions)
the function savePredictions() saves the user predictions , it performes date checks to see if the user try to save a match that has already started.

you can change the getMatches() to bring only the matches that the user has not predicted but you will have to change the savePredictions() to be sure that the user can't send you data for already predicted match

there is already a check for that "if(count($alreadyPredictCheck)==0){"
you can simply remove the else and the user won't be able to update his prediction (but of course it will be good to change the getMatches so the user can't see in matches he predicted in front end).