diff --git a/htdocs/application/models/Pastes.php b/htdocs/application/models/Pastes.php index 46c88d8..f941606 100644 --- a/htdocs/application/models/Pastes.php +++ b/htdocs/application/models/Pastes.php @@ -678,13 +678,12 @@ class Pastes extends CI_Model $total_rows = $query->num_rows(); // query - if ($this->db->dbdriver == "postgre") { $sql = "SELECT id, title, name, created, pid, lang, raw FROM $TABLE WHERE private = 0 AND (title LIKE ? OR raw LIKE ?) ORDER BY created DESC LIMIT $amount OFFSET $page"; } - else - if ($root == 'api/recent') + else + if ($root == 'api/recent') { $sql = "SELECT id, title, name, created, pid, lang, raw FROM $TABLE WHERE private = 0 AND (title LIKE ? OR raw LIKE ?) ORDER BY created DESC LIMIT 0,15"; } @@ -711,6 +710,11 @@ class Pastes extends CI_Model { $sql = "SELECT id, title, name, created, pid, lang, raw FROM $TABLE WHERE private = 0 ORDER BY created DESC LIMIT $amount OFFSET $page"; } + else + if ($root == 'api/recent') + { + $sql = "SELECT id, title, name, created, pid, lang, raw FROM $TABLE WHERE private = 0 ORDER BY created DESC LIMIT 0,15"; + } else { $sql = "SELECT id, title, name, created, pid, lang, raw FROM $TABLE WHERE private = 0 ORDER BY created DESC LIMIT $page,$amount"; @@ -807,6 +811,11 @@ class Pastes extends CI_Model { $sql = "SELECT id, title, name, created, pid, lang, raw, hits FROM $TABLE WHERE private = 0 ORDER BY hits DESC, created DESC LIMIT $amount OFFSET $page"; } + else + if ($root == "api/trending") + { + $sql = "SELECT id, title, name, created, pid, lang, raw, hits FROM $TABLE WHERE private = 0 ORDER BY hits DESC, created DESC LIMIT 0,15"; + } else { $sql = "SELECT id, title, name, created, pid, lang, raw, hits FROM $TABLE WHERE private = 0 ORDER BY hits DESC, created DESC LIMIT $page,$amount"; diff --git a/htdocs/index.php b/htdocs/index.php index d27278b..85f0567 100755 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -53,7 +53,7 @@ * * NOTE: If you change these, also change the error_reporting() code below */ - define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); + define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'production'); /* *---------------------------------------------------------------