Cleaning up some stuff, added some rewrites

This commit is contained in:
Josh Sherman 2013-12-17 14:07:45 -05:00
parent fa408978fd
commit 44f0139e13
4 changed files with 20 additions and 1 deletions

View file

@ -42,6 +42,9 @@ server
break; break;
} }
# Accommodate UID's in the URI
rewrite ^/(.+)/(\d+)$ /index.php?request=$1&uid=$2 last;
# and the rest # and the rest
rewrite ^/(.+)$ /index.php?request=$1 last; rewrite ^/(.+)$ /index.php?request=$1 last;
} }

View file

@ -0,0 +1,15 @@
<?php
class leaderboard_edit extends leaderboard_new
{
public function __default()
{
// Looks up the leaderboard by UID
// Checks that the leaderboard is owned by this user
// Returns the leaderboard
}
}
?>

View file

@ -48,6 +48,7 @@
{ {
$links = array( $links = array(
'/leaderboards' => 'My Leaderboards', '/leaderboards' => 'My Leaderboards',
'/api' => 'API Documentation',
'/contact' => 'Contact Us', '/contact' => 'Contact Us',
'/logout' => 'Logout', '/logout' => 'Logout',
); );

View file

@ -19,7 +19,7 @@ if ($this->module['leaderboards'])
?> ?>
<tr class="lead"> <tr class="lead">
<td><?php echo $uid; ?></td> <td><?php echo $uid; ?></td>
<td><?php echo $this->module['names'][$uid]; ?></td> <td><a href="/leaderboard/<?php echo $uid; ?>"><?php echo $this->module['names'][$uid]; ?></a></td>
<td><?php echo Time::ago($updated_at); ?></td> <td><?php echo Time::ago($updated_at); ?></td>
<td class="text-right"> <td class="text-right">
<a class="btn btn-danger" href="/leaderboard/delete/<?php echo $uid; ?>">Delete</a> <a class="btn btn-danger" href="/leaderboard/delete/<?php echo $uid; ?>">Delete</a>