catseyes

Utilisateur open source
  • Compteur de contenus

    45
  • Inscrit(e) le

  • Dernière visite


Messages posté(e)s par catseyes


  1. bonjour a tous,

    apres réinstallation due a un virus, j'ai le message d'erreur suivant : "Call to undefined function vb" sur configuration.inc.php on line 176.

    la ligne concernée est :

    $dir_template					= vb($_SESSION['ecom']['template_directory']);
    La fonction étant :
    function vb(&$var, $default="") { // Variable blanche
    
    /* if $var n'est pas défini, retourne $default, sinon retourne $var */
    
    
    	return isset($var) ? $var : $default;
    
    }

    Toute aide est bienvenue pour m'aider a résoudre ce problème :rolleyes:


  2. RESOLU

    Bonjour à tous,

    j'ai un léger soucis d'affichage sur mes actus. Le tableau est plus petit que pour les produits en dessous.

    Les width sont bien à 100% pourtant, mais rien n'y fait, j'ai ça :

    site.gif

    Comment récupérer mon espace gris pour le texte ??

    function print_actu() {
    
    
    				global $wwwroot;
    
    				global $repertoire_upload;
    
    
    				$sql_ACTU = "SELECT p.id, p.surtitre_".$_SESSION['langue'].", p.titre_".$_SESSION['langue'].", p.chapo_".$_SESSION['langue'].", p.texte_".$_SESSION['langue']."
    
    				, p.image1, p.on_special, p.date_maj, pc.rubrique_id 
    
    				FROM peel2_articles p, peel2_articles_rubriques pc WHERE p.id = pc.article_id AND p.on_special = '1' AND p.etat = '1' ORDER BY p.date_maj DESC LIMIT 0,1";
    
    
    				$query_ACTU = mysql_query($sql_ACTU) or DIE('Une erreur de connexion &agrave; la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR());
    
    
    				if (mysql_num_rows($query_ACTU) > 0) {
    
    
    echo "<table class=\"produits\" border=\"0\" cellspacing=\"0\" width=\"100%\" cellpadding=\"8\" summary=\"\">";
    
    
    					while ($art = mysql_fetch_array($query_ACTU)) {
    
    
    						echo "<tr>";
    
    
    
    
    						echo "<h2>".html_entity_decode($art['titre_'.$_SESSION['langue'].''])."</h2>";
    
    
    
    
    						if (!empty($art['image1'])) {
    
    
    						echo "<td  valign=\"top\" align=\"left\"><a class=\"normal\" href=\"".$wwwroot."/lire/article_details.php?rubid=".$art['id']."\"><img src=\"$repertoire_upload/".$art['image1']."\" align=\"left\" width=\"200\"></a></td>";
    
    
    						}
    
    	echo "<td colspan=\"2\">";
    
    						echo nl2br(html_entity_decode($art['chapo_'.$_SESSION['langue'].'']));
    
    	echo "<br>";
    
    	echo "<a class=\"normal\" href=\"".$wwwroot."/lire/article_details.php?rubid=".$art['id']."\">";?>
    
    	<b>
    
    	<?php echo MORE?>
    
    	<?php echo "</b>";
    
    	echo "</a>";
    
    						  echo "</td></tr>";
    
    
    					}
    
    
    					echo "</table>";
    
    
    				}
    
    
    }


  3. coucou,

    exact, paulanna, ça ne marche pas pour les produits mais pour les catégories.

    La question est, vu mon pauvre niveau en php, comment transposer pour les produits ?

    :huh:

    Si j'ai bien lu, c'est cette portion de code qui modifie le tableau ?

    if ($qid_c) {
    
    
    if (mysql_num_rows($qid_c) == 0) {
    
    
    echo "";
    
    
    } else {
    
    
    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
    
    $nb_cellules = mysql_num_rows($qid_c);
    
    $nb_colonnes = 2;
    
    $j = 0;


  4. réponse donnée 350 698 fois sur le forum

    $nb_colonnes = 2 ou 3 ou 4 ou ...

    Bonjour Paulanna,

    je suis désolée de te décevoir, mais si je post, c'est parce que ça ne marche pas !

    j'ai bien spécifié mon nombre de colonnes à 3 sans succés,

    voici mon code :

    <?php
    
    include("../configuration.inc.php");
    
    
    if (!isset($_GET['catid'])) {	$catid = 0;} else {$catid = intval($_GET['catid']);}
    
    
    $qid_c = recupere_sous_categorie($catid);
    
    
    $DOC_TITLE = "Peter Span Design";
    
    
    include("$repertoire_modele/haut.php");
    
    ?>
    
    <table width="70%"  border="0" align="center" cellpadding="0" cellspacing="0">
    
      <tr>
    
    	<td class="tetiere">
    
    	  <?php affiche_arbre_categorie($catid) ?>
    
    	</td>
    
      </tr>
    
    </table>
    
    
    
    
    
    
    <table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
    
      <tr>
    
    	<td>
    
    	  <?php
    
    
    
    		$sqlcat = "SELECT image, description FROM peel_categories WHERE id = '".$catid."'";
    
    		$rescat = mysql_query($sqlcat);
    
    		$objcat = mysql_fetch_object($rescat);
    
    		if ($rescat) {
    
    			if (mysql_num_rows($rescat) > 0) {
    
    				echo "<div align=\"center\" class=\"normal\">";
    
    				if (!empty($objcat->image)) {
    
    				echo "<img  src=\"$wwwroot/upload/".$objcat->image."\" width=\"150\" align=\"center\">";
    
    				}
    
    				echo "<br /><br >".stripslashes($objcat->description);
    
    				echo "</div>";
    
    			}
    
    		}
    
    			if ($qid_c) {
    
    				if (mysql_num_rows($qid_c) == 0) {
    
    					echo "";
    
    				} else {
    
    				$nb_cellules = mysql_num_rows($qid_c);
    
    	$nb_colonnes = 3;
    
    				echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr valign=\"top\"><td class=\"normal\">";
    
    				echo "<strong>Dans cette rubrique :</strong>";
    
    				echo "</td></tr>";
    
    					 while ($cat = mysql_fetch_array($qid_c)) { ?>
    
    	  <?php }
    
    					echo "<tr><td><img src=$wwwroot/images/blank.gif width=\"1\" height=\"10\"  border=\"0\" alt=\"\" /></td></tr></table>";
    
    				}
    
    			} else {
    
    			echo "";
    
    			}
    
    		 ?>
    
    	  <?php
    
    $nb = 12; //nombre d'enregistrement par page
    
    if (!isset($_GET['start'])) {$start=0;} else {$start = $_REQUEST['start'];}
    
    // Récupération et affichage des données
    
    $sql = "SELECT p.id, p.nom,  p.image1
    
    	FROM peel_produits_categories pc, peel_produits p  LEFT JOIN peel_ecotaxes e ON (p.id_ecotaxe = e.id) WHERE p.id = pc.produit_id AND pc.categorie_id = '".intval($catid)."'
    
    	AND p.etat = '1' ORDER BY p.prix LIMIT $start,$nb";
    
    $result=mysql_query($sql) or die('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . mysql_error());
    
    if (mysql_num_rows($result) == 0) {
    
    	if (mysql_num_rows($qid_c) == 0) {
    
    		echo "aucun produit disponible dans cette catégorie";
    
    	}
    
    	} else {
    
    
    echo "<table colspan=\"3\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
    
    
    while($prod=mysql_fetch_array($result))
    
    {
    
    ?>
    
    	</td>
    
    	<td>
    
    	  <?php
    
    
    
    		$sqlcat = "SELECT image, description FROM peel_categories WHERE id = '".$catid."'";
    
    		$rescat = mysql_query($sqlcat);
    
    		$objcat = mysql_fetch_object($rescat);
    
    		if ($rescat) {
    
    			if (mysql_num_rows($rescat) > 0) {
    
    				echo "<div align=\"center\" class=\"normal\">";
    
    				if (!empty($objcat->image)) {
    
    				echo "<img  src=\"$wwwroot/upload/".$objcat->image."\" width=\"150\" align=\"center\">";
    
    				}
    
    				echo "<br /><br >".stripslashes($objcat->description);
    
    				echo "</div>";
    
    			}
    
    		}
    
    			if ($qid_c) {
    
    				if (mysql_num_rows($qid_c) == 0) {
    
    					echo "";
    
    				} else {
    
    				$nb_cellules = mysql_num_rows($qid_c);
    
    	$nb_colonnes = 3;
    
    				echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr valign=\"top\"><td class=\"normal\">";
    
    				echo "<strong>Dans cette rubrique :</strong>";
    
    				echo "</td></tr>";
    
    					 while ($cat = mysql_fetch_array($qid_c)) { ?>
    
    	  <?php }
    
    					echo "<tr><td><img src=$wwwroot/images/blank.gif width=\"1\" height=\"10\"  border=\"0\" alt=\"\" /></td></tr></table>";
    
    				}
    
    			} else {
    
    			echo "";
    
    			}
    
    		 ?>
    
    	  <?php
    
    $nb = 12; //nombre d'enregistrement par page
    
    if (!isset($_GET['start'])) {$start=0;} else {$start = $_REQUEST['start'];}
    
    // Récupération et affichage des données
    
    $sql = "SELECT p.id, p.nom,  p.image1
    
    	FROM peel_produits_categories pc, peel_produits p  LEFT JOIN peel_ecotaxes e ON (p.id_ecotaxe = e.id) WHERE p.id = pc.produit_id AND pc.categorie_id = '".intval($catid)."'
    
    	AND p.etat = '1' ORDER BY p.prix LIMIT $start,$nb";
    
    $result=mysql_query($sql) or die('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . mysql_error());
    
    if (mysql_num_rows($result) == 0) {
    
    	if (mysql_num_rows($qid_c) == 0) {
    
    		echo "aucun produit disponible dans cette catégorie";
    
    	}
    
    	} else {
    
    
    echo "<table colspan=\"3\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
    
    
    while($prod=mysql_fetch_array($result))
    
    {
    
    ?>
    
    	</td>
    
    	<td>
    
    	  <?php
    
    
    
    		$sqlcat = "SELECT image, description FROM peel_categories WHERE id = '".$catid."'";
    
    		$rescat = mysql_query($sqlcat);
    
    		$objcat = mysql_fetch_object($rescat);
    
    		if ($rescat) {
    
    			if (mysql_num_rows($rescat) > 0) {
    
    				echo "<div align=\"center\" class=\"normal\">";
    
    				if (!empty($objcat->image)) {
    
    				echo "<img  src=\"$wwwroot/upload/".$objcat->image."\" width=\"150\" align=\"center\">";
    
    				}
    
    				echo "<br /><br >".stripslashes($objcat->description);
    
    				echo "</div>";
    
    			}
    
    		}
    
    			if ($qid_c) {
    
    				if (mysql_num_rows($qid_c) == 0) {
    
    					echo "";
    
    				} else {
    
    				$nb_cellules = mysql_num_rows($qid_c);
    
    	$nb_colonnes = 3;
    
    				echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr valign=\"top\"><td class=\"normal\">";
    
    				echo "<strong>Dans cette rubrique :</strong>";
    
    				echo "</td></tr>";
    
    					 while ($cat = mysql_fetch_array($qid_c)) { ?>
    
    	  <?php }
    
    					echo "<tr><td><img src=$wwwroot/images/blank.gif width=\"1\" height=\"10\"  border=\"0\" alt=\"\" /></td></tr></table>";
    
    				}
    
    			} else {
    
    			echo "";
    
    			}
    
    		 ?>
    
    	  <?php
    
    $nb = 12; //nombre d'enregistrement par page
    
    if (!isset($_GET['start'])) {$start=0;} else {$start = $_REQUEST['start'];}
    
    // Récupération et affichage des données
    
    $sql = "SELECT p.id, p.nom,  p.image1
    
    	FROM peel_produits_categories pc, peel_produits p  LEFT JOIN peel_ecotaxes e ON (p.id_ecotaxe = e.id) WHERE p.id = pc.produit_id AND pc.categorie_id = '".intval($catid)."'
    
    	AND p.etat = '1' ORDER BY p.prix LIMIT $start,$nb";
    
    $result=mysql_query($sql) or die('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . mysql_error());
    
    if (mysql_num_rows($result) == 0) {
    
    	if (mysql_num_rows($qid_c) == 0) {
    
    		echo "aucun produit disponible dans cette catégorie";
    
    	}
    
    	} else {
    
    
    echo "<table colspan=\"3\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
    
    
    while($prod=mysql_fetch_array($result))
    
    {
    
    ?>
    
    	</td>
    
      </tr>
    
    </table>
    
    <tr>
    
      <td class="normal" colspan="3">
    
    	<!-- Début du formulaire -->
    
      </td>
    
    </tr>
    
    <tr>
    
    <td align="center" class="normal" colspan="6">
    
    <?php
    
    }
    
    
    //Boutons précédent et suivant
    
    if($start)
    
    {echo ("<a class=\"normal\" href=\"$wwwroot/achat/index.php?catid=".$catid."&start=".($start-$nb)."\">Page pr&eacute;c&eacute;dente</a>");}
    
    
    $result=mysql_query("SELECT COUNT(*) FROM peel_produits p, peel_produits_categories pc WHERE p.id = pc.produit_id	AND pc.categorie_id = $catid  AND p.etat = 1");
    
    
    $row=mysql_fetch_row($result);
    
    
    if($row[0]>($start+$nb))
    
    {
    
    if($start)
    
    {echo (" / ");}
    
    echo ("<a class=\"normal\" href=\"$wwwroot/achat/index.php?catid=".$catid."&start=".($start+$nb)."\">Page suivante</a>");
    
    }
    
    
    echo ("<br />");
    
    
    //Affichage des pages
    
    if($row[0]>$nb) {// le nombre d'enreg. est > au nb de lignes d'affichage ?
    
    echo ("Page :");
    
    for($index=0;($index*$nb)<$row[0];$index++) // oui alors on affiche les numéros de pages
    
    {
    
    ?>
    
    	<b><a class="normal" href="<?php echo $_SERVER['PHP_SELF']."?catid=".$catid."&start=".$index*$nb; ?>"><?php echo $index+1; ?></a></b>
    
    <?php
    
    }
    
    }
    
    echo "</td></tr></table>";
    
    
    include("$repertoire_modele/bas.php");
    
    
    /******************************************************************************
    
    * FONCTIONS
    
    *****************************************************************************/
    
    
    function recupere_sous_categorie($catid=0) {
    
    /* Récupère le nom et la description de toutes les sous-catégories de celle-ci */
    
    	$qid = mysql_query("SELECT id, nom, description, parent_id  FROM peel_categories WHERE parent_id = $catid AND id > 0 AND etat = 1") or DIE('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR());
    
    
    	return $qid; }
    
    
    ?>


  5. bonjour,

    en suivant vos indications j'ai modifié achat/ index.php comme suit.

    mais j'ai un Parse error: syntax error, unexpected $end in /home/peters/public_html/peter/achat/indexTest.php on line 241 (dernière ligne)

    <?php 
    
    include("../configuration.inc.php");
    
    
    if (!isset($_GET['catid'])) {	$catid = 0;} else {$catid = intval($_GET['catid']);}
    
    
    $qid_c = recupere_sous_categorie($catid);
    
    
    $DOC_TITLE = "Peter Span Design";
    
    
    include("$repertoire_modele/haut.php");
    
    ?>
    
    <table width="70%"  border="0" align="center" cellpadding="0" cellspacing="0">
    
      <tr> 
    
    	<td class="tetiere"> 
    
    	  <?php affiche_arbre_categorie($catid) ?>
    
    	</td>
    
      </tr>
    
    </table>
    
    
    
    
    
    
    <table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
    
      <tr>
    
    	<td>
    
    	  <?php
    
    
    
    		$sqlcat = "SELECT image, description FROM peel_categories WHERE id = '".$catid."'";
    
    		$rescat = mysql_query($sqlcat);
    
    		$objcat = mysql_fetch_object($rescat);
    
    		if ($rescat) {
    
    			if (mysql_num_rows($rescat) > 0) {
    
    				echo "<div align=\"center\" class=\"normal\">";
    
    				if (!empty($objcat->image)) {
    
    				echo "<img  src=\"$wwwroot/upload/".$objcat->image."\" width=\"150\" align=\"center\">";
    
    				}
    
    				echo "<br /><br >".stripslashes($objcat->description);
    
    				echo "</div>";
    
    			}
    
    		}
    
    			if ($qid_c) {
    
    				if (mysql_num_rows($qid_c) == 0) { 
    
    					echo "";
    
    				} else {
    
    				$nb_cellules = mysql_num_rows($qid_c);
    
    	$nb_colonnes = 3;
    
    				echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr valign=\"top\"><td class=\"normal\">";
    
    				echo "<strong>Dans cette rubrique :</strong>";
    
    				echo "</td></tr>";
    
    					 while ($cat = mysql_fetch_array($qid_c)) { ?>
    
    	  <?php } 
    
    					echo "<tr><td><img src=$wwwroot/images/blank.gif width=\"1\" height=\"10\"  border=\"0\" alt=\"\" /></td></tr></table>"; 
    
    				}
    
    			} else {
    
    			echo "";
    
    			}
    
    		 ?>
    
    	  <?php 
    
    $nb = 12; //nombre d'enregistrement par page 
    
    if (!isset($_GET['start'])) {$start=0;} else {$start = $_REQUEST['start'];}
    
    // Récupération et affichage des données 
    
    $sql = "SELECT p.id, p.nom,  p.image1
    
    	FROM peel_produits_categories pc, peel_produits p  LEFT JOIN peel_ecotaxes e ON (p.id_ecotaxe = e.id) WHERE p.id = pc.produit_id AND pc.categorie_id = '".intval($catid)."'
    
    	AND p.etat = '1' ORDER BY p.prix LIMIT $start,$nb";
    
    $result=mysql_query($sql) or die('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . mysql_error()); 
    
    if (mysql_num_rows($result) == 0) { 
    
    	if (mysql_num_rows($qid_c) == 0) { 
    
    		echo "aucun produit disponible dans cette catégorie"; 
    
    	}
    
    	} else {
    
    
    echo "<table colspan=\"3\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
    
    
    while($prod=mysql_fetch_array($result)) 
    
    {
    
    ?>
    
    	</td>
    
    	<td>
    
    	  <?php
    
    
    
    		$sqlcat = "SELECT image, description FROM peel_categories WHERE id = '".$catid."'";
    
    		$rescat = mysql_query($sqlcat);
    
    		$objcat = mysql_fetch_object($rescat);
    
    		if ($rescat) {
    
    			if (mysql_num_rows($rescat) > 0) {
    
    				echo "<div align=\"center\" class=\"normal\">";
    
    				if (!empty($objcat->image)) {
    
    				echo "<img  src=\"$wwwroot/upload/".$objcat->image."\" width=\"150\" align=\"center\">";
    
    				}
    
    				echo "<br /><br >".stripslashes($objcat->description);
    
    				echo "</div>";
    
    			}
    
    		}
    
    			if ($qid_c) {
    
    				if (mysql_num_rows($qid_c) == 0) { 
    
    					echo "";
    
    				} else {
    
    				$nb_cellules = mysql_num_rows($qid_c);
    
    	$nb_colonnes = 3;
    
    				echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr valign=\"top\"><td class=\"normal\">";
    
    				echo "<strong>Dans cette rubrique :</strong>";
    
    				echo "</td></tr>";
    
    					 while ($cat = mysql_fetch_array($qid_c)) { ?>
    
    	  <?php } 
    
    					echo "<tr><td><img src=$wwwroot/images/blank.gif width=\"1\" height=\"10\"  border=\"0\" alt=\"\" /></td></tr></table>"; 
    
    				}
    
    			} else {
    
    			echo "";
    
    			}
    
    		 ?>
    
    	  <?php 
    
    $nb = 12; //nombre d'enregistrement par page 
    
    if (!isset($_GET['start'])) {$start=0;} else {$start = $_REQUEST['start'];}
    
    // Récupération et affichage des données 
    
    $sql = "SELECT p.id, p.nom,  p.image1
    
    	FROM peel_produits_categories pc, peel_produits p  LEFT JOIN peel_ecotaxes e ON (p.id_ecotaxe = e.id) WHERE p.id = pc.produit_id AND pc.categorie_id = '".intval($catid)."'
    
    	AND p.etat = '1' ORDER BY p.prix LIMIT $start,$nb";
    
    $result=mysql_query($sql) or die('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . mysql_error()); 
    
    if (mysql_num_rows($result) == 0) { 
    
    	if (mysql_num_rows($qid_c) == 0) { 
    
    		echo "aucun produit disponible dans cette catégorie"; 
    
    	}
    
    	} else {
    
    
    echo "<table colspan=\"3\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
    
    
    while($prod=mysql_fetch_array($result)) 
    
    {
    
    ?>
    
    	</td>
    
    	<td>
    
    	  <?php
    
    
    
    		$sqlcat = "SELECT image, description FROM peel_categories WHERE id = '".$catid."'";
    
    		$rescat = mysql_query($sqlcat);
    
    		$objcat = mysql_fetch_object($rescat);
    
    		if ($rescat) {
    
    			if (mysql_num_rows($rescat) > 0) {
    
    				echo "<div align=\"center\" class=\"normal\">";
    
    				if (!empty($objcat->image)) {
    
    				echo "<img  src=\"$wwwroot/upload/".$objcat->image."\" width=\"150\" align=\"center\">";
    
    				}
    
    				echo "<br /><br >".stripslashes($objcat->description);
    
    				echo "</div>";
    
    			}
    
    		}
    
    			if ($qid_c) {
    
    				if (mysql_num_rows($qid_c) == 0) { 
    
    					echo "";
    
    				} else {
    
    				$nb_cellules = mysql_num_rows($qid_c);
    
    	$nb_colonnes = 3;
    
    				echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr valign=\"top\"><td class=\"normal\">";
    
    				echo "<strong>Dans cette rubrique :</strong>";
    
    				echo "</td></tr>";
    
    					 while ($cat = mysql_fetch_array($qid_c)) { ?>
    
    	  <?php } 
    
    					echo "<tr><td><img src=$wwwroot/images/blank.gif width=\"1\" height=\"10\"  border=\"0\" alt=\"\" /></td></tr></table>"; 
    
    				}
    
    			} else {
    
    			echo "";
    
    			}
    
    		 ?>
    
    	  <?php 
    
    $nb = 12; //nombre d'enregistrement par page 
    
    if (!isset($_GET['start'])) {$start=0;} else {$start = $_REQUEST['start'];}
    
    // Récupération et affichage des données 
    
    $sql = "SELECT p.id, p.nom,  p.image1
    
    	FROM peel_produits_categories pc, peel_produits p  LEFT JOIN peel_ecotaxes e ON (p.id_ecotaxe = e.id) WHERE p.id = pc.produit_id AND pc.categorie_id = '".intval($catid)."'
    
    	AND p.etat = '1' ORDER BY p.prix LIMIT $start,$nb";
    
    $result=mysql_query($sql) or die('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . mysql_error()); 
    
    if (mysql_num_rows($result) == 0) { 
    
    	if (mysql_num_rows($qid_c) == 0) { 
    
    		echo "aucun produit disponible dans cette catégorie"; 
    
    	}
    
    	} else {
    
    
    echo "<table colspan=\"3\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
    
    
    while($prod=mysql_fetch_array($result)) 
    
    {
    
    ?>
    
    	</td>
    
      </tr>
    
    </table>
    
    <tr>
    
      <td class="normal" colspan="3"> 
    
    	<!-- Début du formulaire -->
    
      </td>
    
    </tr>
    
    <tr>
    
    <td align="center" class="normal" colspan="6">
    
    <?php 
    
    } 
    
    
    //Boutons précédent et suivant 
    
    if($start) 
    
    {echo ("<a class=\"normal\" href=\"$wwwroot/achat/index.php?catid=".$catid."&start=".($start-$nb)."\">Page pr&eacute;c&eacute;dente</a>");} 
    
    
    $result=mysql_query("SELECT COUNT(*) FROM peel_produits p, peel_produits_categories pc WHERE p.id = pc.produit_id	AND pc.categorie_id = $catid  AND p.etat = 1"); 
    
    
    $row=mysql_fetch_row($result); 
    
    
    if($row[0]>($start+$nb)) 
    
    { 
    
    if($start) 
    
    {echo (" / ");} 
    
    echo ("<a class=\"normal\" href=\"$wwwroot/achat/index.php?catid=".$catid."&start=".($start+$nb)."\">Page suivante</a>"); 
    
    } 
    
    
    echo ("<br />"); 
    
    
    //Affichage des pages 
    
    if($row[0]>$nb) {// le nombre d'enreg. est > au nb de lignes d'affichage ?
    
    echo ("Page :"); 
    
    for($index=0;($index*$nb)<$row[0];$index++) // oui alors on affiche les numéros de pages
    
    { 
    
    ?>
    
    	<b><a class="normal" href="<?php echo $_SERVER['PHP_SELF']."?catid=".$catid."&start=".$index*$nb; ?>"><?php echo $index+1; ?></a></b>
    
    <?php 
    
    }
    
    }
    
    echo "</td></tr></table>";
    
    
    include("$repertoire_modele/bas.php");
    
    
    /******************************************************************************
    
     * FONCTIONS
    
     *****************************************************************************/
    
    
    function recupere_sous_categorie($catid=0) { 
    
    /* Récupère le nom et la description de toutes les sous-catégories de celle-ci */
    
    	$qid = mysql_query("SELECT id, nom, description, parent_id  FROM peel_categories WHERE parent_id = $catid AND id > 0 AND etat = 1") or DIE('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR()); 
    
    
    	return $qid; }
    
    
    ?>

    je n'ai pas l'impression d'avoir oublié de guillemets ou d'acolade mais vraisemblablement, quelque chose cloche ;)

    si vous avez des idées, je suis preneuse. :huh:


  6. coucou,

    merci pour ta reponse paulana,

    j'ai trouvé !

    si l'on veut juste ne nom de la marque, on ajoute p.marque au select et <?php echo ($prod['marque'] dans le td.

    Si l'on veut le logo (image2 etant le logo :

    function print_on_specials() {
    
    /* Affiche la liste des catégories qui sont spéciales */
    
    	global $wwwroot, $repertoire_modele;
    
    
    	$requete = "SELECT p.id, p.nom, p.promotion, p.descriptif, p.image1, p.image2, p.marque, e.prix_ttc , p.stock, p.on_stock 
    
    	, IF(ISNULL(e.prix_ttc),p.prix, (p.prix + e.prix_ttc)) AS prix_catalogue
    
    	, IF(ISNULL(e.prix_ttc),p.prix * (1-p.promotion/100),(p.prix * (1-p.promotion/100) + e.prix_ttc)) AS prix_vente 
    
    	FROM peel_produits p LEFT JOIN peel_ecotaxes e ON (p.id_ecotaxe = e.id) WHERE p.on_special = '1' AND p.etat = '1'";
    
    
    	$qid = mysql_query($requete) or DIE('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR());
    
    
    	if (mysql_num_rows($qid) == 0) { 
    
    
    	echo "Aucun produit n'a été prévu en page d'accueil"; 
    
    
    	} else {
    
    
    	$nb_cellules = mysql_num_rows($qid);
    
    	$nb_colonnes = 3;
    
    	?>
    
    
    <p>&nbsp;</p>
    
    <p>&nbsp;</p>
    
    <table align="center" border="0" cellspacing="0" cellpadding="0" width="80%">
    
      <tr><td colspan="<?php echo $nb_colonnes?>" class="tetiere">Notre sélection</td></tr>
    
    			<?php 
    
    			$j = 0;
    
    			while ($prod = mysql_fetch_array($qid)) 
    
    			{
    
    			if ( $j % $nb_colonnes == 0 ) {
    
    			echo "<tr valign=\"top\">";
    
    			}
    
    			if($j % $nb_colonnes !=0 OR $j % $nb_colonnes == 0 ) {
    
    			// on affiche une cellule
    
    			echo "<td class=\"petit\" width=\"33%\">";
    
    			?>
    
    			<table align="center" border="0" cellspacing="0" cellpadding="0" width="100%">
    
    
    			<tr><td class="label" align="center"><a class="normal" href="<?php echo $wwwroot ?>/achat/produit_details.php?id=<?php echo $prod['id'] ?>"><?php echo $prod['nom']?></a></td></tr>
    
    
    			<tr><td  class="normal"align="center" valign="middle">
    
    
    						<?php if ($prod['image2'] <> "") {?>
    
    
    			<div align="center"><img src="<?php echo $wwwroot?>/upload/<?php echo $prod['image2']?>" alt="" /></div>
    
    
    			<?php } else {?><div align="center"><img src="<?php echo $wwwroot?>/upload/<?php echo $prod['image2']?>" alt="" /></div><?php }?>
    
    
    			<?php if ($prod['image1'] <> "") {?>
    
    
    			<div align="center"><img src="<?php echo $wwwroot?>/upload/<?php echo $prod['image1']?>" width="150" alt="" /></div>
    
    
    			<?php } else {?><div align="center"><img src="<?php echo $wwwroot?>/images/photo-non-disponible.gif" alt="" /></div><?php }?></td></tr>
    
    
    			<tr><td class="normal">


  7. bonjour, :(

    je travaille actuellement sur une boutique ou il y à beaucoup de produits par catégories.

    Je voudrais donc générer des vignettes sur achat/index.php

    J'ai le code suivant :

    <?php
    
    
    
    // ---- function to rotate and merge the RGB and Alpha Channels
    
    // adapted from jon at driestone dot com http://us3.php.net/manual/en/function.imagerotate.php
    
    function alpha_rotate($src_RGB, $src_alpha, $angle, $PNGsupport){
    
    	   global $r0, $g0, $b0;
    
    
    	   if($angle != 0) {
    
    		 $src_RGB = imagerotate($src_RGB, $angle, 0x000000);
    
    		 $src_alpha = imagerotate($src_alpha, $angle, 0x000000);
    
    	   }
    
    
    	   imagealphablending($src_RGB, false);
    
    
    	   for ($theX=0;$theX<imagesx($src_RGB);$theX++){
    
    		   for ($theY=0;$theY<imagesy($src_RGB);$theY++){
    
    
    			   $rgb = imagecolorat($src_RGB,$theX,$theY);
    
    			   $r = ($rgb >> 16) & 0xFF;
    
    			   $g = ($rgb >> 8) & 0xFF;
    
    			   $b = $rgb & 0xFF;
    
    
    			   $rgb = imagecolorat($src_alpha,$theX,$theY);
    
    			   $a = $rgb & 0xFF;
    
    			   $a = 127-floor($a/2);
    
    			   $t = $a/128.0;
    
    
    			   if($PNGsupport) {
    
    				 $myColour = imagecolorallocatealpha($src_RGB,$r,$g,$b,$a);
    
    			   } else {
    
    				 $myColour = imagecolorallocate($src_RGB,$r*(1.0-$t)+$r0*$t,$g*(1.0-$t)+$g0*$t,$b*(1.0-$t)+$b0*$t);
    
    			   }
    
    			   imagesetpixel($src_RGB, $theX, $theY, $myColour);	
    
    		   }
    
    	   }
    
    
    	   return $src_RGB;
    
    }
    
    
    // -- test for PNG transparency support, ie if the browser is MicroSoft Internet Explorer version <7 --
    
    $PNGsupport = true;
    
    $Browser = $HTTP_USER_AGENT;
    
    if(!$Browser) $Browser = $_SERVER['HTTP_USER_AGENT'];
    
    if (ereg ( 'MSIE ([0-9].[0-9]{1,2})', $Browser,$log_version) ) {
    
      if($log_version[1] < 7) $PNGsupport = false;
    
    }
    
    
    // --- Cache ---
    
    $cache_directory = "cache";  // specify the cache directory - make sure it has writing authorization
    
    $use_cache = false;  // set to true or false, whether you'd like to cache the thumbnails or not
    
    
    // --- parameters ---
    
    $filename = $_REQUEST['file'];  // name of the file containing the source image
    
    $max_h = $_REQUEST['150'];   // maximal wanted horizontal size
    
    $max_v = $_REQUEST['150'];   // maximal wanted vertical size
    
    $flou = $_REQUEST['flou']; // distance of blur
    
    $r = $_REQUEST['0'];  // angle to rotate the image
    
    $d = $_REQUEST['20'];  // distance of the shadow
    
    $a = $_REQUEST['45'];  // angle of the shadow
    
    $b = $_REQUEST['10'];  // thickness of border
    
    $c = $_REQUEST['c'];  // whether the picture should be cached
    
    if(!$max_h) $max_h = 150;
    
    if(!$max_v) $max_v = 150;
    
    if(!$a) $a = 45;
    
    if(!$d) $d = $flou*0.25;
    
    if(!$flou) $flou = 10;
    
    if($c) $use_cache = true;
    
    $flou_h = $flou;
    
    $flou_v = $flou;
    
    $dist_h = $d * cos(deg2rad($a+$r));
    
    $dist_v = $d * sin(deg2rad($a+$r));
    
    
    // --- background colour (in case PNG transparency not supported) ---
    
    $r0 = $_REQUEST['r0'];
    
    $g0 = $_REQUEST['g0'];
    
    $b0 = $_REQUEST['b0'];
    
    if(!$r0) $r0 = 255; // default background colour is white
    
    if(!$g0) $g0 = 255;
    
    if(!$b0) $b0 = 255;
    
    
    if($filename && file_exists($filename)) {
    
      $md5 = md5_file($filename);
    
    
      if($PNGsupport) {
    
    	$cached_file = $md5.".png";
    
      } else {
    
    	$cached_file = $md5.".jpg";
    
      }
    
    
      if( file_exists($cache_directory.$cached_file) && $use_cache) {
    
    	header("Location:".$cache_directory.$cached_file."\n\n");
    
      }
    
      else {
    
    	if(substr($filename,-4,4)==".jpg") {
    
    	  $image = imagecreatefromjpeg($filename);
    
    	}
    
    	if(substr($filename,-4,4)==".png") {
    
    	  $image = imagecreatefrompng($filename);
    
    	}
    
    
    	$src_size = getimagesize($filename);
    
    	$h = $src_size[0];
    
    	$v = $src_size[1];
    
    	if($v * $max_h - $h * $max_v < 0)
    
    	{ $wanted_h = $max_h; $wanted_v = $v*($max_h/$h); }
    
    	else 
    
    	{ $wanted_v = $max_v; $wanted_h = $h*($max_v/$v);  }
    
    	$thumbnail = imagecreatetruecolor($wanted_h-2*$b, $wanted_v-2*b);
    
    	imagecopyresampled($thumbnail, $image, 0, 0, 0, 0, $wanted_h-2*$b, $wanted_v-2*$b, $h, $v);
    
    
    	if(!$flou_h) $flou_h = 10; 
    
    	if(!$flou_v) $flou_v = 10;
    
    
    	// ---- RGB ----
    
    	$rgb = imagecreatetruecolor($wanted_h+$flou_h,$wanted_v+$flou_v);
    
    	$colour = imagecolorallocate($rgb, 0, 0, 0);
    
    	imagefilledrectangle($rgb, 0, 0, $wanted_h+$flou_h, $wanted_v+$flou_v, $colour);
    
    	$colour = imagecolorallocate($rgb, 255, 255, 255);
    
    	imagefilledrectangle($rgb, $flou_h*0.5-$dist_h, $flou_v*0.5-$dist_v, $wanted_h+$flou_h*0.5-$dist_h, $wanted_v+$flou_h*0.5-$dist_v, $colour);
    
    	imagecopymerge($rgb, $thumbnail, 1+$b + $flou_h*0.5-$dist_h, 1+$b + $flou_v*0.5-$dist_v, 0,0, $wanted_h-2*$b, $wanted_v-2*$b, 100);
    
    
    	// ---- Ombre (alpha) ----
    
    	$ombre = imagecreatetruecolor($wanted_h+$flou_h,$wanted_v+$flou_v);
    
    	imagealphablending($ombre, false);
    
    	$colour = imagecolorallocate($ombre, 0, 0, 0);
    
    	imagefilledrectangle($ombre, 0, 0, $wanted_h+$flou_h, $wanted_v+$flou_v, $colour);
    
    
    	$nStep = 30; // this parameter can be increased for better smoothness
    
    	for($i=0;$i<=$nStep;$i++) {
    
    	  $t = ((1.0*$i)/$nStep);
    
    	  $intensity = 255*$t*$t;
    
    	  $colour = imagecolorallocate($ombre, $intensity, $intensity, $intensity);
    
    	  $points = array(
    
    		   $flou_h*$t,				$flou_v,	 // Point 1 (x, y)
    
    		   $flou_h,				   $flou_v*$t,  // Point 2 (x, y)
    
    		   $wanted_h,				 $flou_v*$t,  // Point 3 (x, y)
    
    		   $wanted_h+$flou_h*(1-$t),  $flou_v,	 // Point 4 (x, y)
    
    		   $wanted_h+$flou_h*(1-$t),  $wanted_v,  // Point 5 (x, y)
    
    		   $wanted_h,				 $wanted_v+$flou_v*(1-$t),  // Point 6 (x, y)
    
    		   $flou_h,				   $wanted_v+$flou_v*(1-$t),  // Point 7 (x, y)
    
    		   $flou_h*$t,				$wanted_v   // Point 8 (x, y)
    
    		 );
    
    	  imagepolygon($ombre, $points, 8, $colour);
    
    	}
    
    	for($i=0;$i<=$nStep;$i++) {
    
    	  $t = ((1.0*$i)/$nStep);
    
    	  $intensity = 255*$t*$t;
    
    	  $colour = imagecolorallocate($ombre, $intensity, $intensity, $intensity);
    
    	  imagefilledarc($ombre, $flou_h-1, $flou_v-1, 2*(1-$t)*$flou_h, 2*(1-$t)*$flou_v, 180, 268, $colour, IMG_ARC_PIE);
    
    	  imagefilledarc($ombre, $wanted_h, $flou_v-1, 2*(1-$t)*$flou_h, 2*(1-$t)*$flou_v, 270, 358, $colour, IMG_ARC_PIE);
    
    	  imagefilledarc($ombre, $wanted_h, $wanted_v, 2*(1-$t)*$flou_h, 2*(1-$t)*$flou_v, 0, 90, $colour, IMG_ARC_PIE);
    
    	  imagefilledarc($ombre, $flou_h-1, $wanted_v, 2*(1-$t)*$flou_h, 2*(1-$t)*$flou_v, 90, 180, $colour, IMG_ARC_PIE);
    
    	}
    
    
    	$colour = imagecolorallocate($ombre, 255, 255, 255);
    
    	imagefilledrectangle($ombre, $flou_h, $flou_v, $wanted_h, $wanted_v, $colour);
    
    	imagefilledrectangle($ombre, $flou_h*0.5-$dist_h, $flou_v*0.5-$dist_v, $wanted_h+$flou_h*0.5-1-$dist_h, $wanted_v+$flou_v*0.5-1-$dist_v, $colour);
    
    
    	$rgb = alpha_rotate($rgb, $ombre, $r, $PNGsupport);
    
    	imagealphablending($rgb, true);
    
    	imagesavealpha($rgb, true);
    
    
    	// deliver image and also write the cached file
    
    	if($PNGsupport) {
    
    	  header("Content-type: image/png");
    
    	  imagepng($rgb);
    
    	  if($use_cache) imagepng($rgb, $cache_directory.$cached_file);
    
    	} else {
    
    	  header("Content-type: image/jpg");
    
    	  imagejpeg($rgb);
    
    	  if($use_cache) imagejpeg($rgb, $cache_directory.$cached_file);
    
    	}
    
    
    	imagedestroy($image);
    
    	imagedestroy($thumbnail);
    
    	imagedestroy($rgb);
    
    	imagedestroy($ombre);
    
      }
    
    } else {
    
      //echo "File not found";
    
    }
    
    
    ?>

    je voudrais savoir :

    - quel dossier mettre en cache? (upload, ou un nouveau dossier)

    - pour le filename, puis-je mettre : <?php echo $repertoire_images?>/<?php echo $prod['image1'] ?>

    merci de votre aide ! :)


  8. bonjour, :)

    Sur ma page d'accueil j'ai une selection de produits qui sont "on_special".

    <?php 
    
    }}
    
    
    function print_categorie() {
    
    
    	/* Affiche la liste des catégories qui sont spéciales */
    
    	global $wwwroot, $repertoire_modele;
    
    
    	$qid = mysql_query("SELECT id, nom, image FROM peel_categories WHERE etat = 1 AND on_special = 1") or DIE('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR());
    
    
    	if (mysql_num_rows($qid) > 0) {
    
    
    	$nb_cellules = mysql_num_rows($qid);
    
    
    	$nb_colonnes = 2;
    
    	?>
    je voudrais pour ces produit, afficher aussi la marque, mais je ne sais pas comment rédiger un double requete ou requete sur deux tables. :( en requete simple cela donne
    $sql = 'SELECT `marque` FROM `peel_produits` WHERE `on_special` = 1 AND `etat` = 1  ';
    est ce que ça marche comma ça :
    	
    
    $qid = mysql_query("SELECT id, nom, image, marque FROM peel_categories WHERE etat = 1 AND on_special = 1 left join peel_produits on peel_produits.marque=peel_categories.etat") or DIE('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR());
    
    
    	if (mysql_num_rows($qid) > 0) {
    
    
    	$nb_cellules = mysql_num_rows($qid);
    
    
    	$nb_colonnes = 2;


  9. Bonjour,

    Vous avez du recevoir un kit comportant une documentation. Il faut juste adapter leurs exemples à Peel.

    C'est pas bien compliqué en réalité mais il faut suivre à la lettre le shéma d'atos et récuperer les informations du montant, du numéro de commande etc via les sessions originelles de Peel.

    Bonjour Eric,

    merci pour ta réponse!

    Si j'ai bien compris, le call response est un exemple, et c'est cette page qu'il faut modifier ?

    Par la suite, dois je l'appeller (include) ou integrer son code dans fin de commande ?

Twitter Advisto ecommerce

Facebook PEEL Shopping