Flux d’activité

Flux d’activité de Messages

  1. Mag


    essaye avec cela

    if (isset($frm['categorie'])) {
    
    
    				if ($frm['categorie'] != "NULL") {$where .= " AND c.id = '".$frm['categorie']."'";}
    
    
    				$sql = "SELECT p.id, p.reference, p.nom, p.description, p.prix, p.etat, p.date_maj FROM peel_produits p, peel_produits_categories pc, peel_categories c WHERE p.id = pc.produit_id AND c.id = pc.categorie_id AND p.lang = 'fr' ".$where." ORDER BY p.id ASC";	
    
    
    				$sql_count = "SELECT COUNT(*) FROM peel_produits p, peel_produits_categories pc, peel_categories c WHERE p.id = pc.produit_id AND c.id = pc.categorie_id AND p.lang = 'fr' ".$where." ORDER BY p.id ASC";
    
    
    			} else {
    
    
    				$sql = "SELECT p.id,  p.reference, p.nom, p.description, p.prix, p.etat, p.date_maj FROM peel_produits p WHERE p.lang = 'fr' ".$where." ORDER BY p.id DESC";
    
    
    				$sql_count = "SELECT COUNT(*) FROM peel_produits p, peel_produits_categories pc, peel_categories c WHERE p.id = pc.produit_id AND c.id = pc.categorie_id AND p.lang = 'fr' ".$where." ORDER BY p.id ASC";
    
    
    			}

    si cela ne fonctionne pas, dis le car je n'ai pas fait de tests et je regarderai avec mes 2 yeux ce soir, il y a un souci avec count()

    J'ai essayé, c'est pareil.

    Je te remercie de consacrer de ton temps à mon problème.

  2. paulanna


    essaye avec cela

    if (isset($frm['categorie'])) {
    
    
    				if ($frm['categorie'] != "NULL") {$where .= " AND c.id = '".$frm['categorie']."'";}
    
    
    				$sql = "SELECT p.id, p.reference, p.nom, p.description, p.prix, p.etat, p.date_maj FROM peel_produits p, peel_produits_categories pc, peel_categories c WHERE p.id = pc.produit_id AND c.id = pc.categorie_id AND p.lang = 'fr' ".$where." ORDER BY p.id ASC";	
    
    
    				$sql_count = "SELECT COUNT(*) FROM peel_produits p, peel_produits_categories pc, peel_categories c WHERE p.id = pc.produit_id AND c.id = pc.categorie_id AND p.lang = 'fr' ".$where." ORDER BY p.id ASC";
    
    
    			} else {
    
    
    				$sql = "SELECT p.id,  p.reference, p.nom, p.description, p.prix, p.etat, p.date_maj FROM peel_produits p WHERE p.lang = 'fr' ".$where." ORDER BY p.id DESC";
    
    
    				$sql_count = "SELECT COUNT(*) FROM peel_produits p, peel_produits_categories pc, peel_categories c WHERE p.id = pc.produit_id AND c.id = pc.categorie_id AND p.lang = 'fr' ".$where." ORDER BY p.id ASC";
    
    
    			}

    si cela ne fonctionne pas, dis le car je n'ai pas fait de tests et je regarderai avec mes 2 yeux ce soir, il y a un souci avec count()

  3. 3DVF


    1) Ajout d'une table dans votre base de donnée :

    -- 
    -- Structure de la table `tag_cloud`
    --

    CREATE TABLE `tag_cloud` (
    `id` int(11) NOT NULL auto_increment,
    `tag_name` varchar(100) NOT NULL default '',
    `nbsearch` int(11) NOT NULL default '0',
    `aff_front` int(1) NOT NULL default '0',
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;[/codebox]

    2) Ajout dans haut.php juste avant la balise </head> (a vous de personaliser les couleurs/tailles)

    [codebox]<style> .nuage {line-height:25px;font: normal small verdana, arial, helvetica, sans-serif;
    text-align: justify;
    border:1px solid #B6CDE1;
    padding:10px;
    position:relative}
    .nuage a {text-decoration:none}
    .nuage a:hover {color: white; background-color: #668AA8;}
    .nuage a.level0 {font-size:3px;color:#DFDFDF;}
    .nuage a.level1 {font-size:6px;color:#B8C9D6;}
    .nuage a.level2 {font-size:7px;color:#668AA8;}
    .nuage a.level3 {font-size:8px;color:#47657B;}
    .nuage a.level4 {font-size:9px;color:#E76300;}
    .nuage a.level5 {font-size:10px;color:#685c65;}
    .nuage a.level6 {font-size:11x;color:#8c524d;}
    .nuage a.level7 {font-size:12px;color:#b44732;}
    .nuage a.level8 {font-size:13px;color:#e53a11;}
    .nuage a.level9 {font-size:15px;color:#E76300;font-weight: bold}
    .nuage a.level10 {font-size:17px;color:#FF3300;font-weight: bold}
    </style>

    3) Affichage du nuage : (modification le 08/06 pour une plus jolie présentation - Willy)

    <?php

    $max = 0;

    // Requete pour l'affichage du nuage
    $query = "SELECT tag_name AS tag, nbsearch AS quantity FROM tag_cloud WHERE aff_front ='1' GROUP BY tag_name ORDER BY RAND() LIMIT 25";
    $result = mysql_query($query);

    // Boucle à travers les résultats afin de les mettres dans un simple tableau:
    while ($row = mysql_fetch_array($result)) {
    $tags[$row['tag']] = $row['quantity'];
    if (intval($row['quantity']) > $max){ $max = intval($row['quantity']);}
    }
    echo '<div class="nuage" style="margin: 0pt auto; line-height: 20px;"><font face="arial,helvetica,sans-serif" size="3">';
    // Boucle à travers le tableau
    foreach ($tags as $key => $value) {
    $valeur = $value;
    // On limite a 10 car le CSS n'a que 10 entrées
    //if($valeur >= 10) { $valeur = 10; }
    echo '<a rel="nofollow" href="'.$wwwroot .'/achat/recherche.php?motclef='.$key.'" ';
    echo ' title="'.$value.' recherche(s) sur le mot '.$key.'"';
    echo ' class="level'.intval($value * 10/$max).'">'.$key.'</a> ';
    }
    echo "</div>";

    ?>[/codebox]

    4) Ajout dans recherche.php:

    a) Ajout après la ligne : $motclef = htmlspecialchars(trim($_GET['motclef']), ENT_QUOTES);

    [codebox]// Insertion Tag de recherche

    if($motclef != ""){
    $query = "SELECT COUNT(*) FROM tag_cloud WHERE tag_name = '$motclef'";
    $result = mysql_query($query);
    $enr = mysql_fetch_array($result);

    if($enr[0] == 0 ){
    $sql = "INSERT INTO `tag_cloud` (`id`, `tag_name`,`nbsearch`,`aff_front`) VALUES ('', '$motclef','0','')";
    mysql_query($sql) or die(mysql_error());

    }
    $query = "SELECT * FROM tag_cloud WHERE tag_name = '$motclef'";
    $result = mysql_query($query);
    while ( $champ = mysql_fetch_array($result) )
    {

    $id = $champ['id'];
    $nb_search = $champ['nbsearch'];
    $nb_search++;
    $sql = "UPDATE `tag_cloud` SET `nbsearch` = '$nb_search' WHERE `id` = $id LIMIT 1";
    mysql_query($sql) or die(mysql_error());
    }
    }
    // Fin Insertion

    b) Ajout après la ligne : echo "<tr><td colspan=\"3\" class=\"normal\">".nl2br(stripslashes(RESULT_SEARCH_NOK))."</td></tr>";

    // Recherche NOK donc on taggue le mot a 1 pour un affichage sur le front office
    $sql = "UPDATE `tag_cloud` SET `aff_front` = '0' WHERE `id` = $id LIMIT 1";
    mysql_query($sql) or die(mysql_error());
    [/codebox]

    c) Ajout après la ligne : echo "<tr><td colspan=\"3\" class=\"normal\">Nous avons trouvé <b>".mysql_num_rows($resultat)."</b> résultats pour votre recherche</td></tr>";

    [codebox]// Recherche OK donc on taggue le mot a 1 pour un affichage sur le front office
    $sql = "UPDATE `tag_cloud` SET `aff_front` = '1' WHERE `id` = $id LIMIT 1";
    mysql_query($sql) or die(mysql_error());

    Voila ça marche, merci à tous les contributeur sur le post : http://forum.peel.fr/index.php?showtopic=1170

    A suivre la partie Admin.

Twitter Advisto ecommerce

Facebook PEEL Shopping