public function bloc_gestion() { $image = new Image(); $query = "select * from {$image->table} where {$this->typeobjet}='{$this->idobjet}' order by classement"; $resul = $image->query($query); while ($resul && ($row = $image->fetch_object($resul))) { $imagedesc = new Imagedesc(); $imagedesc->charger($row->id, $this->lang); ?> <form action="<?php echo $this->nompageadmin; ?> " method="post"> <input type="hidden" name="action" value="modifierphoto" /> <input type="hidden" name="id_photo" value="<?php echo $row->id; ?> " /> <input type="hidden" name="id" value="<?php echo $this->idobjet; ?> " /> <input type="hidden" name="lang" value="<?php echo $this->lang; ?> " /> <?php $this->form_hidden_fieds(); ?> <ul> <li class="lignesimple"> <div class="cellule_designation" style="height:208px;"> </div> <div class="cellule_photos" style="height:200px; overflow:hidden;"><a href="<?php echo $this->chemin_objet($row->fichier); ?> " target="_blank"><img src="../fonctions/redimlive.php?type=<?php echo $this->typeobjet; ?> &nomorig=<?php echo $row->fichier; ?> &width=&height=200&opacite=&nb=" border="0" /></a></div> <div class="cellule_supp"><a onclick="return confirm('<?php echo trad('Supprimer définitivement cette image ?', 'admin'); ?> ');" href="<?php echo $this->url_page_admin(); ?> &id_photo=<?php echo $row->id; ?> &action=supprimerphoto"><img src="gfx/supprimer.gif" width="9" height="9" border="0" /></a></div> </li> <li class="lignesimple"> <div class="cellule_designation" style="height:30px;"><?php echo trad('Titre', 'admin'); ?> </div> <div class="cellule"> <input type="text" name="titre_photo" style="width:219px;" class="form" value="<?php echo htmlspecialchars($imagedesc->titre); ?> " /> </div> </li> <li class="lignesimple"> <div class="cellule_designation" style="height:50px;"><?php echo trad('Chapo', 'admin'); ?> </div> <div class="cellule"><textarea name="chapo_photo" rows="2"class="form" style="width:219px;"><?php echo $imagedesc->chapo; ?> </textarea></div> </li> <li class="lignesimple"> <div class="cellule_designation" style="height:65px;"><?php echo trad('Description', 'admin'); ?> </div> <div class="cellule"><textarea name="description_photo" class="form" rows="3"><?php echo $imagedesc->description; ?> </textarea></div> </li> <li class="lignesimple"> <div class="cellule_designation" style="height:30px;"><?php echo trad('Classement', 'admin'); ?> </div> <div class="cellule"> <div class="classement"> <a href="<?php echo $this->url_page_admin() . "&id_photo=" . $row->id . "&action=modclassementphoto&type=M"; ?> "><img src="gfx/up.gif" border="0" /></a></div> <div class="classement"> <a href="<?php echo $this->url_page_admin() . "&id_photo=" . $row->id . "&action=modclassementphoto&type=D"; ?> "><img src="gfx/dn.gif" border="0" /></a></div> </div> </li> <li class="lignesimple"> <div class="cellule_designation" style="height:30px;"> </div> <div class="cellule" style="height:30px; border-bottom: 1px dotted #9DACB6"><input type="submit" value="<?php echo trad('Enregistrer', 'admin'); ?> " /></div> </li> </ul> </form> <?php } }
function boucleImage($texte, $args) { // récupération des arguments $produit = lireTag($args, "produit", "int"); $id = lireTag($args, "id", "int"); $num = lireTag($args, "num", "int"); $nb = lireTag($args, "nb", "int"); $debut = lireTag($args, "debut", "int"); $deb = lireTag($args, "deb", "int"); $rubrique = lireTag($args, "rubrique", "int"); $largeur = lireTag($args, "largeur", "int"); $hauteur = lireTag($args, "hauteur", "int"); $dossier = lireTag($args, "dossier", "int"); $contenu = lireTag($args, "contenu", "int"); $opacite = lireTag($args, "opacite", "int"); $noiretblanc = lireTag($args, "noiretblanc", "int"); $miroir = lireTag($args, "miroir", "int"); $aleatoire = lireTag($args, "aleatoire", "int"); $exclusion = lireTag($args, "exclusion", "int_liste"); $exact = lireTag($args, "exact", "int"); $couleurfond = lireTag($args, "couleurfond", "string"); $source = lireTag($args, "source", "string"); $search = ""; $res = ""; $limit = ""; if ($deb != "") { $debut = $deb; } if ($aleatoire) { $order = "order by " . " RAND()"; } else { $order = " order by classement"; } if ($source != '') { $search .= " and {$source}=" . intval($id); } else { if ($id != "") { $search .= " and id=\"{$id}\""; } if ($produit != "") { $search .= " and produit=\"{$produit}\""; } if ($rubrique != "") { $search .= " and rubrique=\"{$rubrique}\""; } if ($dossier != "") { $search .= " and dossier=\"{$dossier}\""; } if ($contenu != "") { $search .= " and contenu=\"{$contenu}\""; } } if ($exclusion != "") { $search .= " and id not in({$exclusion})"; } $image = new Image(); if ($debut != "") { $debut--; } else { $debut = 0; } $query = "select * from {$image->table} where 1 {$search}"; if ($debut != "" && $num == "") { $num = CacheBase::getCache()->query_count($query); } if ($debut != "" || $num != "") { $limit .= " limit {$debut},{$num}"; } if ($nb != "") { $nb--; $limit .= " limit {$nb},1"; } $query = "select * from {$image->table} where 1 {$search} {$order} {$limit}"; $pr = new Produit(); $prdesc = new Produitdesc(); $rudesc = new Rubriquedesc(); $contenudesc = new Contenudesc(); $dossierdesc = new Dossierdesc(); $compt = 1; $result = CacheBase::getCache()->query($query); if ($result == "" || count($result) == 0) { return ""; } foreach ($result as $row) { $image = new Image(); $image->charger($row->id); $imagedesc = new Imagedesc(); $imagedesc->charger($image->id); $temp = $texte; // Compatibilité $temp = str_replace("#FGRANDE", "#FICHIER", $temp); $temp = str_replace("#FPETITE", "#FICHIER", $temp); $temp = str_replace("#GRANDE", "#IMAGE", $temp); $temp = str_replace("#PETITE", "#IMAGE", $temp); if ($image->produit != 0) { $type = "produit"; $pr->charger_id($image->produit); $prdesc->charger($image->produit); $temp = str_replace("#PRODTITRE", $prdesc->titre, $temp); $temp = str_replace("#PRODUIT", $image->produit, $temp); $temp = str_replace("#PRODREF", $pr->ref, $temp); $temp = str_replace("#RUBRIQUE", $pr->rubrique, $temp); } else { if ($image->rubrique != 0) { $type = "rubrique"; $rudesc->charger($image->rubrique); $temp = str_replace("#RUBRIQUE", $image->rubrique, $temp); $temp = str_replace("#RUBTITRE", $rudesc->titre, $temp); } else { if ($image->dossier != 0) { $type = "dossier"; $dosdesc = new Dossierdesc(); $dosdesc->charger($image->dossier); $temp = str_replace("#DOSSIER", $image->dossier, $temp); $temp = str_replace("#DOSTITRE", $dosdesc->titre, $temp); } else { if ($image->contenu != 0) { $type = "contenu"; $ctdesc = new Contenudesc(); $ctdesc->charger($image->contenu); $temp = str_replace("#CONTTITRE", $ctdesc->titre, $temp); $temp = str_replace("#CONTENU", $image->contenu, $temp); } } } } if ($type != "") { $nomcache = redim($type, $image->fichier, $largeur, $hauteur, $opacite, $noiretblanc, $miroir, 1, $exact, $couleurfond); if (!$largeur && !$hauteur) { $temp = str_replace("#IMAGE", "client/gfx/photos/{$type}/" . $image->fichier, $temp); } else { $temp = str_replace("#IMAGE", $nomcache, $temp); } $temp = str_replace("#FICHIER", "client/gfx/photos/{$type}/" . $image->fichier, $temp); } $temp = str_replace("#ID", $image->id, $temp); $temp = str_replace("#TITRE", $imagedesc->titre, $temp); $temp = str_replace("#CHAPO", $imagedesc->chapo, $temp); $temp = str_replace("#DESCRIPTION", $imagedesc->description, $temp); $temp = str_replace("#COMPT", "{$compt}", $temp); $temp = str_replace("#NOMCACHE", "{$nomcache}", $temp); $temp = str_replace("#CACHE", "{$nomcache}", $temp); $compt++; $res .= $temp; } return $res; }