It is currently Tue Nov 13, 2018 2:49 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Shuffle
PostPosted: Tue Oct 09, 2012 1:43 pm 
Offline

Joined: Tue Oct 09, 2012 1:40 pm
Posts: 1
Hi, is it possible to make the images appear in a random order? to have them on a shuffle setting?


Top
 Profile  
 
 Post subject: Shuffle
PostPosted: Tue Oct 09, 2012 1:43 pm 
Top  
 Post subject: Re: Shuffle
PostPosted: Thu Oct 11, 2012 5:35 pm 
Offline
Developer
Developer
User avatar

Joined: Sat Aug 14, 2010 9:31 pm
Posts: 1241
Location: Novi Sad, Serbia
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:
     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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

 


All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

This is the official Admiror Joomla! Community Forum. You are welcome to join the Admiror Joomla! Community. All Admiror Joomla! Extensions Users, Joomla! Developers, PHP or mySQL Developers are welcome to support & contribute to Admiror Joomla! Projects.

Joomla! is a free and open source content management system (CMS) for publishing content on the World Wide Web and intranets. With a vibrant volunteer community, user-friendly features and plenty of power, Joomla is perfect for your website!

Joomla! is written in PHP, uses object-oriented programming (OOP) techniques and software patterns, stores data in a MySQL database, and includes features such as page caching, RSS feeds, printable versions of pages, news flashes, blogs, polls, search, and support for language internationalization.

Joomla! is the property of Open Source Matters, Inc. All rights reserved. Read more about Joomla! at http://www.joomla.org/.


Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group