From: <re...@us...> - 2004-08-22 22:50:14
|
Update of /cvsroot/tikiwiki/tiki In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31819 Modified Files: tiki-browse_gallery.php Log Message: Start of subgalleries development in imagegalleries. Index: tiki-browse_gallery.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/tiki-browse_gallery.php,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- tiki-browse_gallery.php 22 Aug 2004 01:37:25 -0000 1.24 +++ tiki-browse_gallery.php 22 Aug 2004 22:49:29 -0000 1.25 @@ -197,6 +197,9 @@ $info["name"] = 'System'; $info["public"] = 'y'; $info["description"] = 'System Gallery'; + $info['sortorder'] = 'created'; + $info['sortdirection'] = 'desc'; + $info['galleryimage'] = 'last'; $smarty->assign('system', 'y'); } else { $info = $imagegallib->get_gallery($_REQUEST["galleryId"]); @@ -265,8 +268,17 @@ } else { $find = ''; } -$images = $imagegallib->get_images($offset, $maxImages, $sort_mode, $find, $_REQUEST["galleryId"]); -$cant_pages = ceil($images["cant"] / $maxImages); + +// get subgalleries first +$subgals = $imagegallib->get_subgalleries($offset, $maxImages, $sort_mode, $find, $_REQUEST["galleryId"]); +$remainingImages = $maxImages-count($subgals['data']); +$newoffset = $offset -$subgals['cant']; +$images = $imagegallib->get_images($newoffset, $remainingImages, $sort_mode, $find, $_REQUEST["galleryId"]); +$smarty->assign('num_objects',count($subgals['data'])+count($images['data'])); +$smarty->assign('num_subgals',count($subgals['data'])); +echo "num_subgals: ".count($subgals['data']); +$smarty->assign('num_images',count($images['data'])); +$cant_pages = ceil(($subgals['cant']+$images['cant']) / $maxImages); $smarty->assign_by_ref('cant_pages', $cant_pages); $smarty->assign('actual_page', 1 + ($offset / $maxImages)); @@ -284,6 +296,7 @@ } $smarty->assign_by_ref('images', $images["data"]); +$smarty->assign_by_ref('subgals', $subgals['data']); if ($feature_image_galleries_comments == 'y') { $comments_per_page = $image_galleries_comments_per_page; |