Select gallery on upload page

HomeSupportNextGEN Public UploaderSelect gallery on upload page

This topic has 1 voice, contains 16 replies, and was last updated by  admin 778 days ago.

Viewing 15 posts - 1 through 15 (of 17 total)
Author Posts
Author Posts
December 1, 2009 at 8:08 am #283

admin

Hi,
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 :)

December 1, 2009 at 10:36 am #284

admin

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:
<div class=”sfcode”>include_once (NGGALLERY_ABSPATH.”lib/ngg-db.php”);
                $nggdb = new nggdb();
                   $gallerylist = $nggdb->find_all_galleries('gid', 'ASC');
               
                $strOutput .= “n<div id=”choosegallery” style=”margin: 10px 0 0 0;”>”;
                $strOutput .= “n<select id=”npu_upload-id-$gal_id” name=”galleryselect”>
                               n<option value=”0″>Choose category</option>
                               n<option value=”"> </option>”;
                   foreach ($gallerylist as $gallery) {
                $name = ( empty($gallery->title) ) ? $gallery->name : $gallery->title;
                $strOutput .= “n<option value=”$gallery->gid”>$name</option>”; }
                $strOutput .= “</select>”;
                $strOutput .= “n</div>”;</div>
<img title=”Smile” src=”/wp-content/forum-smileys/sf-smile.gif” alt=”Smile” />

December 7, 2009 at 8:24 pm #285

admin

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

December 8, 2009 at 12:30 pm #286

admin

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!!?

December 10, 2009 at 3:37 pm #287

admin

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

<hr />
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?

December 12, 2009 at 5:41 am #288

admin

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) {
[/code]

Is this really the correct place?

December 12, 2009 at 3:52 pm #289

admin

This is what's on line 243 (in version 1.4)

<div class=”sfcode”>$strOutput .= “n<input type=”hidden” name=”galleryselect” value=”{$gal_id}”>”;</div>

It's on line 211 in 1.5 :)

December 13, 2009 at 6:02 am #290

admin

<img title=”Cry” src=”/wp-content/forum-smileys/sf-cry.gif” alt=”Cry” /> If I replace line 2.11 in 1.5 it stops my blog working completely.

<img title=”Embarassed” src=”/wp-content/forum-smileys/sf-embarassed.gif” alt=”Embarassed” width=”18″ height=”18″ /> 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.

December 14, 2009 at 3:36 am #291

admin

line 244 on mine

Works a treat

Chanty big thanks for providing the code and the code it replaces <img title=”Cool” src=”/wp-content/forum-smileys/sf-cool.gif” alt=”Cool” /> <img title=”Smile” src=”/wp-content/forum-smileys/sf-smile.gif” alt=”Smile” />

December 15, 2009 at 3:32 am #292

admin

Spoke to soon I'm afraid, added a gallery and it went back to throwing my template out <img title=”Cry” src=”/wp-content/forum-smileys/sf-cry.gif” alt=”Cry” />

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!

December 16, 2009 at 2:20 pm #293

admin

castvision said:
line 244 on mine

Works a treat

Chanty big thanks for providing the code and the code it replaces <img title=”Cool” src=”/wp-content/forum-smileys/sf-cool.gif” alt=”Cool” /> <img title=”Smile” src=”/wp-content/forum-smileys/sf-smile.gif” alt=”Smile” />

<hr />
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…

December 17, 2009 at 11:54 am #294

admin

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!
Thanks for any help you can provide

<img src=”http://hccnatex.havantcameraclub.co.uk/wp-content/gallery/open/ok.jpg?604077539&#8243; alt=”" width=”573″ height=”318″ />
<img src=”http://hccnatex.havantcameraclub.co.uk/wp-content/gallery/open/notok.jpg?1808305702&#8243; alt=”" />

December 23, 2009 at 5:27 am #295

admin

Hi Chanty.
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

when this is the script:
 $strOutput .= “n</div>”;
include_once (NGGALLERY_ABSPATH.”lib/ngg-db.php”);
                $nggdb = new nggdb();
                   $gallerylist = $nggdb->find_all_galleries('gid', 'ASC');
any idea what Im doing wrong?
thanks

December 23, 2009 at 5:37 am #296

admin

<img title=”Laugh” src=”/wp-content/forum-smileys/sf-laugh.gif” alt=”Laugh” />

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');
              
                $strOutput .= "n<div id=”choosegallery" style="margin: 10px 0 0 0;">";
                $strOutput .= "n<select id="npu_upload-id-$gal_id" name="galleryselect">
                               n<option value="0">Choose gallery</option>
                               n<option value=""> </option>";
                   foreach ($gallerylist as $gallery) {
                $name = ( empty($gallery->title) ) ? $gallery->name : $gallery->title;
                $strOutput .= "n<option value="$gallery->gid">$name</option>"; }
                $strOutput .= "</select>";
                $strOutput .= "n</div>";
[/code]

Thanks to everyone, particularly Chanty for this <img title=”Laugh” src=”/wp-content/forum-smileys/sf-laugh.gif” alt=”Laugh” /><img title=”Laugh” src=”/wp-content/forum-smileys/sf-laugh.gif” alt=”Laugh” /><img title=”Laugh” src=”/wp-content/forum-smileys/sf-laugh.gif” alt=”Laugh” />

If you want to see what it looks like on my site you can visit http://vrcc.turnspain.com

December 23, 2009 at 8:03 am #297

admin

Thanks Valkrider,
I visited you're site, very cool, I use the same template on mine- http://knows-dive.com
I managed to change the code as you said, ( did I need to delete anything from line 280?) and nothing has changed,
I couldnt see any loading options yet on your site. can you help me out here.

another question. 1.Do you know if theres a way to add users email adress or a name to attach to the image?
2. where can I specify the upload directory? where does the file go?
thanks again

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic. Register or login