diff --git a/contrib/blotter/main.php b/contrib/blotter/main.php index 2b381668..a97e63c4 100644 --- a/contrib/blotter/main.php +++ b/contrib/blotter/main.php @@ -126,7 +126,7 @@ class Blotter extends SimpleExtension { private function display_blotter() { global $database, $config; $limit = $config->get_int("blotter_recent", 5); - $entries = $database->get_all("SELECT * FROM blotter ORDER BY id DESC LIMIT ?,?", array(0, $limit)); + $entries = $database->get_all("SELECT * FROM blotter ORDER BY id DESC LIMIT ?", array($limit)); $this->theme->display_blotter($entries); } } diff --git a/contrib/pools/main.php b/contrib/pools/main.php index 10d63a12..5ffe3c5d 100644 --- a/contrib/pools/main.php +++ b/contrib/pools/main.php @@ -275,7 +275,7 @@ class Pools extends SimpleExtension { "INNER JOIN users AS u ". "ON p.user_id = u.id ". "ORDER BY p.date DESC ". - "LIMIT ?, ?" + "OFFSET ? LIMIT ?" , array($pageNumber * $poolsPerPage, $poolsPerPage) ); @@ -452,7 +452,7 @@ class Pools extends SimpleExtension { INNER JOIN images AS i ON i.id = p.image_id WHERE p.pool_id = ? AND i.rating IN ($rating) ORDER BY p.image_order ASC - LIMIT ?, ?", + OFFSET ? LIMIT ?", array($poolID, $pageNumber * $imagesPerPage, $imagesPerPage)); $totalPages = ceil($database->db->GetOne(" @@ -468,7 +468,7 @@ class Pools extends SimpleExtension { FROM pool_images WHERE pool_id=? ORDER BY image_order ASC - LIMIT ?, ?", + OFFSET ? LIMIT ?", array($poolID, $pageNumber * $imagesPerPage, $imagesPerPage)); $totalPages = ceil($database->db->GetOne("SELECT COUNT(*) FROM pool_images WHERE pool_id=?", array($poolID)) / $imagesPerPage); } @@ -588,7 +588,7 @@ class Pools extends SimpleExtension { "INNER JOIN users AS u ". "ON h.user_id = u.id ". "ORDER BY h.date DESC ". - "LIMIT ?, ?" + "OFFSET ? LIMIT ?" , array($pageNumber * $historiesPerPage, $historiesPerPage)); $totalPages = ceil($database->db->GetOne("SELECT COUNT(*) FROM pool_history") / $historiesPerPage); diff --git a/ext/alias_editor/main.php b/ext/alias_editor/main.php index e856bfb9..096598c7 100644 --- a/ext/alias_editor/main.php +++ b/ext/alias_editor/main.php @@ -70,12 +70,7 @@ class AliasEditor implements Extension { $alias_per_page = $config->get_int('alias_items_per_page', 30); - if($database->engine->name == "mysql") { - $query = "SELECT oldtag, newtag FROM aliases ORDER BY newtag ASC LIMIT ?, ?"; - } - else { - $query = "SELECT oldtag, newtag FROM aliases ORDER BY newtag ASC OFFSET ? LIMIT ?"; - } + $query = "SELECT oldtag, newtag FROM aliases ORDER BY newtag ASC OFFSET ? LIMIT ?"; $alias = $database->db->GetAssoc($query, array($page_number * $alias_per_page, $alias_per_page) );