Author Topic: Thumbs above image  (Read 14961 times)

0 Members and 1 Guest are viewing this topic.

Offline The Tester

  • Pre-Newbie
  • Posts: 7
    • View Profile
Thumbs above image
« on: December 31, 2006, 06:41:54 PM »
Hello
I've tried to find something like this thing that I'll try to describe here but I couldn't...Maybe because I don't know how to name it properly ;)

I wonder what should I change in files to get something like this:

When I click to see whole image I would like to have previous and next images above one that I'm currently watching. but not only one for previous and one for next but more. I don't know exactly how much...I must test it before i decide but it need to be at least 4 (2 for previous and 2 for next). I hope you've understand what i meant. :P

Offline mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Thumbs above image
« Reply #1 on: December 31, 2006, 07:22:17 PM »
... try this : [MOD] Photo Preview Hack ...
... http://www.4homepages.de/forum/index.php?topic=7294.0 ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline The Tester

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: Thumbs above image
« Reply #2 on: January 01, 2007, 02:06:13 AM »
Yea but only a little. There's one dead link and one solution that not resolve exactly my problem. From this solution I can turn on one thumb for previous and next:
{prev_image_url}{current_image}{next_image_url}
But I need something like this:
{prev_prev_image_url}{prev_image_url}{current_image}{next_image_url}{next_next_image_url}

I'm pretty sure that this can be done via current php code but I'm not php expert...I can edit php when someone point me where and how and that's it. :D

Edit: I just checked gallery that you have in your sig and there is this thing that I want...For example here: http://klick.kl.funpic.de/details.php?image_id=3221
« Last Edit: January 01, 2007, 02:27:22 AM by The Tester »

Offline The Tester

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: Thumbs above image
« Reply #3 on: January 01, 2007, 02:35:56 AM »
Um...I told you that I saw this...and besides...How this can help me anyway? Maybe there is something wrote and I don't see it?

Edit: Sigh...and there was some post before mine...If someone is using such mode like I need then it would be great if that person could share it here. :P
« Last Edit: January 01, 2007, 09:18:45 PM by The Tester »

manurom

  • Guest
Re: Thumbs above image
« Reply #4 on: January 03, 2007, 01:57:22 AM »
Hello;
bad no one tried to help.
So you want to display five images, and let us name them, by picture order:
prev1_image << prev_image << actual_image >> next_image >> next1_image

There is my way to manage it:
Edit the file details.php.
Go around line #170 and find:
Code: [Select]
$act_key = array_search($image_id, $image_id_cache);
$next_image_id = (isset($image_id_cache[$act_key + 1])) ? $image_id_cache[$act_key + 1] : 0;
$prev_image_id = (isset($image_id_cache[$act_key - 1])) ? $image_id_cache[$act_key - 1] : 0;
unset($image_id_cache);

// Get next and previous image
if (!empty($next_prev_cache[$next_image_id])) {
  $next_image_name = format_text($next_prev_cache[$next_image_id]['image_name'], 2);
  $next_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    $next_image_file = ICON_PATH."/404.gif";
  }
  else {
    $next_image_file = get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    $next_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$next_image_id]['image_media_file']).".gif";
  }
  else {
    $next_thumb_file = get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
}
else {
  $next_image_name = REPLACE_EMPTY;
  $next_image_url = REPLACE_EMPTY;
  $next_image_file = REPLACE_EMPTY;
  $next_thumb_file = REPLACE_EMPTY;
}

if (!empty($next_prev_cache[$prev_image_id])) {
  $prev_image_name = format_text($next_prev_cache[$prev_image_id]['image_name'], 2);
  $prev_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$prev_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    $prev_image_file = ICON_PATH."/404.gif";
  }
  else {
    $prev_image_file = get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    $prev_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$prev_image_id]['image_media_file']).".gif";
  }
  else {
    $prev_thumb_file = get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
}
else {
  $prev_image_name = REPLACE_EMPTY;
  $prev_image_url = REPLACE_EMPTY;
  $prev_image_file = REPLACE_EMPTY;
  $prev_thumb_file = REPLACE_EMPTY;
}

$site_template->register_vars(array(
  "next_image_id" => $next_image_id,
  "next_image_name" => $next_image_name,
  "next_image_url" => $next_image_url,
  "next_image_file" => $next_image_file,
  "next_thumb_file" => $next_thumb_file,
  "prev_image_id" => $prev_image_id,
  "prev_image_name" => $prev_image_name,
  "prev_image_url" => $prev_image_url,
  "prev_image_file" => $prev_image_file,
  "prev_thumb_file" => $prev_thumb_file
));
unset($next_prev_cache);


Please replace with:
Code: [Select]
$act_key = array_search($image_id, $image_id_cache);
$next_image_id = (isset($image_id_cache[$act_key + 1])) ? $image_id_cache[$act_key + 1] : 0;
$next1_image_id = (isset($image_id_cache[$act_key + 2])) ? $image_id_cache[$act_key + 2] : 0;
$prev_image_id = (isset($image_id_cache[$act_key - 1])) ? $image_id_cache[$act_key - 1] : 0;
$prev1_image_id = (isset($image_id_cache[$act_key - 2])) ? $image_id_cache[$act_key - 2] : 0;
unset($image_id_cache);

// Get next and previous image
if (!empty($next_prev_cache[$next_image_id])) {
  $next_image_name = format_text($next_prev_cache[$next_image_id]['image_name'], 2);
  $next_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    $next_image_file = ICON_PATH."/404.gif";
  }
  else {
    $next_image_file = get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    $next_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$next_image_id]['image_media_file']).".gif";
  }
  else {
    $next_thumb_file = get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
}
else {
  $next_image_name = REPLACE_EMPTY;
  $next_image_url = REPLACE_EMPTY;
  $next_image_file = REPLACE_EMPTY;
  $next_thumb_file = REPLACE_EMPTY;
}

if (!empty($next_prev_cache[$next1_image_id])) {
  $next1_image_name = format_text($next_prev_cache[$next1_image_id]['image_name'], 2);
  $next1_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next1_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$next1_image_id]['image_media_file'], "media", $next_prev_cache[$next1_image_id]['cat_id'], 0, 0)) {
    $next1_image_file = ICON_PATH."/404.gif";
  }
  else {
    $next1_image_file = get_file_path($next_prev_cache[$next1_image_id]['image_media_file'], "media", $next_prev_cache[$next1_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$next1_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next1_image_id]['cat_id'], 0, 0)) {
    $next1_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$next1_image_id]['image_media_file']).".gif";
  }
  else {
    $next1_thumb_file = get_file_path($next_prev_cache[$next1_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next1_image_id]['cat_id'], 0, 1);
  }
}
else {
  $next1_image_name = REPLACE_EMPTY;
  $next1_image_url = REPLACE_EMPTY;
  $next1_image_file = REPLACE_EMPTY;
  $next1_thumb_file = REPLACE_EMPTY;
}


if (!empty($next_prev_cache[$prev_image_id])) {
  $prev_image_name = format_text($next_prev_cache[$prev_image_id]['image_name'], 2);
  $prev_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$prev_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    $prev_image_file = ICON_PATH."/404.gif";
  }
  else {
    $prev_image_file = get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    $prev_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$prev_image_id]['image_media_file']).".gif";
  }
  else {
    $prev_thumb_file = get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
}
else {
  $prev_image_name = REPLACE_EMPTY;
  $prev_image_url = REPLACE_EMPTY;
  $prev_image_file = REPLACE_EMPTY;
  $prev_thumb_file = REPLACE_EMPTY;
}

if (!empty($next_prev_cache[$prev1_image_id])) {
  $prev1_image_name = format_text($next_prev_cache[$prev1_image_id]['image_name'], 2);
  $prev1_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$prev1_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$prev1_image_id]['image_media_file'], "media", $next_prev_cache[$prev1_image_id]['cat_id'], 0, 0)) {
    $prev1_image_file = ICON_PATH."/404.gif";
  }
  else {
    $prev1_image_file = get_file_path($next_prev_cache[$prev1_image_id]['image_media_file'], "media", $next_prev_cache[$prev1_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$prev1_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev1_image_id]['cat_id'], 0, 0)) {
    $prev1_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$prev1_image_id]['image_media_file']).".gif";
  }
  else {
    $prev1_thumb_file = get_file_path($next_prev_cache[$prev1_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev1_image_id]['cat_id'], 0, 1);
  }
}
else {
  $prev1_image_name = REPLACE_EMPTY;
  $prev1_image_url = REPLACE_EMPTY;
  $prev1_image_file = REPLACE_EMPTY;
  $prev1_thumb_file = REPLACE_EMPTY;
}

$site_template->register_vars(array(
  "next_image_id" => $next_image_id,
  "next_image_name" => $next_image_name,
  "next_image_url" => $next_image_url,
  "next_image_file" => $next_image_file,
  "next_thumb_file" => $next_thumb_file,
  "next1_image_id" => $next1_image_id,
  "next1_image_name" => $next1_image_name,
  "next1_image_url" => $next1_image_url,
  "next1_image_file" => $next1_image_file,
  "next1_thumb_file" => $next1_thumb_file,
  "prev_image_id" => $prev_image_id,
  "prev_image_name" => $prev_image_name,
  "prev_image_url" => $prev_image_url,
  "prev_image_file" => $prev_image_file,
  "prev_thumb_file" => $prev_thumb_file,
  "prev1_image_id" => $prev1_image_id,
  "prev1_image_name" => $prev1_image_name,
  "prev1_image_url" => $prev1_image_url,
  "prev1_image_file" => $prev1_image_file,
  "prev1_thumb_file" => $prev1_thumb_file
));
unset($next_prev_cache);


Edit the file templates/your_template/details.html.
Find:
Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr valign="top">
                            <td class="row2"> {if prev_image_name}{lang_prev_image}<br />
                              <b><a href="{prev_image_url}">{prev_image_name}</a></b>
                              <!-- <br /><br /><a href="{prev_image_url}"><img src="{prev_thumb_file}" border="1"></a> -->
                              {endif prev_image_name}&nbsp;</td>
                            <td align="right" class="row2"> &nbsp;{if next_image_name}{lang_next_image}<br />
                              <b><a href="{next_image_url}">{next_image_name}</a></b>
                              <!-- <br /><br /><a href="{next_image_url}"><img src="{next_thumb_file}" border="1"></a> -->
                              {endif next_image_name}</td>
                          </tr>
                        </table>

and change with:
Code: [Select]
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left" class="row2">{if prev_image_name}{lang_prev_image}<b><a href="{prev_image_url}"><img src="{prev_thumb_file}" border="0" alt="{prev_image_name} image"></a></b>
                {endif prev_image_name}</td>
    <td align="center" class="row2">{if next_image_name}{lang_next_image}<b><a href="{next_image_url}"><img src="{next_thumb_file}" border="0" alt="{next_image_name} image"></a></b>
{endif next_image_name}</td>
    <td align="right" class="row2">{if next1_image_name}{lang_next1_image}<b><a href="{next1_image_url}"><img src="{next1_thumb_file}" border="0" alt="{next1_image_name} image"></a></b>
{endif next_image_name}</td>
  </tr>
</table>

You can add language description.Edit lang/your_language/main.php. Around line #92, find:
Code: [Select]
$lang['next_image'] = "Next image:"; (for english language, for instance)
Add after:
Code: [Select]
$lang['next1_image'] = "your description";
Must declare it in includes/page_header.php: around line #151, after:
Code: [Select]
  "lang_lightbox" => $lang['lightbox'],
Add:
Code: [Select]
  "lang_next1_image" => $lang['next1_image'],Do the same for prev1_image, if needed.


I attached the modified version of details.php, version 1.7.4, in another topic here: Galeria en Details ó mas thumbnails
Hope it will help a little.
« Last Edit: January 03, 2007, 02:34:44 AM by manurom »

Offline The Tester

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: Thumbs above image
« Reply #5 on: January 03, 2007, 02:49:39 AM »
Ok. Great! Thx. :D It's work. I have to add one line because your code do:
<<prev <<current>> next>> next>>>>
and it suppose to do:
<<<<prev <<prev <<current>> next>> next>>>>
So templates/your_template/details.html should have this line too:
Code: [Select]
<td align="left" class="row2">{if prev1_image_name}{lang_prev1_image}<b><a href="{prev1_image_url}"><img src="{prev1_thumb_file}" border="0" alt="{prev1_image_name} image"></a></b>
                {endif prev_image_name}</td>

But it works just like I want it. :)

Offline FunnyUser

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: Thumbs above image
« Reply #6 on: February 17, 2007, 08:12:54 PM »
Thanks, works great for me with Version: 1.7.4 !


Thanks

Offline vredin

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: Thumbs above image
« Reply #7 on: August 18, 2008, 05:35:51 PM »
Hello,

what about "current" image thumb? how to show it "highlighted" in this bar?

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: Thumbs above image
« Reply #8 on: December 21, 2008, 04:55:26 PM »
Hello,

what about "current" image thumb? how to show it "highlighted" in this bar?

Just use {thumbnail} on the details page ;)