summaryrefslogtreecommitdiff
path: root/modules/latestupdates
diff options
context:
space:
mode:
Diffstat (limited to 'modules/latestupdates')
-rw-r--r--modules/latestupdates/controllers/latestupdates.php34
1 files changed, 15 insertions, 19 deletions
diff --git a/modules/latestupdates/controllers/latestupdates.php b/modules/latestupdates/controllers/latestupdates.php
index bcee909e..39f0df60 100644
--- a/modules/latestupdates/controllers/latestupdates.php
+++ b/modules/latestupdates/controllers/latestupdates.php
@@ -25,7 +25,7 @@ class latestupdates_Controller extends Controller {
// Figure out which page # the visitor is on and
// don't allow the visitor to go below page 1.
- $page = $this->input->get("page", 1);
+ $page = Input::instance()->get("page", 1);
if ($page < 1) {
$page = 1;
}
@@ -37,22 +37,19 @@ class latestupdates_Controller extends Controller {
// for page numbering purposes.
$count = ORM::factory("item", $id)
->viewable()
- ->where("type !=", "album")
- ->orderby("created", "DESC")
- ->descendants()
- ->count();
+ ->where("type", "!=", "album")
+ ->order_by("created", "DESC")
+ ->count_all();
// Figure out what the highest page number is.
- $max_pages = ceil($count / $itemsPerPage, 1);
+ $max_pages = ceil($count / $itemsPerPage);
// Figure out which items to display on this page.
$children = ORM::factory("item", $id)
->viewable()
- ->where("type !=", "album")
- ->orderby("created", "DESC")
- ->limit($itemsPerPage)
- ->offset($offset)
- ->descendants();
+ ->where("type", "!=", "album")
+ ->order_by("created", "DESC")
+ ->find_all($itemsPerPage, $offset);
// Set up and display the actual page.
$template = new Theme_View("page.html", "collection", "LatestUpdates");
@@ -72,8 +69,8 @@ class latestupdates_Controller extends Controller {
$itemsPerPage = module::get_var("gallery", "page_size", 9);
// Figure out which page # the visitor is on and
- // don't allow the visitor to go below page 1.
- $page = $this->input->get("page", 1);
+ // don't allow the visitor to go below page 1.
+ $page = Input::instance()->get("page", 1);
if ($page < 1) {
$page = 1;
@@ -86,18 +83,17 @@ class latestupdates_Controller extends Controller {
// for page numbering purposes.
$count = ORM::factory("item")
->viewable()
- ->where("type !=", "album")
- ->find_all()
- ->count();
+ ->where("type", "!=", "album")
+ ->count_all();
// Figure out what the highest page number is.
- $max_pages = ceil($count / $itemsPerPage, 1);
+ $max_pages = ceil($count / $itemsPerPage);
// Figure out which items to display on this page.
$items = ORM::factory("item")
->viewable()
- ->where("type !=", "album")
- ->orderby("created", "DESC")
+ ->where("type", "!=", "album")
+ ->order_by("created", "DESC")
->find_all($itemsPerPage, $offset);
// Set up and display the actual page.