14 if (!empty($_GET[
'type']) && $_GET[
'type'] ==
'error404') {
15 if (substr($_SERVER[
'REQUEST_URI'], 0, 1) ==
'/' && substr($_SERVER[
'REQUEST_URI'], 3, 1) ==
'/' && substr($_SERVER[
'REQUEST_URI'], 1, 2) !=
'js') {
19 $_GET[
'langue'] = substr($_SERVER[
'REQUEST_URI'], 1, 2);
21 define(
'IN_404_ERROR_PAGE',
true);
23 if(in_array(substr($_SERVER[
'REQUEST_URI'],-4), array(
'.css',
'.png',
'.jpg',
'.gif',
'.txt',
'.xml'))) {
29 if (defined(
'PEEL_PREFETCH')) {
32 include(
"configuration.inc.php");
35 if (!empty($_GET[
'type']) && $_GET[
'type'] ==
'unset_quick_add_product_from_search_page') {
36 unset(
$_SESSION[
'session_search_product_list']);
38 if (!empty($_GET[
'type']) && $_GET[
'type'] ==
'quick_add_product_from_search_page' && !empty(
$GLOBALS[
'site_parameters'][
'quick_add_product_from_search_page'])) {
40 $quick_add_product_from_search_page =
true;
41 if (!empty($_GET[
'prodid']) && !empty($_GET[
'quantite'])) {
42 $_SESSION[
'session_search_product_list'][$_GET[
'prodid']] = $_GET[
'quantite'];
45 if (!empty($_GET[
'type']) && $_GET[
'type'] ==
'error404') {
47 $_SERVER[
'REQUEST_URI'] =
$GLOBALS[
'apparent_folder'] .
'search.php';
52 if (strpos($_GET[
'search'],
'/') !==
false) {
58 foreach(array(
'/produits/',
'/'.
$GLOBALS[
'STR_MODULE_PREMIUM_URL_ADS_BY_KEYWORD'].
'-',
'/supplier-research-',
'/recherche-fournisseur-',
'/busqueda-proveedor-') as $this_url_rewriting_main_expression) {
69 define(
'IN_SEARCH',
true);
72 get_lang_ads_post_manage($_GET);
74 include_once(
$GLOBALS[
'fonctionsmap']);
79 $GLOBALS[
'multipage_avoid_redirect_if_page_over_limit'] =
true;
80 if (!empty(
$GLOBALS[
'site_parameters'][
'twenga_ads_account_url'])) {
81 $GLOBALS[
'integrate_twenga_ads'] =
true;
93 if(!empty($_GET[
'latitude'])){
94 $_SESSION[
'session_latitude'] = floatval($_GET[
'latitude']);
96 if(!empty($_GET[
'longitude'])){
97 $_SESSION[
'session_longitude'] = floatval($_GET[
'longitude']);
111 if (!empty($_GET[
'page']) && $_GET[
'page'] > 10 &&
String::strpos($_SERVER[
'HTTP_USER_AGENT'],
'bingbot') !==
false) {
127 if (!empty($_GET[
'country'])) {
134 'couleur' => array(
'table' =>
'couleurs',
'join' =>
'produits_couleurs',
'join_id' =>
'couleur_id',
'label' =>
$GLOBALS[
'STR_COLOR_LB']),
135 'taille' => array(
'table' =>
'tailles',
'join' =>
'produits_tailles',
'join_id' =>
'taille_id',
'label' =>
$GLOBALS[
'STR_TALL_LB'])
137 if (empty(
$GLOBALS[
'site_parameters'][
'disable_search_form_on_search_page'])) {
138 $output_form = get_search_form($_GET,
$search,
$match,
$real_search,
"full", !empty($quick_add_product_from_search_page));
151 $tpl_r->assign(
'STR_SEARCH_PRODUCT',
$GLOBALS[
'STR_SEARCH_PRODUCT']);
152 $tpl_r->assign(
'STR_SEARCH_RESULT_PRODUCT',
$GLOBALS[
'STR_SEARCH_RESULT_PRODUCT']);
153 $tpl_r->assign(
'STR_SEARCH_NO_RESULT_PRODUCT',
$GLOBALS[
'STR_SEARCH_NO_RESULT_PRODUCT']);
154 $tpl_r->assign(
'STR_RESULT_SEARCH',
$GLOBALS[
'STR_RESULT_SEARCH']);
155 $tpl_r->assign(
'STR_SEARCH_RESULT_ARTICLE',
$GLOBALS[
'STR_SEARCH_RESULT_ARTICLE']);
156 $tpl_r->assign(
'STR_SEARCH_NO_RESULT_ARTICLE',
$GLOBALS[
'STR_SEARCH_NO_RESULT_ARTICLE']);
157 $tpl_r->assign(
'STR_SEARCH_RESULT_BRAND',
$GLOBALS[
'STR_SEARCH_RESULT_BRAND']);
158 $tpl_r->assign(
'STR_SEARCH_NO_RESULT_BRAND',
$GLOBALS[
'STR_SEARCH_NO_RESULT_BRAND']);
160 $tpl_r->assign(
'search_in_product_and_ads', !empty(
$GLOBALS[
'site_parameters'][
'search_in_product_and_ads']));
161 $tpl_r->assign(
'page',
vn($_GET[
'page']));
164 $tpl_r->assign(
'display_save_search_button', display_save_search_button($_GET));
174 $launch_product_search =
true;
177 if(!empty($launch_product_search)) {
179 $additional_sql_inner =
'';
180 $additional_sql_cond_array = array();
181 $additional_sql_having =
'';
184 if (!empty($_GET[
'taille'])) {
185 $additional_sql_inner .=
' INNER JOIN peel_produits_tailles pt ON p.id=pt.produit_id';
186 $additional_sql_cond_array[] =
'pt.taille_id= "' . intval($_GET[
'taille']) .
'"';
188 if (!empty($_GET[
'categorie'])) {
189 $additional_sql_cond_array[] =
'pc.categorie_id IN ("' . implode(
'","',
get_category_tree_and_itself(intval($_GET[
'categorie']),
'sons',
'categories')) .
'")';
191 if (!empty($_GET[
'couleur'])) {
192 $additional_sql_inner .=
' INNER JOIN peel_produits_couleurs pco ON p.id=pco.produit_id';
193 $additional_sql_cond_array[] =
'pco.couleur_id="' . intval($_GET[
'couleur']) .
'"';
195 if (!empty($_GET[
'marque'])) {
198 if (!empty($_GET[
'date_flash'])) {
201 if (!empty($_GET[
'custom_attribut']) && is_array($_GET[
'custom_attribut'])) {
202 foreach($_GET[
'custom_attribut'] as $this_attribut_id) {
203 if (!empty($this_attribut_id) && is_numeric($this_attribut_id)) {
208 if (!empty($_GET[
'custom_nom_attribut']) && is_array($_GET[
'custom_nom_attribut'])) {
209 foreach($_GET[
'custom_nom_attribut'] as $this_nom_attribut_id) {
210 if (!empty($this_nom_attribut_id) && is_numeric($this_nom_attribut_id)) {
211 $nom_attributs_array[intval($this_nom_attribut_id)] =
true;
216 $additional_sql_inner .=
' INNER JOIN peel_produits_attributs pat ON p.id=pat.produit_id';
220 $having_cond_array[] =
'COUNT(DISTINCT pat.attribut_id)>=' . count(
$attributs_array);
223 if (!empty($nom_attributs_array)) {
224 $additional_sql_cond_array[] =
'pat.nom_attribut_id IN (' .
nohtml_real_escape_string(implode(
',', array_keys($nom_attributs_array))) .
')';
226 $having_cond_array[] =
'COUNT(DISTINCT pat.nom_attribut_id)>=' . count($nom_attributs_array);
231 if(!empty($having_cond_array)) {
232 $additional_sql_having .=
'HAVING '.implode(
' AND ', $having_cond_array);
236 if (count(
$terms) > 0 || !empty($additional_sql_cond_array)) {
239 $fields[] =
'p.nom_' . (!empty(
$GLOBALS[
'site_parameters'][
'product_name_forced_lang'])?
$GLOBALS[
'site_parameters'][
'product_name_forced_lang']:
$_SESSION[
'session_langue']);
240 $fields[] =
'p.descriptif_' .
$_SESSION[
'session_langue'];
241 $fields[] =
'p.description_' . (!empty(
$GLOBALS[
'site_parameters'][
'product_description_forced_lang'])?
$GLOBALS[
'site_parameters'][
'product_description_forced_lang']:
$_SESSION[
'session_langue']);
242 $fields[] =
'p.tab1_html_' .
$_SESSION[
'session_langue'];
243 $fields[] =
'p.tab1_title_' .
$_SESSION[
'session_langue'];
244 $fields[] =
'p.tab2_html_' .
$_SESSION[
'session_langue'];
245 $fields[] =
'p.tab2_title_' .
$_SESSION[
'session_langue'];
246 $fields[] =
'p.tab3_html_' .
$_SESSION[
'session_langue'];
247 $fields[] =
'p.tab3_title_' .
$_SESSION[
'session_langue'];
248 $fields[] =
'p.tab4_html_' .
$_SESSION[
'session_langue'];
249 $fields[] =
'p.tab4_title_' .
$_SESSION[
'session_langue'];
250 $fields[] =
'p.tab5_html_' .
$_SESSION[
'session_langue'];
251 $fields[] =
'p.tab5_title_' .
$_SESSION[
'session_langue'];
252 $fields[] =
'p.reference';
253 $fields[] =
'c.nom_' .
$_SESSION[
'session_langue'];
257 if (!empty($additional_sql_cond_array)) {
258 $additional_sql_cond =
'(' . implode(
') AND (', array_unique($additional_sql_cond_array)) .
')';
260 $additional_sql_cond =
'';
262 $result_affichage_produit = affiche_produits(null, 2,
'search',
$GLOBALS[
'site_parameters'][
'nb_produit_page'],
'column',
true, 0, 3,
true,
true, $additional_sql_inner, $additional_sql_cond, $additional_sql_having);
266 $tpl_r->assign(
'result_affichage_produit', $result_affichage_produit);
271 $additional_sql_cond_array = array();
272 $additional_sql_inner =
'';
273 $categorie_annonce = null;
274 $tpl_r->assign(
'STR_MODULE_ANNONCES_SEARCH_RESULT_ADS',
$GLOBALS[
'STR_MODULE_ANNONCES_SEARCH_RESULT_ADS']);
275 $tpl_r->assign(
'STR_MODULE_ANNONCES_SEARCH_NO_RESULT_ADS',
$GLOBALS[
'STR_MODULE_ANNONCES_SEARCH_NO_RESULT_ADS']);
276 if (!empty($_GET[
'cat_select']) && !is_array($_GET[
'cat_select'])) {
277 $categorie_annonce = intval($_GET[
'cat_select']);
280 $sql_cond = get_ad_search_sql($_GET, empty($categorie_annonce));
281 if (!empty(
$GLOBALS[
'site_parameters'][
'ads_search_page_display_mode']) &&
$GLOBALS[
'site_parameters'][
'ads_search_page_display_mode'] ==
'column') {
282 $boostrap_column_sizes_array = array(
'sm' => 4,
'md' => 4,
'lg' => 4);
284 $boostrap_column_sizes_array = array(
'sm' => 12,
'md' => 12,
'lg' => 12);
286 $res_affiche_annonces = affiche_annonces($categorie_annonce, $sql_cond, null,
'search',
$GLOBALS[
'site_parameters'][
'ads_per_page'],
vb(
$GLOBALS[
'site_parameters'][
'ads_search_page_display_mode'],
'line'),
true, null, 4,
false,
true,
false, $boostrap_column_sizes_array, 0,
'',
'',
false);
290 if (
vn($_GET[
'page'])<=1) {
293 if(!empty($_GET[
'search']) && strpos($xml_call_args,
'search=')===
false) {
295 if(!empty($xml_call_args)) {
296 $xml_call_args .=
'&';
298 $xml_call_args .=
'search='.$_GET[
'search'];
301 $res_affiche_annonces = getUserMap(null, $xml_call_args, 0,
false,
false) . $res_affiche_annonces;
304 $tpl_r->assign(
'res_affiche_annonces', $res_affiche_annonces);
307 if (
vn($_GET[
'page'])<=1 && count(
$terms) > 0) {
310 $tpl_r->assign(
'are_terms',
true);
311 $tpl_arts_found = array();
314 FROM peel_rubriques r
319 $launch_content_category_search =
true;
321 if(!empty($launch_content_category_search)) {
324 $fields[] =
'r.nom_' .
$_SESSION[
'session_langue'];
325 $fields[] =
'r.description_' .
$_SESSION[
'session_langue'];
329 $titre = $rub[
'nom_' .
$_SESSION[
'session_langue']];
338 $tpl_arts_found[] = array(
'num' =>
$i,
339 'category_href' => get_content_category_url($rub[
'id'], $rub[
'nom_' .
$_SESSION[
'session_langue']]),
340 'rubrique' => $rub[
'nom_' . $_SESSION[
'session_langue']],
341 'content_href' => null,
355 $launch_article_search =
true;
357 if(!empty($launch_article_search)) {
360 $fields[] =
'a.surtitre_' .
$_SESSION[
'session_langue'];
361 $fields[] =
'a.titre_' .
$_SESSION[
'session_langue'];
362 $fields[] =
'a.texte_' .
$_SESSION[
'session_langue'];
363 $fields[] =
'a.chapo_' .
$_SESSION[
'session_langue'];
367 $surtitre = $art[
'surtitre_' .
$_SESSION[
'session_langue']];
368 $titre = $art[
'titre_' .
$_SESSION[
'session_langue']];
383 $tpl_arts_found[] = array(
'num' =>
$i,
384 'category_href' => get_content_category_url($art[
'rubrique_id'], $art[
'rubrique']),
385 'rubrique' => $art[
'rubrique'],
386 'content_href' => get_content_url($art[
'id'], $titre, $art[
'rubrique_id'], $art[
'rubrique']),
392 $tpl_r->assign(
'arts_found', $tpl_arts_found);
401 $launch_article_search =
true;
403 if(!empty($launch_brand_search)) {
405 $tpl_brands_found = array();
408 $fields[] =
'm.nom_' .
$_SESSION[
'session_langue'];
409 $fields[] =
'm.description_' .
$_SESSION[
'session_langue'];
413 $nom = $marque[
'nom_' .
$_SESSION[
'session_langue']];
414 $urlbrand = get_url(
'/achat/marque.php', array(
'id' => $marque[
'id']));
424 $tpl_brands_found[] = array(
'num' =>
$i,
427 'description' => $description
431 $tpl_r->assign(
'brands_found', $tpl_brands_found);
436 foreach ($keywords_array as $this_keyword) {
444 if (!empty($_GET[
'type']) && $_GET[
'type'] ==
'error404') {
445 $content = affiche_contenu_html(
'error404',
true);
446 if(!
$GLOBALS[
'affiche_contenu_html_last_found']) {
448 $content =
'<h1>Error 404</h1><br />';
450 $tpl->assign(
'content', $content);
453 $tpl->assign(
'quick_add_product_from_search_page', !empty($quick_add_product_from_search_page));
454 $tpl->assign(
'form', $output_form);
457 $tpl->assign(
'page',
vn($_GET[
'page']));
458 $tpl->assign(
'STR_SEARCH_HELP',
$GLOBALS[
'STR_SEARCH_HELP']);
459 $tpl->assign(
'STR_SEARCH_PRODUCT',
$GLOBALS[
'STR_SEARCH_PRODUCT']);
462 include(
$GLOBALS[
'repertoire_modele'] .
'/haut.php');
464 include(
$GLOBALS[
'repertoire_modele'] .
'/bas.php');
478 $requete =
'SELECT r.id';
479 foreach ($fields as $value) {
483 FROM peel_rubriques r
485 ORDER BY r.position ASC, r.id DESC
500 $requete =
'SELECT a.id, r.id AS rubrique_id, r.nom_' .
$_SESSION[
'session_langue'] .
' AS rubrique ';
501 foreach ($fields as $value) {
506 INNER JOIN peel_articles_rubriques ar ON ar.article_id = a.id
507 INNER JOIN peel_rubriques r ON r.id = ar.rubrique_id AND r.technical_code NOT IN ("nosearch", "other", "iphone_content") AND ' .
get_filter_site_cond(
'rubriques',
'r') .
'
510 ORDER BY a.position ASC, a.id DESC
525 $requete =
'SELECT m.id ';
526 foreach ($fields as $value) {
if(!empty($GLOBALS['site_parameters']['twenga_ads_account_url'])) $output
static strip_tags($string, $allowed_tags=null)
String::strip_tags()
build_terms_clause($terms, $fields, $match_method)
builds the sql statement's where clause this will build the sql based on the given information Valeur...
static strpos($haystack, $needle, $offset=0)
Returns the numeric position of the first occurrence of needle in the haystack string.
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
static rawurldecode($string, $avoid_slash=false)
Returns rawurldecode.
redirect_and_die($url, $permanent_redirection=false, $avoid_loop=false)
Redirige vers l'URL demandée et arrête le programme.
build_search_terms($search, $match_method)
Découpe la chaine recherchée en éléments distincts suivant le mode $match_method Valeurs de $match_me...
static html_entity_decode_if_needed($string)
String::html_entity_decode_if_needed()
sql_tagcloud($motclef)
Insertion Tag de recherche.
static strtolower($string)
Returns string with all alphabetic characters converted to lowercase.
static strlen($string)
Returns the length of the given string.
nohtml_real_escape_string($value, $allowed_tags=null)
Protège les données pour insertion dans MySQL ET supprime les tags HTML pour protéger de toute sorte ...
build_sql_articles($terms, $fields, $match_method)
build_sql_articles()
if(!empty($_GET['country'])) $search_attribute_tab
if(check_if_module_active('sauvegarde_recherche')) if(!check_if_module_active('annonces')||(check_if_module_active('annonces')&&!empty($GLOBALS['site_parameters']['search_in_product_and_ads']))) if(!empty($launch_product_search)) if(check_if_module_active('annonces')) if(vn($_GET['page'])<=1 &&count($terms) > 0) $result
real_escape_string($value)
real_escape_string()
if(check_if_module_active('annonces')) $GLOBALS['multipage_avoid_redirect_if_page_over_limit']
get_filter_site_cond($table_technical_code, $table_alias=null, $use_strict_rights_if_in_admin=false, $specific_site_id=null, $exclude_public_items=false, $admin_force_multisite_if_allowed=false)
Retourne la condition SQL permettant de filtrer les données pour une table.
get_category_tree_and_itself($id_or_ids_array, $mode= 'sons', $table_to_use= 'categories')
get_category_tree_and_itself()
query($query, $die_if_error=false, $database_object=null, $silent_if_error=false, $security_sql_filter=true)
The query() function is meant to be called anywhere you want to make a query.
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
necessite_identification()
Si l'utilisateur n'est pas connecté à un compte, on affiche une page d'identification et arrête le sc...
fetch_assoc($query_result)
fetch_assoc()
build_sql_marques($terms, $fields, $match_method)
build_sql_marques()
call_module_hook($hook, $params, $mode= 'boolean')
Appelle la fonction correspondant au $hook pour chaque module installé La fonction doit s'appeler : [...
static html_entity_decode($string, $quote_style=ENT_COMPAT, $charset=GENERAL_ENCODING)
String::html_entity_decode()
build_sql_content_category($terms, $fields, $match_method)
build_sql_content_category()
static substr($string, $start, $length=null)
Returns the portion of string specified by the start and length parameters.
check_if_module_active($module_name, $specific_file_name=null)
Renvoie si un module est présent et activé ou non - Peut être appelé avant ou après le chargement d'u...
static str_shorten($string, $length_limit, $middle_separator= '', $ending_if_no_middle_separator= '...', $ideal_length_with_clean_cut_if_possible=null)
Raccourcit une chaine de caractère en insérant au milieu ou à la fin un séparateur.
static ucfirst($string)
Returns string with first letter uppercase.
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']
static rawurlencode($string, $avoid_slash=true)
Returns string compatible with Apache without the AllowEncodedSlashes directive ON => avoids systemat...