WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Monoslideshow
using dynamic information from nextgen gallery custom fields (5 posts)

  1. lucascorato
    Member
    Posted 3 years ago #

    Hi everybody,

    It's been a while I've trying to find a way to add links to images in wordpress with this plugin.

    So far, I managed to do the following:

    1. installed the nextgen custom fields plugin
    2. created a custom field called "Image links to"
    3. Added a specific info to each picture, in this case a URL (although the field is text only)

    Much of it I found here: http://www.hackingethics.com/blog/2010/08/02/how-to-add-custom-fields-in-nextgen-gallery-to-give-link-on-images-of-posts-or-page/

    So, my question is: now that I have this dynamic information somewhere, how to I take it to my xml.php in the monoslideshow plugin?

    I tried to add the following, between the blank lines, but with no success:

    if (is_array ($pictures)){
    	foreach ($pictures as $picture) {
            $description = htmlspecialchars ( strip_tags( stripslashes( nggGallery::i18n($picture->description) ) ) , ENT_QUOTES );
            if (!empty($picture->alttext))
                $title = stripslashes( htmlspecialchars (nggGallery::i18n($picture->alttext) , ENT_QUOTES) );
            else
                $title = $picture->filename;
    
                $link = $image->ngg_custom_fields["Image links to"];
    
            $path = $siteurl . '/' . $picture->path . '/' . $picture->filename;
            $thumbnail = $siteurl . '/' . $picture->path . '/thumbs/thumbs_' . $picture->filename;
            echo "\t\t<image id='$picture->pid' source='$path' title='$title' link='$link' description='$description' thumbnail='$thumbnail' />\n";
    	}
    }

    I really think this is the way to go, since if I add a static adress like:

    $link ='http://www.google.com'

    It will indeed take me to google but from every image. I need to know what string to use so that the xml.php gets the right information - which by the way I don't know where it comes from, if it's a file in the nextgen gallery plugin or what...

    I guess it's just a last step to get this thing done.

    Ah, the gallery is here: http://fot.lucascorato.com/category/360

    Anybody?

    Thanks for your time.

    LUCAS

  2. plymouthdesign
    Member
    Posted 3 years ago #

    Here's the solution. The changes to the xml.php file are highlighted.

  3. lucascorato
    Member
    Posted 3 years ago #

    Thanks a lot plymouthdesign!
    I'll give it a try and let you know about the results!
    I'm sorry I didn't reply before, I've been flooded with work and only now I can get back to my website!
    Regards,
    LUCAS

  4. lucascorato
    Member
    Posted 3 years ago #

    Amazing, it works really well!
    Going one step further, how can I make it to open the links on a new window?
    Thanks again
    LUCAS

  5. empulse
    Member
    Posted 2 years ago #

    I'm sure this is a ridiculous longshot, but I desperately need the info linked above by plymouthdesign on adding hyperlinks to nextgen gallery monoslideshow. Sadly, the above link is down.... Does anyone happen to know of another location to find this info?

    Regards,
    Brandon

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic