diff --git a/system/admin/admin.php b/system/admin/admin.php
index dabc20a..4237632 100644
--- a/system/admin/admin.php
+++ b/system/admin/admin.php
@@ -1627,15 +1627,16 @@ function reorder_subpages($subpages = null)
rebuilt_cache();
}
+// Return image gallery in pager.
// Return image gallery in pager.
function image_gallery($images, $page = 1, $perpage = 0)
{
if (empty($images)) {
- $images = get_gallery();
+ $images = scan_images();
}
- $pagination = has_pagination(count($images), $perpage, $page);
$tmp = '';
$images = array_slice($images, ($page - 1) * $perpage, $perpage);
+ $pagination = has_pagination(count($images), $perpage, $page);
$tmp .= '
';
foreach ($images as $index => $v) {
$tmp .= '
';
diff --git a/system/includes/functions.php b/system/includes/functions.php
index edaefbd..8750c40 100644
--- a/system/includes/functions.php
+++ b/system/includes/functions.php
@@ -222,19 +222,19 @@ function get_zip_files()
}
// Get images in content/images folder
-function get_gallery() {
- static $_gallery = array();
- if (empty($_gallery)) {
+function scan_images() {
+ static $_images = array();
+ if (empty($_images)) {
$tmp = array();
$tmp = glob('content/images/*', GLOB_NOSORT);
if (is_array($tmp)) {
foreach ($tmp as $file) {
- $_gallery[] = pathinfo($file);
+ $_images[] = pathinfo($file);
}
}
- usort($_gallery, "sortfile_d");
+ usort($_images, "sortfile_d");
}
- return $_gallery;
+ return $_images;
}
// usort function. Sort by filename.