Skip to content

Commit 463c748

Browse files
committed
[2.0.56] Highlight correct aswer + misc.
1 parent f85f8d2 commit 463c748

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

functions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ function deleteAccount($username, $password){
392392
*/
393393
function eligible(){
394394
if(!isConnected()) return false;
395+
if(isMod()) return true;
395396

396397
global $eligibleMinimumDays;
397398
global $eligibleMinimumPoints;

style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ tr, td, th {
128128
border: 1px solid whitesmoke;
129129
}
130130

131+
tr.correct_answer {
132+
background-color: #040;
133+
}
134+
131135
th {
132136
position: sticky;
133137
top: 55px;

views/about.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,5 @@
118118
v1.0 (juin 2022) par <a href="https://www.marioswitch.fr/">MarioSwitch</a> et <a href="https://github.com/yoshakami">Yosh</a><br>
119119
v1.1 (mai 2023) par <a href="https://www.marioswitch.fr/">MarioSwitch</a><br>
120120
v2.0 (actuelle, juin 2023) par <a href="https://www.marioswitch.fr/">MarioSwitch</a><br><br>
121-
<i>Version 2.0.55 du 15 mai 2024</i>
121+
<i>Version 2.0.56 du 15 mai 2024</i>
122122
</p>

views/prediction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
}
8484

8585
$choiceName = $prediChoices[$i]["name"];
86-
$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>";
86+
$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>";
8787
$pointsMaxChoiceUsersText = "";
8888
}
8989
$pointsMaxTotal = intSQL("SELECT MAX(points) FROM `votes` WHERE `prediction` = ?;", [$_REQUEST["id"]]);

views/profile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@
160160
</tr>
161161
<tr>
162162
<td>Bons paris (mises)</td>
163-
<td>" . displayInt($correctBets, false) . " sur " . $answerBets . "<br><small>" . ($answerBets?displayFloat($correctBetsPercentage):"N/A") . " %</small></td>
163+
<td>" . displayInt($correctBets, false) . " sur " . $answerBets . ($answerBets?("<br><small>" . displayFloat($correctBetsPercentage) . " %</small>"):"") . "</td>
164164
<td>À venir</td>
165165
</tr>
166166
<tr>
167167
<td>Bons paris (points)</td>
168-
<td>" . displayInt($correctBetsPoints, false) . " sur " . $answerBetsPoints . "<br><small>" . ($answerBetsPoints?displayFloat($correctBetsPercentagePoints):"N/A") . " %</small></td>
168+
<td>" . displayInt($correctBetsPoints, false) . " sur " . $answerBetsPoints . ($answerBetsPoints?("<br><small>" . displayFloat($correctBetsPercentagePoints) . " %</small>"):"") . "</td>
169169
<td>À venir</td>
170170
</tr>
171171
</table>

0 commit comments

Comments
 (0)