Wordpress NextGen gallery tweak

Recently I found myself in that very anoying situation where a very good piece of software seemed to lack just this one function… again. I have been doing a gallery website and used the NextGen gallery plugin to display the photos. Unfortunatelly it was a case of a gallery per post with about 1 or 2 photos per gallery.

The biggest issue with this setting was the process of creating galleries. By default in NextGen you create the gallery on one page, upload the images in another, and then create new post yet elsewhere. But there had to be a way to at least merge the gallery creation with photo upload, especially considering a new gallery form consisted of a single “gallery name” field.Surprisingly enough after checking the code, both actions are actually processed in the same place. Thus by adding a new field on the photo upload form this time consuming problem could be solved:

Edit the file: wp-content/plugins/nggallery/admin/wp25/addgallery.php (line: 15)

// link for the flash file $swfuploadlink = NGGALLERYURLPATH . 'admin/wp25/upload.php'; $swfuploadlink = wpnonceurl($swfuploadlink, 'nggswfupload'); //flash doesn't seem to like encoded ampersands, so convert them back here $swfuploadlink = strreplace('&', '&', $swfuploadlink); $defaultpath = $nggoptions['gallerypath']; if ($POST['addgallery']** || !empty($POST['newgalleryname'])){ *if(!empty($_POST['newgalleryname'])) $_POST['galleryname'] = $_POST['newgalleryname']; check_admin_referer('ngg_addgallery'); $newgallery = attribute_escape($_POST['galleryname']); if (!empty($newgallery)) *$POST['galleryselect'] = **nggAdmin::creategallery($newgallery, $defaultpath); } if ($_POST['zipupload']){

Edit the file: wp-content/plugins/nggallery/admin/wp25/addgallery.php (line: 263)

e('in to', 'nggallery') ;?> ** **
" . iniget('uploadmaxfilesize') . "Byten"; ?>
WPMU) && wpmuenablefunction('wpmuQuotaCheck')) displayspace_usage(); ?>

Edit the file: wp-content/plugins/nggallery/admin/wp25/functions.php (line: 77)

if ($result) { nggallery::showerror(('Gallery', 'nggallery').' '.$galleryname.' '.('already exists', 'nggallery')); return false; } else { $result = $wpdb->query("INSERT INTO $wpdb->nggallery (name, path, title) VALUES ('$galleryname', '$nggpath', '$gallerytitle') "); if ($result) nggallery::showmessage(('Gallery', 'nggallery').' '.$wpdb->insertid." : ".$galleryname.' '.('successfully created!','nggallery')." ".('You can show this gallery with the tag','nggallery').' '); return $wpdb->insertid; }