Author Topic: Thumbnails for previous and next _3_ images in details.php ?  (Read 14653 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
In version 1.0, I enhanced details.php to return new variables 'next_image2' and 'next_image3'.  This was so I could display the previous and next 3 image thumbnails to the user for navigational purposes.  

I don't know PHP but I am make my living as a programmer.  It was easy enough for me to figure out that this data was already available in the cache.

Under 1.5 beta, this cache seems to have been removed.  I spent a couple hours yesterday trying to figure out how to accomplish the same thing but failed.  

Does anyone know if it's possible to copy and hack these sections of code to get the next 3 images instead of just the next 1 image?

Code: [Select]

details.php
-----------

$order = ($config['image_sort'] == "DESC") ? "DESC" : "ASC";
$condition = ($order == "DESC") ? "<" : ">";
$row = $site_db->query_firstrow("SELECT image_id AS next_image_id
                                 FROM ".IMAGES_TABLE."
                                 WHERE ".$config['image_order']." $condition '".$search_key."' AND cat_id = $cat_id AND image_active = 1
                                 ORDER BY ".$config['image_order']." $order
                                 LIMIT 1");
$next_image_id = (!empty($row['next_image_id'])) ? $row['next_image_id'] : 0;
$next_image_name = REPLACE_EMPTY;
$next_image_url = REPLACE_EMPTY;
$next_image_file = REPLACE_EMPTY;
$next_thumb_file = REPLACE_EMPTY;

...

// Get next and previous image
if (!empty($image_row[$next_image_id])) {
  $next_image_name = stripslashes($image_row[$next_image_id]['image_name']);
  $next_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next_image_id);
  $next_image_file = (is_remote($image_row[$next_image_id]['image_media_file'])) ? $image_row[$next_image_id]['image_media_file'] : MEDIA_PATH."/".$cat_id."/".$image_row[$next_image_id]['image_media_file'];
  $next_thumb_file = (is_remote($image_row[$next_image_id]['image_thumb_file'])) ? $image_row[$next_image_id]['image_thumb_file'] : THUMB_PATH."/".$cat_id."/".$image_row[$next_image_id]['image_thumb_file'];
}


It's the LIMIT 1 and query_firstrow() I couldn't figure out how to replace (I think)

Here is a screen shot to illustrate what I'm trying to do:


The 2nd and 3rd '190-14' should be '190-15' and '190-16'.

(I only blurred the URL because my site isn't public yet.  Too much work to do before going live.)

Offline Insider

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: Thumbnails for previous and next _3_ images in details.php ?
« Reply #1 on: January 01, 2006, 09:40:36 PM »
i have exactly the same problem..
i want more then next & previous image on the details page / for example the next 3 thumbnails...

could anybody help me??? please  :D

Offline Eagle Eye

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: Thumbnails for previous and next _3_ images in details.php ?
« Reply #2 on: May 19, 2006, 02:35:44 PM »
me too intrested in this

or even like on Sir V@no's site ;)

Offline iguanna

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Thumbnails for previous and next _3_ images in details.php ?
« Reply #3 on: October 05, 2006, 01:15:49 AM »
I would like this too!
www.summer-school-programs.com Summer study programs
http://celebrity.fake-images.com Celebrity Fake Images

Offline iguanna

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Thumbnails for previous and next _3_ images in details.php ?
« Reply #4 on: October 05, 2006, 04:43:30 AM »
this is an exaple of what could be great!

http://www.newbiesinc.com/CATS.jpg


or something like merging categories.html and details.html

help us please!
www.summer-school-programs.com Summer study programs
http://celebrity.fake-images.com Celebrity Fake Images

Offline Fere

  • Newbie
  • *
  • Posts: 19
  • echo "Hello world!"
    • View Profile
    • www.aribrushart.ro
Re: Thumbnails for previous and next _3_ images in details.php ?
« Reply #5 on: January 22, 2009, 06:24:47 PM »
Nothing new on this topic ? I was looking to modify the scipt to add some navigation arrows and I saw the thumbnail script. Is there anyway to activate it ?

I.m using 4images 1.7.6

It would sufice me just 1 iteneration, no necesary three.

Offline alekinna

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • Gallery of cross-stitching
Re: Thumbnails for previous and next _3_ images in details.php ?
« Reply #6 on: January 23, 2009, 12:30:52 AM »
What about this - [MOD] Photo Preview Hack ?