Add pages to image display screen in store admin area (v. 2.8x)
The "Images" area of the storeadmin will display thumbnail images in versions 2.8 and above. If a client has many images and you'd like to set up page numbering for those images, so that not all images are shown on the page at once, you can use the following modification:
-
Open the images.php file in the /storeadmin/ folder.
-
Add
// START IMAGE PAGES $image_rows_per_page=10; $pg=(int)$_REQUEST['pg']; // END IMAGE PAGES
just under the first
-
Add
// START IMAGE PAGE NUMBER echo ""; // END IMAGE PAGE NUMBER
just under the code
echo "";
-
Change the lines
// If uploaded message exists, display it here. if ($uploadmsg) echo "
";$uploadmsg to:
// START SHOW UPLOADED IMAGE if ($uploadmsg) { echo " "; echo "$uploadmsg "; } // END SHOW UPLOADED IMAGE -
Add
// START IMAGE PAGE NUMBER echo ""; // END IMAGE PAGE NUMBER
just above the code
?> Add New Image:
-
Change the lines
// while (list ($key, $val) = each ($filelist)) for ($fl = 1; list ($key, $val) = each ($filelist); ++$fl)
to
// START PAGINATION $page_list=array_chunk($filelist, $image_rows_per_page*2); $page_list_count=max(1, count($page_list)); $pg=min(max($pg, 1), $page_list_count); $pgpos=$pg-1; $pgdisplay=array(); for($ipg=1; $ipg<=$page_list_count; ++$ipg) { // HIGHLIGHT PAGE $pgclass=($pg==$ipg?" class="fieldname"":""); $pgdisplay[]="$ipg"; } // SHOW PAGE NUMBERS if(count($pgdisplay)>1) echo " "; // END PAGINATION for ($fl = 1; list ($key, $val) = each($page_list[$pgpos]); ++$fl)" .implode(" | ", $pgdisplay) ." -
Change
echo "$val DEL";
to
// START IMAGE PAGE NUMBER echo "$val DEL"; // END IMAGE PAGE NUMBER
-
Save and upload the file.