besoin d'aide pour petit site d'enchère

seb72000
Invité n'ayant pas de compte PHPfrance

07 août 2011, 14:42

Bonjour,
J'ai un petit soucis, je suis entrain de créer un petit site d'enchère et je souhaiterais ajouter une image en miniature (30x30) à gauche du titre de chaque annonce, mais j'ai beau regarder sur les forums ou dans google, je ne trouve rien. La seule façon que j'ai trouvais pour mettre une miniature devant le titre de l'annonce c'est grâce au code html d'une image que j'applique directement dans la designation de l'annonce ex: <img src="http://www.tv-foot.fr/images/Minerai-de-fer2.jpg" />Minerai de fer
<br />. Lorsqu'un utilisateur souhaite vendre un objet, il doit ajouter une image (redimensionné à 100px × 100px) pour son annonce, mais celle-ci ce place directement dans l'annonce, et-il possible que cette même image puisse être repris et redimensionné en (30px x 30px) et placé automatique devant le titre de l'annonce?
Si oui est-ce que qu'une âme charitable peux m'aider a réaliser cela?

J'ai passer pas mal de temps à modifier le script, malgrès le fait que je ne soit pas très doué en programmation, c'est un projet auquel je tiens et que je souhaiterais emmener à son terme.

Voici l'adresse provisoire de mon site: http://www.tv-foot.fr/achat_rubrique.php?parent=0


(Ps: Je ne connais pas grand chose en programmation et le script (phpdeal) n'est pas terrible, je sais, alors svp, pour ceux et celles qui sont là pour n'apporter qu'une critique non constructive, abstenez vous svp, évitez de polluer le post pour des choses que l'ont sait déjà, ex: ce script est nul, va apprendre à programmer etc..., merci)

seb72000
Invité n'ayant pas de compte PHPfrance

07 août 2011, 16:00

Je pense que la modification à faire et dans ce fichier.

<?
require("data/tools.inc.php");
$nav=Navigation($parent,$mysql_link);
require("data/header.inc.php");
require("data/options.inc.php");
?>
<?
if($howrub=="column") {
if($parent=="0") {
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="200" valign="top">
	
	<table width="100%" border="0" cellspacing="15" cellpadding="0">
  		<tr>
<td bgcolor="#cccccc"></td>
		</tr>
    		<div id='obj_2581' style='position:absolute; left:8px; top:294px; width:200px; height:30px; z-index:8'><img src='http://www.tv-foot.fr/images/Rubriques-3.jpg' width='200' height='30' border='0'></div>
	</table>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
  		<tr>
    		<td valign="top">
      		<table width="100%" border="0" cellspacing="0" cellpadding="0">
        <?
        $balise=0;
        $query = "SELECT nom,id_rubrique FROM deal_rubriques WHERE parent='$parent'";
        $mysql_result = mysql_query($query,$mysql_link);
        while($row = mysql_fetch_array($mysql_result))
               {
               $nom=$row[0];
               $rubrique=$row[1];
               $inventaire=Inventaire($rubrique,$mysql_link);
               $line=$balise/2;
               $isset_rubrique="y";
               if(is_integer($line))
                 {
                 echo "<tr><td width=\"2\" bgcolor=\"$bg1color\"><img src=\"images/transparent.gif\" width=\"1\" height=\"1\"></td>
				 <td>&nbsp;<a href=\"achat_rubrique.php?parent=$rubrique\"><font color=\"$textcolor\">$nom</font></a> ($inventaire)</td>
				 <td width=\"2\" bgcolor=\"$bg1color\"><img src=\"images/transparent.gif\" width=\"1\" height=\"1\"></td></tr>";
                 $balise++;
                 }
               else
                 {
                 echo "<tr bgcolor=\"$bg2color\"><td width=\"2\" bgcolor=\"$bg1color\"><img src=\"images/transparent.gif\" width=\"1\" height=\"1\"></td>
				 <td>&nbsp;<a href=\"achat_rubrique.php?parent=$rubrique\"><font color=\"$textcolor\">$nom</font></a> ($inventaire)</td>
				 <td width=\"2\" bgcolor=\"$bg1color\"><img src=\"images/transparent.gif\" width=\"1\" height=\"1\"></td></tr>";
                 $balise++;
                 }
               }
        if($isset_rubrique!="y") {
        echo "<tr><td colspan=\"3\"><i>Aucune sous-rubrique n'est disponible.</i></td></tr>";
        }
        ?>
      		</table>
    		</td>    
  		</tr>
		<tr bgcolor="<? echo "$bg1color" ?>">
    		<td colspan="3" height="2"><img src="images/transparent.gif" width="1" height="1"></td>
  		</tr>
<td><br><a href="http://www.tv-foot.fr/achat_rubrique.php?parent=1"><img src="http://www.tv-foot.fr/images/pub-100-500-1000po.gif" /></a></td>
  	</table>
	</td>
    <td width=3><img src="images/transparent.gif" width="1" height="1"></td>
	<td valign="top">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
  		<? if($okedito=="yes") { ?>
		<tr bgcolor="<? echo "$bg1color" ?>">
    		<td width="2"><img src="images/transparent.gif" width="1" height="1"></td>
			<td width="1">&nbsp;</td>
			<td colspan="2"><b>E</b>ditorial</td>
			<td width="2"><img src="images/transparent.gif" width="1" height="1"></td>			
  		</tr>
		<tr>
    		<td width="2" bgcolor="<? echo "$bg1color" ?>"><img src="images/transparent.gif" width="1" height="1"></td>
			<td width="1">&nbsp;</td>
			<td colspan="2">
			<?
			$contentedito=ereg_replace("([^>])\n","\\1<BR>\n",$contentedito);
			echo "$contentedito";
			?>
			</td>
			<td width="2" bgcolor="<? echo "$bg1color" ?>"><img src="images/transparent.gif" width="1" height="1"></td>			
  		</tr>
		<tr bgcolor="<? echo "$bg1color" ?>">
    		<td colspan="5" height="2"><img src="images/transparent.gif" width="1" height="1"></td>
		</tr>
		<tr>
    		<td colspan="5" height="3"><img src="images/transparent.gif" width="1" height="1"></td>
		</tr>
		<?
		}
		if($affichnext!="0" and $affichnext!="") { ?>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<div id='obj_2581' style='position:absolute; left:211px; top:294px; width:788px; height:300px; z-index:8'><img src='http://www.tv-foot.fr/images/banniere-centrale.jpg' width='788' height='300' border='0'></div>

		<tr bgcolor="<? echo "$bg1color" ?>">
    		<td width="2"><img src="images/transparent.gif" width="1" height="1"></td>
			
			<td><img src="http://www.tv-foot.fr/images/vente-se-terminant-3.jpg" /></td>
		
			<td width="1"><img src="images/transparent.gif" width="1" height="1"></td>			
  		</tr>
		<tr>
			<td width="1" bgcolor="<? echo "$bg1color" ?>"><img src="images/transparent.gif" width="1" height="1"></td>
			<td colspan="0">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
  			<tr>
    			<td width="35%">&nbsp;Objets en vente : </td>
    			<td width="21%">Mise &agrave; prix :</td>
    			<td width="21%">Prix actuel :</td>
    			<td width="23%">Fin de l'ench&egrave;re :</td>
  			</tr>
  			<tr bgcolor="<? echo "$bg1color" ?>">
    			<td colspan="4" height="2"><img src="images/transparent.gif" width="1" height="1"></td>
  			</tr>
		</table>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
$balise=0;
$query = "SELECT deal_articles.*,deal_rubriques.nom,deal_rubriques.id_rubrique FROM deal_articles,deal_rubriques WHERE deal_rubriques.id_rubrique=deal_articles.id_rubrique AND deal_articles.en_ligne='Y' ORDER BY deal_articles.fin ASC LIMIT 0,$affichnext";
$mysql_result = mysql_query($query,$mysql_link);
while($row = mysql_fetch_array($mysql_result))
       {
       $designation=stripslashes($row["designation"]);
       $devise=$row["devise"];
       $prix_depart=$row["prix_depart"];
       $prix_actuel=$row["prix_actuel"];
       $fin=DateFrench($row["fin"]);
       $id_article=$row["id_article"];
       $rubrique=$row["nom"];
       $numero=$row["id_rubrique"];
       $line=$balise/2;
       $isset_site="y";
       if(is_integer($line))
          {
          echo "<tr>";
          $balise++;
          }
       else
          {
          echo "<tr bgcolor=\"$bg2color\">";
          $balise++;
          }
       echo "<td width=\"35%\">&nbsp;<a href=\"in_article.php?id_article=$id_article&id_rubrique=$numero&rubrique=$rubrique\"><font color=\"$textcolor\">$designation</font></a></td>
       <td width=\"21%\">$prix_depart $devise</td>
       <td width=\"21%\">$prix_actuel $devise</td>
       <td width=\"23%\">$fin</td>
       </tr>";
       }
if($isset_site!="y") {
echo "<tr>
<td colspan=\"4\"><i>Aucun objet en vente actuellement.</i></td>
</tr>";
}
?>
  			<tr bgcolor="<? echo "$bg1color" ?>">
    			<td colspan="4" height="2"><img src="images/transparent.gif" width="1" height="1"></td>
  			</tr>
		</table>
		</td>
		<td width="2" bgcolor="<? echo "$bg1color" ?>"><img src="images/transparent.gif" width="1" height="1"></td>			
  		</tr>
		<tr>
    		<td colspan="5" height="20"><img src="images/transparent.gif" width="1" height="1"></td>
		</tr>
		<?
		}
		if($topview!="0" and $topview!="") { ?>
		<tr bgcolor="<? echo "$bg1color" ?>">
    		<td width="2"><img src="images/transparent.gif" width="1" height="1"></td>
			
			<td><img src="http://www.tv-foot.fr/images/objets-les-plus-consultes.jpg" /></td>
			
			<td width="2"><img src="images/transparent.gif" width="1" height="1"></td>			
  		</tr>
		<tr>
			<td width="2" bgcolor="<? echo "$bg1color" ?>"><img src="images/transparent.gif" width="1" height="1"></td>
			<td colspan="0">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
  			<tr>
    			<td width="35%">&nbsp;Objets en vente : </td>
    			<td width="21%">Mise &agrave; prix :</td>
    			<td width="21%">Prix actuel :</td>
    			<td width="23%">Fin de l'ench&egrave;re :</td>
  			</tr>
  			<tr bgcolor="<? echo "$bg1color" ?>">
    			<td colspan="4" height="2"><img src="images/transparent.gif" width="1" height="1"></td>
  			</tr>
		</table>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
$balise=0;
$query = "SELECT deal_articles.*,deal_rubriques.nom,deal_rubriques.id_rubrique FROM deal_articles,deal_rubriques WHERE deal_rubriques.id_rubrique=deal_articles.id_rubrique AND deal_articles.en_ligne='Y' ORDER BY deal_articles.views DESC LIMIT 0,$topview";
$mysql_result = mysql_query($query,$mysql_link);
while($row = mysql_fetch_array($mysql_result))
       {
       $designation=stripslashes($row["designation"]);
       $devise=$row["devise"];
       $prix_depart=$row["prix_depart"];
       $prix_actuel=$row["prix_actuel"];
       $fin=DateFrench($row["fin"]);
       $id_article=$row["id_article"];
       $rubrique=$row["nom"];
       $numero=$row["id_rubrique"];
       $line=$balise/2;
       $isset_site="y";
       if(is_integer($line))
          {
          echo "<tr>";
          $balise++;
          }
       else
          {
          echo "<tr bgcolor=\"$bg2color\">";
          $balise++;
          }
       echo "<td width=\"35%\">&nbsp;$balise.&nbsp;<a href=\"in_article.php?id_article=$id_article&id_rubrique=$numero&rubrique=$rubrique\"><font color=\"$textcolor\">$designation</font></a></td>
       <td width=\"21%\">$prix_depart $devise</td>
       <td width=\"21%\">$prix_actuel $devise</td>
       <td width=\"23%\">$fin</td>
       </tr>";
       }
if($isset_site!="y") {
echo "<tr>
<td colspan=\"4\"><i>Aucun objet en vente actuellement.</i></td>
</tr>";
}
?>
  			<tr bgcolor="<? echo "$bg1color" ?>">
    			<td colspan="4" height="2"><img src="images/transparent.gif" width="1" height="1"></td>
  			</tr>
		</table>
		</td>
		<td width="2" bgcolor="<? echo "$bg1color" ?>"><img src="images/transparent.gif" width="1" height="1"></td>			
  		</tr>
		<tr>
    		<td colspan="5" height="3"><img src="images/transparent.gif" width="1" height="1"></td>
		</tr>
		<? } ?>		
	</table>
	</td>
  </tr>
</table>
<?
}
else {
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td width="50%"><b>L</b>iste des
    sous-rubriques disponibles :</td>
    <td width="50%">
      <div align="right">[<a href="recherche.php"><font color="<? echo "$textcolor" ?>">Rechercher
        une ench&egrave;re</font></a>]</div>
    </td>
  </tr>
</table>
<?
$query = "SELECT id_rubrique FROM deal_rubriques WHERE parent='$parent'";
$resu = mysql_query($query,$mysql_link);
$rows = mysql_num_rows($resu);
$demi=$rows/2;
if(!is_integer($demi))
  {
  $demie=$demi;
  $demi=intval($demi)+1;
  }
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <?
        $balise=0;
        $query = "SELECT nom,id_rubrique FROM deal_rubriques WHERE parent='$parent' limit 0, $demi";
        $mysql_result = mysql_query($query,$mysql_link);
        while($row = mysql_fetch_array($mysql_result))
               {
               $nom=$row[0];
               $rubrique=$row[1];
               $inventaire=Inventaire($rubrique,$mysql_link);
               $line=$balise/2;
               $isset_rubrique="y";
               if(is_integer($line))
                 {
                 echo "<tr><td>• <a href=\"achat_rubrique.php?parent=$rubrique\"><font color=\"$textcolor\">$nom</font></a> ($inventaire)</td></tr>";
                 $balise++;
                 }
               else
                 {
                 echo "<tr bgcolor=\"$bg2color\"><td>• <a href=\"achat_rubrique.php?parent=$rubrique\"><font color=\"$textcolor\">$nom</font></a> ($inventaire)</td></tr>";
                 $balise++;
                 }
               }
        if($isset_rubrique!="y") {
        echo "<tr><td><i>Aucune sous-rubrique n'est disponible.</i></td></tr>";
        }
        ?>
      </table>
    </td>
    <td valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <?
        $balise=0;
        $query = "SELECT nom,id_rubrique FROM deal_rubriques WHERE parent='$parent' limit $demi, $demi";
        $mysql_result = mysql_query($query,$mysql_link);
        while($row = mysql_fetch_array($mysql_result))
               {
               $nom=$row[0];
               $rubrique=$row[1];
               $inventaire=Inventaire($rubrique,$mysql_link);
               $line=$balise/2;
               if(is_integer($line))
                 {
                 echo "<tr><td>• <a href=\"achat_rubrique.php?parent=$rubrique\"><font color=\"$textcolor\">$nom</font></a> ($inventaire)</td></tr>";
                 $balise++;
                 }
               else
                 {
                 echo "<tr bgcolor=\"$bg2color\"><td>• <a href=\"achat_rubrique.php?parent=$rubrique\"><font color=\"$textcolor\">$nom</font></a> ($inventaire)</td></tr>";
                 $balise++;
                 }
               }
        if(isset($demie))
           {
           $line=$balise/2;
           if(is_integer($line))
                 {
                 echo "<tr><td>&nbsp;</td></tr>";
                 }
           else
                 {
                 echo "<tr bgcolor=\"$bg2color\"><td>&nbsp;</td></tr>";
                 }
           }
        ?>
      </table>
    </td>
  </tr>
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td colspan="2" height="3"><img src="images/transparent.gif" width="1" height="1"></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td width="50%"><b>E</b>nch&egrave;res en cours dans cette rubrique :</td>
    <td width="50%">
      <div align="right">[<a href="recherche.php"><font color="<? echo "$textcolor" ?>">Rechercher
        une ench&egrave;re</font></a>]</div>
    </td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="45%">D&eacute;signation : </td>
    <td width="16%">Mise &agrave; prix :</td>
    <td width="16%">Prix actuel :</td>
    <td width="23%">Fin de l'ench&egrave;re :</td>
  </tr>
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td colspan="4" height="3"><img src="images/transparent.gif" width="1" height="1"></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
$balise=0;
    $query = "SELECT deal_articles.*,deal_rubriques.nom FROM deal_articles,deal_rubriques WHERE deal_articles.id_rubrique='$parent' AND deal_rubriques.id_rubrique=deal_articles.id_rubrique AND deal_articles.en_ligne='Y' ORDER BY deal_articles.fin ASC";
$mysql_result = mysql_query($query,$mysql_link);
while($row = mysql_fetch_array($mysql_result))
       {
       $designation=stripslashes($row["designation"]);
       $devise=$row["devise"];
       $prix_depart=$row["prix_depart"];
       $prix_actuel=$row["prix_actuel"];
       $fin=DateFrench($row["fin"]);
       $id_article=$row["id_article"];
       $rubrique=$row["nom"];
       $line=$balise/2;
       $isset_site="y";
       if(is_integer($line))
          {
          echo "<tr>";
          $balise++;
          }
       else
          {
          echo "<tr bgcolor=\"$bg2color\">";
          $balise++;

              }
           echo "<td width=\"45%\"><a href=\"in_article.php?id_article=$id_article&id_rubrique=$parent&rubrique=$rubrique\"><font color=\"$textcolor\">$designation</font></a></td>
       <td width=\"16%\">$prix_depart $devise</td>
       <td width=\"16%\">$prix_actuel $devise</td>
       <td width=\"23%\">$fin</td>
       </tr>";
       }
if($isset_site!="y") {
echo "<tr>
<td colspan=\"4\"><i>Aucun objet disponible dans cette rubrique.</i></td>
</tr>";
}
?>
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td colspan="4" height="3"><img src="images/transparent.gif" width="1" height="1"></td>
  </tr>
</table>
<?
}
}
elseif($howrub="column") {
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td width="50%"><b>L</b>iste des
    <? if($parent!="0") { echo "sous-"; } ?>rubriques disponibles :</td>
    <td width="50%">
      <div align="right">[<a href="recherche.php"><font color="<? echo "$textcolor" ?>">Rechercher
        une ench&egrave;re</font></a>]</div>
    </td>
  </tr>
</table>
<?
$query = "SELECT id_rubrique FROM deal_rubriques WHERE parent='$parent'";
$resu = mysql_query($query,$mysql_link);
$rows = mysql_num_rows($resu);
$demi=$rows/2;
if(!is_integer($demi))
  {
  $demie=$demi;
  $demi=intval($demi)+1;
  }
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <?
        $balise=0;
        $query = "SELECT nom,id_rubrique FROM deal_rubriques WHERE parent='$parent' limit 0, $demi";
        $mysql_result = mysql_query($query,$mysql_link);
        while($row = mysql_fetch_array($mysql_result))
               {
               $nom=$row[0];
               $rubrique=$row[1];
               $inventaire=Inventaire($rubrique,$mysql_link);
               $line=$balise/2;
               $isset_rubrique="y";
               if(is_integer($line))
                 {
                 echo "<tr><td>• <a href=\"achat_rubrique.php?parent=$rubrique\"><font color=\"$textcolor\">$nom</font></a> ($inventaire)</td></tr>";
                 $balise++;
                 }
               else
                 {
                 echo "<tr bgcolor=\"$bg2color\"><td>• <a href=\"achat_rubrique.php?parent=$rubrique\"><font color=\"$textcolor\">$nom</font></a> ($inventaire)</td></tr>";
                 $balise++;
                 }
               }
        if($isset_rubrique!="y") {
        echo "<tr><td><i>Aucune sous-rubrique n'est disponible.</i></td></tr>";
        }
        ?>
      </table>
    </td>
    <td valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <?
        $balise=0;
        $query = "SELECT nom,id_rubrique FROM deal_rubriques WHERE parent='$parent' limit $demi, $demi";
        $mysql_result = mysql_query($query,$mysql_link);
        while($row = mysql_fetch_array($mysql_result))
               {
               $nom=$row[0];
               $rubrique=$row[1];
               $inventaire=Inventaire($rubrique,$mysql_link);
               $line=$balise/2;
               if(is_integer($line))
                 {
                 echo "<tr><td>• <a href=\"achat_rubrique.php?parent=$rubrique\"><font color=\"$textcolor\">$nom</font></a> ($inventaire)</td></tr>";
                 $balise++;
                 }
               else
                 {
                 echo "<tr bgcolor=\"$bg2color\"><td>• <a href=\"achat_rubrique.php?parent=$rubrique\"><font color=\"$textcolor\">$nom</font></a> ($inventaire)</td></tr>";
                 $balise++;
                 }
               }
        if(isset($demie))
           {
           $line=$balise/2;
           if(is_integer($line))
                 {
                 echo "<tr><td>&nbsp;</td></tr>";
                 }
           else
                 {
                 echo "<tr bgcolor=\"$bg2color\"><td>&nbsp;</td></tr>";
                 }
           }
        ?>
      </table>
    </td>
  </tr>
<? if($parent!="0") { ?>
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td colspan="2" height="3"><img src="images/transparent.gif" width="1" height="1"></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td width="50%"><b>E</b>nch&egrave;res en cours dans cette rubrique :</td>
    <td width="50%">
      <div align="right">[<a href="recherche.php"><font color="<? echo "$textcolor" ?>">Rechercher
        une ench&egrave;re</font></a>]</div>
    </td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="45%">D&eacute;signation : </td>
    <td width="16%">Mise &agrave; prix :</td>
    <td width="16%">Prix actuel :</td>
    <td width="23%">Fin de l'ench&egrave;re :</td>
  </tr>
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td colspan="4" height="3"><img src="images/transparent.gif" width="1" height="1"></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
$balise=0;
    $query = "SELECT deal_articles.*,deal_rubriques.nom FROM deal_articles,deal_rubriques WHERE deal_articles.id_rubrique='$parent' AND deal_rubriques.id_rubrique=deal_articles.id_rubrique AND deal_articles.en_ligne='Y' ORDER BY deal_articles.fin ASC";
$mysql_result = mysql_query($query,$mysql_link);
while($row = mysql_fetch_array($mysql_result))
       {
       $designation=stripslashes($row["designation"]);
       $devise=$row["devise"];
       $prix_depart=$row["prix_depart"];
       $prix_actuel=$row["prix_actuel"];
       $fin=DateFrench($row["fin"]);
       $id_article=$row["id_article"];
       $rubrique=$row["nom"];
       $line=$balise/2;
       $isset_site="y";
       if(is_integer($line))
          {
          echo "<tr>";
          $balise++;
          }
       else
          {
          echo "<tr bgcolor=\"$bg2color\">";
          $balise++;

              }
           echo "<td width=\"45%\"><a href=\"in_article.php?id_article=$id_article&id_rubrique=$parent&rubrique=$rubrique\"><font color=\"$textcolor\">$designation</font></a></td>
       <td width=\"16%\">$prix_depart $devise</td>
       <td width=\"16%\">$prix_actuel $devise</td>
       <td width=\"23%\">$fin</td>
       </tr>";
       }
if($isset_site!="y") {
echo "<tr>
<td colspan=\"4\"><i>Aucun objet disponible dans cette rubrique.</i></td>
</tr>";
}
?>
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td colspan="4" height="3"><img src="images/transparent.gif" width="1" height="1"></td>
  </tr>
</table>
<?
}
else {
?>
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td colspan="2" height="3"><img src="images/transparent.gif" width="1" height="1"></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
</table>
<?
if($affichnext!="0" and $affichnext!="") {
?>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td width="50%"><b>P</b>rochaines clôtures :</td>
    <td width="50%">
      <div align="right">[<a href="recherche.php"><font color="<? echo "$textcolor" ?>">Rechercher
        une ench&egrave;re</font></a>]</div>
    </td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="45%">D&eacute;signation : </td>
    <td width="16%">Mise &agrave; prix :</td>
    <td width="16%">Prix actuel :</td>
    <td width="23%">Fin de l'ench&egrave;re :</td>
  </tr>
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td colspan="4" height="3"><img src="images/transparent.gif" width="1" height="1"></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
$balise=0;
$query = "SELECT deal_articles.*,deal_rubriques.nom,deal_rubriques.id_rubrique FROM deal_articles,deal_rubriques WHERE deal_rubriques.id_rubrique=deal_articles.id_rubrique AND deal_articles.en_ligne='Y' ORDER BY deal_articles.fin ASC LIMIT 0,$affichnext";
$mysql_result = mysql_query($query,$mysql_link);
while($row = mysql_fetch_array($mysql_result))
       {
       $designation=stripslashes($row["designation"]);
       $devise=$row["devise"];
       $prix_depart=$row["prix_depart"];
       $prix_actuel=$row["prix_actuel"];
       $fin=DateFrench($row["fin"]);
       $id_article=$row["id_article"];
       $rubrique=$row["nom"];
       $numero=$row["id_rubrique"];
       $line=$balise/2;
       $isset_site="y";
       if(is_integer($line))
          {
          echo "<tr>";
          $balise++;
          }
       else
          {
          echo "<tr bgcolor=\"$bg2color\">";
          $balise++;
          }
         echo "<td width=\"45%\"><a href=\"in_article.php?id_article=$id_article&id_rubrique=$parent&rubrique=$rubrique\"><font color=\"$textcolor\">$designation</font></a></td>
       <td width=\"16%\">$prix_depart $devise</td>
       <td width=\"16%\">$prix_actuel $devise</td>
       <td width=\"23%\">$fin</td>
       </tr>";
       }
if($isset_site!="y") {
echo "<tr>
<td colspan=\"4\"><i>Aucun objet en vente actuellement.</i></td>
</tr>";
}
?>
  <tr bgcolor="<? echo "$bg1color" ?>">
    <td colspan="4" height="3"><img src="images/transparent.gif" width="1" height="1"></td>
  </tr>
</table>
<?
}
}
}
?>
<p>&nbsp;</p>
<?
require("data/footer.inc.php");
?>

seb72000
Invité n'ayant pas de compte PHPfrance

07 août 2011, 16:28

Personne ne sait comment faire?

Avatar du membre
Modérateur PHPfrance
Modérateur PHPfrance | 10684 Messages

07 août 2011, 19:18

Modération :
Afin d'améliorer la lisibilité de ton message,
pense à utiliser les balises [code] ou [php] (selon le langage utilisé).

Elles sont disponibles au-dessus de la zone de saisie de ton message
lorsque tu postes un nouveau message.

Des indications sont disponibles sur la manière de mettre en forme vos messages dans la FAQ


Quant au fait que tu n'ais pas eu de réponse, je dirais que c'est sans doute parce que personne n'a eu le courage entre 16h et 16h28 de lire la tartine de code que tu as posté ;)

Quel est ton problème exactement ? Si tu veux juste afficher l'image en 30*30, il te suffit d'ajouter les attributs width="30" et height="30", ou encore style="width:30px; height:30px;" dans ta balise img. Si le problème est où et comment insérer cette balise, si tu pouvais réduire le code que tu postes aux quelques lignes qui affichent ton titre, tu aurais d'avantage de réponses :)
Ce n'est pas en améliorant la bougie que l'on a inventé l'ampoule...

seb72000
Invité n'ayant pas de compte PHPfrance

07 août 2011, 19:36

D'accord je vais pofiner le code car je pense savoir ou se situe a peu près l'endroit ou je dois rajouter une balise, le problème est que je ne sait pas écrire la balise qui dit de prendre l'image de l'annonce et la dupliquer (si je puis dire) pour la placer en miniature devant le titre de l'annonce.
Ex: sur mon site en page d'accueil, il y a des annonces avec image, c'est cela que je souhaite faire, car actuellement c'est image là sont mise manuellement grâce au code html d'une image (<img src="http://www.tv-foot.fr/images/Minerai-de-fer2.jpg" />Minerai de fer) que j'ai mis directement dans la designation de l'annonce (en créant l'annonce), un vendeur qui viendrais vendre sur le site mettrait dans la désignation "minerai de fer" (en tant que titre) et du coup il ni aurais pas de photo en miniature de l'annonce sur la page d'accueil car la photo de l'article que celui-ci va uploader via le bouton (parcourir) se place automatiquement DANS l'annonce, ce que je souhaiterais, c'est que la miniature se créer automatiquement a partir de l'mage que le vendeur va uploader.

Invité
Invité n'ayant pas de compte PHPfrance

07 août 2011, 19:46

Je pense que c'est dans cette partie là que je dois modifier le code (entre la ligne 370 et 400)
$balise=0;
    $query = "SELECT deal_articles.*,deal_rubriques.nom FROM deal_articles,deal_rubriques WHERE deal_articles.id_rubrique='$parent' AND deal_rubriques.id_rubrique=deal_articles.id_rubrique AND deal_articles.en_ligne='Y' ORDER BY deal_articles.fin ASC";
$mysql_result = mysql_query($query,$mysql_link);
while($row = mysql_fetch_array($mysql_result))
       {
       $designation=stripslashes($row["designation"]);
       $devise=$row["devise"];
       $prix_depart=$row["prix_depart"];
       $prix_actuel=$row["prix_actuel"];
       $fin=DateFrench($row["fin"]);
       $id_article=$row["id_article"];
       $rubrique=$row["nom"];
       $line=$balise/2;
       $isset_site="y";
       if(is_integer($line))
          {
          echo "<tr>";
          $balise++;
          }
       else
          {
          echo "<tr bgcolor=\"$bg2color\">";
          $balise++;

              }
           echo "<td width=\"45%\"><a href=\"in_article.php?id_article=$id_article&id_rubrique=$parent&rubrique=$rubrique\"><font color=\"$textcolor\">$designation</font></a></td>
       <td width=\"16%\">$prix_depart $devise</td>
       <td width=\"16%\">$prix_actuel $devise</td>
       <td width=\"23%\">$fin</td>
       </tr>";
       }

Avatar du membre
Modérateur PHPfrance
Modérateur PHPfrance | 10684 Messages

08 août 2011, 22:32

Il faut procéder par étape.

Pour afficher ton image sur chaque ligne de ton tableau, il faut ajouter la balise <img> à l'intérieur du <td> (cellule de tableau). Si tu veux que le clic sur l'image ouvre l'article comme le clic sur le titre, il faut mettre ta balise à l'intérieur du lien <a>.

quant au contenu de la balise, il faudrait que tu récupères le chemin de l'image de ta base de données (faut voir dans ta table à quel champ ca correspond), et tu peux jouer avec la taille de l'image à afficher.

Une fois que tu y sera arrivé, tu pourras te pencher sur la création de miniatures (AB propose une classe pour faire ça dans le forum contribution)
Ce n'est pas en améliorant la bougie que l'on a inventé l'ampoule...

Petit nouveau ! | 1 Messages

09 août 2011, 05:46

Un grand merci a toi, ca a été dur mais j'y suis arrivé encore merci