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:

  1. Open the images.php file in the /storeadmin/ folder.

  2. Add

    // START IMAGE PAGES
    $image_rows_per_page=10;
    $pg=(int)$_REQUEST['pg'];
    // END IMAGE PAGES

    just under the first

  3. Add

    // START IMAGE PAGE NUMBER
    echo "";
    // END IMAGE PAGE NUMBER

    just under the code

    echo "";
  4. Change the lines

    // If uploaded message exists, display it here.
    if ($uploadmsg)
    echo "$uploadmsg";

    to:

    // START SHOW UPLOADED IMAGE
    if ($uploadmsg)
    {
    echo "$uploadmsg";
    echo "";
    }
    // END SHOW UPLOADED IMAGE
  5. Add

    // START IMAGE PAGE NUMBER
    echo "";
    // END IMAGE PAGE NUMBER

    just above the code

    ?>
    
    Add New Image:  
  6. 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 "" .implode(" | ", $pgdisplay) ."";
    // END PAGINATION
    for ($fl = 1; list ($key, $val) = each($page_list[$pgpos]); ++$fl)
    
  7. Change

    echo "$val   DEL";

    to

    // START IMAGE PAGE NUMBER
    echo "$val   DEL";
    // END IMAGE PAGE NUMBER
  8. Save and upload the file.