I recently installed NGG Public Uploader and it almost perfectly suits my needs. The one thing that's missing is the ability to let users choose the gallery they want to upload to, instead of choosing a default one. I already have 9 existing galleries and I'd like my users to choose the right one for their uploads, how do I achieve this?
Thanks a bunch in advance
10:36 am December 1, 2009
Chanty
Member
posts 5
2
Never mind, I put my PHP knowledge to the test and managed to add a little dropdown menu myself!
Here's the code if anyone's interested, I put this in place of line 243 in inc/npu-upload.php:
include_once (NGGALLERY_ABSPATH.”lib/ngg-db.php”); $nggdb = new nggdb(); $gallerylist = $nggdb->find_all_galleries('gid', 'ASC');
Awesome! Thanks for the “how-to”. I'll incorporate this in a future release of the plugin and until then send people here for the patch.
Thanks again,
-Scott
12:30 pm December 8, 2009
castvision
Member
posts 7
4
Hi there
Just loaded the plugin in the hopes of doing the above but not working on mine, it sends the template off
Not familiar with PHP so perhaps doing something wrong!!?
3:37 pm December 10, 2009
Chanty
Member
posts 5
5
WDS-Scott said:
Awesome! Thanks for the “how-to”. I'll incorporate this in a future release of the plugin and until then send people here for the patch.
Thanks again,
-Scott
No problem! It's not optimal code though, it apparently gives an error when uploading the same file (not sure if that's related to the plugin itself or just a lack of proper error code handling for my code) and whenever you don't select a gallery, I'm guessing that's because I got rid of the default gallery setting in my code. But glad to have helped
@ castvision; did you copy & paste the code in place of the code on line 243?
5:41 am December 12, 2009
Valkrider
Member
posts 6
6
Post edited 10:43 am – December 12, 2009 by Valkrider
It may be me but I can't get this code to work either. line 243 for me just contains a }
This is the code from lines 240 to 250 according to my editor
[code]
echo $strOutput; } else { return $strOutput; } }
// Function: Widget Form public function display_uploader_widget($gal_id, $strDetailsPage = false, $blnShowAltText = true, $echo = true) { $strOutput = ""; if (count($this->arrErrorMsg_widg) > 0) {
Post edited 11:03 am – December 13, 2009 by Valkrider
If I replace line 2.11 in 1.5 it stops my blog working completely.
My php skills are not up to resolving this so I have had to revert to the vanilla version unfortunately.
I suspect it may be incompatibility with the theme I am using (Suffusion) but I don't want to change the theme so I will have to stick with v1.5 unmodified unless you can suggest an alternative way of achieving the same outcome.
3:36 am December 14, 2009
castvision
Member
posts 7
9
line 244 on mine
Works a treat
Chanty big thanks for providing the code and the code it replaces
3:32 am December 15, 2009
castvision
Member
posts 7
10
Spoke to soon I'm afraid, added a gallery and it went back to throwing my template out
Any suggestions would be very much appreciated?
In the meantime I'll see if any thing makes sense to me, damn wish I knew PHP!
2:20 pm December 16, 2009
Chanty
Member
posts 5
11
castvision said:
line 244 on mine
Works a treat
Chanty big thanks for providing the code and the code it replaces
Ah yes, there are two of that line in 1.5. Do you just get a blank page then? I'm not sure what other changes have been made to the code in 1.5, so something else may be needing that line…
11:54 am December 17, 2009
castvision
Member
posts 7
12
Hi Chanty
No not blank a screendump before and after I add another gallery below
After I add a gallery the 'choose category' doesn't include the new gallery but does include the text I added for the image title
So I'm assuming there is a fault with the code there but I can't work out what!
I tried replacing line 243 as described and keep getting Parse error: syntax error, unexpected '<' in /home/content/t/o/b/tobisan/html/wp-content/plugins/nextgen-public-uploader/inc/npu-upload.php on line 243
Post edited 10:40 am – December 23, 2009 by Valkrider
Got it sorted. It is the same code Chanty said above but the line number is incorrect. It is line 280 that needs to have this code inserted. I also changed the quotes to proper ones in case that was the problem and also changed the word category to gallery. This is how my code now looks from line 280 onwards
[code]
include_once (NGGALLERY_ABSPATH.”lib/ngg-db.php”); $nggdb = new nggdb(); $gallerylist = $nggdb->find_all_galleries('gid', 'ASC');
if it does work, can anyone show the script changed including a linr before and after the actual change, I keep getting error messages and Im very new at php
thanks
11:18 am December 23, 2009
Valkrider
Member
posts 6
17
tobi1kanoby
You need to delete line 280 and in its place put the 13 lines of code above.
On my site the upload is minimised using the > symbol in the upload widget on the right hand side.
Looking at your site I think that you are going to have a problem using this widget as your left widget bar isn't wide enough. Consider increasing the width of your widget bar. Attached is a screenshot showing the space that you need taken from my site.
The upload directory is part of the next gen configuration as it loads the photos into the gallery that the uploader selects.
There doesn't appear to be a way to capture the email address of the uploader, it is one of the things that has been requested.
If you have a problem editing the code and making it work, I have zipped it up and you can download it from http://turnspain.com/npu-upload.zip.