14 if (!defined(
'IN_PEEL')) {
18 if (!function_exists(
'tr_rollover')) {
29 function tr_rollover($line_number, $return_mode =
false, $style = null, $onclick = null,
$id = null)
33 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'tr_rollover.tpl');
35 $tpl->assign(
'onclick', $onclick);
36 $tpl->assign(
'style', $style);
37 $tpl->assign(
'line_number', $line_number);
48 if (!function_exists(
'affiche_meta')) {
61 function affiche_meta($page_name, $return_mode =
false)
66 if (!empty($_GET[
'id']) && defined(
'IN_LEXIQUE')) {
67 $sql_Meta =
'SELECT word_' .
$_SESSION[
'session_langue'] .
' AS nom, meta_title_' .
$_SESSION[
'session_langue'] .
' AS meta_titre, meta_definition_' .
$_SESSION[
'session_langue'] .
' AS meta_desc
70 }
elseif (!empty($_GET[
'catid']) && (defined(
'IN_CATALOGUE_ANNONCE') || defined(
'IN_CATALOGUE_ANNONCE_DETAILS'))) {
71 $sql_Meta =
'SELECT nom_' .
$_SESSION[
'session_langue'] .
' AS nom, meta_titre_' .
$_SESSION[
'session_langue'] .
' AS meta_titre, meta_key_' .
$_SESSION[
'session_langue'] .
' AS meta_key, meta_desc_' .
vb(
$_SESSION[
'session_langue']) .
' AS meta_desc, image_' .
$_SESSION[
'session_langue'] .
' AS image
72 FROM peel_categories_annonces
73 WHERE id = "' . intval($_GET[
'catid']) .
'" AND ' .
get_filter_site_cond(
'categories_annonces') .
'';
74 }
elseif (!empty($_GET[
'id']) && defined(
'IN_SEARCH_BRAND')) {
76 $sql_Meta =
'SELECT nom_' .
$_SESSION[
'session_langue'] .
' AS nom, meta_titre_' .
$_SESSION[
'session_langue'] .
' AS meta_titre, meta_desc_' .
$_SESSION[
'session_langue'] .
' AS meta_desc, meta_key_' .
$_SESSION[
'session_langue'] .
' AS meta_key, image
79 }
elseif (!empty($_GET[
'catid']) && empty($_GET[
'id'])) {
81 $sql_Meta =
'SELECT nom_' .
$_SESSION[
'session_langue'] .
' AS nom, meta_titre_' .
$_SESSION[
'session_langue'] .
' AS meta_titre, meta_desc_' .
$_SESSION[
'session_langue'] .
' AS meta_desc, meta_key_' .
$_SESSION[
'session_langue'] .
' AS meta_key, image_' .
$_SESSION[
'session_langue'] .
' AS image
84 }
elseif (!empty($_GET[
'rubid']) && empty($_GET[
'id'])) {
86 $sql_Meta =
'SELECT nom_' .
$_SESSION[
'session_langue'] .
' AS nom, meta_titre_' .
$_SESSION[
'session_langue'] .
' AS meta_titre, meta_desc_' .
$_SESSION[
'session_langue'] .
' AS meta_desc, meta_key_' .
$_SESSION[
'session_langue'] .
' AS meta_key, image
89 }
elseif (!empty($_GET[
'id']) && defined(
'IN_CATALOGUE_PRODUIT')) {
91 $display_facebook_tag =
'product';
92 $sql_Meta =
"SELECT nom_".(!empty(
$GLOBALS[
'site_parameters'][
'product_name_forced_lang'])?
$GLOBALS[
'site_parameters'][
'product_name_forced_lang']:
$_SESSION[
'session_langue']).
" AS nom, meta_titre_" .
$_SESSION[
'session_langue'] .
' AS meta_titre, meta_desc_' .
$_SESSION[
'session_langue'] .
' AS meta_desc, meta_key_' .
$_SESSION[
'session_langue'] .
' AS meta_key, image1 AS image
95 }
elseif (!empty($_GET[
'id']) && defined(
'IN_RUBRIQUE_ARTICLE')) {
97 $display_facebook_tag =
'article';
98 $sql_Meta =
'SELECT titre_' .
$_SESSION[
'session_langue'] .
' AS nom, meta_titre_' .
$_SESSION[
'session_langue'] .
' AS meta_titre, meta_desc_' .
$_SESSION[
'session_langue'] .
' AS meta_desc, meta_key_' .
$_SESSION[
'session_langue'] .
' AS meta_key, image1 AS image
103 if (!empty($sql_Meta)) {
104 $query_Meta =
query($sql_Meta);
107 $no_meta_by_page_content =
true;
110 $sql_Meta =
'SELECT *
113 $query_Meta =
query($sql_Meta);
115 if(!empty($m_peel_meta)) {
116 $meta_by_exact_url =
true;
117 }
elseif(!empty($page_name)) {
118 $sql_Meta =
'SELECT *
121 $query_Meta =
query($sql_Meta);
125 if (defined(
'IN_PARTNER')) {
126 $GLOBALS[
'strSpecificMeta'][
'Title'][$page_name] =
$GLOBALS[
'STR_OUR_PARTNER'];
127 }
elseif (defined(
'IN_MAP')) {
128 $GLOBALS[
'strSpecificMeta'][
'Title'][$page_name] =
$GLOBALS[
'STR_WORD_RESELLER'];
129 }
elseif (defined(
'IN_RETAILER')) {
130 $GLOBALS[
'strSpecificMeta'][
'Title'][$page_name] =
$GLOBALS[
'STR_RETAILER_SUBSCRIBE'];
131 }
elseif (defined(
'IN_REFERENCE')) {
132 $GLOBALS[
'strSpecificMeta'][
'Title'][$page_name] =
$GLOBALS[
'STR_REFERENCE_ON_LINE_SHOP'];
133 }
elseif (defined(
'IN_DEVIS')) {
134 $GLOBALS[
'strSpecificMeta'][
'Title'][$page_name] =
$GLOBALS[
'STR_DEVIS_ON_LINE_SHOP'];
135 }
elseif (defined(
'IN_DOWNLOAD_PEEL') && !empty(
$GLOBALS[
'STR_MODULE_PEEL_DOWNLOAD_PEEL'])) {
136 $GLOBALS[
'strSpecificMeta'][
'Title'][$page_name] =
$GLOBALS[
'STR_MODULE_PEEL_DOWNLOAD_PEEL'];
139 $sql_Meta =
'SELECT *
142 ORDER BY LENGTH(technical_code) DESC
144 $query_Meta =
query($sql_Meta);
147 if (!empty($meta_by_exact_url) && !empty($m_peel_meta) && !empty($m_peel_meta[
'meta_titre_' .
$_SESSION[
'session_langue']])) {
149 $this_title = $m_peel_meta[
'meta_titre_' . $_SESSION[
'session_langue']];
151 $this_title =
$GLOBALS[
'meta_title'];
152 }
elseif (!empty($m) && !empty($m[
'meta_titre'])) {
153 $this_title = $m[
'meta_titre'];
154 }
elseif (!empty($m) && !empty($m[
'nom'])) {
155 $this_title = $m[
'nom'];
156 }
elseif (!empty($m_peel_meta) && !empty($m_peel_meta[
'meta_titre_' . $_SESSION[
'session_langue']])) {
157 $this_title = $m_peel_meta[
'meta_titre_' . $_SESSION[
'session_langue']];
160 $this_title =
$GLOBALS[
'DOC_TITLE'];
161 }
elseif (!empty(
$GLOBALS[
'strSpecificMeta'][
'Title'][$page_name])) {
162 $this_title =
$GLOBALS[
'strSpecificMeta'][
'Title'][$page_name];
164 $this_title = $m_default[
'meta_titre_' . $_SESSION[
'session_langue']];
167 if (!empty(
$GLOBALS[
'meta_description'])) {
168 $this_description = str_replace(array(
' ',
' ',
' ',
"\t"),
' ', trim(
String::strip_tags(
$GLOBALS[
'meta_description']))) .
' ';
170 $this_description =
'';
173 if (!empty($m[
'meta_desc'])) {
174 $this_description .= $m[
'meta_desc'];
175 }
elseif (!empty($m_peel_meta[
'meta_desc_' . $_SESSION[
'session_langue']])) {
176 $this_description .= $m_peel_meta[
'meta_desc_' . $_SESSION[
'session_langue']];
177 }
elseif (!empty(
$GLOBALS[
'strSpecificMeta'][
'Description'][$page_name])) {
178 $this_description .=
$GLOBALS[
'strSpecificMeta'][
'Description'][$page_name];
180 $this_description .= $m_default[
'meta_desc_' . $_SESSION[
'session_langue']];
181 if (!empty($m[
'nom'])) {
182 $this_description = $m[
'nom'] .
'. ' . $this_description;
184 $this_description =
$GLOBALS[
'meta_title'] .
'. ' . $this_description;
186 $this_description =
$GLOBALS[
'DOC_TITLE'] .
'. ' . $this_description;
194 if (!empty(
$GLOBALS[
'STR_TITLE_SUFFIX'])) {
195 foreach(explode(
' ',
$GLOBALS[
'STR_TITLE_SUFFIX']) as $this_word) {
197 $this_title .=
' ' .$this_word;
203 $this_keywords = $m[
'meta_key'];
204 }
elseif((!empty($meta_by_exact_url) || !empty($no_meta_by_page_content)) && !empty($m_peel_meta) && !empty($m_peel_meta[
'meta_key_' . $_SESSION[
'session_langue']]) &&
String::strlen($m_peel_meta[
'meta_key_' . $_SESSION[
'session_langue']]) > 40 &&
String::strlen($m_peel_meta[
'meta_key_' . $_SESSION[
'session_langue']]) < 150) {
207 $this_keywords = $m_peel_meta[
'meta_key_' . $_SESSION[
'session_langue']];
209 $this_keywords = $this_title .
' ' .
vb(
$GLOBALS[
'meta_keywords']) .
' ' .
vb($m[
'nom']) .
' ' .
vb($m[
'meta_key']) .
' '.
vb(
$GLOBALS[
'strSpecificMeta'][
'Keywords'][$page_name]) .
' ' .
vb($m_peel_meta[
'meta_key_' . $_SESSION[
'session_langue']]);
211 $this_keywords .=
' ' . $this_description;
214 $this_keywords .=
' ' . $m_default[
'meta_key_' . $_SESSION[
'session_langue']];
216 if (!empty($this_keywords)) {
218 $temp_array = array_unique(explode(
',', trim(
String::strip_tags(str_replace(array(
"\r",
"\n",
"\t",
'!',
'?',
'(',
')',
'.',
'#',
':',
';',
' ',
'+',
'-',
" ",
".",
'"',
"'"),
',',
String::html_entity_decode(str_replace(array(
' '),
',',
String::strtolower($this_keywords))))))));
219 foreach($temp_array as $this_key => $this_value) {
221 unset($temp_array[$this_key]);
224 $this_keywords = implode(
', ', array_slice($temp_array, 0, 12));
227 $GLOBALS[
'meta_description_html_uncut'] = $this_description;
228 if (!empty($this_description)) {
229 $this_description =
String::str_shorten(str_replace(array(
' ',
' ',
' ',
' .',
'....'), array(
' ',
' ',
' ',
'.',
'.'), trim(
String::strip_tags(
String::html_entity_decode_if_needed(str_replace(array(
"\r",
"\n",
"<br>",
"<br />",
"</p>"),
' ', $this_description))))), 190,
'',
'...', 170);
234 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'meta.tpl');
235 $tpl->assign(
'charset', GENERAL_ENCODING);
237 $tpl->assign(
'keywords', $this_keywords);
239 if($_SESSION[
'session_langue'] ==
'fr') {
240 $tpl->assign(
'generator',
'https://www.peel.fr/');
242 $tpl->assign(
'generator',
'http://www.peel-shopping.com/');
245 $tpl->assign(
'content_language', $_SESSION[
'session_langue']);
246 if ((!empty($display_facebook_tag) || !empty(
$GLOBALS[
'site_parameters'][
'facebook_meta_force_all_pages'])) &&
check_if_module_active(
'facebook')) {
247 if(empty(
$GLOBALS[
'facebook_image'])) {
250 $display_facebook_tag_array = array(
'meta_titre' => $this_title,
'meta_desc' => $this_description,
'image' =>
$GLOBALS[
'facebook_image'],
'type' => (!empty($display_facebook_tag) && is_string($display_facebook_tag)?$display_facebook_tag:
'website'),
'image_size' =>
vb(
$GLOBALS[
'facebook_image_size']));
251 $tpl->assign(
'facebook_tag', display_facebook_tag($display_facebook_tag_array));
253 if(!empty(
$GLOBALS[
'site_parameters'][
'bootstrap_enabled'])) {
254 $tpl->assign(
'specific_meta',
'<meta name="viewport" content="width=device-width, initial-scale=1.0" />');
256 if((!empty($_GET[
'update']) && $_GET[
'update'] == 1) || !empty(
$GLOBALS[
'robots_noindex'])|| !empty($_GET[
'follow']) || !empty($_GET[
'nofollow'])) {
257 $robots =
'noindex, nofollow';
261 $tpl->assign(
'robots', $robots);
272 if (!function_exists(
'affiche_ariane')) {
281 function affiche_ariane($show_home =
true, $page_name = null, $buttons = null)
284 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'ariane.tpl');
285 $hidden = !empty(
$GLOBALS[
'site_parameters'][
'module_ariane_hidden']);
286 $tpl->assign(
'hidden', $hidden);
289 $ariane = array(
'href' =>
false,
293 $other = array(
'href' =>
false,
297 if (!defined(
'IN_HOME')) {
299 $ariane[
'href'] = get_url(
'/');
301 if (defined(
'IN_CATALOGUE')) {
302 $other[
'txt'] = affiche_arbre_categorie(
vn($_GET[
'catid']), null, null, array());
304 $other[
'hidden'] = affiche_arbre_categorie(
vn($_GET[
'catid']), null, null, array(),
true);
306 }
elseif (defined(
'IN_CATALOGUE_PRODUIT')) {
307 $other[
'txt'] = affiche_arbre_categorie(
vn($_GET[
'catid']), null, null, array());
309 $other[
'hidden'] = affiche_arbre_categorie(
vn($_GET[
'catid']), null, null, array(),
true);
311 }
elseif (defined(
'IN_RUBRIQUE')) {
312 $other[
'txt'] = affiche_arbre_rubrique(
vn($_GET[
'rubid']), null);
314 $other[
'hidden'] = affiche_arbre_rubrique(
vn($_GET[
'rubid']), null,
true);
316 }
elseif (defined(
'IN_RUBRIQUE_ARTICLE')) {
317 $other[
'txt'] = affiche_arbre_rubrique(
vn($_GET[
'rubid']), null);
319 $other[
'hidden'] = affiche_arbre_rubrique(
vn($_GET[
'rubid']), null,
true);
321 }
elseif (defined(
'IN_NOUVEAUTES')) {
322 $other[
'txt'] =
$GLOBALS[
'STR_NOUVEAUTES'];
323 $other[
'href'] = get_url(
'/achat/nouveautes.php');
324 }
elseif (defined(
'IN_PROMOTIONS')) {
325 $other[
'txt'] =
$GLOBALS[
'STR_PROMOTIONS'];
326 $other[
'href'] = get_url(
'/achat/promotions.php');
327 }
elseif (defined(
'IN_SPECIAL')) {
328 $other[
'txt'] =
$GLOBALS[
'STR_SPECIAL'];
329 $other[
'href'] = get_url(
'/achat/special.php');
330 }
elseif (defined(
'IN_TOP')) {
331 $other[
'txt'] =
$GLOBALS[
'STR_TOP'];
332 $other[
'href'] = get_url(
'/achat/top.php');
333 }
elseif (defined(
'IN_FLASH')) {
334 $other[
'txt'] =
$GLOBALS[
'STR_FLASH'];
335 $other[
'href'] = get_url(
'/modules/flash/flash.php');
336 }
elseif (defined(
'IN_CHEQUE_CADEAU')) {
337 $other[
'txt'] =
$GLOBALS[
'STR_CHEQUE_CADEAU'];
338 $other[
'href'] = get_url(
'/modules/gift_check/cheques.php');
339 }
elseif (defined(
'IN_ORDER_HISTORY')) {
340 $other[
'txt'] =
$GLOBALS[
'STR_ORDER_HISTORY'];
341 $other[
'href'] = get_url(
'/achat/historique_commandes.php');
342 }
elseif (defined(
'IN_COMPTE')) {
343 $other[
'txt'] =
$GLOBALS[
'STR_COMPTE'];
344 $other[
'href'] = get_account_url(
false,
false);
345 }
elseif (defined(
'IN_CONTACT')) {
346 $other[
'txt'] =
$GLOBALS[
'STR_CONTACT'];
348 $other[
'href'] = get_contact_url(
false,
false);
350 $other[
'href'] = get_url(
'/utilisateurs/contact.php');
352 }
elseif (defined(
'IN_CONTACT_US')) {
353 $other[
'txt'] =
$GLOBALS[
'STR_CONTACT_US'];
354 $other[
'href'] = get_url(
'/contacts.php');
355 }
elseif (defined(
'IN_SEARCH')) {
356 $other[
'txt'] =
$GLOBALS[
'STR_SEARCH'];
357 $other[
'href'] = get_url(
'search');
358 }
elseif (defined(
'IN_SITEMAP')) {
359 $other[
'txt'] =
$GLOBALS[
'STR_SITEMAP'];
360 $other[
'href'] = get_url(
'sitemap');
361 }
elseif (defined(
'IN_CGV')) {
362 $other[
'txt'] =
$GLOBALS[
'STR_CGV'];
363 $other[
'href'] = get_cgv_url(
false);
364 }
elseif (defined(
'IN_FAQ')) {
365 $other[
'txt'] =
$GLOBALS[
'STR_FAQ_TITLE'];
366 $other[
'href'] = get_url(
'/modules/faq/faq.php');
367 }
elseif (defined(
'IN_INFO_LEGALE')) {
368 $other[
'txt'] =
$GLOBALS[
'STR_LEGAL_INFORMATION'];
369 $other[
'href'] = get_url(
'legal');
370 }
elseif (defined(
'IN_CONDITION_PARRAIN')) {
371 $other[
'txt'] =
$GLOBALS[
'STR_CONDITION_PARRAIN'];
372 $other[
'href'] = get_url(
'/modules/parrainage/conditions.php');
373 }
elseif (defined(
'IN_PARRAIN_ENTETE')) {
374 $other[
'txt'] =
$GLOBALS[
'STR_PARRAIN_ENTETE'];
375 $other[
'href'] = get_url(
'/modules/parrainage/parrain.php');
376 }
elseif (defined(
'IN_CONDITION_AFFILI')) {
377 $other[
'txt'] =
$GLOBALS[
'STR_CONDITION_AFFILI'];
378 $other[
'href'] = get_url(
'/modules/affiliation/conditions.php');
379 }
elseif (defined(
'IN_AFFILIATE')) {
380 $other[
'txt'] =
$GLOBALS[
'STR_AFFILIATE'];
381 $other[
'href'] = get_url(
'/modules/affiliation/affiliate.php');
382 }
elseif (defined(
'IN_RETAILER')) {
383 $other[
'txt'] =
$GLOBALS[
'STR_RETAILER'];
384 $other[
'href'] = get_url(
'/modules/reseller/retailer.php');
385 }
elseif (defined(
'IN_CHANGE_PASSWORD')) {
386 $other[
'txt'] =
$GLOBALS[
'STR_CHANGE_PASSWORD'];
387 $other[
'href'] = get_url(
'/utilisateurs/change_mot_passe.php');
388 }
elseif (defined(
'IN_CHANGE_PARAMS')) {
389 $other[
'txt'] =
$GLOBALS[
'STR_CHANGE_PARAMS'];
390 $other[
'href'] = get_url(
'/utilisateurs/change_params.php');
391 }
elseif (defined(
'IN_GET_PASSWORD')) {
392 $other[
'txt'] =
$GLOBALS[
'STR_GET_PASSWORD'];
393 $other[
'href'] = get_url(
'/utilisateurs/oubli_mot_passe.php');
394 }
elseif (defined(
'IN_REGISTER')) {
395 $other[
'txt'] =
$GLOBALS[
'STR_REGISTER'];
396 $other[
'href'] = get_account_register_url(
false,
false);
397 }
elseif (defined(
'IN_ACCES_ACCOUNT')) {
398 $other[
'txt'] =
$GLOBALS[
'STR_ACCES_ACCOUNT'];
399 $other[
'href'] = get_url(
'membre');
400 }
elseif (defined(
'IN_TELL_FRIEND')) {
401 $other[
'txt'] =
$GLOBALS[
'STR_TELL_FRIEND'];
402 $other[
'href'] = get_tell_friends_url(
false);
403 }
elseif (defined(
'IN_TOUS_LES_AVIS')) {
404 $other[
'txt'] =
$GLOBALS[
'STR_TOUS_LES_AVIS'];
405 }
elseif (defined(
'IN_DONNEZ_AVIS')) {
406 $other[
'txt'] =
$GLOBALS[
'STR_DONNEZ_AVIS'];
407 }
elseif (defined(
'IN_CADDIE')) {
408 $other[
'txt'] =
$GLOBALS[
'STR_CADDIE'];
409 $other[
'href'] = get_url(
'caddie_affichage');
410 }
elseif (defined(
'IN_STEP1')) {
411 $other[
'txt'] =
$GLOBALS[
'STR_STEP1'];
412 }
elseif (defined(
'IN_STEP2')) {
413 $other[
'txt'] =
$GLOBALS[
'STR_STEP2'];
414 }
elseif (defined(
'IN_STEP3')) {
415 $other[
'txt'] =
$GLOBALS[
'STR_STEP3'];
416 }
elseif (defined(
'IN_SEARCH_BRAND')) {
417 $other[
'txt'] =
$GLOBALS[
'STR_SEARCH_BRAND'];
418 }
elseif (defined(
'IN_PENSE_BETE')) {
419 $other[
'txt'] =
$GLOBALS[
'STR_PENSE_BETE'];
420 $other[
'href'] = get_url(
'/modules/pensebete/voir.php');
421 }
elseif (defined(
'IN_DOWNLOAD')) {
422 $other[
'txt'] =
$GLOBALS[
'STR_YOUR_ORDER_DOWNLOAD'];
423 $other[
'href'] = get_url(
'/modules/download/telecharger.php', array(
'id' =>
vb($_GET[
'id']) ,
'key' =>
vb($_GET[
'key'])));
424 }
elseif (defined(
'IN_FORUM')) {
425 $other[
'txt'] =
$GLOBALS[
'STR_FORUM'];
426 $other[
'href'] = get_url(
'/modules/forum/index.php');
427 }
elseif (defined(
'IN_LEXIQUE')) {
428 $other[
'txt'] =
$GLOBALS[
'STR_LEXIQUE'];
429 $other[
'href'] = get_lexicon_url();
431 if(!empty($page_name)) {
432 $other[
'txt'] .=
' > ' . $page_name;
434 $tpl->assign(
'ariane', $ariane);
435 $tpl->assign(
'other', $other);
436 $tpl->assign(
'buttons', $buttons);
437 return $tpl->fetch();
442 if (!function_exists(
'affiche_filtre')) {
449 function affiche_filtre(
$id = null, $return_mode =
false)
452 if (
vn(
$GLOBALS[
'site_parameters'][
'module_filtre']) == 1) {
454 $qid =
query(
'SELECT id, c.nom_' . $_SESSION[
'session_langue'] .
' as categorie, c.image_' . $_SESSION[
'session_langue'] .
'
455 FROM peel_categories c
456 WHERE c.nom_' . $_SESSION[
'session_langue'] .
'!="" AND c.etat="1" AND id="' . intval(
$id) .
'" AND ' .
get_filter_site_cond(
'categories',
'c') .
'
457 ORDER BY c.position');
459 $urlcat_with_suffixe = get_product_category_url(
$id, $cat[
'categorie'],
true,
true);
464 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'filtre.tpl');
465 $tpl->assign(
'options', array(
466 $_SERVER[
'REQUEST_URI'] =>
$GLOBALS[
'STR_ORDER_RESULTS_BY'],
467 $urlcat_with_suffixe .
'tri=nom_' . $_SESSION[
'session_langue'] .
'&sort=asc' =>
$GLOBALS[
'STR_PRODUCT_NAME'] .
' ' .
$GLOBALS[
'STR_ASC'],
468 $urlcat_with_suffixe .
'tri=nom_' . $_SESSION[
'session_langue'] .
'&sort=desc' => $GLOBALS[
'STR_PRODUCT_NAME'] .
' ' . $GLOBALS[
'STR_DESC'],
469 $urlcat_with_suffixe .
'tri=prix&sort=asc' => $GLOBALS[
'STR_PRICE'] .
' ' . $GLOBALS[
'STR_ASC'],
470 $urlcat_with_suffixe .
'tri=prix&sort=desc' => $GLOBALS[
'STR_PRICE'] .
' ' . $GLOBALS[
'STR_DESC']
473 if(!empty($_GET[
'tri']) && !empty($_GET[
'sort'])) {
474 $selected = $urlcat_with_suffixe .
'tri=' . $_GET[
'tri'] .
'&sort=' . $_GET[
'sort'];
476 $tpl->assign(
'selected', $selected);
487 if (!function_exists(
'get_brand_link_html')) {
497 function get_brand_link_html(
$id_marque = null, $return_mode =
false, $show_all_brands_link =
false, $location = null)
501 SELECT m.id, m.nom_' . $_SESSION[
'session_langue'] .
' AS marque, m.image
502 FROM peel_marques m';
505 LEFT JOIN peel_produits p ON p.id_marque=m.id AND p.etat=1 AND ' .
get_filter_site_cond(
'produits',
'p') .
'';
515 ORDER BY count(m.id) DESC
521 $this_url = get_url(
'/achat/marque.php', array(
'id' => $brand->id));
522 $links[] = array(
'href' => $this_url,
523 'value' => $brand->marque,
524 'image' => $brand->image,
527 if($show_all_brands_link) {
528 $this_url = get_url(
'/achat/marque.php');
529 $links[] = array(
'href' => $this_url,
530 'value' => $GLOBALS[
'STR_ALL_BRAND'],
534 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'brand_link_html.tpl');
536 $tpl->assign(
'links', $links);
537 $tpl->assign(
'location', $location);
543 if (!function_exists(
'get_brand_description_html')) {
552 function get_brand_description_html(
$id_marque, $return_mode =
false, $show_links_to_details =
true)
554 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'brand_description_html.tpl');
555 $sql =
"SELECT id, image, description_" . $_SESSION[
'session_langue'] .
" AS description, nom_" . $_SESSION[
'session_langue'] .
" AS nom
558 ORDER BY position ASC, nom ASC";
562 $sql2 =
'SELECT COUNT(*) AS nb_produits
564 WHERE id_marque=' . intval($brand_object->id) .
' AND etat=1 AND nom_'.(!empty($GLOBALS[
'site_parameters'][
'product_name_forced_lang'])?$GLOBALS[
'site_parameters'][
'product_name_forced_lang']:$_SESSION[
'session_langue']).
' != ""' .
" AND " .
get_filter_site_cond(
'produits');
565 $query2 =
query($sql2);
567 $tmpData = array(
'nom' => $brand_object->nom,
568 'display_brand' =>
true
570 $tmpData[
'admin_content'] =
a_priv(
'admin_content');
571 if ($tmpData[
'admin_content']) {
572 $tmpData[
'admin_link'] = array(
'href' => $GLOBALS[
'administrer_url'] .
'/marques.php?mode=modif&id=' . $brand_object->id,
'name' => $GLOBALS[
'STR_MODIFY_BRAND']);
574 $tmpData[
'small_width'] = $GLOBALS[
'site_parameters'][
'small_width'];
575 $tmpData[
'has_image'] = !empty($brand_object->image);
576 if ($tmpData[
'has_image']) {
577 $thumb_file =
thumbs($brand_object->image, $GLOBALS[
'site_parameters'][
'small_width'], $GLOBALS[
'site_parameters'][
'small_height'],
'fit');
578 if(!empty($thumb_file)) {
579 $tmpData[
'image'] = array(
'href' => ($show_links_to_details ? get_url(
'/achat/marque.php', array(
'id' => $brand_object->id)) :
''),
580 'src' => $GLOBALS[
'repertoire_upload'] .
'/thumbs/' .
thumbs($brand_object->image, $GLOBALS[
'site_parameters'][
'small_width'], $GLOBALS[
'site_parameters'][
'small_height'],
'fit')
584 $tmpData[
'href'] = ($show_links_to_details ? get_url(
'/achat/marque.php', array(
'id' => $brand_object->id)) :
'');
585 $tmpData[
'nb_produits_txt'] = $brand_products[
'nb_produits'] .
' ' . $GLOBALS[
'STR_ARTICLES'];
589 $tmpData[
'description'] = $brand_object->description;
590 $tplData[] = $tmpData;
593 if (empty($tplData)) {
594 $tpl->assign(
'is_error',
true);
595 $tpl->assign(
'error_header', $GLOBALS[
'STR_BRAND']);
596 $tpl->assign(
'error_content', $GLOBALS[
'STR_SEARCH_NO_RESULT_BRAND']);
598 $tpl->assign(
'is_error',
false);
599 $tpl->assign(
'data', $tplData);
602 return $tpl->fetch();
609 if (!function_exists(
'get_categories_output')) {
626 function get_categories_output($location = null,
$mode =
'categories', $selected_item = null, $display_mode =
'option', $add_indent =
' ', $input_name = null, $technical_code = null, $use_admin_rights =
false, $text_max_length = 25, $max_depth_allowed = null, $columns_if_related_display_mode = null, $parent_id=null, $exclude_id=null)
629 if(
$mode ==
'categories') {
631 $sql =
'SELECT c.id, c.parent_id, c.nom_' . $_SESSION[
'session_langue'] .
' AS nom
632 FROM peel_categories c
633 WHERE c.etat="1" '.(!defined(
'IN_PEEL_ADMIN')?
' AND nom_' . $_SESSION[
'session_langue'] .
'!="" ':
'').
' '.(!empty($technical_code)?
' AND technical_code ="' .
nohtml_real_escape_string($technical_code) .
'"':
'').
' AND ' .
get_filter_site_cond(
'categories',
'c', $use_admin_rights) .
' '.(!empty($exclude_id)?
' AND c.id !="' . intval($exclude_id) .
'"':
'').
' '.($parent_id!==null?
' AND parent_id ="' . intval($parent_id) .
'"':
'').
'
634 ORDER BY c.position ASC, nom ASC';
636 $sql =
'SELECT r.id, r.parent_id, r.nom_' . $_SESSION[
'session_langue'] .
' AS nom
637 FROM peel_rubriques r
638 WHERE r.etat = "1" AND r.nom_' . $_SESSION[
'session_langue'] .
'!="" AND r.technical_code NOT IN ("other", "iphone_content") AND r.position>=0 AND ' .
get_filter_site_cond(
'rubriques',
'r', $use_admin_rights) .
'
639 ORDER BY r.position ASC, nom ASC';
640 if(!empty($GLOBALS[
'site_parameters'][
'content_categories_nb_limit_footer'])){
641 $sql .=
' LIMIT '.$GLOBALS[
'site_parameters'][
'content_categories_nb_limit_footer'];
644 $sql =
'SELECT c.id, c.parent_id, c.nom_' . $_SESSION[
'session_langue'] .
' AS nom
645 FROM peel_categories_annonces c
646 WHERE '.(!defined(
'IN_PEEL_ADMIN')?
'c.nom_' . $_SESSION[
'session_langue'] .
'!="" AND c.etat=1':
'1') .
' AND ' .
get_filter_site_cond(
'categories_annonces',
'c') .
'
647 ORDER BY c.position ASC, '.word_real_escape_string($GLOBALS[
'site_parameters'][
'ads_categories_order_by']).
' ASC';
649 $sql =
'SELECT r.id, r.parent_id, r.nom_' . $_SESSION[
'session_langue'] .
' AS nom
650 FROM peel_partenaires_categories r
652 ORDER BY r.position ASC, nom ASC';
658 $all_parents_with_ordered_direct_sons_array[
$result[
'parent_id']][] = $result[
'id'];
659 $item_name_array[$result[
'id']] = (!empty($result[
'nom'])?$result[
'nom']:
'['.$result[
'id'].
']');
661 if (!empty($all_parents_with_ordered_direct_sons_array)) {
664 if($display_mode ==
'columns_linear') {
665 $class =
'col-sm-4 col-md-3';
666 }
elseif($display_mode ==
'columns') {
667 $columns = $columns_if_related_display_mode;
669 $output .= get_recursive_items_display($all_parents_with_ordered_direct_sons_array, $item_name_array, 0, 0, $selected_item,
$mode, $location, $max_depth_allowed, $text_max_length, $display_mode, $add_indent, $input_name,
$class, $columns);
670 if($display_mode ==
'columns_linear') {
678 if (!function_exists(
'get_recursive_items_display')) {
698 function get_recursive_items_display(&$all_parents_with_ordered_direct_sons_array, &$item_name_array, $this_parent, $this_parent_depth, $selected_item = null,
$mode =
'categories', $location = null, $max_depth_allowed = null, $item_max_length = 25, $display_mode =
'option', $add_indent =
' ', $input_name = null,
$class = null, $columns = null)
702 if (!empty($all_parents_with_ordered_direct_sons_array[$this_parent])) {
704 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'recursive_items_display.tpl');
706 $tpl->assign(
'sons_ico_src', get_url(
'/images/right.gif'));
707 $tpl->assign(
'display_mode', $display_mode);
708 $tpl->assign(
'location', $location);
709 $tpl->assign(
'input_name', $input_name);
711 $this_depth = $this_parent_depth + 1;
713 for(
$i=1;
$i<$this_depth;
$i++) {
714 $indent .= $add_indent;
716 foreach ($all_parents_with_ordered_direct_sons_array[$this_parent] as $this_item) {
719 if (is_array($selected_item)) {
721 $is_selected = in_array($this_item, $selected_item);
723 $is_selected = ($this_item == $selected_item);
725 if (!empty($all_parents_with_ordered_direct_sons_array[$this_item])) {
726 if(empty($max_depth_allowed) || $this_depth<$max_depth_allowed) {
727 $tplItem[
'has_sons'] =
true;
729 $tplItem[
'has_sons'] =
false;
731 if (!is_array($selected_item)) {
734 $searched_item = $selected_item;
737 while (
$i++ < 500 && !empty($searched_item) && $searched_item != $this_item && !in_array($searched_item, $all_parents_with_ordered_direct_sons_array[$this_item])) {
740 foreach ($all_parents_with_ordered_direct_sons_array as $this_tested_item => $tested_items_array) {
741 if (in_array($searched_item, $tested_items_array)) {
745 if (
$result != $searched_item) {
748 $searched_item =
false;
753 $tplItem[
'has_sons'] =
false;
755 $tplItem[
'is_current'] = ($is_selected || !empty($searched_item));
756 $tplItem[
'is_selected'] = $is_selected;
758 if (!empty($item_name_array[$this_item])) {
759 if (
$mode ==
'categories') {
760 $tplItem[
'href'] = get_product_category_url($this_item, $item_name_array[$this_item]);
762 $tplItem[
'href'] = get_annonce_category_url($this_item, $item_name_array[$this_item]);
764 $tplItem[
'href'] = get_content_category_url($this_item, $item_name_array[$this_item]);
766 $tplItem[
'nb'] = null;
767 if (
vn($GLOBALS[
'site_parameters'][
'display_nb_product']) == 1) {
768 if (
$mode ==
'categories_annonces') {
769 $nb = calcul_nbannonces_parcat($this_item, $all_parents_with_ordered_direct_sons_array);
770 $tplItem[
'nb'] = $nb;
773 $tplItem[
'nb'] = $nb;
776 $tplItem[
'name'] = $item_name_array[$this_item];
779 if ($tplItem[
'has_sons']) {
780 $tplItem[
'SONS'] = get_recursive_items_display($all_parents_with_ordered_direct_sons_array, $item_name_array, $this_item, $this_depth, $selected_item,
$mode, $location, $max_depth_allowed, $item_max_length, $display_mode, $add_indent, $input_name,
$class);
782 if (function_exists(
'get_technical_code')) {
783 $tplItem[
'technical_code'] = get_technical_code($this_item);
785 $tplItem[
'value'] = $this_item;
786 $tplItem[
'id'] =
'menu_'.substr(md5(
vb($tplItem[
'href']) .
'_' .
vb($tplItem[
'name'])),0,8);
787 $tplItem[
'depth'] = $this_depth;
788 $tplItem[
'indent'] = $indent;
789 $tplItem[
'item_max_length'] = $item_max_length;
790 $tplItem[
'class'] =
$class;
791 $tplItems[] = $tplItem;
793 $tpl->assign(
'items', $tplItems);
794 $tpl->assign(
'columns', $columns);
802 if (!function_exists(
'print_societe')) {
809 function print_societe($return_mode =
false)
812 $qid =
query(
"SELECT *
817 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'societe.tpl');
818 $tpl->assign(
'societe', $ligne->societe);
819 $tpl->assign(
'adresse', $ligne->adresse);
820 $tpl->assign(
'code_postal', $ligne->code_postal);
821 $tpl->assign(
'ville', $ligne->ville);
822 $tpl->assign(
'pays', $ligne->pays);
823 $tpl->assign(
'tel', $ligne->tel);
824 $tpl->assign(
'tel_label', $GLOBALS[
'STR_SHORT_TEL'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
825 $tpl->assign(
'fax', $ligne->fax);
826 $tpl->assign(
'fax_label', $GLOBALS[
'STR_SHORT_FAX'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
827 $tpl->assign(
'siren', $ligne->siren);
828 $tpl->assign(
'siren_label', $GLOBALS[
'STR_SIREN'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
829 $tpl->assign(
'tvaintra', $ligne->tvaintra);
830 $tpl->assign(
'tvaintra_label', $GLOBALS[
'STR_VAT_INTRACOM'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
831 $tpl->assign(
'cnil', $ligne->cnil);
832 $tpl->assign(
'cnil_label', $GLOBALS[
'STR_CNIL_NUMBER'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
843 if (!function_exists(
'print_rib')) {
850 function print_rib($return_mode =
false)
853 $qid =
query(
"SELECT *
859 if (!empty($ligne->code_banque)) {
860 $tplData[] = array(
'label' => $GLOBALS[
'STR_BANK_ACCOUNT_CODE'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' => $ligne->code_banque);
862 if (!empty($ligne->code_guichet)) {
863 $tplData[] = array(
'label' => $GLOBALS[
'STR_BOX_OFFICE_CODE'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' => $ligne->code_guichet);
865 if (!empty($ligne->numero_compte)) {
866 $tplData[] = array(
'label' => $GLOBALS[
'STR_ACCOUNT_NUMBER'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' => $ligne->numero_compte);
868 if (!empty($ligne->cle_rib)) {
869 $tplData[] = array(
'label' => $GLOBALS[
'STR_BANK_ACCOUNT_RIB_KEY'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' => $ligne->cle_rib);
871 if (!empty($ligne->titulaire)) {
872 $tplData[] = array(
'label' => $GLOBALS[
'STR_ACCOUNT_MASTER'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' => $ligne->titulaire);
874 if (!empty($ligne->domiciliation)) {
875 $tplData[] = array(
'label' => $GLOBALS[
'STR_DOMICILIATION'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' => $ligne->domiciliation);
877 if (!empty($ligne->iban)) {
878 $tplData[] = array(
'label' => $GLOBALS[
'STR_IBAN'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' => $ligne->iban);
880 if (!empty($ligne->swift)) {
881 $tplData[] = array(
'label' => $GLOBALS[
'STR_SWIFT'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' => $ligne->swift);
884 if (!empty($tplData)) {
885 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'rib.tpl');
886 $tpl->assign(
'data', $tplData);
898 if (!function_exists(
'print_cgv')) {
906 function print_cgv($return_mode =
false)
909 $sql =
'SELECT titre_' . $_SESSION[
'session_langue'] .
' as titre, texte_' . $_SESSION[
'session_langue'] .
' as texte
914 if (!empty($cgv->texte)) {
916 $title = $cgv->titre;
919 $longtext = $GLOBALS[
'STR_EMPTY_TEXT_CGV'];
921 $output .= get_formatted_longtext_with_title($longtext, $title,
'cgv');
930 if (!function_exists(
'print_legal')) {
938 function print_legal($return_mode =
false)
941 $sql =
"SELECT titre_" . $_SESSION[
'session_langue'] .
" as titre, texte_" . $_SESSION[
'session_langue'] .
" as texte
946 if (!empty($cgv->texte)) {
948 $title = $cgv->titre;
951 $longtext = $GLOBALS[
'STR_EMPTY_TEXT_LEGAL'];
953 $output .= get_formatted_longtext_with_title($longtext, $title,
'legal');
962 if (!function_exists(
'print_contact')) {
970 function print_contact($return_mode =
false)
973 $sql =
"SELECT titre_" . $_SESSION[
'session_langue'] .
" AS titre, texte_" . $_SESSION[
'session_langue'] .
" AS texte
978 if (!empty($contact_infos) && !empty($contact_infos->titre)) {
979 $title = $contact_infos->titre;
981 $title = $GLOBALS[
"STR_CONTACT"];
983 if (!empty($contact_infos) && !empty($contact_infos->texte)) {
986 $longtext = $GLOBALS[
'STR_EMPTY_TEXT_CONTACTS'];
988 $output .= get_formatted_longtext_with_title($longtext, $title,
'contact');
997 if (!function_exists(
'print_actu')) {
1005 function print_actu($return_mode =
false,
$rubid = null)
1008 $sql =
'SELECT p.id, p.on_reseller, p.surtitre_' . $_SESSION[
'session_langue'] .
', p.titre_' . $_SESSION[
'session_langue'] .
', p.chapo_' . $_SESSION[
'session_langue'] .
', p.texte_' . $_SESSION[
'session_langue'] .
', p.image1, p.on_special, p.date_maj
1009 FROM peel_articles p
1010 '.(!empty(
$rubid)?
'INNER JOIN peel_articles_rubriques pc ON p.id = pc.article_id AND pc.rubrique_id='.intval(
$rubid):
'').
'
1012 ORDER BY p.date_maj DESC
1017 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'actu.tpl');
1020 if ((!
a_priv(
"admin_product") && !
a_priv(
"reve")) && $art[
'on_reseller'] == 1) {
1023 $tplData[] = array(
'titre' => $art[
'titre_' . $_SESSION[
'session_langue']],
1025 'image_src' => (!empty($art[
'image1']) ? $GLOBALS[
'repertoire_upload'] .
'/thumbs/' .
thumbs($art[
'image1'], $GLOBALS[
'site_parameters'][
'medium_width'], $GLOBALS[
'site_parameters'][
'medium_height'],
'fit') : null),
1026 'chapo' => $art[
'chapo_' . $_SESSION[
'session_langue']]
1030 $tpl->assign(
'data', $tplData);
1041 if (!function_exists(
'print_compte')) {
1048 function print_compte($return_mode =
false)
1052 if ($est_identifie) {
1054 if (!empty($user_infos)) {
1060 if (
String::substr(
vb($user_infos[
'email_bounce']), 0, 2) ==
'5.' || empty($user_infos[
'email'])) {
1063 $domain = explode(
'@',
vb($user_infos[
'email']));
1064 $email_explain = sprintf($GLOBALS[
'STR_EMAIL_BOUNCE_REPLACE'],
vb($domain[1]),
vb($user_infos[
'email_bounce']),
vb($user_infos[
'email']));
1065 $output .= $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => $GLOBALS[
'STR_IMPORTANT'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
': <a href="' . $GLOBALS[
'wwwroot'] .
'/utilisateurs/change_params.php">' . $email_explain .
'</a>'))->fetch();
1067 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'compte.tpl');
1070 $GLOBALS[
'css_files'][
'font-awesome'] = get_url(
'/lib/css/font-awesome.min.css');
1072 $GLOBALS[
'site_parameters'][
'minify_css_exclude_array'][] =
'font-awesome.min.css';
1075 $tpl->assign(
'downloadable_file_link_array', get_downloadable_file_link(array(
'user_id' => $_SESSION[
'session_utilisateur'][
'id_utilisateur'])));
1076 $tpl->assign(
'STR_MODULE_TELECHARGEMENT_FOR_DOWNLOAD', $GLOBALS[
'STR_MODULE_TELECHARGEMENT_FOR_DOWNLOAD']);
1078 $tpl->assign(
'compte', $GLOBALS[
'STR_COMPTE']);
1079 $tpl->assign(
'msg_support', $GLOBALS[
'STR_SUPPORT']);
1080 $tpl->assign(
'est_identifie', $est_identifie);
1081 if ($est_identifie) {
1082 $modules_data = array();
1083 $modules_data_group = array();
1084 $tpl->assign(
'number', $GLOBALS[
'STR_NUMBER']);
1085 $tpl->assign(
'code_client',
vb($user_infos[
'code_client']));
1086 $tpl->assign(
'my_order', $GLOBALS[
'STR_MY_ORDER']);
1087 if(empty($GLOBALS[
'site_parameters'][
'user_multiple_addresses_disable'])) {
1088 $tpl->assign(
'STR_ADDRESS_TEXT', $GLOBALS[
'STR_ADDRESS_TEXT']);
1090 $tpl->assign(
'STR_ADDRESS', $GLOBALS[
'STR_ADDRESS']);
1092 $modules_data_group[
'other'] = array(
'header' => $GLOBALS[
"STR_OTHER"],
'position' => null);
1093 $modules_data_group[
'cart'] = array(
'header' => $GLOBALS[
'STR_MY_ORDER'],
'position' => 2);
1094 $modules_data[
'cart'][] = array(
'txt' =>
'<span class="fa fa-shopping-cart fa-5x"></span> <span class="fa fa-history fa-3x"></span><br />' . $GLOBALS[
'STR_ORDER_HISTORY'],
'href' => get_url(
'/achat/historique_commandes.php'));
1095 $modules_data[
'cart'][] = array(
'txt' =>
'<span class="fa fa-cart-arrow-down fa-5x"></span><br />' . $GLOBALS[
'STR_PRODUCTS_PURCHASED_LIST'],
'href' => get_url(
'/achat/historique_commandes.php', array(
'mode' =>
'product_ordered_history')));
1096 if (!empty($GLOBALS[
'site_parameters'][
'enable_create_product_in_front'])) {
1097 $modules_data_group[
'catalog'] = array(
'header' => $GLOBALS[
'STR_CATALOGUE'],
'position' => 6);
1098 $modules_data[
'catalog'][] = array(
'txt' =>
'' . $GLOBALS[
'STR_MODULE_CREATE_PRODUCT_IN_FRONT_OFFICE_CREATE_PRODUCT'],
'href' => get_content_url(null, null, null, null,
false,
false,
'display_product_form'));
1100 $modules_data_group[
'account'] = array(
'header' => null,
'position' => 1);
1101 $modules_data[
'account'][] = array(
'txt' =>
'<span class="glyphicon glyphicon-user fa-5x"></span> <span class="fa fa-pencil fa-3x"></span><br />' . $GLOBALS[
'STR_CHANGE_PARAMS'],
'href' => get_url(
'/utilisateurs/change_params.php'));
1102 $modules_data[
'account'][] = array(
'txt' =>
'<span class="fa fa-key fa-5x"></span><br />' . $GLOBALS[
'STR_CHANGE_PASSWORD'],
'href' => get_url(
'/utilisateurs/change_mot_passe.php'));
1103 $modules_data[
'account'][] = array(
'txt' =>
'<span class="fa fa-location-arrow fa-5x"></span><br />' . $GLOBALS[
'STR_ADDRESS_TEXT'],
'href' => get_url(
'/utilisateurs/adresse.php'));
1105 $code_promo_query =
query(
'SELECT code_promo, valeur_code_promo, percent_code_promo
1106 FROM peel_commandes pc
1107 WHERE pc.id_utilisateur = "' . intval($_SESSION[
'session_utilisateur'][
'id_utilisateur']) .
'" AND code_promo != "" AND ' .
get_filter_site_cond(
'commandes',
'pc'));
1108 if (
num_rows($code_promo_query) > 0) {
1109 $cpu_data = array();
1111 $cpu_data[] = array(
'code_promo' => $cp[
'code_promo'],
'discount_text' =>
get_discount_text($cp[
'valeur_code_promo'], $cp[
'percent_code_promo'],
true));
1113 $tpl->assign(
'code_promo_utilise', array(
'header' => $GLOBALS[
'STR_MES_CODE_PROMO_UTILISE'],
'data' => $cpu_data));
1116 $current_code_promo_query =
query(
'SELECT *
1117 FROM peel_utilisateurs_codes_promos ucp
1118 INNER JOIN peel_codes_promos cp ON cp.id = ucp.id_code_promo AND ' .
get_filter_site_cond(
'codes_promos',
'cp') .
' AND cp.etat = "1" AND ("' . date(
'Y-m-d', time()) .
'" BETWEEN cp.date_debut AND cp.date_fin)
1119 WHERE ucp.id_utilisateur = "' . intval($_SESSION[
'session_utilisateur'][
'id_utilisateur']) .
'" AND (cp.nombre_prevue=0 OR ucp.utilise<cp.nombre_prevue) AND (cp.nb_used_per_client=0 OR ucp.utilise<cp.nb_used_per_client)');
1120 if (
num_rows($current_code_promo_query) > 0) {
1121 $cpv_data = array();
1122 while ($cp =
fetch_assoc($current_code_promo_query)) {
1123 $cpv_data[] = array(
'nom_code' => $cp[
'nom_code'],
1125 'code_promo_valid_from' => $GLOBALS[
'STR_CODE_PROMO_VALID_FROM'],
1127 'flash_to' => $GLOBALS[
'STR_FLASH_TO'],
1131 $tpl->assign(
'code_promo_valide', array(
'header' => $GLOBALS[
'STR_MES_CODE_PROMO_VALIDE'],
'data' => $cpv_data));
1133 if (
vn($user_infos[
'remise_percent']) > 0) {
1134 $tpl->assign(
'remise_percent', array(
'label' => $GLOBALS[
'STR_REMISE'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' => $user_infos[
'remise_percent']));
1136 if (
vn($user_infos[
'avoir']) > 0) {
1137 $tpl->assign(
'avoir', array(
'label' => $GLOBALS[
'STR_AVOIR'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' =>
fprix($user_infos[
'avoir'],
true)));
1139 $tpl->assign(
'logout', array(
'href' => get_url(
'sortie'),
'txt' => $GLOBALS[
'STR_LOGOUT']));
1141 if (
a_priv(
'admin*',
true)) {
1142 $tpl->assign(
'admin', array(
'href' => $GLOBALS[
'administrer_url'] .
'/index.php',
'txt' => $GLOBALS[
'STR_ADMIN']));
1145 $tpl->assign(
'ABONNEMENT_MODULE', verified_status_activated());
1147 if (function_exists(
'get_user_infos_resume_array') && !empty($_GET[
'display_user_infos_resume_array'])) {
1148 $tpl->assign(
'user_infos_resume_array', get_user_infos_resume_array());
1151 $modules_data = array_merge_recursive($modules_data,
vb(
$hook_result[
'modules_data'], array()));
1152 $modules_data_group = array_merge_recursive($modules_data_group,
vb(
$hook_result[
'modules_data_group'], array()));
1153 if(!empty($modules_data)) {
1154 $position_if_null = 100000;
1155 foreach(array_keys($modules_data_group) as $this_group) {
1156 if(!empty($modules_data_group[$this_group][
'disabled'])) {
1157 unset($modules_data_group[$this_group]);
1158 unset($modules_data[$this_group]);
1162 if(!empty($GLOBALS[
'site_parameters'][
'account_show_modules_data_group_position'])) {
1163 if(isset($GLOBALS[
'site_parameters'][
'account_show_modules_data_group_position'][$this_group])) {
1164 $modules_data_group[$this_group][
'position'] = $GLOBALS[
'site_parameters'][
'account_show_modules_data_group_position'][$this_group];
1167 if(!isset($modules_data_group[$this_group][
'position'])) {
1169 $modules_data_group[$this_group][
'position'] = $position_if_null++;
1172 foreach(array_keys($modules_data) as $this_group) {
1173 foreach(array_keys($modules_data[$this_group]) as $this_key) {
1174 if(!empty($modules_data[$this_group][$this_key][
'disabled'])) {
1175 unset($modules_data[$this_group][$this_key]);
1178 if(!isset($modules_data[$this_group][$this_key][
'position'])) {
1180 $modules_data[$this_group][$this_key][
'position'] = $position_if_null++;
1184 uasort($modules_data_group,
'data_position_sort');
1186 foreach(array_keys($modules_data_group) as $this_group) {
1187 if(!empty($modules_data[$this_group])) {
1188 $temp[$this_group] = $modules_data[$this_group];
1189 unset($modules_data[$this_group]);
1192 $modules_data = array_merge($temp, $modules_data);
1194 foreach(array_keys($modules_data) as $this_key) {
1195 usort($modules_data[$this_key],
'data_position_sort');
1197 $tpl->assign(
'modules_data_group', $modules_data_group);
1198 $tpl->assign(
'modules_data', $modules_data);
1200 if(!empty($GLOBALS[
'site_parameters'][
'disable_account_by_user_in_front_office'])) {
1201 $tpl->assign(
'disable_account',
true);
1202 $tpl->assign(
'disable_account_text', $GLOBALS[
"STR_DISABLE_ACCOUNT"]);
1203 $tpl->assign(
'disable_account_href', $GLOBALS[
'wwwroot'] .
'/compte.php?unsubscribe_account=true');
1204 $tpl->assign(
'confirm_disable_account', $GLOBALS[
"STR_CONFIRM_DISABLE_ACCOUNT"]);
1207 $tpl->assign(
'register_href', get_account_register_url(
false,
false));
1208 $tpl->assign(
'register', $GLOBALS[
'STR_REGISTER']);
1209 $tpl->assign(
'login_href', get_url(
'membre'));
1210 $tpl->assign(
'login', $GLOBALS[
'STR_LOGIN']);
1221 if (!function_exists(
'affiche_mini_caddie')) {
1229 function affiche_mini_caddie($detailed =
true, $return_mode =
false)
1231 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'mini_caddie.tpl');
1232 $tpl->assign(
'logo_src', $GLOBALS[
'repertoire_images'] .
'/cart-logo.png');
1233 $tpl->assign(
'affichage_href', get_url(
'caddie_affichage'));
1234 $tpl->assign(
'count_products', $_SESSION[
'session_caddie']->count_products());
1235 $tpl->assign(
'products_txt', ($_SESSION[
'session_caddie']->count_products() > 1 ? str_replace(array(
'(',
')'), array(
''), $GLOBALS[
'STR_CADDIE_OBJECTS_COUNT']) : str_replace(array(
'(s)',
'(es)',
'(n)',
'(en)'),
'', $GLOBALS[
'STR_CADDIE_OBJECTS_COUNT'])));
1237 $tpl->assign(
'has_details', $detailed);
1238 $tplProducts = array();
1239 foreach ($_SESSION[
'session_caddie']->articles as $numero_ligne =>
$product_id) {
1242 $product_object->set_configuration($_SESSION[
'session_caddie']->couleurId[$numero_ligne], $_SESSION[
'session_caddie']->tailleId[$numero_ligne],
check_if_module_active(
'reseller') && is_reseller());
1245 $tmpProd[
'size'] = array(
'label' => $GLOBALS[
'STR_SIZE'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' =>
$product_object->get_size());
1250 $tmpProd[
'color'] = array(
'label' => $GLOBALS[
'STR_COLOR'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' =>
$product_object->get_color());
1251 $urlprod .=
'?cId=' . $_SESSION[
'session_caddie']->couleurId[$numero_ligne];
1252 if (isset($tmpProd[
'size'])) {
1253 $urlprod .=
'&sId=' . $_SESSION[
'session_caddie']->tailleId[$numero_ligne];
1255 }
elseif (isset($tmpProd[
'size'])) {
1256 $urlprod .=
'?sId=' . $_SESSION[
'session_caddie']->tailleId[$numero_ligne];
1258 $tmpProd[
'href'] = $urlprod;
1261 $price_displayed = $_SESSION[
'session_caddie']->total_prix[$numero_ligne];
1263 $price_displayed = $_SESSION[
'session_caddie']->total_prix_ht[$numero_ligne];
1265 $tmpProd[
'quantite'] = $_SESSION[
'session_caddie']->quantite[$numero_ligne];
1267 $tmpProd[
'price'] =
fprix($price_displayed,
true);
1269 if ($display_picture) {
1270 $product_picture = $GLOBALS[
'repertoire_upload'] .
'/thumbs/' .
thumbs($display_picture, 75, 75,
'fit');
1271 }
elseif(!empty($GLOBALS[
'site_parameters'][
'default_picture'])) {
1272 $product_picture = $GLOBALS[
'repertoire_upload'] .
'/thumbs/' .
thumbs($GLOBALS[
'site_parameters'][
'default_picture'], 75, 75,
'fit');
1274 $product_picture = null;
1276 $tmpProd[
'picture'] = $product_picture;
1277 $tplProducts[] = $tmpProd;
1280 $tpl->assign(
'products', $tplProducts);
1282 $total_displayed = $_SESSION[
'session_caddie']->total;
1283 $shipping_displayed = $_SESSION[
'session_caddie']->cout_transport;
1285 $total_displayed = $_SESSION[
'session_caddie']->total_ht;
1286 $shipping_displayed = $_SESSION[
'session_caddie']->cout_transport_ht;
1288 if (!empty($_SESSION[
'session_caddie']->cout_transport)) {
1289 $tpl->assign(
'transport', array(
'label' => $GLOBALS[
'STR_SHIPPING_COST'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' =>
fprix($shipping_displayed,
true)));
1292 $tpl->assign(
'total', array(
'label' => $GLOBALS[
"STR_NET"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' =>
fprix($total_displayed,
true)));
1294 $tpl->assign(
'total', array(
'label' => $GLOBALS[
'STR_TOTAL_HT'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'],
'value' =>
fprix($total_displayed,
true)));
1296 $tpl->assign(
'STR_CADDIE', $GLOBALS[
'STR_CADDIE']);
1297 $tpl->assign(
'STR_DETAILS_ORDER', $GLOBALS[
'STR_DETAILS_ORDER']);
1299 return $tpl->fetch();
1306 if (!function_exists(
'affiche_sideblock')) {
1314 function affiche_sideblock($title, $text, $block_class, $return_mode =
false)
1317 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'sideblock.tpl');
1318 $tpl->assign(
'block_class', $block_class);
1319 $tpl->assign(
'text', $text);
1329 if (!function_exists(
'affiche_sideblocktitle')) {
1337 function affiche_sideblocktitle($title, $text, $block_class, $return_mode =
false)
1340 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'sideblocktitle.tpl');
1341 $tpl->assign(
'block_class', $block_class);
1342 $tpl->assign(
'title', $title);
1343 $tpl->assign(
'text', $text);
1353 if (!function_exists(
'affiche_block')) {
1369 function affiche_block($display_mode =
'sideblocktitle', $location =
'', $technical_code =
'', $title =
'', $content =
'', $block_class =
'', $block_style =
'', $return_mode =
true, $is_slider_mode =
false, $is_simplify_mode =
false, $extra_class =
false)
1371 $mode = (!empty($rewrite_mame_mode)) ?
clean_str($display_mode) : $display_mode;
1372 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'block.tpl');
1373 $tpl->assign(
'is_slider_mode', $is_slider_mode);
1374 $tpl->assign(
'extra_class', $extra_class);
1375 $tpl->assign(
'is_simplify_mode', $is_simplify_mode);
1376 $tpl->assign(
'lang', $_SESSION[
'session_langue']);
1378 $tpl->assign(
'block_class', $block_class);
1379 $tpl->assign(
'location', $location);
1380 $tpl->assign(
'technical_code', $technical_code);
1381 $tpl->assign(
'block_style', $block_style);
1382 $tpl->assign(
'content', $content);
1383 $tpl->assign(
'title', $title);
1384 $tpl->assign(
'block_columns_width_sm',
vb($GLOBALS[
'site_parameters'][
'block_columns_width_sm'], 4));
1385 $tpl->assign(
'block_columns_width_md',
vb($GLOBALS[
'site_parameters'][
'block_columns_width_md'], 3));
1386 $tpl->assign(
'STR_PREVIOUS_PAGE', $GLOBALS[
'STR_PREVIOUS_PAGE']);
1387 $tpl->assign(
'STR_NEXT_PAGE', $GLOBALS[
'STR_NEXT_PAGE']);
1397 if (!function_exists(
'affiche_menu_recherche')) {
1405 function affiche_menu_recherche($return_mode =
false, $display_mode =
'header')
1407 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'menu_recherche.tpl');
1410 $tpl->assign(
'add_webpage_microdata', defined(
'IN_HOME'));
1411 $tpl->assign(
'action', get_url(
'search'));
1412 $tpl->assign(
'display_mode', $display_mode);
1420 if(empty($GLOBALS[
'site_parameters'][
'advanced_fields_in_search_bar_disabled'])) {
1421 $tpl->assign(
'select_categorie', get_categories_output(null,
'categories_annonces',
vn($_GET[
"categorie"]),
'option',
' ', null, null,
false, 40));
1423 $tpl->assign(
'STR_CATEGORY', $GLOBALS[
'STR_MODULE_ANNONCES_SEARCH_CATEGORY_AD']);
1424 if(!empty($GLOBALS[
'STR_MODULE_ANNONCES_SEARCH_TYPOLOGIE']) && empty($GLOBALS[
'site_parameters'][
'ad_search_typologie_disable'])) {
1425 $additionnal_select =
'';
1426 if (!empty($GLOBALS[
'site_parameters'][
'ads_verified_status_per_subscription'])) {
1427 $additionnal_select .=
'
1428 <option value="1" ' .
frmvalide((!empty($_GET[
'cat_statut_detail']) && $_GET[
'cat_statut_detail'] == 1),
'selected="selected"') .
'>' . $GLOBALS[
'STR_MODULE_ANNONCES_ALT_VERIFIED_ADS'] .
'</option>
1431 if(!empty($GLOBALS[
'site_parameters'][
'ads_contain_lot_sizes'])) {
1432 $additionnal_select .=
'
1433 <option value="gros" ' .
frmvalide((!empty($_GET[
'cat_statut_detail']) && $_GET[
'cat_statut_detail'] ==
'gros'),
'selected="selected"') .
'>' . $GLOBALS[
'STR_MODULE_ANNONCES_OFFER_GROS'] .
'</option>
1434 <option value="demigros" ' .
frmvalide((!empty($_GET[
'cat_statut_detail']) && $_GET[
'cat_statut_detail'] ==
'demigros'),
'selected="selected"') .
'>' . $GLOBALS[
'STR_MODULE_ANNONCES_OFFER_DEMIGROS'] .
'</option>
1435 <option value="detail" ' .
frmvalide((!empty($_GET[
'cat_statut_detail']) && $_GET[
'cat_statut_detail'] ==
'detail'),
'selected="selected"') .
'>' . $GLOBALS[
'STR_MODULE_ANNONCES_OFFER_DETAIL'] .
'</option>';
1437 if(!empty($additionnal_select)) {
1438 $additionnal_select =
' <select class="form-control" name="cat_statut_detail">
1439 <option value="">' . $GLOBALS[
'STR_MODULE_ANNONCES_SEARCH_TYPOLOGIE'] .
'</option>
1440 ' . $additionnal_select .
'
1443 $tpl->assign(
'additionnal_select', $additionnal_select);
1448 if(empty($GLOBALS[
'site_parameters'][
'advanced_fields_in_search_bar_disabled'])) {
1449 $tpl->assign(
'select_categorie', get_categories_output(null,
'categories',
vb($_GET[
"categorie"]),
'option',
' ', null, null,
false, 40));
1451 $tpl->assign(
'STR_CATEGORY', $GLOBALS[
'STR_CATEGORY']);
1453 if(!empty($GLOBALS[
'site_parameters'][
'header_search_form_additionnal_button'])) {
1454 $additionnal_button =
'<a class="btn btn-default btn-header_search" href="'.$GLOBALS[
'site_parameters'][
'header_search_form_additionnal_button'][
'href'].
'" title="">'.$GLOBALS[
'site_parameters'][
'header_search_form_additionnal_button'][
'anchor'] .
'</a>
1456 $tpl->assign(
'additionnal_button', $additionnal_button);
1458 $tpl->assign(
'STR_SEARCH', $GLOBALS[
"STR_SEARCH"]);
1460 return $tpl->fetch();
1467 if (!function_exists(
'affiche_guide')) {
1475 function affiche_guide($location, $return_mode =
false, $more_infos =
true)
1477 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'guide.tpl');
1478 $tplLinks = array();
1479 $tplLinks[
'cgv'] = array(
'href' => get_url(
'cgv'),
'label' => $GLOBALS[
'STR_CGV'],
'selected' => defined(
'IN_CGV'));
1480 $tplLinks[
'contact'] = array(
'name' =>
'contact',
'href' => get_url(
'/contacts.php'),
'label' => $GLOBALS[
'STR_CONTACT_INFO'],
'selected' => defined(
'IN_CONTACT_US'));
1483 $tplLinks = array_merge_recursive($tplLinks,
$hook_result);
1484 $tplLinks[
'access_plan'] = array(
'name' =>
'access_plan',
'href' => get_url(
'/plan_acces.php'),
'label' => $GLOBALS[
'STR_ACCESS_PLAN'],
'selected' => defined(
'IN_PLAN_ACCES'));
1485 if(isset($GLOBALS[
'site_parameters'][
'show_on_affiche_guide']) && is_array($GLOBALS[
'site_parameters'][
'show_on_affiche_guide'])) {
1487 foreach($GLOBALS[
'site_parameters'][
'show_on_affiche_guide'] as $this_value) {
1488 if(isset($tplLinks[$this_value])) {
1489 $temp[$this_value] = $tplLinks[$this_value];
1494 $tpl->assign(
'links', $tplLinks);
1495 $content_categories = get_categories_output($location,
'rubriques',
vn($_GET[
'rubid']),
'list', null);
1496 $tpl->assign(
'menu_contenu', $content_categories);
1497 $tpl->assign(
'affiche_guide_returned_link_list_without_ul',
vb($GLOBALS[
'site_parameters'][
'affiche_guide_returned_link_list_without_ul']));
1500 return $tpl->fetch();
1507 if (!function_exists(
'affiche_footer')) {
1514 function affiche_footer($return_mode =
false)
1516 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'footer.tpl');
1517 $tpl->assign(
'footer_columns_width_sm',
vb($GLOBALS[
'site_parameters'][
'footer_columns_width_sm'], 4));
1518 $tpl->assign(
'footer_columns_width_md',
vb($GLOBALS[
'site_parameters'][
'footer_columns_width_md'], 3));
1519 $tpl->assign(
'site', $GLOBALS[
'site']);
1520 $tpl->assign(
'propulse', $GLOBALS[
'STR_PROPULSE']);
1522 $tplLinks = array();
1523 $tplLinks[
'legal'] = array(
'href' => get_url(
'legal'),
'label' => $GLOBALS[
'STR_LEGAL_INFORMATION'],
'selected' => defined(
'IN_INFO_LEGALE'));
1524 $tplLinks[
'cgv'] = array(
'href' => get_url(
'cgv'),
'label' => $GLOBALS[
'STR_CGV'],
'selected' => defined(
'IN_CGV'));
1526 $tplLinks[
'parrain'] = array(
'href' => get_url(
'/modules/parrainage/conditions.php'),
'label' => $GLOBALS[
'STR_CONDITION_PARRAIN'],
'selected' => defined(
'IN_CONDITION_PARRAIN'));
1529 $tplLinks[
'affiliate'] = array(
'href' => get_url(
'/modules/affiliation/conditions.php'),
'label' => $GLOBALS[
'STR_CONDITION_AFFILI'],
'selected' => defined(
'IN_CONDITION_AFFILI'));
1531 $tpl->assign(
'links',
vb($GLOBALS[
'site_parameters'][
'footer_links'], $tplLinks));
1532 $tpl->assign(
'links_2',
vb($GLOBALS[
'site_parameters'][
'footer_links_2'], array()));
1533 if (empty($GLOBALS[
'site_parameters'][
'social_icons_disable'])) {
1534 $tpl->assign(
'rss', affiche_social_icons(
true));
1535 $tpl->assign(
'facebook_page', null);
1537 $tpl->assign(
'facebook_page', get_facebook_page(
'Facebook'));
1539 if(function_exists(
'get_footer_additional')) {
1540 $tpl->assign(
'footer_additional', get_footer_additional());
1542 $tpl->assign(
'footer_additional',
vb($GLOBALS[
'site_parameters'][
'footer_additional']));
1544 if(function_exists(
'get_footer_additional_link')) {
1545 $tpl->assign(
'footer_additional_link', get_footer_additional_link());
1547 $tpl->assign(
'footer_additional_link',
vb($GLOBALS[
'site_parameters'][
'get_footer_additional_link']));
1549 $tpl->assign(
'STR_SITE_GENERATOR', $GLOBALS[
'STR_SITE_GENERATOR']);
1551 return $tpl->fetch();
1558 if (!function_exists(
'affiche_social_icons')) {
1565 function affiche_social_icons($return_mode =
false)
1568 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'modules/rss_func.tpl');
1571 $tpl->assign(
'href', get_url(
'/modules/annonces/rss.php'));
1572 $tpl->assign(
'rss_new_window',
false);
1574 $tpl->assign(
'href', $GLOBALS[
'wwwroot'] .
'/modules/rss/rss.php');
1575 $tpl->assign(
'rss_new_window',
true);
1577 $tpl->assign(
'src', $GLOBALS[
'repertoire_images'] .
'/rss.png');
1580 if (!empty($GLOBALS[
'site_parameters'][
'facebook_page_link'])) {
1581 $tpl->assign(
'fb_href', $GLOBALS[
'site_parameters'][
'facebook_page_link']);
1582 $tpl->assign(
'fb_src', $GLOBALS[
'repertoire_images'] .
'/facebook.png');
1585 if (!empty($GLOBALS[
'site_parameters'][
'twitter_page_link'])) {
1586 $tpl->assign(
'twitter_href', $GLOBALS[
'site_parameters'][
'twitter_page_link']);
1587 $tpl->assign(
'twitter_src', $GLOBALS[
'repertoire_images'] .
'/twitter.png');
1590 if (!empty($GLOBALS[
'site_parameters'][
'googleplus_page_link'])) {
1591 $tpl->assign(
'googleplus_href', $GLOBALS[
'site_parameters'][
'googleplus_page_link']);
1592 $tpl->assign(
'googleplus_src', $GLOBALS[
'repertoire_images'] .
'/googleplus.png');
1596 $tpl->assign(
'block_columns_width_sm',
vb($GLOBALS[
'site_parameters'][
'footer_columns_width_sm'], 4));
1597 $tpl->assign(
'block_columns_width_md',
vb($GLOBALS[
'site_parameters'][
'footer_columns_width_md'], 3));
1608 if (!function_exists(
'affiche_compte')) {
1616 function affiche_compte($return_mode =
false, $location)
1620 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'compte_mini.tpl');
1621 $tpl->assign(
'location', $location);
1622 $tpl->assign(
'repertoire_images', $GLOBALS[
'repertoire_images']);
1623 $tpl->assign(
'membre_href', get_url(
'membre'));
1624 $tpl->assign(
'prenom',
vb($_SESSION[
'session_utilisateur'][
'prenom']));
1625 $tpl->assign(
'nom_famille',
vb($_SESSION[
'session_utilisateur'][
'nom_famille']));
1626 $tpl->assign(
'sortie_href', get_url(
'sortie'));
1627 if (function_exists(
'get_social_icone')) {
1628 $tpl->assign(
'social_icone', get_social_icone());
1630 $tpl->assign(
'compte_href', get_account_url(
false,
false));
1631 $tpl->assign(
'history_href', get_url(
'/achat/historique_commandes.php'));
1632 if (
check_if_module_active(
'facebook_connect') && !empty($_SESSION[
'session_utilisateur'][
'connected_by_fb'])) {
1633 $tpl->assign(
'fb_deconnect_lbl', $GLOBALS[
'STR_FB_DECONNECT']);
1635 if (
a_priv(
'admin*',
true)) {
1636 $tpl->assign(
'admin', array(
'href' => $GLOBALS[
'administrer_url'] .
'/index.php',
'txt' => $GLOBALS[
'STR_ADMINISTRATION']));
1638 if (!empty($GLOBALS[
'site_parameters'][
'quick_add_product_from_search_page'])) {
1639 $tpl->assign(
'quick_add_product_from_search_page_href', $GLOBALS[
'wwwroot'] .
'/search.php?type=quick_add_product_from_search_page');
1641 $tpl->assign(
'STR_HELLO', $GLOBALS[
'STR_HELLO']);
1642 $tpl->assign(
'STR_COMPTE', $GLOBALS[
'STR_COMPTE']);
1643 $tpl->assign(
'STR_DECONNECT', $GLOBALS[
'STR_DECONNECT']);
1644 $tpl->assign(
'STR_ORDER_HISTORY', $GLOBALS[
'STR_ORDER_HISTORY']);
1647 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'compte_login_mini.tpl');
1648 $tpl->assign(
'location', $location);
1649 $tpl->assign(
'repertoire_images', $GLOBALS[
'repertoire_images']);
1650 $tpl->assign(
'email_lbl', $GLOBALS[
'STR_EMAIL']);
1652 $tpl->assign(
'password_lbl', $GLOBALS[
'STR_PASSWORD']);
1653 $tpl->assign(
'password',
vb(
$frm[
'mot_passe']));
1655 $tpl->assign(
'forgot_pass_href', get_url(
'/utilisateurs/oubli_mot_passe.php'));
1656 $tpl->assign(
'forgot_pass_lbl', $GLOBALS[
'STR_FORGOT_YOUR_PASSWORD']);
1657 if (empty($GLOBALS[
'site_parameters'][
'disable_register_button_on_login_form'])) {
1658 $url_enregistrement = get_account_register_url(
false,
false);
1659 $tpl->assign(
'enregistrement_href', $url_enregistrement);
1660 $tpl->assign(
'enregistrement_lbl', $GLOBALS[
'STR_OPEN_ACCOUNT']);
1662 $tpl->assign(
'via_lbl', $GLOBALS[
'STR_VIA']);
1663 if (function_exists(
'get_social_icone')) {
1664 $tpl->assign(
'social_icone', get_social_icone());
1666 $social = array(
'is_any' =>
false);
1668 $social[
'is_any'] =
true;
1669 $social[
'facebook'] = get_facebook_connect_btn();
1672 $social[
'is_any'] =
true;
1673 $social[
'twitter'] = get_sign_in_twitter_btn();
1676 $social[
'is_any'] =
true;
1677 $social[
'openid'] = get_openid_btn();
1679 $tpl->assign(
'social', $social);
1680 $tpl->assign(
'STR_COMPTE', $GLOBALS[
'STR_COMPTE']);
1681 $tpl->assign(
'STR_LOGIN', $GLOBALS[
'STR_LOGIN']);
1682 $tpl->assign(
'STR_BEFORE_TWO_POINTS', $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
1693 if (!function_exists(
'getHTMLHead')) {
1700 function getHTMLHead($page_name, &$category_introduction_text)
1704 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'HTMLHead.tpl');
1706 $tpl->assign(
'head_attributes', get_facebook_xmlns());
1708 if(!empty($GLOBALS[
'meta_rss_links_array'])){
1709 $link_rss_html =
'';
1710 foreach($GLOBALS[
'meta_rss_links_array'] as $this_title => $this_url){
1712 <link rel="alternate" type="application/rss+xml" title="'.String::str_form_value($this_title).
'" href="'.
String::str_form_value($this_url).
'" />';
1714 $tpl->assign(
'link_rss_html', $link_rss_html);
1716 if (!empty($page_name)) {
1717 $tpl->assign(
'meta', affiche_meta($page_name,
true));
1719 if (defined(
'IN_PARTNER')) {
1720 $default_title = $GLOBALS[
'STR_OUR_PARTNER'];
1721 }
elseif (defined(
'IN_MAP')) {
1722 $default_title = $GLOBALS[
'STR_WORD_RESELLER'];
1723 }
elseif (defined(
'IN_RETAILER')) {
1724 $default_title = $GLOBALS[
'STR_RETAILER_SUBSCRIBE'];
1725 }
elseif (defined(
'IN_REFERENCE')) {
1726 $default_title = $GLOBALS[
'STR_REFERENCE_ON_LINE_SHOP'];
1727 }
elseif (defined(
'IN_DEVIS')) {
1728 $default_title = $GLOBALS[
'STR_DEVIS_ON_LINE_SHOP'];
1729 }
elseif (defined(
'IN_DOWNLOAD_PEEL') && !empty($GLOBALS[
'STR_MODULE_PEEL_DOWNLOAD_PEEL'])) {
1730 $default_title = $GLOBALS[
'STR_MODULE_PEEL_DOWNLOAD_PEEL'];
1732 $default_title = null;
1734 $tpl->assign(
'meta', affiche_meta($default_title,
true));
1737 if (!empty($GLOBALS[
'site_parameters'][
'favicon'])) {
1738 $tpl->assign(
'favicon_href', $GLOBALS[
'repertoire_upload'] .
'/' . $GLOBALS[
'site_parameters'][
'favicon']);
1741 $GLOBALS[
'css_files'][] = get_url(
'/modules/vitrine/css/vitrine.css');
1744 $GLOBALS[
'css_files'][] = get_url(
'/modules/annonces/rating_bar/rating.css');
1745 $GLOBALS[
'css_files'][] = get_url(
'/modules/annonces/annonces.css');
1750 $GLOBALS[
'css_files'][] = get_url(
'/modules/carrousel/css/carrousel.css');
1751 $GLOBALS[
'js_files'][-21] = get_url(
'/modules/carrousel/js/carrousel.js');
1753 if (empty($GLOBALS[
'site_parameters'][
'lightbox_disable']) || !empty($GLOBALS[
'lightbox_force'])) {
1755 $GLOBALS[
'css_files'][] = get_url(
'/lib/css/lightbox.css');
1756 if (!empty($GLOBALS[
'lightbox_force'])) {
1758 $GLOBALS[
'site_parameters'][
'minify_css_exclude_array'][] =
'lightbox.css';
1761 if (
vb($GLOBALS[
'site_parameters'][
'zoom']) ==
'jqzoom' &&
vb($GLOBALS[
'site_parameters'][
'enable_jquery']) == 1) {
1762 $GLOBALS[
'css_files'][] = get_url(
'/lib/css/jqzoom.css');
1763 }
elseif (
vb($GLOBALS[
'site_parameters'][
'zoom']) ==
'cloud-zoom' &&
vb($GLOBALS[
'site_parameters'][
'enable_jquery']) == 1) {
1764 $GLOBALS[
'css_files'][] = get_url(
'/lib/css/cloudzoom.css');
1768 $GLOBALS[
'js_files'][] = get_url(
'/modules/fianet/lib/js/fianet.js');
1770 if (
vb($GLOBALS[
'site_parameters'][
'enable_jquery']) == 1) {
1771 $GLOBALS[
'js_files'][-100] = get_url(
'/lib/js/jquery.js');
1773 $GLOBALS[
'css_files'][] = get_url(
'/lib/css/jquery-ui.css');
1774 $GLOBALS[
'js_files'][-90] = get_url(
'/lib/js/jquery-ui.js');
1775 if(file_exists($GLOBALS[
'dirroot'] .
'/lib/js/jquery.ui.datepicker-'.$_SESSION[
'session_langue'].
'.js')) {
1777 $GLOBALS[
'js_files'][] = get_url(
'/lib/js/jquery.ui.datepicker-'.$_SESSION[
'session_langue'].
'.js');
1780 if (empty($GLOBALS[
'site_parameters'][
'lightbox_disable']) || !empty($GLOBALS[
'lightbox_force'])) {
1782 $GLOBALS[
'js_files'][] = get_url(
'/lib/js/lightbox.js');
1783 if (!empty($GLOBALS[
'lightbox_force'])) {
1785 $GLOBALS[
'site_parameters'][
'minify_js_exclude_array'][] =
'lightbox.js';
1789 if (
vb($GLOBALS[
'site_parameters'][
'enable_prototype']) == 1 && empty($GLOBALS[
'site_parameters'][
'bootstrap_enabled'])) {
1790 $GLOBALS[
'js_files'][] = get_url(
'/lib/js/prototype.js');
1791 $GLOBALS[
'js_files'][] = get_url(
'/lib/js/effects.js');
1792 $GLOBALS[
'js_files'][] = get_url(
'/lib/js/controls.js');
1795 $GLOBALS[
'js_files'][] = get_url(
'/modules/annonces/rating_bar/js/rating.js');
1797 if (!empty($GLOBALS[
'load_anythingslider'])) {
1802 $GLOBALS[
'js_files_nominify'][-19] = get_url(
'/modules/carrousel/js/jquery.anythingslider.min.js');
1804 if (((defined(
'IN_RUBRIQUE') &&
vb($rub[
'technical_code']) ==
'creation') || (defined(
'IN_REFERENCE') && !empty($GLOBALS[
'site_parameters'][
'affiche_reference_multipage_with_pheonix_gallery']))) &&
check_if_module_active(
'references')) {
1805 $GLOBALS[
'css_files'][] = get_url(
'/modules/references/style/style.css');
1806 $GLOBALS[
'css_files'][] = get_url(
'/modules/references/phoenixgallery/style/style.css');
1807 $GLOBALS[
'js_files'][-60] = get_url(
'/lib/js/jquery.easing.min.js');
1808 $GLOBALS[
'js_files'][] = get_url(
'/modules/references/phoenixgallery/js/phoenixgallery.js');
1811 $GLOBALS[
'css_files'][] = get_url(
'/modules/photodesk/css/style.css');
1812 $GLOBALS[
'js_files'][-50] = get_url(
'/modules/photodesk/js/jquery.transform-0.6.2.min.js');
1813 $GLOBALS[
'js_files'][-49] = get_url(
'/modules/photodesk/js/jquery.animate-shadow-min.js');
1814 $GLOBALS[
'js_files'][-48] = get_url(
'/modules/photodesk/js/jquery-ui-1.8.16.custom.min.js');
1815 $GLOBALS[
'js_files'][-47] = get_url(
'/modules/photodesk/js/photodesk.js');
1819 $js_output .= get_welcome_ad_script();
1821 if ($GLOBALS[
'site_parameters'][
'zoom'] ==
'jqzoom' && $GLOBALS[
'site_parameters'][
'enable_jquery'] == 1) {
1822 $GLOBALS[
'js_files'][-70] = get_url(
'/lib/js/jquery.jqzoom-core-pack.js');
1823 }
elseif ($GLOBALS[
'site_parameters'][
'zoom'] ==
'cloud-zoom' && $GLOBALS[
'site_parameters'][
'enable_jquery'] == 1) {
1824 $GLOBALS[
'js_files'][] = get_url(
'/lib/js/cloud-zoom.1.0.2.js');
1826 foreach($GLOBALS[
'modules_installed'] as $this_module) {
1827 if(!empty($GLOBALS[
'site_parameters'][
'modules_front_office_js_array'][$this_module])) {
1828 $GLOBALS[
'js_files'][] = get_url($GLOBALS[
'site_parameters'][
'modules_front_office_js_array'][$this_module]);
1832 $js_output .= get_cart_popup_script();
1833 unset($_SESSION[
'session_show_caddie_popup']);
1836 $js_output .= google_friend_connect_javascript_library();
1839 '.vb($js_sortable).
'
1841 if (empty($GLOBALS[
'site_parameters'][
'disable_autocomplete'])) {
1843 $GLOBALS[
'js_ready_content_array'][] =
'
1844 bind_search_autocomplete("search", "' . $GLOBALS[
'wwwroot'] .
'/modules/search/produit.php", true);
1847 if (empty($GLOBALS[
'site_parameters'][
'autocomplete_search_advanced_enable'])) {
1849 $GLOBALS[
'js_ready_content_array'][] =
'
1850 bind_search_autocomplete("search_advanced", "' . $GLOBALS[
'wwwroot'] .
'/modules/search/produit.php", true);
1853 if(!empty($GLOBALS[
'load_nyromodal'])){
1855 $GLOBALS[
'site_parameters'][
'load_javascript_async'] =
false;
1856 $GLOBALS[
'css_files'][] = get_url(
'/lib/css/nyroModal.css');
1857 $GLOBALS[
'js_files'][] = get_url(
'/lib/js/jquery.nyroModal.custom.js');
1859 $GLOBALS[
'js_ready_content_array'][] =
'
1861 $(".nyroModal").nyroModal();
1865 if(!empty($GLOBALS[
'site_parameters'][
'scroll_to_top'])) {
1867 $GLOBALS[
'js_ready_content_array'][] =
'
1868 // Compatibilité pour iOS
1869 $(document).touchmove(function() { advisto_scroll() });
1870 $(window).scroll(function() { advisto_scroll() });
1871 function advisto_scroll() {
1872 if ($(document).scrollTop() > 100) {
1873 if($(".scroll_to_top").css("display") == "none") {
1874 $(".scroll_to_top").stop(true, false).show(800);
1876 } else if($(".scroll_to_top").css("display") != "none") {
1877 $(".scroll_to_top").stop(true, false).hide(400);
1882 if(!empty($GLOBALS[
'site_parameters'][
'images_preload_urls_array'])) {
1883 foreach($GLOBALS[
'site_parameters'][
'images_preload_urls_array'] as $this_image_url) {
1885 $this_image = $GLOBALS[
'wwwroot'] . $this_image_url;
1887 $GLOBALS[
'js_content_array'][] =
'
1888 loadImage=new Image();
1889 loadImage.src="' . $this_image_url .
'";';
1893 if(!empty($GLOBALS[
'site_parameters'][
'bootstrap_enabled'])) {
1894 $GLOBALS[
'css_files'][] = get_url(
'/lib/css/bootstrap.css');
1895 $GLOBALS[
'js_files'][] = $GLOBALS[
'wwwroot_in_admin'] .
'/lib/js/bootstrap.js';
1896 $GLOBALS[
'js_ready_content_array'][] =
'
1897 bootbox.setDefaults({
1898 locale: "'.$_SESSION[
'session_langue'].
'"
1901 $GLOBALS[
'js_files'][] = get_url(
'/lib/js/advisto.js');
1902 if (
vb($GLOBALS[
'site_parameters'][
'anim_prod']) == 1) {
1903 $GLOBALS[
'js_files'][] = get_url(
'/lib/js/fly-to-basket.js');
1905 if(!empty($GLOBALS[
'site_parameters'][
'css'])) {
1907 $this_css_file = trim($this_css_file);
1909 $GLOBALS[
'css_files'][] = $this_css_file;
1910 }
elseif(file_exists($GLOBALS[
'repertoire_modele'] .
'/css/' . $this_css_file)) {
1911 $GLOBALS[
'css_files'][] = $GLOBALS[
'repertoire_css'] .
'/' . $this_css_file;
1919 if (!empty($GLOBALS[
'site_parameters'][
'javascript_force_load_header'])) {
1920 $tpl->assign(
'js_output', $js_output .
get_javascript_output(
false, !empty($GLOBALS[
'site_parameters'][
'minify_js']), empty($GLOBALS[
'site_parameters'][
'javascript_content_force_load_header'])));
1922 $tpl->assign(
'js_output', $js_output);
1924 $tpl->assign(
'msg_err_keyb', $GLOBALS[
'STR_ERR_KEYB']);
1926 if (isset($_GET[
'catid'])) {
1927 $queryCP =
query(
'SELECT header_html_' . $_SESSION[
'session_langue'] .
' AS category_introduction_text, background_menu, background_color
1928 FROM peel_categories
1936 if (strlen($background_color) > 1 || strlen($background_menu) > 1) {
1937 $tpl->assign(
'bg_colors', array(
'body' => $background_color,
1938 'menu' => $background_menu
1948 if (!function_exists(
'get_menu')) {
1958 if (!empty($GLOBALS[
'site_parameters'][
'bootstrap_enabled'])) {
1963 $indent =
' ';
1965 if (empty($GLOBALS[
'main_menu_items']) || isset($GLOBALS[
'site_parameters'][
'main_menu_items_if_available'])) {
1966 $GLOBALS[
'main_menu_items'][
'home'] = array($GLOBALS[
'wwwroot'] .
'/' => $GLOBALS[
'STR_HOME']);
1967 $GLOBALS[
'main_menu_items'][
'catalog'] = array(get_product_category_url() => $GLOBALS[
'STR_CATALOGUE']);
1968 $GLOBALS[
'main_menu_items'][
'news'] = array(get_product_category_url() .
'nouveautes.php' => $GLOBALS[
'STR_NOUVEAUTES']);
1969 $GLOBALS[
'main_menu_items'][
'content'] = array(get_content_category_url() => $GLOBALS[
"STR_INFORMATIONS"]);
1970 $GLOBALS[
'main_menu_items'][
'other'] = array(
'#' => $GLOBALS[
"STR_OTHER"]);
1971 $GLOBALS[
'main_menu_items'][
'faq'] = array(get_url(
'/modules/faq/faq.php') => $GLOBALS[
'STR_FAQ_TITLE']);
1972 $GLOBALS[
'main_menu_items'][
'brand'] = array(get_url(
'/achat/marque.php') => $GLOBALS[
'STR_ALL_BRAND']);
1973 $GLOBALS[
'main_menu_items'][
'contact_us'] = array(get_url(
'/contacts.php') => $GLOBALS[
'STR_CONTACT_US']);
1974 $GLOBALS[
'main_menu_items'][
'flash'][get_url(
'/modules/flash/flash.php')] = $GLOBALS[
'STR_FLASH'];
1975 $GLOBALS[
'main_menu_items'][
'promotions'][get_product_category_url() .
'promotions.php'] = $GLOBALS[
'STR_PROMOTIONS'];
1976 $GLOBALS[
'main_menu_items'][
'reseller'][get_url(
'/modules/reseller/retailer.php')] = $GLOBALS[
'STR_RETAILER'];
1977 if (!empty($GLOBALS[
'site_parameters'][
'enable_create_product_in_front'])) {
1980 $GLOBALS[
'main_menu_items'][
'draft'] = array(get_product_category_url(
$result[
'id']) => $GLOBALS[
'STR_MODULE_CREATE_PRODUCT_IN_FRONT_OFFICE_SORTIE_SAVE_DRAFT']);
1984 $GLOBALS[
'main_menu_items'][
'account'] = array(get_account_url(
false,
false) => $GLOBALS[
'STR_COMPTE']);
1985 if(!empty($GLOBALS[
'site_parameters'][
'bootstrap_enabled'])) {
1986 $GLOBALS[
'menu_items'][
'account'][get_account_url(
false,
false)] = $GLOBALS[
'STR_COMPTE'];
1988 $GLOBALS[
'menu_items'][
'account'][get_product_category_url() .
'historique_commandes.php'] = $GLOBALS[
'STR_ORDER_HISTORY'];
1989 $GLOBALS[
'menu_items'][
'account'][get_url(
'/utilisateurs/change_mot_passe.php')] = $GLOBALS[
'STR_CHANGE_PASSWORD'];
1991 $GLOBALS[
'menu_items'][
'account'][get_url(
'/modules/cart_preservation/cart_preservation.php')] = $GLOBALS[
'STR_CART_PRESERVATION_TITLE'];
1993 $GLOBALS[
'menu_items'][
'account'][get_url(
'/utilisateurs/change_params.php')] = $GLOBALS[
'STR_CHANGE_PARAMS'];
1994 $GLOBALS[
'menu_items'][
'account'][get_url(
'sortie')] = $GLOBALS[
'STR_LOGOUT'];
1996 $GLOBALS[
'main_menu_items'][
'account'] = array(get_url(
'membre') => $GLOBALS[
'STR_COMPTE']);
1998 $GLOBALS[
'main_menu_items'][
'contact'] = array(get_contact_url(
false,
false) => $GLOBALS[
'STR_CONTACT']);
1999 if(!empty($GLOBALS[
'site_parameters'][
'bootstrap_enabled'])) {
2000 $GLOBALS[
'menu_items'][
'contact'][get_contact_url(
false,
false)] = $GLOBALS[
'STR_CONTACT'];
2002 $GLOBALS[
'menu_items'][
'contact'][get_url(
'/plan_acces.php')] = $GLOBALS[
'STR_ACCESS_PLAN'];
2003 if (
a_priv(
'admin*',
true)) {
2004 $GLOBALS[
'main_menu_items'][
'admin'] = array($GLOBALS[
'administrer_url'] .
'/' => $GLOBALS[
'STR_ADMIN']);
2006 $GLOBALS[
'menu_items'][
'news'][get_product_category_url() .
'promotions.php'] = $GLOBALS[
'STR_PROMOTIONS'];
2007 if (is_flash_active_on_site()) {
2008 $GLOBALS[
'menu_items'][
'news'][get_url(
'/modules/flash/flash.php')] = $GLOBALS[
'STR_FLASH'];
2011 $GLOBALS[
'menu_items'][
'devis'][get_url(
'/modules/devis/devis.php')] = $GLOBALS[
'STR_DEVIS'];
2013 $GLOBALS[
'menu_items'][
'devis'] = array();
2015 foreach(
vb($GLOBALS[
'site_parameters'][
'main_menu_custom_titles'], array()) as $this_key => $this_title) {
2016 $GLOBALS[
'main_menu_items'][$this_key][
vb($GLOBALS[
'site_parameters'][
'main_menu_custom_urls'][$this_key],
'#')] = $this_title;
2019 $GLOBALS[
'main_menu_items'] = array_merge_recursive($GLOBALS[
'main_menu_items'],
vb(
$hook_result[
'main_menu_items'], array()));
2020 $GLOBALS[
'menu_items'] = array_merge_recursive($GLOBALS[
'menu_items'],
vb(
$hook_result[
'menu_items'], array()));
2022 $GLOBALS[
'menu_items'][
'other'] = array_merge($GLOBALS[
'main_menu_items'][
'catalog'], $GLOBALS[
'menu_items'][
'news'], (!in_array(
'news', $GLOBALS[
'site_parameters'][
'main_menu_items_if_available'])? $GLOBALS[
'main_menu_items'][
'news']:array()), array(
'' =>
'divider'), $GLOBALS[
'menu_items'][
'contact'], $GLOBALS[
'menu_items'][
'devis'],(!in_array(
'contact', $GLOBALS[
'site_parameters'][
'main_menu_items_if_available'])? $GLOBALS[
'main_menu_items'][
'contact']:array()));
2024 if(isset($GLOBALS[
'site_parameters'][
'main_menu_items_if_available']) && is_array($GLOBALS[
'site_parameters'][
'main_menu_items_if_available'])) {
2026 foreach($GLOBALS[
'site_parameters'][
'main_menu_items_if_available'] as $this_value) {
2027 if(isset($GLOBALS[
'main_menu_items'][$this_value])) {
2028 $temp[$this_value] = $GLOBALS[
'main_menu_items'][$this_value];
2031 $GLOBALS[
'main_menu_items'] = $temp;
2034 if(!empty($GLOBALS[
'site_parameters'][
'product_categories_depth_in_menu'])) {
2035 $selected_item = intval(
vn($_GET[
'catid']));
2036 $sql =
'SELECT c.id, c.parent_id, c.nom_' . $_SESSION[
'session_langue'] .
' as nom, parent_id
2037 FROM peel_categories c
2038 WHERE c.etat="1" AND nom_' . $_SESSION[
'session_langue'] .
'!="" AND ' .
get_filter_site_cond(
'categories',
'c') .
' ' . (!empty($GLOBALS[
'site_parameters'][
'categories_exclude_from_main_menu'])?
' AND id NOT IN ("'.implode($GLOBALS[
'site_parameters'][
'categories_exclude_from_main_menu'],
'","').
'")':
'') .
'
2039 ORDER BY c.position ASC, nom ASC';
2042 $all_parents_with_ordered_direct_sons_array[
$result[
'parent_id']][] = $result[
'id'];
2043 $item_name_array[$result[
'id']] = $result[
'nom'];
2044 if(empty($result[
'parent_id'])) {
2047 if(!empty($GLOBALS[
'site_parameters'][
'insert_product_categories_in_menu'])) {
2049 if(!isset($GLOBALS[
'main_menu_items'][
"cat_" . $result[
'id']])) {
2050 $GLOBALS[
'main_menu_items'][
"cat_" . $result[
'id']] = array(get_product_category_url($result[
'id'], $result[
'nom']) => $result[
'nom']);
2052 $GLOBALS[
'categories_level'][$result[
'parent_id']][] =
"cat_" . $result[
'id'];
2055 $GLOBALS[
'submenu_html_array'][
'catalog'] =
'';
2056 if(!empty($item_name_array) && !empty($GLOBALS[
'site_parameters'][
'product_categories_depth_in_menu'])) {
2057 $GLOBALS[
'submenu_html_array'][
'catalog'] .=
'<ul class="sousMenu dropdown-menu" role="menu">'.get_recursive_items_display($all_parents_with_ordered_direct_sons_array, $item_name_array, 0, 0, $selected_item,
'categories',
'left',
vn($GLOBALS[
'site_parameters'][
'product_categories_depth_in_menu']),
vb($GLOBALS[
'site_parameters'][
'categories_top_menu_item_max_length'], 25),
'list', $indent, null).
'</ul>';
2058 foreach($item_name_array as
$catid => $nom) {
2059 if (!empty($all_parents_with_ordered_direct_sons_array[
$catid]) && !isset($GLOBALS[
'submenu_html_array'][
"cat_".$catid])) {
2060 $GLOBALS[
'submenu_html_array'][
"cat_".$catid] =
'<ul class="sousMenu dropdown-menu" role="menu">';
2061 if(!empty($GLOBALS[
'site_parameters'][
'submenus_include_products'])) {
2063 $sql_offre =
'SELECT p.nom_' . $_SESSION[
'session_langue'] .
' AS nom_produit, p.id
2064 FROM peel_produits p
2065 INNER JOIN peel_produits_categories pc ON pc.produit_id = p.id
2066 INNER JOIN peel_categories c ON pc.categorie_id = c.id
2067 WHERE p.etat="1" AND p.nom_' . $_SESSION[
'session_langue'] .
'!="" AND pc.categorie_id="'.intval($catid).
'"
2069 ORDER BY p.`position` ASC, p.id ASC';
2070 $qid =
query($sql_offre);
2073 $GLOBALS[
'submenu_html_array'][
"cat_".$catid] .=
'<li><a href="'.
$product_object->get_product_url().
'">' . $result[
'nom_produit'] .
'</a></li>';
2077 $GLOBALS[
'submenu_html_array'][
"cat_".$catid] .= get_recursive_items_display($all_parents_with_ordered_direct_sons_array, $item_name_array, $catid, 0, $selected_item,
'categories',
'left',
vn($GLOBALS[
'site_parameters'][
'product_categories_depth_in_menu']),
vb($GLOBALS[
'site_parameters'][
'categories_submenu_item_max_length'], 50),
'list', $indent, null);
2078 if($avoid_links_when_hover) {
2082 $GLOBALS[
'submenu_html_array'][
"cat_".$catid] .=
'<li><a href="'. array_shift(array_keys($GLOBALS[
'main_menu_items'][
"cat_".$catid])) .
'">' . array_shift(array_values($GLOBALS[
'main_menu_items'][
"cat_".$catid])) .
'</a></li>';
2084 $GLOBALS[
'submenu_html_array'][
"cat_".$catid] .=
'</ul>';
2089 $GLOBALS[
'submenu_html_array'][
'catalog'] .=
'<ul class="sousMenu dropdown-menu" role="menu">'.display_ads_search_list($_SESSION[
'session_utilisateur'][
'id_utilisateur'],
true).
'</ul>';
2093 if(!empty($GLOBALS[
'site_parameters'][
'insert_article_in_menu'])) {
2094 $sql =
'SELECT a.id, a.on_reseller, a.titre_' . $_SESSION[
'session_langue'] .
' as nom
2095 FROM peel_articles a
2096 WHERE a.etat = "1" AND a.technical_code NOT IN ("other", "iphone_content") AND a.position>=0 AND ' .
get_filter_site_cond(
'articles',
'a') .
'
2097 ORDER BY a.position ASC, nom ASC';
2101 if ((!
a_priv(
"admin_product") && !
a_priv(
"reve")) && $result[
'on_reseller'] == 1) {
2105 $GLOBALS[
'main_menu_items'][
"art_".$result[
'id']] = array(get_content_url($result[
'id']) => $result[
'nom']);
2111 if(!empty($GLOBALS[
'site_parameters'][
'content_categories_depth_in_menu'])) {
2113 $selected_item = intval(
vn($_GET[
'rubid']));
2114 unset($all_parents_with_ordered_direct_sons_array);
2115 unset($item_name_array);
2116 $sql =
'SELECT r.id, r.parent_id, r.nom_' . $_SESSION[
'session_langue'] .
' AS nom
2117 FROM peel_rubriques r
2118 WHERE r.etat = "1" AND r.technical_code NOT IN ("other", "iphone_content") AND r.position>=0 AND ' .
get_filter_site_cond(
'rubriques',
'r') .
'
2119 ORDER BY r.position ASC, nom ASC';
2123 $all_parents_with_ordered_direct_sons_array[$result[
'parent_id']][] = $result[
'id'];
2124 $item_name_array[$result[
'id']] = $result[
'nom'];
2125 if(!empty($GLOBALS[
'site_parameters'][
'insert_article_categories_in_menu'])) {
2127 if(!isset($GLOBALS[
'main_menu_items'][
"rub_" . $result[
'id']])) {
2128 $GLOBALS[
'main_menu_items'][
"rub_".$result[
'id']] = array(get_content_category_url($result[
'id'], $result[
'nom']) => $result[
'nom']);
2130 $GLOBALS[
'rubriques_level'][$result[
'parent_id']][] =
"rub_" . $result[
'id'];
2133 $GLOBALS[
'submenu_html_array'][
'content'] =
'';
2134 if(!empty($item_name_array)) {
2135 $GLOBALS[
'submenu_html_array'][
'content'] .=
'<ul class="sousMenu dropdown-menu" role="menu">'.get_recursive_items_display($all_parents_with_ordered_direct_sons_array, $item_name_array, 0, 0, $selected_item,
'rubriques',
'left', $GLOBALS[
'site_parameters'][
'content_categories_depth_in_menu'],
vb($GLOBALS[
'site_parameters'][
'categories_top_menu_item_max_length'], 25),
'list', $indent, null).
'</ul>';
2136 foreach($item_name_array as
$rubid => $nom) {
2137 if(!isset($GLOBALS[
'submenu_html_array'][
"rub_".
$rubid])) {
2138 if (!empty($GLOBALS[
'site_parameters'][
'insert_content_articles_in_menu'])) {
2140 $sql =
"SELECT a.id, a.titre_" . $_SESSION[
'session_langue'] .
" as nom
2141 FROM peel_rubriques r
2142 INNER JOIN peel_articles_rubriques pc ON r.id = pc.rubrique_id
2143 INNER JOIN peel_articles a ON a.id = pc.article_id AND " .
get_filter_site_cond(
'articles',
'a') .
"
2144 WHERE r.id ='" . intval($rubid) .
"' AND r.technical_code NOT IN ('other', 'iphone_content') AND " .
get_filter_site_cond(
'rubriques',
'r') .
"";
2146 $GLOBALS[
'submenu_html_array'][
"rub_".$rubid] =
'<ul class="sousMenu dropdown-menu" role="menu">';
2147 if($avoid_links_when_hover) {
2149 $GLOBALS[
'submenu_html_array'][
"rub_".$rubid] .=
'<li><a href="'. array_shift(array_keys($GLOBALS[
'main_menu_items'][
"rub_".$rubid])) .
'">' . array_shift(array_values($GLOBALS[
'main_menu_items'][
"rub_".$rubid])) .
'</a></li>';
2152 $GLOBALS[
'submenu_html_array'][
"rub_".$rubid] .=
'<li><a href="'. get_content_url($result[
'id']) .
'">' . $result[
'nom'] .
'</a></li>';
2154 $GLOBALS[
'submenu_html_array'][
"rub_".$rubid] .=
'</ul>';
2155 }
elseif (!empty($all_parents_with_ordered_direct_sons_array[$rubid])) {
2157 $GLOBALS[
'submenu_html_array'][
"rub_".$rubid] =
'
2158 <ul class="sousMenu dropdown-menu" role="menu">' . get_recursive_items_display($all_parents_with_ordered_direct_sons_array, $item_name_array, $rubid, 0, $selected_item,
'rubriques',
'left', $GLOBALS[
'site_parameters'][
'content_categories_depth_in_menu'],
vb($GLOBALS[
'site_parameters'][
'categories_submenu_item_max_length'], 50),
'list', $indent, null) .
vb($article) .
'</ul>';
2164 if(in_array(
'brand',$GLOBALS[
'site_parameters'][
'main_menu_items_if_available'])) {
2165 $sql =
"SELECT id, image, description_" . $_SESSION[
'session_langue'] .
" AS description, nom_" . $_SESSION[
'session_langue'] .
" AS nom
2168 ORDER BY position ASC, nom ASC";
2171 $GLOBALS[
'submenu_html_array'][
'brand'] =
'<ul class="sousMenu dropdown-menu" role="menu">';
2173 $GLOBALS[
'submenu_html_array'][
'brand'] .=
'<li><a href="'.get_url(
'/achat/marque.php', array(
'id' => $result[
'id'])).
'">
2177 $GLOBALS[
'submenu_html_array'][
'brand'] .=
'</ul>';
2179 if(!empty($GLOBALS[
'site_parameters'][
'insert_article_in_menu'])) {
2181 $sql =
'SELECT a.id, a.titre_' . $_SESSION[
'session_langue'] .
' as nom
2182 FROM peel_articles a
2183 WHERE a.etat = "1" AND a.technical_code NOT IN ("other", "iphone_content") AND a.position>=0 AND ' .
get_filter_site_cond(
'articles',
'a') .
'
2184 ORDER BY a.position ASC, nom ASC';
2188 $GLOBALS[
'main_menu_items'][
"art_".$result[
'id']] = array(get_content_url($result[
'id']) => $result[
'nom']);
2192 if(in_array(
'brand',$GLOBALS[
'site_parameters'][
'main_menu_items_if_available'])) {
2195 $sql =
"SELECT id, image, description_" . $_SESSION[
'session_langue'] .
" AS description, nom_" . $_SESSION[
'session_langue'] .
" AS nom
2198 ORDER BY position ASC, nom ASC";
2201 $GLOBALS[
'submenu_html_array'][
'brand'] =
'<ul class="sousMenu dropdown-menu" role="menu">';
2203 $GLOBALS[
'submenu_html_array'][
'brand'] .=
'<li><a href="'.get_url(
'/achat/marque.php', array(
'id' => $result[
'id'])).
'">
2207 $GLOBALS[
'submenu_html_array'][
'brand'] .=
'</ul>';
2209 if(!empty($GLOBALS[
'site_parameters'][
'main_menu_items_if_available']) && is_array($GLOBALS[
'site_parameters'][
'main_menu_items_if_available'])) {
2210 $temp_main_menu_items = array();
2211 if(in_array(
'cat_*', $GLOBALS[
'site_parameters'][
'main_menu_items_if_available']) && !empty($GLOBALS[
'categories_level'][0])) {
2212 $new_menu = array();
2213 foreach($GLOBALS[
'site_parameters'][
'main_menu_items_if_available'] as $this_key => $this_value) {
2214 if($this_value==
'cat_*') {
2215 foreach($GLOBALS[
'categories_level'][0] as $this_imported_value) {
2217 $new_menu[] = $this_imported_value;
2220 }
elseif(!is_numeric($this_key)) {
2221 $new_menu[$this_key] = $this_value;
2223 $new_menu[] = $this_value;
2226 $GLOBALS[
'site_parameters'][
'main_menu_items_if_available'] = $new_menu;
2228 if(in_array(
'rub_*', $GLOBALS[
'site_parameters'][
'main_menu_items_if_available']) && !empty($GLOBALS[
'rubriques_level'][0])) {
2229 $new_menu = array();
2230 foreach($GLOBALS[
'site_parameters'][
'main_menu_items_if_available'] as $this_key => $this_value) {
2231 if($this_value==
'rub_*') {
2232 foreach($GLOBALS[
'rubriques_level'][0] as $this_imported_value) {
2234 $new_menu[] = $this_imported_value;
2237 }
elseif(!is_numeric($this_key)) {
2238 $new_menu[$this_key] = $this_value;
2240 $new_menu[] = $this_value;
2243 $GLOBALS[
'site_parameters'][
'main_menu_items_if_available'] = $new_menu;
2246 foreach($GLOBALS[
'site_parameters'][
'main_menu_items_if_available'] as $this_key => $this_value) {
2247 if(isset($GLOBALS[
'main_menu_items'][$this_value])) {
2249 $temp_main_menu_items[$this_value] = $GLOBALS[
'main_menu_items'][$this_value];
2250 }
elseif(!is_numeric($this_key)) {
2252 if(
String::substr($this_value, 0, 4) ==
'STR_' && isset($GLOBALS[$this_value])) {
2253 $this_text = $GLOBALS[$this_value];
2255 $this_text = $this_value;
2258 $this_url = $this_key;
2261 $this_url = $GLOBALS[
'wwwroot'] .
'/' . $this_key;
2263 $this_url = $GLOBALS[
'wwwroot'] . $this_key;
2266 $temp_main_menu_items[
'custom'.$custom] = array($this_url => $this_text);
2268 if(!empty($GLOBALS[
'site_parameters'][
'menu_custom_submenus']) && is_array($GLOBALS[
'site_parameters'][
'menu_custom_submenus']) && isset($GLOBALS[
'site_parameters'][
'menu_custom_submenus'][$this_value])) {
2271 $temp_menu_items = array();
2272 if(!empty($GLOBALS[
'site_parameters'][
'menu_custom_submenus_keep_default'])) {
2273 $temp_menu_items = $GLOBALS[
'menu_items'];
2275 foreach($GLOBALS[
'site_parameters'][
'menu_custom_submenus'] as $this_main_menu_items_value => $this_menu_items_value) {
2276 if(isset($GLOBALS[
'main_menu_items'][$this_main_menu_items_value])) {
2279 $this_output = affiche_contenu_html($this_menu_items_value,
true);
2280 if(!empty($this_output)) {
2281 $GLOBALS[
'submenu_html_array'][$this_main_menu_items_value] =
'
2282 <ul class="sousMenu dropdown-menu" role="menu">
2284 <div class="yamm-content">
2285 ' . $this_output .
'
2291 foreach(explode(
',',str_replace(
' ',
'', $this_menu_items_value)) as $this_submenu) {
2293 if(!empty($GLOBALS[
'site_parameters'][
'menu_custom_urls'][$this_submenu]) && !empty($GLOBALS[
'site_parameters'][
'menu_custom_titles'][$this_submenu])) {
2296 $temp_menu_items[$this_main_menu_items_value][$GLOBALS[
'site_parameters'][
'menu_custom_urls'][$this_submenu]] = $GLOBALS[$GLOBALS[
'site_parameters'][
'menu_custom_titles'][$this_submenu]];
2297 }
elseif(!empty($GLOBALS[
'site_parameters'][
'menu_custom_submenus_keep_default'])) {
2298 unset($temp_menu_items[$this_main_menu_items_value]);
2304 $GLOBALS[
'menu_items'] = $temp_menu_items;
2307 $GLOBALS[
'main_menu_items'] = $temp_main_menu_items;
2313 foreach($GLOBALS[
'main_menu_items'] as $this_main_item => $this_main_array) {
2315 foreach ($this_main_array as $this_main_url => $this_main_title) {
2317 if($avoid_links_when_hover && (!empty($GLOBALS[
'menu_items'][$this_main_item]) || !empty($GLOBALS[
'submenu_html_array'][$this_main_item]))) {
2319 if(!empty($GLOBALS[
'menu_items'][$this_main_item]) && empty($GLOBALS[
'menu_items'][$this_main_item][$this_main_url])) {
2320 $GLOBALS[
'menu_items'][$this_main_item] = array_merge(array($this_main_url => $this_main_title), $GLOBALS[
'main_menu_items'][$this_main_item]);
2322 $this_main_url =
'#';
2324 if($this_main_item ==
'other' && ((defined(
"IN_CATALOGUE") && !empty($_GET[
'catid'])) || (defined(
"IN_RUBRIQUE") && !empty($_GET[
'rubid'])))) {
2326 $current_menu =
false;
2327 $full_match =
false;
2329 $current_menu = (!empty($GLOBALS[
'menu_items'][$this_main_item][$current_url_full]));
2331 if ($current_menu ===
false && ((defined(
'IN_RUBRIQUE_ARTICLE') && $this_main_item ===
'rub_' . intval(
vn($_GET[
'rubid']))) || (defined(
'IN_CATALOGUE_PRODUIT') && $this_main_item ===
'cat_' . intval(
vn($_GET[
'catid']))))) {
2332 $current_menu =
true;
2335 if ($current_menu ===
false && !empty($GLOBALS[
'menu_items'][$this_main_item])) {
2336 $current_menu = (!empty($GLOBALS[
'menu_items'][$this_main_item][$current_url]));
2337 $full_match =
false;
2340 $tmp_menu_item = array(
'name' => $this_main_item,
2341 'id' =>
'menu_' .
String::substr(md5($this_main_item.
'_'.$this_main_title.
'_'.$this_main_url), 0, 4),
2342 'label' => $this_main_title,
2343 'href' => (!empty($this_main_url) && !is_numeric($this_main_url)) ? ($this_main_url !=
get_current_url(
true) || !empty($_POST)? $this_main_url :
'#') :
false,
2344 'selected' => ($current_menu !==
false || !empty($this_main_array[$current_url]) || !empty($this_main_array[$current_url_full]) ||
String::strpos(
vb($GLOBALS[
'submenu_html_array'][$this_main_item]),
'class="minus active"')!==
false),
2345 'submenu_global' =>
vb($GLOBALS[
'submenu_html_array'][$this_main_item]),
2346 'class' =>
vb($GLOBALS[
'site_parameters'][
'main_menu_custom_classes'][$this_main_item]),
2347 'submenu' => array()
2349 if (!empty($GLOBALS[
'menu_items'][$this_main_item])) {
2350 foreach ($GLOBALS[
'menu_items'][$this_main_item] as $this_url => $this_title) {
2351 $tmp_menu_item[
'submenu'][] = array(
'label' => $this_title,
2352 'href' => (!empty($this_url) && !is_numeric($this_url)) ? $this_url :
false,
2353 'selected' => (($current_url == $this_url && !$full_match) || $current_url_full == $this_url)
2357 $menu[] = $tmp_menu_item;
2360 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'menu.tpl');
2362 $tpl->assign(
'site', $GLOBALS[
'site']);
2363 $tpl->assign(
'affiche_contenu_html_menu', affiche_contenu_html(
'affiche_contenu_html_menu',
true));
2364 return $tpl->fetch();
2368 if (!function_exists(
'affiche_flags')) {
2379 function affiche_flags($return_mode =
false, $forced_destination_url = null, $display_names =
false, $langs_array = array(), $big_flags =
false, $force_width = null)
2381 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'flags.tpl');
2383 if (count($langs_array) > 1 || !empty($forced_destination_url)) {
2384 foreach ($langs_array as $this_lang) {
2385 if(!empty($forced_destination_url)){
2386 $url = $forced_destination_url .
'?langue=' . $this_lang;
2390 if($big_flags && !empty($GLOBALS[
'lang_flags_big'][$this_lang])) {
2391 $this_flag = $GLOBALS[
'lang_flags_big'][$this_lang];
2393 $this_flag = $GLOBALS[
'lang_flags'][$this_lang];
2396 $this_flag =
'/lib/flag/' . $this_flag;
2399 $this_flag = (defined(
'IN_PEEL_ADMIN') ? $GLOBALS[
'wwwroot_in_admin'] : $GLOBALS[
'wwwroot']) . $this_flag;
2401 $data[] = array(
'lang' => $this_lang,
2402 'lang_name' => (!empty($GLOBALS[
'lang_names'][$this_lang])?$GLOBALS[
'lang_names'][$this_lang]:$this_lang),
2404 'src' => $this_flag,
2405 'selected' => ($_SESSION[
'session_langue'] == $this_lang && empty($forced_destination_url)),
2406 'flag_css_class' => (($_SESSION[
'session_langue'] == $this_lang && empty($forced_destination_url)) ?
"flag_selected":
"flag_not_selected")
2411 $tpl->assign(
'display_names', $display_names);
2412 $tpl->assign(
'force_width', $force_width);
2414 return $tpl->fetch();
2421 if (!function_exists(
'getFlag')) {
2429 function getFlag($country_code, $country_name)
2431 if (!empty($country_code)) {
2432 $flag =
'<img src="' . $GLOBALS[
'wwwroot'] .
'/lib/flag/' . strtolower($country_code) .
'.gif" width="18" height="12" alt="" title="' .
String::str_form_value($country_name) .
'" /> ';
2440 if (!function_exists(
'get_formatted_longtext_with_title')) {
2448 function get_formatted_longtext_with_title($longtext, $title,
$mode =
'general')
2450 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'longtext_with_title.tpl');
2452 if(strip_tags($longtext)==$longtext) {
2453 $longtext =
'<p>' . $longtext .
'</p>';
2455 $tpl->assign(
'longtext', $longtext);
2456 $tpl->assign(
'title', $title);
2457 return $tpl->fetch();
2461 if (!function_exists(
'output_light_html_page')) {
2474 function output_light_html_page($body, $title =
'', $additional_header = null, $convert_to_encoding = null, $full_head_section_text = null, $onload = null, $add_general_css_js_files =
true)
2476 if (!empty($convert_to_encoding)) {
2477 $encoding = $convert_to_encoding;
2479 $encoding = GENERAL_ENCODING;
2481 header(
'Content-type: text/html; charset=' . $encoding);
2482 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'light_html_page.tpl');
2483 $tpl->assign(
'lang', $_SESSION[
'session_langue']);
2484 $tpl->assign(
'charset', $encoding);
2485 $tpl->assign(
'title', $title);
2486 $tpl->assign(
'onload', $onload);
2487 $tpl->assign(
'additional_header', $additional_header);
2488 $tpl->assign(
'body', $body);
2489 $tpl->assign(
'full_head_section_text', $full_head_section_text);
2490 if (empty($full_head_section_text) && $add_general_css_js_files) {
2491 if(!empty($GLOBALS[
'site_parameters'][
'bootstrap_enabled'])) {
2492 $GLOBALS[
'js_files'][-100] = get_url(
'/lib/js/jquery.js');
2493 $GLOBALS[
'css_files'][] = get_url(
'/lib/css/bootstrap.css');
2494 $GLOBALS[
'js_files'][] = get_url(
'/lib/js/bootstrap.js');
2497 $this_css_file = trim($this_css_filename);
2499 $GLOBALS[
'css_files'][] = $this_css_file;
2500 }
elseif(file_exists($GLOBALS[
'repertoire_modele'] .
'/css/' . $this_css_file)) {
2501 $GLOBALS[
'css_files'][] = $GLOBALS[
'repertoire_css'] .
'/' . $this_css_file;
2504 if(!empty($GLOBALS[
'css_files'])) {
2505 ksort($GLOBALS[
'css_files']);
2506 $tpl->assign(
'css_files', array_unique($GLOBALS[
'css_files']));
2508 $tpl->assign(
'js_output',
get_javascript_output(!empty($GLOBALS[
'site_parameters'][
'load_javascript_async']), !empty($GLOBALS[
'site_parameters'][
'minify_js'])));
2511 if (!empty($convert_to_encoding)) {
2519 if (!function_exists(
'print_alpha')) {
2525 function print_alpha()
2527 $alpha = array(
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z');
2529 foreach ($alpha as $value) {
2531 $tmp = array(
'value' => $value,
'items' => array());
2532 $sqlCat =
"SELECT c.id, c.nom_" . $_SESSION[
'session_langue'] .
", c.alpha_" . $_SESSION[
'session_langue'] .
", c.image_" . $_SESSION[
'session_langue'] .
"
2533 FROM peel_categories c
2535 $resCat =
query($sqlCat);
2537 $sqlCount =
"SELECT COUNT(*) AS this_count
2538 FROM peel_produits_categories pc
2539 INNER JOIN peel_produits p ON p.id = pc.produit_id AND " .
get_filter_site_cond(
'produits',
'p') .
"
2540 WHERE pc.categorie_id='" . intval($cat[
'id']) .
"'";
2541 $resCount =
query($sqlCount);
2543 $urlcat = get_product_category_url($cat[
'id'], $cat[
'nom_' . $_SESSION[
'session_langue']]);
2544 $tmp[
'items'][
String::strtoupper($cat[
'nom_' . $_SESSION[
'session_langue']]).md5($urlcat)] = array(
'href' => $urlcat,
2545 'name' => $cat[
'nom_' . $_SESSION[
'session_langue']],
2546 'count' => $Count[
'this_count']
2551 $sqlCat =
"SELECT r.id, r.nom_" . $_SESSION[
'session_langue'] .
", r.image
2552 FROM peel_rubriques r
2554 $resCat =
query($sqlCat);
2557 $tmp[
'items'][
String::strtoupper($cat[
'nom_' . $_SESSION[
'session_langue']]).md5(get_content_category_url(
$id, $cat[
'nom_' . $_SESSION[
'session_langue']]))] = array(
'href' => get_content_category_url(
$id, $cat[
'nom_' . $_SESSION[
'session_langue']]),
2558 'name' => $cat[
'nom_' . $_SESSION[
'session_langue']],
2562 $map[$value] = $tmp;
2564 $general_items[] = array(
'href' => get_url(
'cgv'),
'name' => $GLOBALS[
'STR_CGV']);
2565 $general_items[] = array(
'href' => get_url(
'legal'),
'name' => $GLOBALS[
'STR_LEGAL_INFORMATION']);
2566 $general_items[] = array(
'href' => get_url(
'sitemap'),
'name' => $GLOBALS[
'STR_SITEMAP']);
2567 foreach($general_items as $this_item) {
2569 $map[$alpha][
'value'] = $alpha;
2570 $map[$alpha][
'items'][
String::strtoupper($this_item[
'name']).md5($this_item[
'href'])] = $this_item;
2572 foreach($map as $this_key => $this_map) {
2573 ksort($map[$this_key][
'items']);
2575 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'alpha.tpl');
2576 $tpl->assign(
'title', $GLOBALS[
'STR_SITEMAP']);
2577 $tpl->assign(
'map', $map);
2582 if (!function_exists(
'print_delete_installation_folder')) {
2588 function print_delete_installation_folder()
2591 $title = $GLOBALS[
'STR_INSTALLATION'];
2593 if (!is_writable($GLOBALS[
'dirroot'] .
"/lib/templateEngines/smarty/compile")) {
2594 echo sprintf($GLOBALS[
'STR_ADMIN_INSTALL_DIRECTORY_NOK'],
"/lib/templateEngines/smarty/compile");
2597 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'delete_installation_folder.tpl');
2598 $tpl->assign(
'installation_links', affiche_flags(
true, get_url(
'/installation/index.php'),
true, $GLOBALS[
'admin_lang_codes'],
true, null));
2599 $tpl->assign(
'STR_INSTALLATION_PROCEDURE', $GLOBALS[
'STR_INSTALLATION_PROCEDURE']);
2600 $tpl->assign(
'STR_INSTALLATION_DELETE_EXPLAIN', $GLOBALS[
'STR_INSTALLATION_DELETE_EXPLAIN']);
2601 $tpl->assign(
'STR_INSTALLATION_DELETE_EXPLAIN_ALTERNATIVE', $GLOBALS[
'STR_INSTALLATION_DELETE_EXPLAIN_ALTERNATIVE']);
2602 $tpl->assign(
'STR_INSTALLATION_DELETED_LINK', $GLOBALS[
'STR_INSTALLATION_DELETED_LINK']);
2604 $body =
$tpl->fetch();
2606 $additional_header =
'
2608 h1 { font-size: 24px; color: #337733; }
2609 h2 { font-size: 20px; }
2610 .launch_installation, .center { text-align:center; margin-top: 10px; }
2611 .flag_not_selected { width: 167px; height:167px; }
2612 .full_flag { display: inline-block; font-size: 18px; font-weight: bold; color: #000000; padding:15px; }
2613 .full_flag a { text-decoration: none; color: #000000 !important;}
2614 .full_flag a:hover { text-decoration: underline;}
2615 .footer { padding-top:10px; margin-top: 10px;}
2618 output_light_html_page($body, $title, $additional_header);
2622 if (!function_exists(
'print_access_plan')) {
2630 function print_access_plan()
2633 $sql =
"SELECT map_tag AS map_tag, text_" . $_SESSION[
'session_langue'] .
" AS texte
2634 FROM peel_access_map
2638 if (!empty($access_plan_infos[
'texte'])) {
2645 $longtext = $GLOBALS[
'STR_EMPTY_TEXT_ACCESS_PLAN'];
2647 $title = $GLOBALS[
'STR_ACCESS_PLAN'];
2648 $output .= get_formatted_longtext_with_title($longtext, $title,
'access_plan') . $tag;
2654 if (!function_exists(
'get_modules_paiement_secu')) {
2661 function get_modules_paiement_secu()
2663 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'modules_paiement_secu.tpl');
2664 $tpl->assign(
'name', $GLOBALS[
'STR_PAIEMENT_SECURISE']);
2665 return $tpl->fetch();
2669 if (!function_exists(
'get_contact_sideblock')) {
2676 function get_contact_sideblock($return_mode =
true)
2678 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'contact_sideblock.tpl');
2679 $tpl->assign(
'lang', $_SESSION[
'session_langue']);
2681 $tpl->assign(
'href', get_contact_url(
false,
false));
2683 $tpl->assign(
'href', get_url(
'/utilisateurs/contact.php'));
2686 return $tpl->fetch();
2693 if (!function_exists(
'extra_catalogue_condition')) {
2697 function extra_catalogue_condition()
2703 if (!function_exists(
'is_flash_active_on_site')) {
2708 function is_flash_active_on_site()
2714 if (!function_exists(
'get_newsletter_form')) {
2720 function get_newsletter_form()
2722 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'newsletter_form.tpl');
2724 $tpl->assign(
'label', $GLOBALS[
'STR_NEWSLETTER'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
2725 $tpl->assign(
'default', $GLOBALS[
'STR_WRITE_EMAIL_HERE']);
2726 return $tpl->fetch();
2730 if (!function_exists(
'newsletter_desinscription_form')) {
2740 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'newsletter_desinscription_form.tpl');
2741 $tpl->assign(
'header', $GLOBALS[
'STR_DESINSCRIPTION_NEWSLETTER']);
2743 $tpl->assign(
'label', $GLOBALS[
'STR_EMAIL'] .
'' . $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
2746 $tpl->assign(
'submit', $GLOBALS[
'STR_DESINSCRIPTION']);
2747 return $tpl->fetch();
2751 if (!function_exists(
'newsletter_validation')) {
2763 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'newsletter_validation.tpl');
2764 $tpl->assign(
'header', $GLOBALS[
'STR_NEWSLETTER_TITLE']);
2767 $q_count_users =
query(
"SELECT COUNT(id_utilisateur) AS nb_users
2768 FROM peel_utilisateurs
2771 if ($r_count_users[
'nb_users'] > 0) {
2772 query(
"UPDATE peel_utilisateurs
2773 SET newsletter = '1'
2776 $frm[
'newsletter'] = 1;
2777 $frm[
'priv'] =
'newsletter';
2780 $custom_template_tags[
'EMAIL'] =
$frm[
'email'];
2782 send_email(
$frm[
'email'],
'',
'',
'inscription_newsletter', $custom_template_tags, null, $GLOBALS[
'support']);
2783 $message .= $GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => $GLOBALS[
'STR_REQUEST_OK'] .
' ' . $GLOBALS[
'STR_SEE_YOU_SOON'] .
' ' . $GLOBALS[
'wwwroot']))->fetch();
2786 $message .= $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' =>
$error))->fetch();
2789 $tpl->assign(
'message', $message);
2790 return $tpl->fetch();
2794 if (!function_exists(
'affiche_contenu_html')) {
2803 function affiche_contenu_html($place, $return_mode =
false, $custom_template_tags = null)
2806 if (!isset($_SESSION[
'session_site_country']) && !empty($_SERVER[
'REMOTE_ADDR']) &&
check_if_module_active(
'geoip')) {
2807 include($GLOBALS[
'dirroot'] .
'/modules/geoip/class/geoIP.php');
2808 $geoIP =
new geoIP();
2809 $_SESSION[
'session_site_country'] = $geoIP->geoIPCountryIDByAddr($_SERVER[
'REMOTE_ADDR']);
2810 $geoIP->geoIPClose();
2813 $sql_cond_array[] =
'etat="1"';
2815 $sql_cond_array[] =
'(lang="' . $_SESSION[
'session_langue'] .
'" OR lang="")';
2816 if (!empty($_SESSION[
'session_site_country'])) {
2821 $GLOBALS[
'affiche_contenu_html_last_found'] =
false;
2824 WHERE ' . implode(
' AND ', $sql_cond_array) .
'
2825 ORDER BY LENGTH(emplacement) DESC, a_timestamp DESC';
2834 $last_emplacement = $obj->emplacement;
2835 $GLOBALS[
'affiche_contenu_html_last_found'] =
true;
2846 if (!function_exists(
'addthis_buttons')) {
2853 function addthis_buttons($share_item_array = null, $text = null)
2855 static $jquery_called;
2856 if (empty($share_item_array)) {
2857 if (!empty($GLOBALS[
'site_parameters'][
'addthis_share_item_array'])) {
2859 $share_item_array = $GLOBALS[
'site_parameters'][
'addthis_share_item_array'];
2862 $share_item_array = array(
'twitter',
'google_plusone_share',
'facebook',
'pinterest_share',
'more');
2866 <table class="addthis_32x32_style">
2868 if (!empty($text)) {
2871 <span class="text_product" style="display:block;height:100%;float:left;vertical-align:middle;">' . $text .
'</span>
2874 foreach($share_item_array as $this_item) {
2877 <a class="addthis_button_' . $this_item .
'"></a>
2883 if(empty($jquery_called)) {
2888 $GLOBALS[
'js_files_nominify'][] = get_url(
'/lib/js/add_widget300_this.js');
2889 $jquery_called =
true;
2895 if (!function_exists(
'get_user_picture')) {
2903 function get_user_picture(
$priv, $nb = 4, $rand =
true) {
2904 $output_array = array();
2906 if (empty(
$priv) || intval($nb) == 0) {
2912 $sql_cond .=
' AND priv="'.nohtml_real_escape_string(
$priv).
'"';
2915 FROM peel_utilisateurs
2922 LIMIT 0,' . intval($nb);
2925 $output_array[] = $result[
'logo'];
2927 return $output_array;
2931 if (!function_exists(
'get_diaporama')) {
2943 if (
$mode ==
'content_category') {
2944 $id_field =
'id_rubrique';
2953 FROM `peel_diaporama`
2957 $tmpdiapo[
'j'] = $j;
2958 $tmpdiapo[
'image'] = $GLOBALS[
'repertoire_upload'] .
'/' . $img_diapo[
"image"];
2959 $tmpdiapo[
'thumbs'] = $GLOBALS[
'repertoire_upload'] .
'/thumbs/' .
thumbs($img_diapo[
"image"], 175, 275,
"fit");
2960 $tmpdiapo[
'is_row'] = ($j % $nb_colonnes == 0);
2963 if ($j % $nb_colonnes == 0 || $j == $total_img) {
2964 $tmpdiapo[
'empty_cells'] = 0;
2965 if($j > $nb_colonnes) {
2967 while ($j % $nb_colonnes != 0) {
2968 $tmpdiapo[
'empty_cells']++;
2976 $diapo[] = $tmpdiapo;
2979 $GLOBALS[
'load_nyromodal']=
true;
2980 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'diaporama.tpl');
2981 $tpl->assign(
'diaporama', $diapo);
2982 return $tpl->fetch();
2989 if (!function_exists(
'get_search_form')) {
2998 function get_search_form(
$frm = null,
$search=null,
$match = null,
$real_search =
false, $display =
'full', $quick_add_product_from_search_page = null) {
2999 $tpl_f = $GLOBALS[
'tplEngine']->createTemplate(
'search_form.tpl');
3000 $tpl_f->assign(
'STR_SEARCH_PRODUCT', $GLOBALS[
'STR_SEARCH_PRODUCT']);
3001 $tpl_f->assign(
'action', get_url(
'search'));
3002 $tpl_f->assign(
'value',
$search);
3003 $tpl_f->assign(
'match', ($display ==
'full' ?
$match :
''));
3004 $tpl_f->assign(
'display', $display);
3006 $tpl_f->assign(
'prix_min',
vb(
$frm[
'prix_min']));
3007 $tpl_f->assign(
'prix_max',
vb(
$frm[
'prix_max']));
3008 $tpl_f->assign(
'date_flash',
vb(
$frm[
'date_flash']));
3009 $tpl_f->assign(
'STR_DATE', $GLOBALS[
'STR_DATE']);
3010 $tpl_f->assign(
'STR_CHOOSE', $GLOBALS[
'STR_CHOOSE']);
3011 $tpl_f->assign(
'STR_SEARCH', $GLOBALS[
'STR_SEARCH']);
3012 $tpl_f->assign(
'STR_ENTER_KEY', $GLOBALS[
'STR_ENTER_KEY']);
3013 $tpl_f->assign(
'STR_SEARCH_ALL_WORDS', $GLOBALS[
'STR_SEARCH_ALL_WORDS']);
3014 $tpl_f->assign(
'STR_SEARCH_ANY_WORDS', $GLOBALS[
'STR_SEARCH_ANY_WORDS']);
3015 $tpl_f->assign(
'STR_SEARCH_EXACT_SENTENCE', $GLOBALS[
'STR_SEARCH_EXACT_SENTENCE']);
3016 $tpl_f->assign(
'STR_SEARCH', $GLOBALS[
'STR_SEARCH']);
3017 $tpl_f->assign(
'STR_TOWN', $GLOBALS[
'STR_TOWN']);
3018 $tpl_f->assign(
'STR_ZIP', $GLOBALS[
'STR_ZIP']);
3019 $tpl_f->assign(
'STR_BEFORE_TWO_POINTS', $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
3020 $tpl_f->assign(
'STR_COUNTRY', $GLOBALS[
'STR_COUNTRY']);
3023 $additional_search_form_parts_array =
call_module_hook(
'search_form_part', array(
'frm' =>
$frm),
'array');
3024 $tpl_f->assign(
'additional_search_form_parts_array', $additional_search_form_parts_array);
3026 if (!empty($_GET[
'load_saved_products_list'])) {
3029 WHERE saved_products_list_id='".intval($_GET[
'load_saved_products_list']).
"'";
3032 unset($_SESSION[
'session_search_product_list']);
3034 $products_list[$result[
'produit_id']] = $result[
'quantite'];
3036 $products_list_name = $result[
'products_list_name'];
3039 }
elseif (!empty($_SESSION[
'session_search_product_list'])) {
3040 $products_list = $_SESSION[
'session_search_product_list'];
3042 $tpl_f->assign(
'products_list_name',
vb($products_list_name));
3043 if (!empty($products_list)) {
3045 foreach ($products_list as
$product_id=>$quantity) {
3048 if ($display_picture) {
3049 $product_picture = $GLOBALS[
'repertoire_upload'] .
'/thumbs/' .
thumbs($display_picture, 75, 75,
'fit');
3051 $product_picture = $GLOBALS[
'repertoire_upload'] .
'/thumbs/' .
thumbs($GLOBALS[
'site_parameters'][
'default_picture'], 75, 75,
'fit');
3053 $produits_options[] = array(
3058 'quantite' => $quantity,
3060 'photo_src' =>
vb($product_picture),
3075 if (!empty($quick_add_product_from_search_page)) {
3076 $sqlPays =
'SELECT p.id, p.pays_' . $_SESSION[
'session_langue'] .
' as pays, p.zone, z.tva, z.on_franco
3083 $user_vat = $result[
'tva'];
3089 $tpl_f->assign(
'id_utilisateur',
vn($_SESSION[
'session_utilisateur'][
'id_utilisateur']));
3090 $tpl_f->assign(
'devise', $_SESSION[
'session_devise'][
'code']);
3091 $tpl_f->assign(
'currency_rate', $_SESSION[
'session_devise'][
'conversion']);
3092 $tpl_f->assign(
'rpc_path', get_url(
'/modules/search/produit.php'));
3093 $tpl_f->assign(
'produits_options',
vb($produits_options));
3094 $tpl_f->assign(
'STR_SCAN_CODE_AND_ADD_LIST', $GLOBALS[
'STR_SCAN_CODE_AND_ADD_LIST']);
3095 $tpl_f->assign(
'quick_add_product_from_search_page',
vb($quick_add_product_from_search_page));
3096 $tpl_f->assign(
'STR_WHAT_DO_YOU_DO_WITH_THAT_LIST', $GLOBALS[
'STR_WHAT_DO_YOU_DO_WITH_THAT_LIST']);
3097 $tpl_f->assign(
'STR_MODULE_FACTURES_ADVANCED_EXPORT_LIST_PDF', $GLOBALS[
'STR_MODULE_FACTURES_ADVANCED_EXPORT_LIST_PDF']);
3098 $tpl_f->assign(
'display_barcode', !empty($GLOBALS[
'site_parameters'][
'display_ean_code_on_product_list']));
3099 $tpl_f->assign(
'search_product_list_save_cart',
vb($GLOBALS[
'site_parameters'][
'search_product_list_save_cart']));
3104 $tpl_f->assign(
'funding_display_search_funding_field', funding_display_search_funding_field($_GET));
3105 $tpl_f->assign(
'STR_MODULE_FUNDING_TITLE', $GLOBALS[
'STR_MODULE_FUNDING_TITLE']);
3108 $tpl_f->assign(
'display_save_search_button', display_save_search_button(
$frm));
3113 $search_attribute_tab = array(
'marque' => array(
'table' =>
'marques',
'join' =>
'produits',
'join_id' =>
'id_marque',
'label' => $GLOBALS[
'STR_BRAND_LB']),
3114 'couleur' => array(
'table' =>
'couleurs',
'join' =>
'produits_couleurs',
'join_id' =>
'couleur_id',
'label' => $GLOBALS[
'STR_COLOR_LB']),
3115 'taille' => array(
'table' =>
'tailles',
'join' =>
'produits_tailles',
'join_id' =>
'taille_id',
'label' => $GLOBALS[
'STR_TALL_LB'])
3119 if(empty($GLOBALS[
'select_categorie'])) {
3121 $GLOBALS[
'parent_categorie'] =
vn(
$frm[
"categorie"]);
3122 $GLOBALS[
'select_categorie'] = get_categories_output(null,
'categories',
vn($_GET[
"categorie"]),
vb($GLOBALS[
'site_parameters'][
'search_form_category_display_mode'],
'option'),
' ', null);
3124 $tpl_f->assign(
'select_categorie', $GLOBALS[
'select_categorie']);
3125 $tpl_f->assign(
'STR_CAT_LB', $GLOBALS[
'STR_CAT_LB']);
3127 $tpl_f_select_attributes = array();
3132 $tpl_f->assign(
'select_attributes', $tpl_f_select_attributes);
3134 if (!empty($GLOBALS[
'site_parameters'][
'custom_attribut_displayed_in_search_form']) && $display ==
'module_products') {
3135 $technical_code = $GLOBALS[
'site_parameters'][
'custom_attribut_displayed_in_search_form'];
3140 $tpl_f_cat_ann_opts = array();
3141 $ad_categories = get_ad_categories();
3142 foreach ($ad_categories as $this_category_id => $this_category_name) {
3143 $tpl_f_cat_ann_opts[] = array(
'value' => $this_category_id,
3144 'issel' => (!empty($_GET[
'cat_select']) && ($_GET[
'cat_select'] == $this_category_id || (is_array($_GET[
'cat_select']) && in_array($this_category_id, $_GET[
'cat_select'])))),
3145 'name' => $this_category_name
3149 $tpl_f->assign(
'search_form_category_display_mode',
vb($GLOBALS[
'site_parameters'][
'search_form_category_display_mode'],
'option'));
3150 $tpl_f->assign(
'cat_ann_opts', $tpl_f_cat_ann_opts);
3151 $tpl_f->assign(
'display_city_zip', empty($GLOBALS[
'site_parameters'][
'disable_city_zip_input_on_search_form']));
3153 if (!empty(
$frm[
'cat_statut_detail'])) {
3154 $type_detail =
$frm[
'cat_statut_detail'];
3156 $type_detail =
$frm[
'cat_detail'];
3158 if (!empty(
$frm[
'cat_statut_detail'])) {
3159 $type_statut =
$frm[
'cat_statut_detail'];
3161 $type_statut =
$frm[
'cat_statut'];
3163 $tpl_f->assign(
'cat_detail',
vb($type_detail));
3164 $tpl_f->assign(
'cat_statut',
vb($type_statut));
3165 if (count($GLOBALS[
'lang_names'])>1) {
3166 $tpl_f->assign(
'ad_lang_select', get_lang_ads_choose(
false));
3168 $tpl_f->assign(
'city_zip',
vb(
$frm[
'city_zip']));
3169 if(!empty($GLOBALS[
'site_parameters'][
'ads_filter_countries_in_search'])) {
3170 $sql =
"SELECT u.pays AS pays
3171 FROM peel_utilisateurs u
3172 INNER JOIN peel_lot_vente a ON a.id_personne=u.id_utilisateur AND " .
get_filter_site_cond(
'lot_vente',
'a') .
"
3173 WHERE a.enligne='OK'
3177 $country_allowed_ids[$result[
'pays']] = $result[
'pays'];
3179 $sql =
"SELECT u.pays
3180 FROM peel_adresses u
3181 INNER JOIN peel_funding f ON f.address_id=u.id
3182 INNER JOIN peel_lot_vente a ON a.ref=f.project_id AND " .
get_filter_site_cond(
'lot_vente',
'a') .
"
3183 WHERE a.enligne='OK'
3187 $country_allowed_ids[$result[
'pays']] = $result[
'pays'];
3192 if (empty($GLOBALS[
'site_parameters'][
'disable_continent_input_on_search_form'])) {
3193 $tpl_continent_inps = array();
3195 if(!empty($GLOBALS[
'site_parameters'][
'ads_filter_countries_in_search'])) {
3196 if(!empty($country_allowed_ids)) {
3197 $sql =
"SELECT c.id, c.name_" . $_SESSION[
'session_langue'] .
" AS name
3198 FROM peel_continents c
3202 ORDER BY c.name_".$_SESSION[
'session_langue'] .
"";
3205 $sql =
"SELECT id, name_" . $_SESSION[
'session_langue'] .
" AS name
3206 FROM peel_continents
3208 ORDER BY name_".$_SESSION[
'session_langue'];
3212 while ($continent =
fetch_assoc($query_continent)) {
3213 $tpl_continent_inps[] = array(
'value' => $continent[
'id'],
3214 'issel' => !empty(
$frm[
'continent']) && is_array(
$frm[
'continent']) && in_array($continent[
'id'],
$frm[
'continent']),
3215 'name' => $continent[
'name']
3219 $tpl_f->assign(
'continent_inputs', $tpl_continent_inps);
3221 if (
check_if_module_active(
'maps') && empty($GLOBALS[
'site_parameters'][
'disable_near_position_input_on_search_form'])) {
3222 if(empty($_SESSION[
'session_latitude'])){
3223 $get_position_text =
'<a href="javascript:load_position()">'.$GLOBALS[
'STR_GET_MY_POSITION'].
'</a>';
3224 $get_position_script = getPositionFromUser(
'document.getElementById("load_position").innerHTML="<span style=\"color:green\">Position OK</span>"; document.getElementById("latitude").value=latitude; document.getElementById("longitude").value=longitude;');
3227 $get_position_text =
'<span style="color:green">Position OK</span>';
3228 $get_position_script =
'';
3230 $tpl_f->assign(
'near_position', sprintf($GLOBALS[
'STR_NEAR_POSITION_INPUT'],
'<input type="text" id="near_position" name="near_position" class="form-control" size="6" value="' .
String::str_form_value(
vb(
$frm[
'near_position'])) .
'" style="width:80px" />').
' <input type="hidden" id="latitude" name="latitude" value="'.
vb($_SESSION[
'session_latitude']).
'" /><input type="hidden" id="longitude" name="longitude" value="'.
vb($_SESSION[
'session_longitude']).
'" /> - <span id="load_position">'.$get_position_text.
'</span>'. $get_position_script);
3232 if (empty($GLOBALS[
'site_parameters'][
'ads_search_end_date_past'])) {
3233 $tpl_f->assign(
'date_end_past', !empty(
$frm[
'date_end_past']));
3234 $tpl_f->assign(
'STR_MODULE_ANNONCES_DATE_END_PAST', $GLOBALS[
'STR_MODULE_ANNONCES_DATE_END_PAST']);
3236 $tpl_f->assign(
'user_verified_status_disable', !empty($GLOBALS[
'site_parameters'][
'user_verified_status_disable']));
3237 $tpl_f->assign(
'ads_contain_lot_sizes', $GLOBALS[
'site_parameters'][
'ads_contain_lot_sizes']);
3238 $tpl_f->assign(
'STR_TYPE', $GLOBALS[
'STR_TYPE']);
3239 $tpl_f->assign(
'STR_MODULE_ANNONCES_AD_CATEGORY', $GLOBALS[
'STR_MODULE_ANNONCES_AD_CATEGORY']);
3240 $tpl_f->assign(
'STR_MODULE_ANNONCES_OFFER_GROS', $GLOBALS[
'STR_MODULE_ANNONCES_OFFER_GROS']);
3241 $tpl_f->assign(
'STR_MODULE_ANNONCES_OFFER_DEMIGROS', $GLOBALS[
'STR_MODULE_ANNONCES_OFFER_DEMIGROS']);
3242 $tpl_f->assign(
'STR_MODULE_ANNONCES_OFFER_DETAIL', $GLOBALS[
'STR_MODULE_ANNONCES_OFFER_DETAIL']);
3243 $tpl_f->assign(
'STR_STATUS', $GLOBALS[
'STR_STATUS']);
3244 $tpl_f->assign(
'STR_MODULE_ANNONCES_ALT_VERIFIED_ADS', $GLOBALS[
'STR_MODULE_ANNONCES_ALT_VERIFIED_ADS']);
3245 $tpl_f->assign(
'STR_MODULE_ANNONCES_NOT_VERIFIED_ADS', $GLOBALS[
'STR_MODULE_ANNONCES_NOT_VERIFIED_ADS']);
3246 $tpl_f->assign(
'STR_MODULE_ANNONCES_SEARCH_CATEGORY_AD', $GLOBALS[
'STR_MODULE_ANNONCES_SEARCH_CATEGORY_AD']);
3249 return $tpl_f->fetch();
3253 if (!function_exists(
'get_address_list')) {
3260 function get_address_list($user_id) {
3262 if(empty($user_id)) {
3265 $q =
query(
'SELECT email, nom_famille, prenom, adresse, code_postal, ville, telephone, portable, pays, address_bill_default, address_ship_default
3266 FROM peel_utilisateurs
3267 WHERE id_utilisateur="' . intval($user_id) .
'"');
3269 $address_select_array[] =
'<p>' . $GLOBALS[
'STR_INVOICE_ADDRESS'] .
' ' . $GLOBALS[
'STR_DEFAULT'] .
'' . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
': ' .
get_personal_address_form(
vn($_SESSION[
'session_utilisateur'][
'id_utilisateur']),
'bill',
vb($_SESSION[
'session_utilisateur'][
'address_bill_default']),
false,
'max-width:300px;') .
'</p>
3271 if (!empty($GLOBALS[
'site_parameters'][
'mode_transport'])) {
3272 $address_select_array[] =
'<p>' . $GLOBALS[
'STR_SHIP_ADDRESS'] .
' ' . $GLOBALS[
'STR_DEFAULT'] .
'' . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
': ' .
get_personal_address_form(
vn($_SESSION[
'session_utilisateur'][
'id_utilisateur']),
'ship',
vb($_SESSION[
'session_utilisateur'][
'address_ship_default']),
false,
'max-width:300px;') .
'</p>
3276 <h1>'.$GLOBALS[
'STR_ADDRESS_TEXT'].
'</h1>
3277 <p>'.$GLOBALS[
'STR_INFO_ADDRESS'].
'</p>
3279 ' . implode(
'', $address_select_array).
'
3283 if(
num_rows(
$q) <
vb($GLOBALS[
'site_parameters'][
'addresses_per_user_max'], 1000)) {
3286 <p><a class="btn btn-primary" href="'.$GLOBALS[
'wwwroot'].
'/utilisateurs/adresse.php?mode=create_new_adress" title="'.$GLOBALS[
'STR_REGISTER_ORDER_ADDRESS'].
'">'.$GLOBALS[
'STR_REGISTER_ORDER_ADDRESS'].
'</a></p>';
3290 <div class="col-sm-6 col-md-4">
3292 <h2>'.$GLOBALS[
'STR_DEFAULT_ADDRESS'].
'</h2>
3293 <div>'.$result[
'prenom'].
' '.strtoupper($result[
'nom_famille']).
'</div>
3294 <div>'.$result[
'adresse'].
'</div>
3295 <div>'.$result[
'code_postal'].
' '.$result[
'ville'].
'</div>
3297 <div>'.$result[
'telephone'].
'</div>
3298 <div>'.$result[
'email'].
'</div>
3299 <div style="margin-top:10px;"><a class="btn btn-default" href="'.$GLOBALS[
'wwwroot'].
'/utilisateurs/change_params.php" title="'.$GLOBALS[
'STR_MODIFY'].
'">'.$GLOBALS[
'STR_MODIFY'].
'</a></div>
3305 WHERE id_utilisateur = "' . intval($user_id) .
'"');
3308 <div class="col-sm-6 col-md-4">
3310 <h2>'.$result[
'nom'] . ($result[
'address_type']==
'bill'?
' ('.$GLOBALS[
'STR_INVOICE_ADDRESS'].
')':($result[
'address_type']==
'ship'?
' ('.$GLOBALS[
'STR_SHIP_ADDRESS'].
')':
'')).
'</h2>
3311 <div>'.$result[
'prenom'].
' '.$result[
'nom_famille'].
'</div>
3312 <div>'.$result[
'adresse'].
'</div>
3313 <div>'.$result[
'code_postal'].
' '.$result[
'ville'].
'</div>
3315 <div>'.$result[
'portable'].
'</div>
3316 <div>'.$result[
'email'].
'</div>
3317 <div style="margin-top:10px;">
3318 <a class="btn btn-warning" data-confirm="'.$GLOBALS[
'STR_DELETE_CONFIRM'].
'" style="width:auto;" href="'.$GLOBALS[
'wwwroot'].
'/utilisateurs/adresse.php?mode=suppr_address&id='.$result[
'id'].
'" title="'.$GLOBALS[
'STR_DELETE'].
'">'.$GLOBALS[
'STR_DELETE'].
'</a>
3319 <a class="btn btn-default" href="'.$GLOBALS[
'wwwroot'].
'/utilisateurs/adresse.php?mode=modif_address&id='.$result[
'id'].
'" title="'.$GLOBALS[
'STR_MODIFY'].
'">'.$GLOBALS[
'STR_MODIFY'].
'</a>
foreach(array('date1', 'date2', 'type', 'renewals', 'width') as $item) $data
static strtoupper($string)
Returns string with all alphabetic characters converted to uppercase.
if(isset($_GET['catid'])&&empty($_GET['catid'])) if(empty($_GET['catid'])&&!empty($GLOBALS['site_parameters']['disallow_main_category'])&&empty($_GET['convert_gift_points'])) $catid
static strip_tags($string, $allowed_tags=null)
String::strip_tags()
if(!empty($GLOBALS['site_parameters']['order_specific_field_titles'])) if(check_if_module_active('socolissimo')&&!empty($_REQUEST)&&!empty($_REQUEST['PUDOFOID'])&&!empty($_REQUEST['CEEMAIL'])&&!empty($_REQUEST['SIGNATURE'])&&!empty($_REQUEST['ORDERID'])) elseif(!empty($_POST)) elseif(check_if_module_active('socolissimo')&&!empty($_SESSION['session_commande']['is_socolissimo_order'])) foreach(array('bill'=> 1, 'ship'=> 2) as $address_type=> $session_commande_address_id) $frm['societe1']
static htmlentities($string, $flags=ENT_COMPAT, $charset=GENERAL_ENCODING, $suppr_endline=false, $encode_only_isolated_amperstands=false, $decode_html_entities_first=false)
Convert all applicable characters to HTML entities Cette fonction sert si on veut afficher du contenu...
get_discount_text($remise_valeur, $remise_percent, $is_remise_valeur_including_taxe)
Retourne la remise d'un code promotionnel (en % dans le cas d'une remise en pourcentage ou dans le fo...
static convert_encoding($string, $new_encoding, $original_encoding=null)
Converts the character encoding of string $string to $new_encoding from optionally $original_encoding...
get_user_information($user_id=null, $get_full_infos=false)
Chargement des détails de l'utilisateur.
get_personal_address_form($id_utilisateur, $address_type= 'bill', $selected=null, $add_manage_choice=true, $css_style=null)
Retourne le menu déroulant avec la lsite des adresses disponibles par utilisateur.
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()
is_user_tva_intracom_for_no_vat($user_id=null)
is_user_tva_intracom_for_no_vat()
display_select_attribute($categorie, $attribute)
if($rub=fetch_assoc($rub_query)) if(check_if_module_active('url_rewriting')) $class
insere_utilisateur(&$frm, $password_already_encoded=false, $send_user_confirmation=false, $warn_admin_if_template_active=true, $skip_existing_account_tests=false)
Ajout d'un utilisateur.
static html_entity_decode_if_needed($string)
String::html_entity_decode_if_needed()
if(!select_db($_SESSION['session_install_choixbase'], $GLOBALS['database_object'], true)) $error
word_real_escape_string($value)
Applique real_escape_string dans le cas où on n'insère qu'un seul mot, de moins de 30 caractères...
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 ...
if(!empty($_GET['country'])) $search_attribute_tab
if(!empty($_GET['id'])) if(isset($_POST['form_name'], $_POST['form_subject'], $_POST['form_text'], $_POST['form_lang'])&&empty($_GET['id'])) if(empty($_GET['id'])) $tpl
if(empty($_GET['id'])) if(!empty($GLOBALS['site_parameters']['allow_multiple_product_url_with_category'])) $product_object
if(!defined('IN_PEEL')) thumbs($source_filename, $width, $height, $method= 'fit', $source_folder=null, $thumb_folder=null, $thumb_rename=true, $return_absolute_path=false)
Charge l'image dont le nom est $source_filename dans le répertoire d'upload, et crée une vignette pou...
real_escape_string($value)
real_escape_string()
if(isset($_POST['pays_zone'])) elseif(empty($_SESSION['session_caddie']->zoneId)&&!empty($GLOBALS['site_parameters']['default_delivery_zone_id'])) if(isset($_POST['type'])) elseif(empty($_SESSION['session_caddie']->typeId)&&!empty($GLOBALS['site_parameters']['default_delivery_type_id'])) if(!empty($_POST['code_promo'])) if(!empty($_GET['code_promo'])&&$_GET['code_promo']== 'delete') $form_error_object
get_javascript_output($async=false, $minify=false, $output_only_script_loading=false, $js_filenames_array=array('js_files', 'js_files_pageonly', 'js_files_nominify', 'js_files_noasync', 'js_files_nominify_noasync'))
Chargement du chargement des scripts.
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.
if(!defined('IN_PEEL')) display_prices_with_taxes_active()
display_prices_with_taxes_active()
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(!defined('IN_PEEL')) est_identifie()
Retourne true si l'utilisateur est identifié
static str_form_value($value, $flags=ENT_COMPAT)
Encode une chaine de caractères pour affichage dans un value="".
get_country_select_options($selected_country_name=null, $selected_country_id=null, $option_value= 'name', $display_inactive_country=false, $allowed_zone_id=null, $preselect_shop_country_if_none_selected=true, $selected_country_lang=null, $allowed_ids=null)
get_country_select_options()
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))
num_rows($query_result)
num_rows()
if(!defined('IN_PEEL')) send_email($to, $mail_subject= '', $mail_content= '', $template_technical_code=null, $template_tags=null, $format=null, $sender=null, $html_add_structure=true, $html_correct_conformity=false, $html_convert_url_to_links=true, $reply_to=null, $attached_files_infos_array=null, $lang=null, $additional_infos_array=array(), $attachment_not_sent_by_email=false)
Envoi d'un email à un utilisateur.
display_custom_attribute($selected_attributes=null, $technical_code=null, $show_all=false)
fetch_object($query_result)
fetch_object()
fetch_assoc($query_result)
fetch_assoc()
call_module_hook($hook, $params, $mode= 'boolean')
Appelle la fonction correspondant au $hook pour chaque module installé La fonction doit s'appeler : [...
$GLOBALS['page_columns_count']
const PEEL_VERSION(version_compare(PHP_VERSION, '5.1.2', '<'))
get_form_token_input($name= 'general', $use_existing_token=true, $return_as_input_form=true)
get_form_token_input()
calcul_nbprod_parcat($catid, $all_parents_with_ordered_direct_sons_array)
calcul_nbprod_parcat()
get_css_files_to_load($minify=false)
get_css_files_to_load()
a_priv($requested_priv, $demo_allowed=false, $site_configuration_modification=false, $user_id=null)
Renvoie true si l'utilisateur de la session a le privilège $requested_priv ou un droit supérieur Des ...
affiche_select_marque($return_mode=false)
affiche_select_marque()
static html_entity_decode($string, $quote_style=ENT_COMPAT, $charset=GENERAL_ENCODING)
String::html_entity_decode()
get_current_url_in_other_language($this_lang)
Ce module de gestion des URL dans d'autres langues doit être compatible avec l'URL Rewriting si activ...
fprix($price, $display_currency=false, $currency_code_or_default=null, $convertion_needed_into_currency=true, $currency_rate=null, $display_iso_currency_code=false, $format=true, $force_format_separator=null, $add_rdfa_properties=false, $round_even_if_no_format=false)
fprix formatte le prix donné en le convertissant si nécessaire au préalable et en ajoutant éventuelle...
if(!defined('IN_PEEL')) get_advanced_search_script()
get_advanced_search_script()
static convert_accents($string, $convert_umlaut=false, $strip_umlaut=true)
convert_accents()
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...
clean_str($string)
Filtre une chaine de caractères.
static nl2br_if_needed($string)
Fonction de compatibilité avec de vieilles versions de PEEL ou du contenu qui vient d'ailleurs...
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.
get_datepicker_javascript($load_timepicker=false)
get_datepicker_javascript()
calcul_nbarti_parrub($rub)
calcul_nbrub()
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']
get_country_name($id)
Renvoie le nom d'un pays.