Skip to content

Commit

Permalink
Release v2.8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilson Wise committed Aug 18, 2014
2 parents b1786b6 + 012c31d commit 061e779
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.8.4
v2.8.5
4 changes: 2 additions & 2 deletions controllers/AdminPlayerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ static function player_do_add() {
if (self::checkPerms()) {
$db = option('db');
$log = option('log');
// uid, username, email, password, wins, loses, permissions
$query = 'INSERT INTO {{users}} VALUES (NULL, "%s", "%s", "%s", 0, 0, %s, 0)';
// uid, username, email, password, wins, loses, permissions, submission, reminder
$query = 'INSERT INTO {{users}} VALUES (NULL, "%s", "%s", "%s", 0, 0, %s, 0, 1)';

if ($db->qry(
$query,
Expand Down
8 changes: 7 additions & 1 deletion controllers/MainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,12 @@ static function save_week() {
/* HELPERS */
/**************************************************************************/

static function get_percentage($wins, $loses) {
$total = $wins + $loses;

return $total > 0 ? round(($wins / $total) * 100, 2) : 0;
}

static function get_standings() {
$db = option('db');
$i = 1;
Expand All @@ -461,7 +467,7 @@ static function get_standings() {
$temp->place = '';
$temp->path = ($obj->submission ? "/week/$week/" : '/picks/' ) . strtolower($obj->username);
$temp->alt = $obj->submission ? 'Picks for this week' : 'All picks';
$temp->per = round(($temp->wins / ($temp->wins + $temp->loses)) * 100, 2);
$temp->per = self::get_percentage($temp->wins, $temp->loses);

// Set proper place
if ($temp->wins !== $score) {
Expand Down

0 comments on commit 061e779

Please sign in to comment.