Skip to content

Commit

Permalink
housekeeping (#271)
Browse files Browse the repository at this point in the history
* Bump version just because

* player.cp does too much.  Refactor a bit.

* Apply fixes from StyleCI

* Debugging
  • Loading branch information
silasary authored Feb 6, 2020
1 parent e055ebc commit c263a38
Show file tree
Hide file tree
Showing 13 changed files with 350 additions and 293 deletions.
4 changes: 2 additions & 2 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
$message = $message.$oppplayer->linkTo().'.';
}
if ($match->player_reportable_check() == true) {
$message = $message.' <a href="player.php?mode=submit_result&match_id='.$match->id.'&player='.$player_number.'">(Report Result)</a>';
$message = $message.' <a href="report.php?mode=submit_result&match_id='.$match->id.'&player='.$player_number.'">(Report Result)</a>';
}
}
} elseif ($match->result != 'BYE' && $match->verification == 'failed') {
Expand All @@ -86,7 +86,7 @@

if ($match->player_reportable_check() == true) {
$message = "The reported result wasn't consistent with your opponent's, please resubmit $event->name vs. ".$oppplayer->linkTo().'.';
$message = $message.'<a href="player.php?mode=submit_result&match_id='.$match->id.'&player='.$player_number.'">(Report Result)</a>';
$message = $message.'<a href="report.php?mode=submit_result&match_id='.$match->id.'&player='.$player_number.'">(Report Result)</a>';
} else {
$message = "You have an unreported match in $match->eventname.";
}
Expand Down
2 changes: 1 addition & 1 deletion admin/infobot.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
$player->setPassword($challenge);
echo "<UaReply>Your temporary password for {$CONFIG['site_name']} is $challenge</UaReply>";
} else {
echo '<error>Unknown Action</error>';
echo "<error>Unknown Action: {$_REQUEST['mode']}</error>";
}
4 changes: 2 additions & 2 deletions event.php
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ function kValueDropMenu($kvalue)
$kvalue = -1;
}
$names = ['' => '- K-Value -', 8 => 'Casual (Alt Event)', 16 => 'Regular (less than 24 players)',
24 => 'Large (24 or more players)', 32 => 'Championship', ];
24 => 'Large (24 or more players)', 32 => 'Championship', ];
print_select_input('K-Value', 'kvalue', $names, $kvalue);
}

Expand All @@ -1144,7 +1144,7 @@ function monthDropMenu($month)
$month = -1;
}
$names = ['January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December', ];
'July', 'August', 'September', 'October', 'November', 'December', ];
echo '<select class="inputbox" name="month">';
echo '<option value="">- Month -</option>';
for ($m = 1; $m <= 12; $m++) {
Expand Down
4 changes: 2 additions & 2 deletions eventreport.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ function fullmetagame($event)
$players = [];
foreach ($decks as $deck) {
$info = ['player' => $deck->playername, 'deckname' => $deck->name,
'archetype' => $deck->archetype, 'medal' => $deck->medal,
'id' => $deck->id, ];
'archetype' => $deck->archetype, 'medal' => $deck->medal,
'id' => $deck->id, ];
$arr = deckInfo($deck);
$info['colors'] = $arr[1];
if ($info['medal'] == 'dot') {
Expand Down
6 changes: 3 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<div id="" class="grid_4">
<div class="box pad">
<?php $player = Player::getSessionPlayer(); ?>
<?php if ($player != null): ?>
<?php if ($player != null) { ?>
<div>
<b> Welcome back <?php echo $player->name ?> </b>
<ul>
Expand All @@ -90,7 +90,7 @@
} ?>
</ul>
</div>
<?php else: ?>
<?php } else { ?>
<div style="height: 165px;">
<b>Login to Gatherling</b>
<table class="form" align="left" cellpadding="3">
Expand All @@ -113,7 +113,7 @@
</form>
</table>
</div>
<?php endif; ?>
<?php } ?>
</div><!-- grid_4 omega (login/links) -->
<?php include 'sidebar.php'; ?>
</div> <!-- Sidebar -->
Expand Down
5 changes: 3 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,13 @@ function print_warning_if($conditional)

function version_number()
{
return '4.8.3';
return '4.8.8';
}

function version_tagline()
{
echo 'Gatherling version 4.8.7 ("Step 7: Steal a bagel.")';
echo 'Gatherling version 4.8.8 ("Fish fingers and custard")';
// echo 'Gatherling version 4.8.7 ("Step 7: Steal a bagel.")';
// echo 'Gatherling version 4.8.6.1 ("I\'m gonna steal the declaration of independence.")';
// echo 'Gatherling version 4.8.6 ("I\'m gonna steal the declaration of independence.")';
// echo 'Gatherling version 4.8.5 ("That\'s my secret, Captain: I\'m always angry...")';
Expand Down
4 changes: 2 additions & 2 deletions models/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ public function getFinalists()
$finalists = [];
while ($stmt->fetch()) {
$finalists[] = ['medal' => $medal,
'player' => $player,
'deck' => $deck, ];
'player' => $player,
'deck' => $deck, ];
}
$stmt->close();

Expand Down
14 changes: 7 additions & 7 deletions models/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -995,13 +995,13 @@ public function getBestDeckStats()
$res = [];
while ($stmt->fetch()) {
$res[] = ['name' => $name,
'cnt' => $cnt,
'id' => $id,
't8' => $t8,
't4' => $t4,
'2nd' => $secnd,
'1st' => $first,
'score' => $score, ];
'cnt' => $cnt,
'id' => $id,
't8' => $t8,
't4' => $t4,
'2nd' => $secnd,
'1st' => $first,
'score' => $score, ];
}
$stmt->close();

Expand Down
14 changes: 7 additions & 7 deletions models/Ratings.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public function __construct($format = '')
$this->wins = 0;
$this->losses = 0;
$this->ratingNames = ['Standard', 'Extended', 'Modern', 'Classic', 'Legacy',
'Pauper', 'SilverBlack', 'Heirloom', 'Commander', 'Tribal Wars',
'Penny Dreadful', ];
'Pauper', 'SilverBlack', 'Heirloom', 'Commander', 'Tribal Wars',
'Penny Dreadful', ];

return;
}
Expand All @@ -31,8 +31,8 @@ public function __construct($format = '')
public function formatDropMenuR($format = '')
{
$names = ['Composite', 'Standard', 'Extended', 'Modern',
'Classic', 'Legacy', 'Pauper', 'SilverBlack', 'Heirloom',
'Commander', 'Tribal Wars', 'Other Formats', ];
'Classic', 'Legacy', 'Pauper', 'SilverBlack', 'Heirloom',
'Commander', 'Tribal Wars', 'Other Formats', ];
echo '<select class="inputbox" name="format">';
foreach ($names as $name) {
$sel = (strcmp($name, $format) == 0) ? 'selected' : '';
Expand Down Expand Up @@ -244,9 +244,9 @@ public function getMatches($event)
$data = [];
while ($stmt->fetch()) {
$data[] = ['playera' => $playera,
'playerb' => $playerb,
'result' => $result,
'kvalue' => $kvalue, ];
'playerb' => $playerb,
'result' => $result,
'kvalue' => $kvalue, ];
}
$stmt->close();

Expand Down
28 changes: 14 additions & 14 deletions models/Series.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,20 +341,20 @@ public function currentSeason()
// TODO: THESE functions are UGLY.
public function getSeasonRules($season_number)
{
$season_rules = ['first_pts' => 0,
'second_pts' => 0,
'semi_pts' => 0,
'quarter_pts' => 0,
'participation_pts' => 0,
'rounds_pts' => 0,
'decklist_pts' => 0,
'win_pts' => 0,
'loss_pts' => 0,
'bye_pts' => 0,
'must_decklist' => 0,
'cutoff_ord' => 0,
'master_link' => '',
'format' => '', ];
$season_rules = ['first_pts' => 0,
'second_pts' => 0,
'semi_pts' => 0,
'quarter_pts' => 0,
'participation_pts' => 0,
'rounds_pts' => 0,
'decklist_pts' => 0,
'win_pts' => 0,
'loss_pts' => 0,
'bye_pts' => 0,
'must_decklist' => 0,
'cutoff_ord' => 0,
'master_link' => '',
'format' => '', ];

$db = Database::getConnection();
$stmt = $db->prepare('SELECT series, first_pts, second_pts, semi_pts, quarter_pts, participation_pts,
Expand Down
Loading

0 comments on commit c263a38

Please sign in to comment.