• Anonymous User 9105421

    (@anonymized-9105421)


    Firts thanks for keeping the NextGEN Gallery 1.9 code alive, i recently found the NextCellent Gallery – NextGEN Legacy plugin and as i use only basic functions since first starting out on NextGEN Gallery i’m happy to find this continuation of it.

    So far all works fine, the switch from NextGEN Gallery to NextCellent Gallery – NextGEN Legacy went smooth preserving all my galleries. Currently running NextCellent Gallery – NextGEN Legacy 1.9.35 on WordPress 4.9.1 and PHP 7.0.26.

    Only thing i found missing sofar was the “Edit gallery” link displaying after upload of one or more images. Not sure why but when i replaced the 1.9.35 code with the old 1.9.13 code in admin/functions.php the “Edit gallery” link is showing again as usual on the line that notifies that “…” images are succesfully uploaded.

    I edited admin/functions.php:

    line 298 from:
    		//TODO:Message will not shown, because AJAX routine require more time, message should be passed to AJAX
    		$message  = $created_msg;
    		if ( count($updated) > 0)
    			$message .= $c . __(' picture(s) successfully renamed','nggallery') . '<br />';
    		if ( count($image_ids) > 0 )
    			$message .= count($image_ids) .__(' picture(s) successfully added','nggallery') . '<br />';
    		if ($created_msg) {
    		$message .= ' [<a href="' . admin_url() . 'admin.php?page=nggallery-manage&mode=image&gid=' . $gallery_id . '" >';
    		$message .=  __('Edit gallery','nggallery');
    		$message .= '</a>]';
    		}
    		if (!$message)
    		$message  = __('No images were added.','nggallery');
    
    		nggGallery::show_message($message);
    
    ----------- to -------------------->>>>
    
    		//TODO:Message will not shown, because AJAX routine require more time, message should be passed to AJAX
    		$message  = $created_msg . count($image_ids) .__(' picture(s) successfully added','nggallery');
    		$message .= ' [<a href="' . admin_url() . 'admin.php?page=nggallery-manage&mode=image&gid=' . $gallery_id . '" >';
    		$message .=  __('Edit gallery','nggallery');
    		$message .= '</a>]';
    		
    		nggGallery::show_message($message); 
Viewing 3 replies - 1 through 3 (of 3 total)
  • I really appreciate your response here, as well as the fix for the “Edit gallery” link. I just realized I had tweaked some of the NGG files along the way and these changes would of course be gone with the NexCellent files being activated. Of course, I didn’t keep great notes (ok, any notes) on the tweaks I made along the way so this could a little interesting.

    Again thanks for helping out here!
    John

    • This reply was modified 6 years, 10 months ago by JPC60.
    Thread Starter Anonymous User 9105421

    (@anonymized-9105421)

    I made some additional edits to NextCellent Gallery – NextGEN Legacy to make it easier for me to work with. I by example made that the dropdown menus that show when adding/uploading images and when you insert images into a post are getting displayed alphabetically:
    https://www.ads-software.com/support/topic/gallery-sorting-order-dropdown-menus-add-gallery-images-and-add-media/#post-9832234

    One other edit i made is that more images (18 instead of 10) are shown per page when inserting images to a post by changing admin/media-upload.php line 110:

    		$picarray = $wpdb->get_col("SELECT pid FROM $wpdb->nggpictures WHERE galleryid = '$galleryID' AND exclude != 1 ORDER BY {$ngg->options['galSort']} {$ngg->options['galSortDir']} LIMIT $start, 10 ");
    
    changed to:
    
    		$picarray = $wpdb->get_col("SELECT pid FROM $wpdb->nggpictures WHERE galleryid = '$galleryID' AND exclude != 1 ORDER BY {$ngg->options['galSort']} {$ngg->options['galSortDir']} LIMIT $start, 18 ");
    
    Thread Starter Anonymous User 9105421

    (@anonymized-9105421)

    Found that the above edit that i made to admin/media-upload.php to show 18 image links per page when inserting images to a post was not working 100% correct, i found that i needed to change two more lines to get a correctly working (as far as i can judge) pagination. I also decided to have NextCellent Gallery show 48 image links per page.

    My current edit to admin/media-upload.php to get this working:

    line 104: (changed 10 to 48 image links)
    
    	$start = ( $_GET['paged'] - 1 ) * 10;
    
    changed to:
    
    	$start = ( $_GET['paged'] - 1 ) * 48;
    
    line 110: (changed 10 to 48 image links)
    
    		$picarray = $wpdb->get_col("SELECT pid FROM $wpdb->nggpictures WHERE galleryid = '$galleryID' AND exclude != 1 ORDER BY {$ngg->options['galSort']} {$ngg->options['galSortDir']} LIMIT $start, 10 ");	
    
    changed to:
    
    		$picarray = $wpdb->get_col("SELECT pid FROM $wpdb->nggpictures WHERE galleryid = '$galleryID' AND exclude != 1 ORDER BY {$ngg->options['galSort']} {$ngg->options['galSortDir']} LIMIT $start, 48 ");	
    
    line 157: (changed 10 to 48 image links)
    
    		'total' => ceil($total / 10),
    
    changed to:
    
    		'total' => ceil($total / 48),
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘“Edit gallery” link not displaying after image upload’ is closed to new replies.