français if($cats[0] == "2") {$country="uk";} // lang=2 => English if($cats[0] == "3") {$country="es";} // lang=3 => Espanol if($displayOutOfStock=="oui" AND $actRes=="oui") {$addToQuery="";} else {$addToQuery = " AND products_qt>0";} // FUNCTION PATH function searchPath($product_name, $cat_name, $parent_id, $lang) { global $productPath; $subCatQuery = mysql_query("SELECT categories_name_".$lang.", parent_id FROM categories WHERE categories_id = '".$parent_id."' "); $arrSubCategory = mysql_fetch_array($subCatQuery); $subCatParentId = $arrSubCategory['parent_id']; $subCatName = $arrSubCategory['categories_name_'.$lang]; if($subCatParentId == '0') { $productPath[$product_name][] = $subCatName; } else { $productPath[$product_name][] = $subCatName; searchPath($product_name, $subCatName, $subCatParentId, $lang); } $pathReturn = implode(">", array_reverse($productPath[$product_name])); $pathReturn = $pathReturn.">".$cat_name; return $pathReturn; } // END FUNCTION PATH if($displayOutOfStock=="oui" AND $actRes=="oui") {$addToQuery="";} else {$addToQuery = " AND products_qt>0";} $Orderquery = mysql_query("SELECT products_name_".$cats[0].", products_desc_".$cats[0].", products_price, products_image, products_ref, products_id, categories_id, products_qt, fabricant_id, products_weight FROM products WHERE products_visible = 'yes' ".$addToQuery." ".$cats11." ORDER BY products_name_".$cats[0].""); $OrderqueryNum = mysql_num_rows($Orderquery); if ($OrderqueryNum > 0) { while ($arrSelect = mysql_fetch_array($Orderquery)) { // Mise en forme des donnees shopmania // Marque $marqueQuery = mysql_query("SELECT fournisseurs_company FROM fournisseurs WHERE fournisseurs_id = '".$arrSelect['fabricant_id']."' "); $arrMarque = mysql_fetch_array($marqueQuery); $marque = $arrMarque['fournisseurs_company']; // Suppression des tags html et des carateres inutiles // titre $titre = strip_tags($arrSelect['products_name_'.$cats[0]]); $titre = trim($titre); $titre = str_replace("\r\n", ". ", $titre); $titre = str_replace("\n", ". ", $titre); $titre = str_replace("/t", " ", $titre); $titre = str_replace(">", "-", $titre); $titre = str_replace(";", ",", $titre); // Suppression des tags html et des carateres inutiles // description $description = strip_tags($arrSelect['products_desc_'.$cats[0]]); $description = trim($description); $description = str_replace("\t", " ", $description); $description = str_replace("\r\n", ". ", $description); $description = str_replace("\n", ". ", $description); $description = str_replace("/t", " ", $description); $description = str_replace(">", "-", $description); $description = str_replace(";", ",", $description); // titre if(strlen($titre) >= 80) { $title = substr($titre, 0, 79); $title = substr_replace($title,'...',-3); } else { $title=$titre; } // Categorie $catQuery = mysql_query("SELECT categories_name_".$cats[0].", parent_id FROM categories WHERE categories_id = '".$arrSelect['categories_id']."' "); $arrCategory = mysql_fetch_array($catQuery); $category = searchPath($titre, $arrCategory['categories_name_'.$cats[0]], $arrCategory['parent_id'], $cats[0]); // description if(strlen($description) >= 249) { $desc = substr($description, 0, 189); $desc = substr_replace($desc,'...',-3); } else { $desc=$description; } // url product $url = "http://www.".$domaineFull."/description.php?lang2=".$cats[0]."&id=".$arrSelect['products_id']."&path=".$arrSelect['categories_id']; // url image $image = "http://www.".$domaineFull."/".$arrSelect['products_image']; // prix $prix = sprintf("%0.2f",$arrSelect['products_price']); // product Id $offerId = $arrSelect['products_ref']; // build chaine items $marque = "Votre marque ici"; //décommenter pour forcer votre marque $devise = "EUR"; $chaine = $category."|".$marque."|".""."|".$offerId."|".$title."|".$desc."|".$url."|".$image."|".$prix."|".$devise."\n"; echo $chaine; } } ?>