The fix: Replace lines 403 to 428 or
if (is_array($imageList)){
-to-
$nggWidget = new nggWidget;
of nggwidget.php with the following code:
if (is_array($imageList)){
foreach($imageList as $image) {
$maxElement = $ngg_options['galImages'];
$thumbwidth = $ngg_options['thumbwidth'];
$thumbheight = $ngg_options['thumbheight'];
// set thumb size
$thumbsize = "";
if ($ngg_options['thumbfix']) $thumbsize = 'style="width:'.$thumbwidth.'px; height:'.$thumbheight.'px;"';
if ($ngg_options['thumbcrop']) $thumbsize = 'style="width:'.$thumbwidth.'px; height:'.$thumbwidth.'px;"';
// get the effect code
if ($galleryID)
$thumbcode = ($ngg_options['galImgBrowser']) ? "" : nggallery::get_thumbcode($imagelist[0]->name);
else
$thumbcode = ($ngg_options['galImgBrowser']) ? "" : nggallery::get_thumbcode(get_the_title());
// show slideshow link
if ($galleryID)
if (($ngg_options['galShowSlide']) AND (NGGALLERY_IREXIST)) {
$args['show'] = "slide";
$out .= '<div class="slideshowlink"><a class="slideshowlink" href="' . $nggRewrite->get_permalink($args) . '">'.$ngg_options['galTextSlide'].'</a></div>';
}
// a description below the picture, require fixed width
if (!$ngg_options['galShowDesc'])
$ngg_options['galShowDesc'] = "none";
$setwidth = ($ngg_options['galShowDesc'] != "none") ? 'style="width:'.($thumbwidth).'px;"' : '';
$class_desc = ($ngg_options['galShowDesc'] != "none") ? 'desc' : '';
// set image url
$folder_url = get_option ('siteurl')."/".$image->path."/";
$thumbnailURL = get_option ('siteurl')."/".$image->path.nggallery::get_thumbnail_folder($image->path, FALSE);
$thumb_prefix = nggallery::get_thumbnail_prefix($image->path, FALSE);
// choose link between imagebrowser or effect
$link = ($ngg_options['galImgBrowser']) ? $nggRewrite->get_permalink(array('pid'=>$image->pid)) : $image->alttext;
// add filter for the link
$link = apply_filters('ngg_create_gallery_link', $link, $image);
$thumbcode2 = apply_filters('ngg_create_gallery_thumbcode', $thumbcode, $image);
// create output
$out .= '<div id="ngg-image-'. $image->pid .'" class="ngg-gallery-thumbnail-box '. $class_desc .'">'."\n\t";
$out .= '<div class="ngg-gallery-thumbnail" '.$setwidth.' >'."\n\t";
$out = '<a id="thumb'.$image->pid.'" href="'.$link.'" title="'.stripslashes($image->description).'" '.$thumbcode2.'>';
if ($ngg_options['galShowDesc'] == "alttext")
$out .= '<span>'.html_entity_decode(stripslashes($image->alttext)).'</span>'."\n";
if ($ngg_options['galShowDesc'] == "desc")
$out .= '<span>'.html_entity_decode(stripslashes($image->description)).'</span>'."\n";
if ( $options[$number]['show'] == "orginal" )
$out .= '<img src="'.NGGALLERY_URLPATH.'nggshow.php?pid='.$image->pid.'&width='.$options[$number]['width'].'&height='.$options[$number]['height'].'" title="'.$image->description.'" alt="'.$image->alttext.'" />';
else
$out .= '<img src="'.nggallery::get_thumbnail_url($image->pid).'" style="width:'.$options[$number]['width'].'px;height:'.$options[$number]['height'].'px;" title="'.$image->description.'" alt="'.$image->alttext.'" />';
echo $out . '</a>'."\n";
// add filter for the output
$out = apply_filters('ngg_inner_gallery_thumbnail', $out, $image);
$out .= '</div>'. "\n" .'</div>'."\n";
$out = apply_filters('ngg_after_gallery_thumbnail', $out, $image);
}
}
echo '</div>'."\n";
$out .= ($maxElement > 0) ? $navigation : '<div class="ngg-clear"></div>'."\n";
echo $after_widget;
}
}
// let's show it
$nggWidget = new nggWidget;
Easy, no?
This does not work for Slideshow widget. Someone would probably have to mess with js rotator settings there.