Shuffle

Admiror Gallery is free extension for Joomla! 1.6. Joomla! 1.7 and Joomla! 2.5 based websites. Admiror Gallery is all in one, a simple and instant solution for rendering image gallery from folder with images, but very flexible and adaptable.
Post Reply
Message
Author
winyard
Posts: 1
Joined: Tue Oct 09, 2012 1:40 pm

Shuffle

#1 Post by winyard »

Hi, is it possible to make the images appear in a random order? to have them on a shuffle setting?

Admiror Gallery 5 - Fundraising Campaign

User avatar
Vasiljevski
Developer
Developer
Posts: 1258
Joined: Sat Aug 14, 2010 9:31 pm
Location: Novi Sad, Serbia
Contact:

Re: Shuffle

#2 Post by Vasiljevski »

Hmm, not without some changes in the code.

This could be done by small change in template code. For example, if you use classic template, you could take the image array before it is output and shuffle:

plugins\content\admirorgallery\AdmirorGallery\templates\classic\index.php

Code: Select all

	  shuffle($AG->images);
	  // Loops over the array of images inside target gallery folder, adding wrapper with SPAN tag and write Popup thumbs inside this wrapper
	  if(!empty($AG->images)){	
	       foreach ($AG->images as $imageKey => $imageName){
		    $html.= '<span class="ag_thumb'.$AG->params['template'].'">';
		    $html.= $AG->writePopupThumb($imageName);
		    $html.='</span>';
	       }
	  }
I was surprised to see that PHP actually have a shuffle function :)
Help Admiror Gallery become even better,
give us a review on JED

Post Reply