4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: trash on July 26, 2002, 08:41:41 PM

Title: Show prev and next thumbnail. Problem if there is none
Post by: trash on July 26, 2002, 08:41:41 PM
Hi,

Check:

http://xander.mine.nu/details.php?image_id=107

I want to show the thumbnail of the next file, but if it has no thumbnail, I want to show the media icon for it. Is there a variable for it? Or do I have to customize?

cheers,

Trash
Title: Show prev and next thumbnail. Problem if there is none
Post by: Jan on July 26, 2002, 09:05:53 PM
No, you find a little bug ;)

Open details.php and replace line:

Code: [Select]
$next_thumb_file = (is_remote($next_prev_cache[$next_image_id]['image_thumb_file'])) ? $next_prev_cache[$next_image_id]['image_thumb_file'] : THUMB_PATH."/".$cat_id."/".$next_prev_cache[$next_image_id]['image_thumb_file'];

with:

Code: [Select]
if (empty($next_prev_cache[$next_image_id]['image_thumb_file'])) {
  $next_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$next_image_id]['image_media_file']).".gif";
}
else {
  $next_thumb_file = (is_remote($next_prev_cache[$next_image_id]['image_thumb_file'])) ? $next_prev_cache[$next_image_id]['image_thumb_file'] : THUMB_PATH."/".$cat_id."/".$next_prev_cache[$next_image_id]['image_thumb_file'];
}


then replace this line:

Code: [Select]
$prev_thumb_file = (is_remote($next_prev_cache[$prev_image_id]['image_thumb_file'])) ? $next_prev_cache[$prev_image_id]['image_thumb_file'] : THUMB_PATH."/".$cat_id."/".$next_prev_cache[$prev_image_id]['image_thumb_file'];

with:

Code: [Select]
if (empty($next_prev_cache[$prev_image_id]['image_thumb_file'])) {
  $prev_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$prev_image_id]['image_media_file']).".gif";
}
else {
  $prev_thumb_file = (is_remote($next_prev_cache[$prev_image_id]['image_thumb_file'])) ? $next_prev_cache[$prev_image_id]['image_thumb_file'] : THUMB_PATH."/".$cat_id."/".$next_prev_cache[$prev_image_id]['image_thumb_file'];
}


Will be fixed in next versions.

Greets Jan
Title: Show prev and next thumbnail. Problem if there is none
Post by: trash on July 26, 2002, 09:39:08 PM
thnx Jan, works like a charm :)

I was already looking for the code to lookup the icon file, but you beat me to it.... :)

thnx...