pb avec limitaiton d'affichage

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : pb avec limitaiton d'affichage

par Hywan » 01 mars 2007, 19:41

Bonsoir :)

Penses à mettre Résolu si ton problème est bel et bien résolu ;-)

par xencinas » 01 mars 2007, 18:34

:shock:

pas pensé. la honte... Merci !

par VaN » 01 mars 2007, 18:31

Je ne comprends pas bien le problème, mais pourquoi ne mets tu pas une condition dasn la requete qui affiche la liste des produits annexes ?

du genre

Code : Tout sélectionner

WHERE article_id != '".$id_main_article."'"
où article_id est l'indentifiant unique dans ta table (je ne connais pas son nom), et $id_main_article, l'identifiant du produit que tu souhaite exclure de la liste, car il est affiché en gros a coté.

par xencinas » 01 mars 2007, 17:50

personne ? :cry:

pb avec limitaiton d'affichage

par xencinas » 24 févr. 2007, 16:44

Bonjour,

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 !