1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| <?php
$req_galerie = "SELECT * FROM photos_refuge";
$result_galerie = mysql_query($req_galerie);
$tab_photo = array();
$tab_width = array();
for( $i = 0 ; $i < mysql_num_rows( $result_galerie ) ; $i++ )
{
$photo = mysql_result( $result_galerie, $i, 'url' );
$width = mysql_result( $result_galerie, $i, 'width' );
$height = mysql_result( $result_galerie, $i, 'height' );
$tab_photo[] = $photo;
$tab_width[] = $width;
$tab_height[] = $height;
if( $width > $height )
{
?>
<input type="hidden" value='<?php echo $width; ?>' name='paysage' id="paysage">
<img name="icone" src="galerie/<?php echo $photo; ?>" width=40 height=30 onmouseover="changer()" /></li>
<?php
}
else
{
?>
<img name="icone" src="galerie/<?php echo $photo; ?>" width=30 height=40 onmouseover="changer()" /></li>
<?php
}
}
?>
</ul>
<br>
<dl id="photo">
<?php
if( $tab_width[0] > $tab_height[0] )
{
?>
<dd><img name="big1" src="galerie/<?php echo $tab_photo[0]; ?>" width=400 height=300 /></dd>
<?php
}
else
{
?>
<dd><img name="big1" src="galerie/<?php echo $tab_photo[0]; ?>" width=300 height=400 /></dd>
<?php
}
?> |
Partager