I would use the Custom Fields plugin:
http://nextgen-gallery.com/custom-fields/
Add your field…
then, after creating a custom field called URL for the images, change line 22 of the singlepic.php file in the “view” folder from this:
<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->linktitle ?>" <?php echo $image->thumbcode ?> >
<img class="<?php echo $image->classname ?>" src="<?php echo $image->thumbnailURL ?>" alt="<?php echo $image->alttext ?>" title="<?php echo $image->alttext ?>" />
to this:
<a href="<?php echo $image->ngg_custom_fields["URL"]; ?>"><img class="<?php echo $image->classname ?>" src="<?php echo $image->thumbnailURL ?>" alt="<?php echo $image->alttext ?>" title="<?php echo $image->alttext ?>" /></a>
that should work…
Hiya – I am attempting the same workaround. I have custom fields installed but I’m sure I have not created the image custom field correctly – Field Name = URL – Field Type = Text Input (?) linked to my gallery. Modifying singlepic.php poses no problem, but I am at a loss to see how I will be able to place and specify the URL’s I am hoping to send visitors who select the images. The ‘lightbulb’ could also be larger and the alt text would be better suited as something like ‘read more’. Would I find these specs in the same file?
Would appreciate some guidance,
Cheers!! William
I may have found an alternative workaround. Using the commands in nggSmoothSharedFunctions.php :
// Error with only one element
foreach ($pictures as $picture)
if ($picture[“img”]) {
$out .= “<div class=\”imageElement\”>”;
$out .= ” <h3> ” . $picture[“title”] . “</h3>”;
$out .= ” <p style=\”color: #FFF000;\”> ” . $picture[“desc”] . “</p>”;
$out .= ” <<<<“;
$out .= ” <img src=\”” . $picture[“img”] . “\” class=\”full\” />”;
$out .= ” <img src=\”” . $picture[“thumb”] . “\” class=\”thumbnail\” />”;
$out .= “</div>”;
}
$out .= ‘ </div></div>’;
return $out;
}
It should be possible, IO am assuming, to modify line:
$out .= ” <<<<“;
[note I have altered the hover-over text for this] to call a page I can attribute to each image…hhhhmmmmmm still drawing board stuff, but closer. I would also like the carousel ‘thumbnails’ to behave in the same way, i.e. link to a page (on the site btw) corresponding to the image – they are covers of ‘zines.
I may have found an alternative workaround by modifying nggSmoothGalleryFunctions.php:
This section:
// Error with only one element
foreach ($pictures as $picture)
if ($picture[“img”]) {
$out .= “<div class=\”imageElement\”>”;
$out .= ” <h3> ” . $picture[“title”] . “</h3>”;
$out .= ” <p style=\”color: #FFF000;\”> ” . $picture[“desc”] . “</p>”;
$out .= ” <(a) target=\”_blank\” href=\”” . $picture[“link”] . “\” title=\”read more\” class=\”open\”></(a)>”;
$out .= ” <img src=\”” . $picture[“img”] . “\” class=\”full\” />”;
$out .= ” <img src=\”” . $picture[“thumb”] . “\” class=\”thumbnail\” />”;
$out .= “</div>”;
}
$out .= ‘ </div></div>’;
return $out;
}
By modifying this [note I have altered the mouse-over text]:
$out .= ” <(a) target=\”_blank\” href=\”” . $picture[“link”] . “\” title=\”read more\” class=\”open\”></(a)>”;
It should be possible, I am assuming, to link each image to a specific page (on the site) I would also like the ‘thumbnails’ in the carousel to behave the same. Still drawing board, but closer!