tags:

views:

22

answers:

2

Hello all,

Consider the following :

$img_pathm = JURI::root().'images/properties/images/'.$this->datos->id.'/';
$peque_path = JURI::root().'images/properties/images/thumbs/'.$this->datos->id.'/';

$result = count($this->Images);
$resultf = $result-1;

while ($resultf>=0){ ?>

<span class="editlinktip hasTip" title="<?php echo $this->datos->image1;?>::

<img border=&quot;1&quot; src=&quot;<?php echo $peque_path.$this->Images[$resultf]->name; ?>&quot; name=&quot;imagelib&quot; alt=&quot;<?php echo JText::_( 'No preview available'.$img_pathm ); ?>&quot; width=&quot;206&quot; height=&quot;100&quot; />">

<img src="<?php echo $peque_path.$this->Images[$resultf]->name; ?>" alt="Additional image <?php echo $resultf+1 ?>" width="65px" height="50px"/></span>  <?php

$resultf--; }

This currently prints images one after the other. All I need to do is to invert the order in which these images are printed to the user. I am not sure where, or how I would insert something similar to ORDER by in this code? Thanks in advance!

A: 

Maybe you can use array_reverse

ign
+1  A: 

Just loop the other way:

$img_pathm = JURI::root().'images/properties/images/'.$this->datos->id.'/';
$peque_path = JURI::root().'images/properties/images/thumbs/'.$this->datos->id.'/';

$result = count($this->Images);
$resultf = 0;

while ($resultf<$result){ ?>

<span class="editlinktip hasTip" title="<?php echo $this->datos->image1;?>::

<img border=&quot;1&quot; src=&quot;<?php echo $peque_path.$this->Images[$resultf]->name; ?>&quot; name=&quot;imagelib&quot; alt=&quot;<?php echo JText::_( 'No preview available'.$img_pathm ); ?>&quot; width=&quot;206&quot; height=&quot;100&quot; />">

<img src="<?php echo $peque_path.$this->Images[$resultf]->name; ?>" alt="Additional image <?php echo $resultf+1 ?>" width="65px" height="50px"/></span>  <?php

$resultf++; }
Jage
Thanks, that did it!
skarama