DISPLAYING NEWEST IMAGES FIRST - Aug 3rd, 2010


NigelGordijk asked if there was a way to display images as newest at the top of a gallery instead of the oldest images
first.

As usual, Dave Edis from Interactive Tools had the perfect solution. He said:

You can reverse the order with array_reverse().

If your current code looks something like this:

<?php foreach ($record['uploads'] as $upload): ?>

Just add "array_reverse" to your code:



<?php foreach (array_reverse($record['uploads']) as $upload): ?>



Thanks Dave.



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service