Web: Support table prefixes

This commit is contained in:
shavitush 2016-05-21 06:05:42 +03:00
parent d3f3fb1e30
commit e56711450a
2 changed files with 4 additions and 4 deletions

View File

@ -52,7 +52,7 @@ a bhop server should be simple
shavit-core - no other plugin will work without it.
shavit-zones - wouldn't really call it required but it's actually needed to get your timer to start/finish.
# Todo for 1.5b release (out of beta!)
# Todo for 1.5b release
- [x] Migrate every menu to the new syntax.
- [ ] Migrate DBI to the new syntax.
@ -90,7 +90,7 @@ shavit-zones - wouldn't really call it required but it's actually needed to get
- [x] Make style names editable from shavit.inc (like I did to the rest of modules) (dynamic!)
~ shavit-misc
- [ ] Allow changing the prespeed limitation.
- [x] Allow changing the prespeed limitation.
~ [NEW PLUGIN] shavit-ranks: (delayed to 1.6b/out-of-beta)
- [ ] Create table.

View File

@ -151,7 +151,7 @@ $rr = isset($_REQUEST["rr"]);
$results = false;
$stmt = FALSE;
if($rr && $stmt = $connection->prepare("SELECT p.map, u.name, p.style, p.time, p.jumps, u.auth, p.date FROM playertimes p JOIN (SELECT style, MIN(time) time FROM playertimes GROUP BY style, map) s ON p.style = s.style AND p.time = s.time JOIN users u ON p.auth = u.auth GROUP BY style, map ORDER BY date DESC;"))
if($rr && $stmt = $connection->prepare("SELECT p.map, u.name, p.style, p.time, p.jumps, u.auth, p.date FROM ".MYSQL_PREFIX."playertimes p JOIN (SELECT style, MIN(time) time FROM ".MYSQL_PREFIX."playertimes GROUP BY style, map) s ON p.style = s.style AND p.time = s.time JOIN ".MYSQL_PREFIX."users u ON p.auth = u.auth GROUP BY style, map ORDER BY date DESC;"))
{
echo $connection->error;
@ -217,7 +217,7 @@ $rr = isset($_REQUEST["rr"]);
}
}
else if($stmt = $connection->prepare("SELECT p.id, u.auth, u.name, p.time, p.jumps, p.date FROM playertimes p JOIN users u ON p.auth = u.auth WHERE map = ? AND style = ? ORDER BY time ASC;"))
else if($stmt = $connection->prepare("SELECT p.id, u.auth, u.name, p.time, p.jumps, p.date FROM ".MYSQL_PREFIX."playertimes p JOIN ".MYSQL_PREFIX."users u ON p.auth = u.auth WHERE map = ? AND style = ? ORDER BY time ASC;"))
{
$stmt->bind_param("ss", $map, $style);
$stmt->execute();