Je suis en train de refaire mon site de galerie photos.
Je passe actuellement par MySQL pour circuler entre les différentes galeries.
Je me demande si cela ne serait pas possible de passe à la place par XML
Qu'en pensez vous.
Mon code (galerie PHP) :
<?php
echo("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Hervé Dunoyer-Galerie Beauté</title>
<meta name="description" content="Photographe Beauté réalise vos publicités et éditoriaux " />
<meta name="robots" content="index,follow" />
<meta name="revisit-after" content="1 days" />
<meta name="classification" content="Photographe beauté" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="librairie/CSS/style.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body>
<div id="topstrip">
<!-- Fin du div topstrip -->
</div>
<div id="topnav">
<?php
$pageName = "Galerie";
include ("templates/haut3.php");
?>
<!-- Fin du div topnav -->
</div>
<table border="0" cellspacing="10" cellpadding="0">
<tr>
<td >
<div id="sidenav">
<?php
$sous_pageName = "Beaute";
include ("templates/cote3.php");
?>
<!--- Fin Div sidenav --->
</div>
</td>
<td >
<?php
$Pos=intval($_GET["serie"]);
$sql_image = "SELECT imageRefImage FROM tblImage WHERE imageSerieId=$Pos " ;
$result_image = mysql_query($sql_image)or exit ('Erreur SQ_image !'.$sql_image.'<br>'.mysql_error());
$nblignes = mysql_num_rows($result_image);
?>
<?php
while ($data_image=mysql_fetch_array($result_image))
{
?>
<td>
<?php
echo "<img src=images/{$data_image['imageRefImage']} height=420 >";
?>
</td>
<?php
}
?>
</tr>
</table>
<div id="footer">
<?php
include ("./templates/bas3.php");
?>
<!--- Fin Div footer --->
</div>
</body>
</html>
Mon code cote3.php :<h2>Portfolio</h2>
<?php
include("Connexion/connexion.php");
$query = "SELECT * FROM tblSerie WHERE serieAffiche=1 ORDER BY serieTri";
$result = mysql_query($query) or exit ('Erreur SQL_theme !'.$result.'<br>'.mysql_error());
$nblignes = mysql_num_rows($result);
?>
<table>
<tr>
<?php
$tab=array();
$cpt=0;
while ($data=mysql_fetch_array($result))
{
?>
<td >
<?php
echo "<a href=galerie.php?serie={$data['serieId']}><img src=thumbs/{$data['serieRefVignette']} >";
$path = "thumbs/$data[serieRefVignette]";
?>
</td>
<?php //affichage
$tab[]=$data['serieId'];
$cpt++;
if (($cpt % 3 == 0) || ($cpt==$nblignes))
{
echo "</tr><tr>";
array_splice ($tab, 0); // remise a zéro du tableau
}
} //fin du while
?>
</tr>
</table>