PEEL Shopping
Open source ecommerce : PEEL Shopping
fonctions.php
Go to the documentation of this file.
1 <?php
2 // This file should be in UTF8 without BOM - Accents examples: éèê
3 // +----------------------------------------------------------------------+
4 // | Copyright (c) 2004-2015 Advisto SAS, service PEEL - contact@peel.fr |
5 // +----------------------------------------------------------------------+
6 // | This file is part of PEEL Shopping 8.0.0, which is subject to an |
7 // | opensource GPL license: you are allowed to customize the code |
8 // | for your own needs, but must keep your changes under GPL |
9 // | More information: https://www.peel.fr/lire/licence-gpl-70.html |
10 // +----------------------------------------------------------------------+
11 // | Author: Advisto SAS, RCS 479 205 452, France, https://www.peel.fr/ |
12 // +----------------------------------------------------------------------+
13 // $Id: fonctions.php 46935 2015-09-18 08:49:48Z gboussin $
14 if (!defined('IN_PEEL')) {
15  die();
16 }
17 
25 function affiche_menu_deroulant_1($div_id, $items_html_array)
26 {
27  $output = '';
28  $fcontent = array();
29  if (!empty($items_html_array) && count($items_html_array) == 1) {
30  $output .= current($items_html_array);
31  } elseif (!empty($items_html_array)) {
32  $i = 0;
33  foreach ($items_html_array as $this_item_html) {
34  $fcontent[] = 'scrollercontent[\'' . $div_id . '\'][' . ($i++) . ']=\'' . str_replace(array(' ', ' ', "\t"), ' ', filtre_javascript($this_item_html, true, true, false)) . '\';' . "\r\n";
35  }
36  $output .= '
37 <script><!--//--><![CDATA[//><!--
38  ' . (empty($GLOBALS['scroller_1_already_initialized']) ? '
39  var index = new Array();
40  var scrollercontent=new Array();
41  ' : '') . '
42  index[\'' . $div_id . '\']=0;
43  scrollercontent[\'' . $div_id . '\']=new Array();
44  ' . implode('', $fcontent) . '
45 //--><!]]></script>
46 ';
47  $GLOBALS['js_ready_content_array'][] = '
48  changecontent(\'' . $div_id . '\');
49 ';
50  if (empty($GLOBALS['scroller_1_already_initialized'])) {
51  $GLOBALS['js_files_pageonly'][] = get_url('/modules/menus/scroller.js');
52  $GLOBALS['scroller_1_already_initialized'] = true;
53  }
54  $output .= '
55 <div id="' . $div_id . '"></div>
56 ';
57  }
58  return $output;
59 }
60 
68 function affiche_menu_deroulant_2($div_id, $items_html_array)
69 {
70  $output = '';
71  $pausecontent = array();
72 
73  $items_html_array = (isset($items_html_array)) ? $items_html_array : get_on_rollover_products_html();
74  if (!empty($items_html_array) && count($items_html_array) == 1) {
75  $output .= current($items_html_array);
76  } elseif (!empty($items_html_array)) {
77  $i = 0;
78  foreach ($items_html_array as $this_item_html) {
79  $pausecontent[] = $div_id . '_content[' . ($i++) . ']=\'' . str_replace(array(' ', ' ', "\t"), ' ', filtre_javascript($this_item_html, true, true, false)) . '\';' . "\r\n";
80  }
81  if (empty($GLOBALS['scroller_2_already_initialized'])) {
82  $GLOBALS['js_files_pageonly'][] = get_url('/modules/menus/pausescroller.js');
83  $GLOBALS['scroller_2_already_initialized'] = true;
84  }
85  $GLOBALS['js_content_array'][] = '
86 var ' . $div_id . '_content=new Array();
87 ' . implode('', $pausecontent) . '
88 ';
89  $GLOBALS['js_ready_content_array'][] = '
90 new pausescroller(' . $div_id . '_content, "' . $div_id . '", 3000);
91 ';
92  $output .= '
93 <div id="' . $div_id . '" class="' . $div_id . '_class pausescroller_container"></div>
94 ';
95  }
96  return $output;
97 }
98 
103 function get_on_rollover_products_html()
104 {
105  $items = array();
106  $sql = "SELECT p.*, c.id AS categorie_id, c.nom_" . $_SESSION['session_langue'] . " AS categorie
107  FROM peel_produits p
108  INNER JOIN peel_produits_categories pc ON p.id = pc.produit_id
109  INNER JOIN peel_categories c ON c.id = pc.categorie_id AND " . get_filter_site_cond('categories', 'c') . "
110  WHERE p.on_rollover = '1' AND " . get_filter_site_cond('produits', 'p') . " AND p.nom_" . (!empty($GLOBALS['site_parameters']['product_name_forced_lang'])?$GLOBALS['site_parameters']['product_name_forced_lang']:$_SESSION['session_langue']) . " != '' AND c.nom_" . $_SESSION['session_langue'] . " != '' AND p.etat='1' ".(empty($GLOBALS['site_parameters']['allow_command_product_ongift'])?" AND p.on_gift != '1'":'')."
111  GROUP BY p.id
112  ORDER BY p.date_insere DESC
113  LIMIT 20";
114  $query = query($sql);
115  $i = 0;
116  while ($prod = fetch_assoc($query)) {
117  $product_object = new Product($prod['id'], $prod, true, null, true, !is_user_tva_intracom_for_no_vat() && !check_if_module_active('micro_entreprise'));
118  $product_html = get_product_in_container_html($product_object, $GLOBALS['site_parameters']['only_show_products_with_picture_in_containers']);
119  unset($product_object);
120  if (!empty($product_html)) {
121  $items[] = $product_html;
122  }
123  }
124  return $items;
125 }
130 function get_on_rollover_articles_html()
131 {
132  $items = array();
133  $sql = "SELECT a.on_reseller, a.titre_" . $_SESSION['session_langue'] . " as name, a.image1 as image, a.date_insere, a.etat, a.id, a.on_special, r.id AS rubrique_id, r.nom_" . $_SESSION['session_langue'] . " AS rubrique
134  FROM peel_articles a
135  INNER JOIN peel_articles_rubriques ar ON a.id = ar.article_id
136  INNER JOIN peel_rubriques r ON r.id = ar.rubrique_id AND " . get_filter_site_cond('rubriques', 'r') . "
137  WHERE a.on_rollover = '1' AND a.titre_" . $_SESSION['session_langue'] . " != '' AND r.nom_" . $_SESSION['session_langue'] . " != '' AND a.etat='1' AND " . get_filter_site_cond('articles', 'a') . "
138  GROUP BY a.id
139  ORDER BY a.date_insere DESC
140  LIMIT 20";
141  $query = query($sql);
142  $i = 0;
143  while ($article = fetch_assoc($query)) {
144  if ((!a_priv("admin_product") && !a_priv("reve")) && $article['on_reseller'] == 1) {
145  continue;
146  } else {
147  $article_html = get_articles_in_container_html($article, $GLOBALS['site_parameters']['only_show_articles_with_picture_in_containers']);
148  if (!empty($article_html)) {
149  $items[] = $article_html;
150  }
151  }
152  }
153  return $items;
154 }
155 
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))
Definition: chart-data.php:160
filtre_javascript($string, $addslashes=true, $allow_escape_single_quote=true, $allow_escape_double_quote=true, $skip_endline=true, $inside_html=true)
Formatte une chaine de caractère pour insertion dans du javascript.
Definition: format.php:237
if(!defined('IN_PEEL')) affiche_menu_deroulant_1($div_id, $items_html_array)
affiche_menu_deroulant_1()
Definition: fonctions.php:25

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:31:00 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.