Author Topic: Show prev and next thumbnail. Problem if there is none  (Read 6898 times)

0 Members and 1 Guest are viewing this topic.

Offline trash

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • http://xander.mine.nu
Show prev and next thumbnail. Problem if there is none
« 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
:: Artificial Intelligence is no match for Natural Stupidity ::

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Show prev and next thumbnail. Problem if there is none
« Reply #1 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
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline trash

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • http://xander.mine.nu
Show prev and next thumbnail. Problem if there is none
« Reply #2 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...
:: Artificial Intelligence is no match for Natural Stupidity ::