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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
<?php
require_once('dyn/lib/app.php');
require("_includes/bdacc.php");
require("_includes/comp.php");
require("dyn/settings/config.php");
$id_prog = $_GET['picture'];
$galerie = isGalerie($id_prog, $db);
define ("NBRE_COLONNES", 12);
if(isset($_GET['selec']) && ($_GET['selec']) != ""){$premier=$_GET['selec'];}
else{$premier = selectionPremier($id_prog, $db);}
// ********************* FONCTIONS **********************
function isGalerie($id_prog, $db)
{
$sql = "SELECT * FROM galery WHERE galery.idp=".$id_prog;
$res=mysql_db_query($db, $sql);
$galerie = array();
while($rs=mysql_fetch_object($res))
{
// Créer le lien
// $lien = DYNPROGURL.$rs->lien_image;
if( $rs->local )
{
$lien = DYNPROGURL.$rs->lien_image;
}else{
$lien = $rs->lien_image;
}
$galerie[]= array(
'nom_image' => $rs->nom_image,
'com_image' => $rs->com_image,
'lien_image' => $lien,
);
}
return $galerie;
}
function selectionPremier($id_prog, $db)
{
$sql = "SELECT * FROM galery WHERE galery.idp=".$id_prog." LIMIT 1";
$res=mysql_db_query($db, $sql);
$rs=mysql_fetch_object($res);
if( $rs->local )
{
$lien = DYNPROGURL.$rs->lien_image;
}else{
$lien = $rs->lien_image;
}
return $lien;
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<div><a href="#" onClick="self.close();">Fermer la fenêtre</a></div>
<table width="100" border="0" align="center" cellpadding="0" cellspacing="0" height="550">
<tr>
<td width="15px" valign="center"><img src="images/fleche_g.gif" alt="Précédent" style="margin-right:15px" /></td>
<td valign="center"><div align="center">
<img style="border:1px solid #c2c2c2" alt="Diaporama" src="<?=$premier;?>">
</div>
</td>
<td width="15px" valign="center"><img src="images/fleche_d.gif" alt="Suivant" style="margin-left:15px" /></td>
</tr>
<tr height="0"><td colspan="3"></td></tr>
</table>
<table align="center">
<tr><td align="center" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#666;">Cliquez sur une photo pour l'agrandir</td></tr>
<tr><td height="5"></td></tr>
</table>
<div align="center">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<?php
$compteur = 1;
foreach($galerie as $k=>$v){
if ($compteur % NBRE_COLONNES == 1) {
echo ('</tr><tr>'); } ?>
<td style="padding:5px 5px 1px 5px;" align="center">
<a href="photos.php?picture=<?=$id_prog;?>&selec=<?=$v['lien_image'];?>">
<img style="border:1px solid #c2c2c2" name="<?=$v['nom_image'];?>" src="<?=$v['lien_image'];?>" width="40" height="40" alt="<?=$v['com_image'];?>" title="<?=$v['com_image'];?>" border="0">
</a>
</td>
<? $compteur++; } ?>
</tr>
</table>
</div>
</body>
</html> |
Partager