Skip to content

Commit

Permalink
[2.0.56] Highlight correct aswer + misc.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioSwitch committed May 15, 2024
1 parent f85f8d2 commit 463c748
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ function deleteAccount($username, $password){
*/
function eligible(){
if(!isConnected()) return false;
if(isMod()) return true;

global $eligibleMinimumDays;
global $eligibleMinimumPoints;
Expand Down
4 changes: 4 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ tr, td, th {
border: 1px solid whitesmoke;
}

tr.correct_answer {
background-color: #040;
}

th {
position: sticky;
top: 55px;
Expand Down
2 changes: 1 addition & 1 deletion views/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@
v1.0 (juin 2022) par <a href="https://www.marioswitch.fr/">MarioSwitch</a> et <a href="https://github.com/yoshakami">Yosh</a><br>
v1.1 (mai 2023) par <a href="https://www.marioswitch.fr/">MarioSwitch</a><br>
v2.0 (actuelle, juin 2023) par <a href="https://www.marioswitch.fr/">MarioSwitch</a><br><br>
<i>Version 2.0.55 du 15 mai 2024</i>
<i>Version 2.0.56 du 15 mai 2024</i>
</p>
2 changes: 1 addition & 1 deletion views/prediction.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
}

$choiceName = $prediChoices[$i]["name"];
$prediChoicesText = $prediChoicesText . "<tr><td>" . $choiceName . "</td><td>" . displayInt($votesChoice) . $votesPercentage . "</td><td>" . displayInt($pointsChoice) . $pointsPercentage . "</td><td>" . $winRate . "</td><td>" . displayInt($pointsMaxChoice) . $pointsMaxChoiceUsersText . "</td></tr>";
$prediChoicesText = $prediChoicesText . "<tr" . (($choiceID == $prediAnswer)?" class='correct_answer'":"") . "><td>" . $choiceName . "</td><td>" . displayInt($votesChoice) . $votesPercentage . "</td><td>" . displayInt($pointsChoice) . $pointsPercentage . "</td><td>" . $winRate . "</td><td>" . displayInt($pointsMaxChoice) . $pointsMaxChoiceUsersText . "</td></tr>";
$pointsMaxChoiceUsersText = "";
}
$pointsMaxTotal = intSQL("SELECT MAX(points) FROM `votes` WHERE `prediction` = ?;", [$_REQUEST["id"]]);
Expand Down
4 changes: 2 additions & 2 deletions views/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@
</tr>
<tr>
<td>Bons paris (mises)</td>
<td>" . displayInt($correctBets, false) . " sur " . $answerBets . "<br><small>" . ($answerBets?displayFloat($correctBetsPercentage):"N/A") . " %</small></td>
<td>" . displayInt($correctBets, false) . " sur " . $answerBets . ($answerBets?("<br><small>" . displayFloat($correctBetsPercentage) . " %</small>"):"") . "</td>
<td>À venir</td>
</tr>
<tr>
<td>Bons paris (points)</td>
<td>" . displayInt($correctBetsPoints, false) . " sur " . $answerBetsPoints . "<br><small>" . ($answerBetsPoints?displayFloat($correctBetsPercentagePoints):"N/A") . " %</small></td>
<td>" . displayInt($correctBetsPoints, false) . " sur " . $answerBetsPoints . ($answerBetsPoints?("<br><small>" . displayFloat($correctBetsPercentagePoints) . " %</small>"):"") . "</td>
<td>À venir</td>
</tr>
</table>
Expand Down

0 comments on commit 463c748

Please sign in to comment.