4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: uploadeur on July 07, 2011, 12:49:55 PM

Title: [Mod] Previous Next Image Circle Circulation
Post by: uploadeur on July 07, 2011, 12:49:55 PM
Hi,

When we are at the final image at a category, tehre is no Next button for sure. But i want to circle the thing and A Next button in the final image for the first image of the same category. How can i do this next/prev image circulation?
Title: Re: [Mod] Previous Next Image Circle Circulation
Post by: Rembrandt on July 07, 2011, 05:56:46 PM
Hi!

1.) search in details.php:

$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;


and replace:

$last_key  = count($image_id_cache) - 1;
$next_image_id = (isset($image_id_cache[$act_key + 1])) ? $image_id_cache[$act_key + 1] : $image_id_cache[0];
$prev_image_id = (isset($image_id_cache[$act_key - 1])) ? $image_id_cache[$act_key - 1] : $image_id_cache[$last_key];


search and remove or comment out:

 if ($break) {
    break;
  }
  if ($prev_id == $image_id) {
    $break = 1;
  }
  $prev_id = $row['image_id'];


mfg Andi
Title: Re: Previous Next Image Circle Circulation
Post by: uploadeur on July 08, 2011, 08:05:33 PM
I think you get the point. But you coded uncorrectly i think. :) Because after this edit, there wasn't the previous(never) button and at the last image of the category the next button didnt work; but at the last imge of the category has a next button, this is good, but not fully correct. :)
Title: Re: Previous Next Image Circle Circulation
Post by: uploadeur on July 11, 2011, 09:40:18 PM
any other ideas?
Title: Re: Previous Next Image Circle Circulation
Post by: Rembrandt on July 12, 2011, 05:07:46 AM
update, test it...
Title: Re: Previous Next Image Circle Circulation
Post by: uploadeur on July 13, 2011, 05:32:54 AM
nothing changed. it was same like default details.php... :(
Title: Re: Previous Next Image Circle Circulation
Post by: uploadeur on September 07, 2011, 12:42:24 PM
UP
Title: Re: Previous Next Image Circle Circulation
Post by: zimba on October 19, 2011, 12:50:15 PM
works great
Title: Re: [Mod] Previous Next Image Circle Circulation
Post by: Rembrandt on August 23, 2012, 06:12:55 PM
Hi!

Code update, now it works correctly.

mfg Andi