Hola amigos tengo un problemita con la logica
y bueno necesito su ayuda.
Resulta que me baje una libreria de php para imagenes que es super util pero para mostrar las imagenes primero mete los parametros en arrays:
Código PHP:
<?php
$phpThumbBase = 'phpThumb.php';
$img['portrait'] = 'images/1.jpg';
$img['portrait2'] = 'images/2.jpg';
$img['portrait3'] = 'images/3.jpg';
$img['portrait4'] = 'images/4.jpg';
$img['portrait5'] = 'images/5.jpg';
$Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['portrait'].'&w=106&h=112&far=C&bg=FE9900&f=png&fltr[]=bord|1'), 'description' => 'Mi imagen');
$Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['portrait2'].'&w=106&h=112&far=C&bg=FE9900&f=png&fltr[]=bord|1'), 'description' => 'Mi imagen2');
$Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['portrait3'].'&w=106&h=112&far=C&bg=FE9900&f=png&fltr[]=bord|1'), 'description' => 'Mi imagen3');
$Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['portrait4'].'&w=106&h=112&far=C&bg=FE9900&f=png&fltr[]=bord|1'), 'description' => 'Mi imagen4');
$Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['portrait5'].'&w=106&h=112&far=C&bg=FE9900&f=png&fltr[]=bord|1'), 'description' => 'Mi imagen5');
?>
Y para mostrarlos usa 2 foreach llamando dtos de una clase:
Código PHP:
<table border="1">
<tr>
<?php
foreach ($Examples as $key => $ExamplesArray) {
$text = '';
foreach ($ExamplesArray['getstrings'] as $dummy => $GETstring) {
echo '<td style="padding: 20px;">';
if ($GETstring == "\n") {
echo '<br>';
$text .= "\n";
} else {
echo '<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><a href="detalle.html"><img border="0" src="'.htmlentities($GETstring).'" alt="'.$ExamplesArray['description'].'"></a></td>
</tr>
<tr>
<td height="14" align="center" class="fontGallery"><a href="#" class="enlaceGallery">Ref. 0004</a> </td>
</tr>
</table>';
echo '</a> ';
}
echo '</td>';
}
}
?>
</tr>
</table>
Bueno en este caso yo muestro los datos en
una fila y se distribuye en columnas del mismo numero que imagenes.
Lo que yo deseo es que se muestren 4 imagenes por columnas asi varien el numero de imagenes.... y me enreda un poco en donde preguntar si se ha llegado a 4 columnas, me podrian ayudar?