Je suis en train de bloquer sur une limitation d'affiche.
Il s'agit d'une fiche produit. A gauche j'affiche le produit et à droite les autres poduits de la même marque. Je veux que la liste à droite soit limité à deux affichages, qu'il n'affiche pas de vignette si c'est le même produit que à gauche et que si pour une même marque il y a plus de 3 produits, il m'affiche un lien vers la liste complète.
J'ai fait ce code avec tous ces paramêtres mais du coup comme il me compte deux d'affichage max, il me compte dans les deux celui qui ne doit pas apparaître donc je me retrouve plus qu'avez 1 affichage :
http://www.rumbero-design.com/levy/fr/f ... te=Encinas
Voici le code :
<?
$query3 = "SELECT * FROM catalogue WHERE nom_artiste='$nomget' AND statut_catalogue='online'";
$result3 = mysql_query($query3)
or die (mysql_error());
$nbResults = mysql_num_rows($result3);
if($nbResults == 1){}
elseif($nbResults > 3){
echo"<table width='100%' border='0' align='center'><tr><td align='center'><br><br></td></tr>";
$i = 0;
while (($ligne3 = mysql_fetch_array($result3)) !== false) {
extract($ligne3);
if($id_catalogue == $idget){}
elseif($type_catalogue == "peinture"){
echo"<tr><td>
<table width='192' border='0' cellpadding='0' cellspacing='0' class='bg_vignette' align='center'>
<tr><td align='center' valign='bottom'><a href='fiche.php?id_catalogue=$id_catalogue&prenom_artiste=$prenom_artiste&nom_artiste=$nom_artiste'>
<img src='../img_s/$image_s' border='0' width='178' height='134'>
</a></td>
</tr>
<tr>
<td height='42'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0' class='bg_languette'>
<tr>
<td align='center' valign='top'><table width='156' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align='center' valign='middle' class='td_languette_lien'></td>
</tr>
<tr>
<td align='center' valign='top' class='td_languette_peinture'></td>
</tr>
</table></td>
</tr>
</table></td></tr>
</table></td></tr>
";}
elseif($type_catalogue == "sculpture"){
echo"<tr><td>
<table width='192' border='0' cellpadding='0' cellspacing='0' class='bg_vignette' align='center'>
<tr><td align='center' valign='bottom'><a href='fiche.php?id_catalogue=$id_catalogue&prenom_artiste=$prenom_artiste&nom_artiste=$nom_artiste'><img src='../img_s/$image_s' border='0' width='178' height='134'></a></td>
</tr>
<tr>
<td height='42'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0' class='bg_languette'>
<tr>
<td align='center' valign='top'><table width='156' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align='center' valign='middle' class='td_languette_lien'></td>
</tr>
<tr>
<td align='center' valign='top' class='td_languette_sculpture'></td>
</tr>
</table></td>
</tr>
</table></td></tr>
</table></td></tr>
";}
else{
echo"<tr><td>
<table width='192' border='0' cellpadding='0' cellspacing='0' class='bg_vignette' align='center'>
<tr><td align='center' valign='bottom'><a href='fiche.php?id_catalogue=$id_catalogue&prenom_artiste=$prenom_artiste&nom_artiste=$nom_artiste'><img src='../img_s/$image_s' border='0' width='178' height='134'></a></td>
</tr>
<tr>
<td height='42'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0' class='bg_languette'>
<tr>
<td align='center' valign='top'><table width='156' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align='center' valign='middle' class='td_languette_lien'></td>
</tr>
<tr>
<td align='center' valign='top' class='td_languette_mobilier'></td>
</tr>
</table></td>
</tr>
</table></td></tr>
</table></td></tr>
";}
$i ++;
if ($i % 2 == 0 && $i != $nbResults) {
break;
}
}
echo"<tr><td valign='bottom' align='right'><a href='browse_fiche.php?prenom_artiste=$prenom_artiste&nom_artiste=$nom_artiste'><img src='img/bt_voir_oeuvres.jpg' border='0'></a></td></tr></table>";}
else{
echo"<table width='100%' border='0' align='center'><tr><td align='center'><br><br></td></tr>";
$i = 0;
while (($ligne3 = mysql_fetch_array($result3)) !== false) {
extract($ligne3);
if($id_catalogue == $idget){}
elseif($type_catalogue == "peinture"){
echo"<tr><td>
<table width='192' border='0' cellpadding='0' cellspacing='0' class='bg_vignette' align='center'>
<tr><td align='center' valign='bottom'><a href='fiche.php?id_catalogue=$id_catalogue&prenom_artiste=$prenom_artiste&nom_artiste=$nom_artiste'><img src='../img_s/$image_s' border='0' width='178' height='134'></a></td>
</tr>
<tr>
<td height='42'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0' class='bg_languette'>
<tr>
<td align='center' valign='top'><table width='156' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align='center' valign='middle' class='td_languette_lien'><a href='fiche.php?id_catalogue=$id_catalogue&prenom_artiste=$prenom_artiste&nom_artiste=$nom_artiste'><img src='img/bt_en_savoir_plus.jpg' border='0'></a></td>
</tr>
<tr>
<td align='center' valign='top' class='td_languette_peinture'></td>
</tr>
</table></td>
</tr>
</table></td></tr>
</table></td></tr>
";}
elseif($type_catalogue == "sculpture"){
echo"<tr><td>
<table width='192' border='0' cellpadding='0' cellspacing='0' class='bg_vignette' align='center'>
<tr><td align='center' valign='bottom'><a href='fiche.php?id_catalogue=$id_catalogue&prenom_artiste=$prenom_artiste&nom_artiste=$nom_artiste'><img src='../img_s/$image_s' border='0' width='178' height='134'></a></td>
</tr>
<tr>
<td height='42'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0' class='bg_languette'>
<tr>
<td align='center' valign='top'><table width='156' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align='center' valign='middle' class='td_languette_lien'><a href='fiche.php?id_catalogue=$id_catalogue&prenom_artiste=$prenom_artiste&nom_artiste=$nom_artiste'><img src='img/bt_en_savoir_plus.jpg' border='0'></a></td>
</tr>
<tr>
<td align='center' valign='top' class='td_languette_sculpture'></td>
</tr>
</table></td>
</tr>
</table></td></tr>
</table></td></tr>
";}
else{
echo"<tr><td>
<table width='192' border='0' cellpadding='0' cellspacing='0' class='bg_vignette' align='center'>
<tr><td align='center' valign='bottom'><a href='fiche.php?id_catalogue=$id_catalogue&prenom_artiste=$prenom_artiste&nom_artiste=$nom_artiste'><img src='../img_s/$image_s' border='0' width='178' height='134'></a></td>
</tr>
<tr>
<td height='42'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0' class='bg_languette'>
<tr>
<td align='center' valign='top'><table width='156' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align='center' valign='middle' class='td_languette_lien'><a href='fiche.php?id_catalogue=$id_catalogue&prenom_artiste=$prenom_artiste&nom_artiste=$nom_artiste '><img src='img/bt_en_savoir_plus.jpg' border='0'></a></td>
</tr>
<tr>
<td align='center' valign='top' class='td_languette_mobilier'></td>
</tr>
</table></td>
</tr>
</table></td></tr>
</table></td></tr>
";}
$i ++;
if ($i % 2 == 0 && $i != $nbResults) {
break;
}
}
echo"</table>";}
?>
Merci pour votre aide !