From dd8ff039f642b9eb6ea65cc1a58017ce867ec7b3 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 13 Dec 2009 02:03:17 +0000 Subject: fixed display of some album pages - caused a cascade of changes required --- lib/tidypics.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/tidypics.php b/lib/tidypics.php index b0a8a70d2..f2a1ccce4 100644 --- a/lib/tidypics.php +++ b/lib/tidypics.php @@ -33,7 +33,7 @@ function tp_get_latest_photos($num_images, $owner_guid = 0) { $prev_context = set_context('front'); - $image_html = tp_list_entities('object', 'image', $owner_guid, $num_images, false, false, false); + $image_html = tp_list_entities('object', 'image', $owner_guid, 0, $num_images, false, false, false); set_context($prev_context); return $image_html; } @@ -152,6 +152,7 @@ foreach ($where as $w) $query .= " $w and "; $query .= get_access_sql_suffix(); // Add access controls + if (!$count) { $query .= " order by $order_by"; if ($limit) $query .= " limit $offset, $limit"; // Add order and limit @@ -163,11 +164,12 @@ } } - function tp_list_entities($type= "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = false, $pagination = true) { + function tp_list_entities($type= "", $subtype = "", $owner_guid = 0, $container_guid = null, $limit = 10, $fullview = true, $viewtypetoggle = false, $pagination = true) { $offset = (int) get_input('offset'); - $count = tp_get_entities($type, $subtype, $owner_guid, "", $limit, $offset, true); - $entities = tp_get_entities($type, $subtype, $owner_guid, "", $limit, $offset); + $count = tp_get_entities($type, $subtype, $owner_guid, "", $limit, $offset, true, 0, $container_guid); + + $entities = tp_get_entities($type, $subtype, $owner_guid, "", $limit, $offset, false, 0, $container_guid); return tp_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle, $pagination); } -- cgit v1.2.3