• Hi, I’m looking for the way to link an image in the gallery to some text in the post/page. Is it possible?
    Please let me know!
    Bye

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter ilvikingodotnet

    (@ilvikingodotnet)

    And so? nobody have the same problem?
    Tnks

    A singlepic or a image inside a gallery view ?

    Thread Starter ilvikingodotnet

    (@ilvikingodotnet)

    Hi Alex,
    Like “Singlepic”, but the link is a text or an icon end not the image.
    Thanks!!

    Thread Starter ilvikingodotnet

    (@ilvikingodotnet)

    Hi, is there a trick or I have to link manually all my foto?

    Thread Starter ilvikingodotnet

    (@ilvikingodotnet)

    up

    Thread Starter ilvikingodotnet

    (@ilvikingodotnet)

    Hi Alex,
    I resolved it
    I added the tag [singlelinkpic=”text-to-link”,id]
    I added following code in nggfunction.php line 32
    if ( stristr( $content, ‘[singlelinkpic’ )) {

    $search = “@\[singlelinkpic=(\”.+\”),(\d+)\]@i”;

    if (preg_match_all($search, $content, $matches)) {

    if (is_array($matches)) {
    foreach ($matches[2] as $key =>$v0) {
    // check for correct id
    $result = $wpdb->get_var(“SELECT filename FROM $wpdb->nggpictures WHERE pid = ‘$v0’ “);
    if($result){
    $search = $matches[0][$key];
    $replace= nggLinkSinglePicture($v0,$matches[1][$key]);
    $content= str_replace ($search, $replace, $content);
    }
    }
    }
    }else{$content= “falso”;}
    }// end singelpic
    and I added the function nggLinkSinglePicture:
    function nggLinkSinglePicture($imageID, $linktxt=””) {
    /**
    * create a gallery based on the tags
    * @imageID db-ID of the image
    * @linktxt txt to link to image
    */
    global $wpdb, $post;

    $ngg_options = nggallery::get_option(‘ngg_options’);

    // remove the comma
    $linktxt = trim($linktxt,’\”‘);

    // get picturedata
    $picture = new nggImage($imageID);

    // check fo cached picture
    if ( ($ngg_options[‘imgCacheSinglePic’]) && ($post->post_status == ‘publish’) )
    $cache_url = $picture->cached_singlepic_file($width, $height, $mode );

    // add fullsize picture as link
    $out = ‘imagePath.'” title=”‘.stripslashes($picture->description).'” ‘.$picture->get_thumbcode(“singlepic”.$imageID).’ >’;
    $out .= $linktxt;
    $out .= ‘
    ‘;
    $out = apply_filters(‘ngg_show_singlepic_content’, $out, $picture );
    return $out;
    }

    I hope you can add this feature to next release of your code 🙂
    bye
    Vik

    I don’t think this is working with the latest NextGen. Could this be updated for the lastest 1.01?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: NextGEN Gallery] what about link text to photo?’ is closed to new replies.