Skip to content

Commit

Permalink
cleanup, aesthetics
Browse files Browse the repository at this point in the history
linked usernames in map results, altered layout and text on landing page, more helpful error messages, removed name from the search dropdown since it defaults to it anyways, fixed the alt-css to conform
  • Loading branch information
pabp committed Jul 16, 2018
1 parent 9ed1406 commit 76d17a8
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 23 deletions.
3 changes: 2 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ TBD
* [ ] Fix remaining elseif SQL queries.
* [ ] Figure out how to show rank per map when displaying one player's times without clobbering the database (indexes?)
* [ ] Rework table drawing into a function rather than, well, this.
* [ ] Make the timer-red.css stylesheet respect the alterations I've made.
* [ ] Redo the search dropdown better.

Done
* [x] Add option to search by SteamID/Steamcommunity URL.
* [x] Add Top 10/50/100 Players page as ranked by total points earned.
* [X] Make the timer-red.css stylesheet respect the alterations I've made.

Ongoing

Expand Down
48 changes: 27 additions & 21 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function()
?>
</select>
</div>
<button type="submit" class="btn btn-success">Submit</button>
<button type="submit" class="btn btn-primary">Lookup</button>
</form>
</div>
</div>
Expand All @@ -172,45 +172,48 @@ function()
?>
<h1><?php echo HEADER_TITLE; ?></h1>
<p>
To view the records of any map, please select it using the menu at the top right of this page.<br/>
Don't forget to select a style if you wish, and then tap 'Submit'!</p>
To view the records of any map, please select it using the menu at the top right of this page.<br />
Otherwise, you can search for a player by their SteamID or display name using the field below.
</p>
<br />

<form id="search" method="GET">
<div class="form-group">
<div class="input-group">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle form-control" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Search by... <span class="caret"></span></button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Search by... <span class="caret"></span></button>
<ul class="dropdown-menu">
<li onclick="steamidsearchtype(0)"><label class="btn btn-default form-control"><input class="srchhide" type="radio" name="stype" value="0" />Name</label></li>
<!-- this is commented out as it's kind of unnecessary
<li onclick="steamidsearchtype(0)"><label class="btn btn-default form-control"><input class="srchhide" type="radio" name="stype" value="0" />Name</label></li> -->
<li onclick="steamidsearchtype(1)"><label class="btn btn-default form-control"><input class="srchhide" type="radio" name="stype" value="1" />SteamID</label></li>
<li onclick="steamidsearchtype(2)"><label class="btn btn-default form-control"><input class="srchhide" type="radio" name="stype" value="2" />SteamID3</label></li>
<li onclick="steamidsearchtype(3)"><label class="btn btn-default form-control"><input class="srchhide" type="radio" name="stype" value="3" />SteamID64</label></li>
<li onclick="steamidsearchtype(4)"><label class="btn btn-default form-control"><input class="srchhide" type="radio" name="stype" value="4" />Steamcommunity.com Profile URL</label></li>
</ul>
</div><!-- /btn-group -->
<input type="text" name="username" class="form-control username-input" aria-label="..." placeholder="">
</div>
<input type="text" name="username" class="form-control username-input" aria-label="..." placeholder="Name">
<div class="input-group-btn">
<button type="submit" class="btn btn-primary">Search</button>
</div>
</div><!-- /input-group -->
<br />
<button type="submit" class="btn btn-primary">Search</button>
<br />
</div>
</div><!-- /form-group -->
</form>
<br />
<br />
<br />
<br />
<p>
Alternatively, you may click <a href="index.php?rr=1">Recent Records</a> to view the latest <?php echo RECORD_LIMIT_LATEST; ?> records or click <a href="#
">here</a> to join the server.
You may click <a href="index.php?rr=1">Recent Records</a> to view the latest <?php echo RECORD_LIMIT_LATEST; ?> records<?php if (USES_RANKINGS == '1') {echo ', click <a href="index.php?top=1">Top Players</a> to view the leaderboard';}; ?> or click <a href="#">here</a> to join the server.
</p>
<br />
<br />
<br />
<br />
</div>
<?php
} else {
$results = false;
$stmt = false;

if ($rr) {
if ($rr) { //recent records
if (USES_RANKINGS == '0') {
$stmt = $connection->prepare('SELECT p.map, u.name, p.style, p.time, p.jumps, p.strafes, p.sync, u.auth, p.date, p.track FROM '.MYSQL_PREFIX.'playertimes p JOIN (SELECT MIN(time) time, map, style, track FROM '.MYSQL_PREFIX.'playertimes GROUP by map, style, track) t JOIN '.MYSQL_PREFIX.'users u ON p.time = t.time AND p.auth = u.auth AND p.map = t.map AND p.style = t.style AND p.track = t.track ORDER BY date DESC LIMIT '.RECORD_LIMIT_LATEST.' OFFSET 0;');
} else {
Expand Down Expand Up @@ -288,7 +291,7 @@ function()
}
}
}
} elseif (!$username && !$top && !$stype) {
} elseif (!$username && !$top && !$stype) { //map dropdown

if (USES_RANKINGS == '0') {
$stmt = $connection->prepare('SELECT p.id, u.auth, u.name, p.time, p.jumps, p.strafes, p.sync, p.date FROM '.MYSQL_PREFIX.'playertimes p JOIN '.MYSQL_PREFIX.'users u ON p.auth = u.auth WHERE p.map = ? AND p.style = ? AND p.track = ? ORDER BY time ASC;');
Expand Down Expand Up @@ -479,7 +482,7 @@ function()
}
} ?> </table> <?php
}
} elseif ($username) {
} elseif ($username) { //search

$authtemp = '';
$sid = '';
Expand Down Expand Up @@ -600,9 +603,12 @@ function()
$stmt->close();
}

if (!$results) {
?> <h1>No results!</h1>
<p>Try another map, there may be some records!</p> <?php
if (!$results) {
echo '<h1>No results!</h1> <br />';
if ($username == false) {
echo '<p>Try another username, Steam names only cache when someone visits the gameserver so names may differ. Try searching by SteamID instead.</p>';
} else {
echo '<p>Try another map or style, there may be some records!</p>';}
}
}
?>
Expand Down
10 changes: 9 additions & 1 deletion timer-red.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ th,td {
.btn {
outline: none !important;
border: 0.25px solid #171C22;
padding:inherit;
}
.btn-primary
{
background-color: #820000 !important;

}
.btn-primary:hover
{
background-color: #a49d92 !important;
}
select,select:focus,select:active {
background-color:#FFF;
Expand Down

0 comments on commit 76d17a8

Please sign in to comment.