PEEL Shopping
Open source ecommerce : PEEL Shopping
Multipage.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: Multipage.php 46935 2015-09-18 08:49:48Z gboussin $
14 if (!defined('IN_PEEL')) {
15  die();
16 }
17 
46 class Multipage {
50  var $sql_count = null;
54  var $tpl_data;
55  var $tpl_name;
56  var $page;
58  var $nbRecord = null;
60  // $HeaderTitlesArray is a table of Titles. Each key can either be numeric if you do not want any sorting, or it can be the name of the SQL item
68  var $nb1;
69  var $nb2;
70  var $nb3;
71  var $LimitSQL;
72  var $first_link_page = true;
73  var $allow_get_sort = true;
74  var $sort_get_variable = 'sort';
75  var $order_get_variable = 'order';
76  var $order_sql_prefix = null;
78 
82  function Multipage($sqlRequest, $nombre_session_var_name = 'default_results_per_page', $DefaultResultsPerPage = 50, $LinkPerPage = 7, $AddToColspan = 0, $always_show = true, $template_name = null, $round_elements_per_page = 1, $external_results_to_merge_at_beginning = null, $no_pagination_displayed = false)
83  {
84  if (empty($template_name)) {
85  if(defined('IN_PEEL_ADMIN')) {
86  // Apparence de l'administration non altérée par l'intégration graphique en front-office
87  $template_name = 'default_admin';
88  } else {
89  // Si aucun template n'est précisé spécifiquement lors de l'appel de la fonction, la sélection en back office est utilisée
90  $template_name = vb($GLOBALS['site_parameters']['template_multipage']);
91  }
92  }
93  $this->tpl_name = $template_name;
94  $this->no_pagination_displayed = $no_pagination_displayed;
95  $this->sqlRequest = $sqlRequest;
96  $this->DefaultResultsPerPage = $DefaultResultsPerPage;
97  if ($this->DefaultResultsPerPage != '*') {
98  if($this->DefaultResultsPerPage<20) {
99  $divisor = 2;
100  } else {
101  $divisor = 5;
102  }
103  $this->nb1 = max($round_elements_per_page, round($this->DefaultResultsPerPage / $divisor) - round($this->DefaultResultsPerPage / $divisor) % $round_elements_per_page);
104  $this->nb2 = max(2 * $round_elements_per_page, round($this->DefaultResultsPerPage) - round($this->DefaultResultsPerPage) % $round_elements_per_page);
105  $this->nb3 = max(10, 3*$round_elements_per_page, round($this->DefaultResultsPerPage * 5) - round($this->DefaultResultsPerPage * 5) % $round_elements_per_page);
106  }
107  $this->LinkPerPage = $LinkPerPage;
108  $this->AddToColspan = $AddToColspan;
109  $this->always_show = $always_show;
110  $this->external_results_to_merge_at_beginning = $external_results_to_merge_at_beginning;
111  if(!empty($nombre_session_var_name)){
112  $this->nombre_session_var_name = 'session_multipage_' . $nombre_session_var_name;
113  }
114  $this->Initialize();
115  }
116 
122  function Initialize()
123  {
124  $this->setResultsNumberPerPage();
125  // Mode de compatibilité avec ancien Multipage utilisant start= à la place de page=
126  if (!empty($_GET['start'])) {
127  if(!empty($this->ResultPerPage)) {
128  $this->page = round($_GET['start'] / $this->ResultPerPage);
129  } else {
130  $this->page = 1;
131  }
132  if (empty($_POST) && !defined('IN_PEEL_ADMIN') && String::strpos(get_current_url(true), 'start=' . $_GET['start']) !== false) {
133  // L'URL contient bien en GET start=... (sans qu'il ne soit dans une URL réécrite)
134  // On fait une redirection 301 pour éviter que cette URL reste indexée
135  redirect_and_die(get_current_url(true, false, array('start')), true);
136  }
137  } else {
138  $this->CurrentPage(vn($_GET['page']));
139  }
140  // Initialisation des valeurs par défaut :
141  $this->pages_count = 1;
142  }
143 
150  {
151  if ($this->DefaultResultsPerPage != '*') {
152  if (isset($_GET['nombre']) && is_numeric($_GET['nombre']) && $_GET['nombre'] >= $this->nb1 && $_GET['nombre'] <= $this->nb3) {
153  if(!empty($this->nombre_session_var_name)){
154  $_SESSION[$this->nombre_session_var_name] = $_GET['nombre'];
155  }
156  if (empty($_POST) && !defined('IN_PEEL_ADMIN') && String::strpos(get_current_url(true), 'nombre=' . urlencode($_GET['nombre'])) !== false && (empty($_GET['multipage']) || $_GET['multipage'] == $this->nombre_session_var_name)) {
157  // L'URL contient bien en GET nombre=... (sans qu'il ne soit dans une URL réécrite) et qui s'applique au multipage souhaité
158  // On fait une redirection 302 pour éviter que cette URL ne soit indexée
159  redirect_and_die(get_current_url(true, false, array('nombre', 'multipage')));
160  }
161  }
162  $ResultsPerPage = $this->DefaultResultsPerPage;
163  if (!empty($this->nombre_session_var_name) && isset($_SESSION[$this->nombre_session_var_name])) {
164  if (($_SESSION[$this->nombre_session_var_name] <= $this->nb1) || ($_SESSION[$this->nombre_session_var_name] < (($this->nb2 + $this->nb1) / 2))) {
165  $ResultsPerPage = $this->nb1;
166  } elseif (($_SESSION[$this->nombre_session_var_name] < $this->nb3) && ($_SESSION[$this->nombre_session_var_name] < (($this->nb3 + $this->nb2) / 2))) {
167  $ResultsPerPage = $this->nb2;
168  } else {
169  $ResultsPerPage = $this->nb3;
170  }
171  }
172  $this->ResultPerPage = $ResultsPerPage;
173  }
174  }
175 
182  function CurrentPage($page)
183  {
184  if (empty($page)) {
185  $page = 1;
186  }
187  if ($this->DefaultResultsPerPage != '*') {
188  $this->page = max(1, intval($page));
189  } else {
190  $this->page = 1;
191  }
192  }
193 
200  function Query($return_objects = false)
201  {
202  $results_array = array();
203  $lines_begin = max(0, intval($this->ResultPerPage * ($this->page - 1)) - count($this->external_results_to_merge_at_beginning));
204  $lines_count = max(0, intval($this->ResultPerPage) + min(0, intval($this->ResultPerPage * ($this->page - 1)) - count($this->external_results_to_merge_at_beginning)));
205  $this->LimitSQL = $this->sqlRequest;
206  if($lines_count > 0) {
207  $this->LimitSQL .= ' ' . $this->getOrderBy();
208  }
209  if ($this->DefaultResultsPerPage != '*') {
210  // Si le nombre de $this->external_results_to_merge_at_beginning est élevé, potentiellement sur les premières pages on a uniquement des éléments extérieurs à cette requête SQL
211  // Donc on obtient ci-dessous LIMIT 0,0 => c'est nécessaire néanmoins de lancer la requête, car elle sert puisqu'elle contient SQL_CALC_FOUND_ROWS qui va servir ensuite au calcul pour le nombre de pages
212  $this->LimitSQL .= " LIMIT " . intval($lines_begin) . ", " . intval($lines_count);
213  }
215  if(($this->sql_count === null || String::strpos($this->sql_count, 'FOUND_ROWS') !== false) && (String::strpos(String::strtoupper($sql), 'SQL_CALC_FOUND_ROWS') === false && (String::substr($sql, 0, 1) != '(' || String::strpos($sql, 'UNION') === false || String::substr_count($sql, 'SELECT')<2))) {
216  // Si nécessaire, on rajoute SQL_CALC_FOUND_ROWS
217  // On ne le fait pas pour une requête de type UNION - le test sur la parenthèse est une sécurité qui évite des hacks lors de recherche utilisateur
218  $sql = str_replace(array('SELECT ', 'select '), 'SELECT SQL_CALC_FOUND_ROWS ', String::substr($sql, 0, 10)) . String::substr($sql, 10);
219  }
220  $query = query($sql);
221  for($i=max(0, intval($this->ResultPerPage * ($this->page - 1)));isset($this->external_results_to_merge_at_beginning[$i]) && $i<max(0, intval($this->ResultPerPage * $this->page));$i++) {
222  $results_array[] = $this->external_results_to_merge_at_beginning[$i];
223  }
224  if ($return_objects) {
225  while ($ligne = fetch_object($query)) {
226  $results_array[] = $ligne;
227  }
228  } else {
229  while ($ligne = fetch_assoc($query)) {
230  $results_array[] = $ligne;
231  }
232  }
233  $this->Calcul(!empty($query));
234  return $results_array;
235  }
236 
242  function Calcul($query_without_error = true)
243  {
244  if($query_without_error) {
245  // Compte le nombre de liens qu'il y aura (= nombre de page)
246  if($this->sql_count === null) {
247  $this->sql_count = "SELECT FOUND_ROWS() AS rows_count";
248  }
249  if(!empty($this->sql_count)) {
250  $query_count_rs = query($this->sql_count);
251  $query_count_row = fetch_assoc($query_count_rs);
252  $this->nbRecord = $query_count_row['rows_count'];
253  $this->nbRecord += count($this->external_results_to_merge_at_beginning);
254  }
255  } else {
256  $this->nbRecord = count($this->external_results_to_merge_at_beginning);
257  }
258  if (!empty($this->ResultPerPage) && ($this->ResultPerPage < $this->nbRecord)) {
259  $this->pages_count = ceil($this->nbRecord / $this->ResultPerPage);
260  }
261 
262  $GLOBALS['all_multipage_limit'] = max($this->pages_count, vn($GLOBALS['all_multipage_limit']));
263  if (empty($GLOBALS['multipage_avoid_redirect_if_page_over_limit']) && $this->page > $GLOBALS['all_multipage_limit']) {
264  $new_url = $this->getPageURL($this->pages_count);
265  if ($new_url != get_current_url(true)) {
266  redirect_and_die($new_url);
267  }
268  }
269  // Si LinkPerPage vaut '*' on affiche tous les liens
270  if ($this->LinkPerPage == '*') {
271  $this->LinkPerPage = $this->pages_count;
272  }
273  if (($this->always_show && $this->DefaultResultsPerPage != '*') || $this->pages_count > 1) {
274  $this->ParseTemplate();
275  } else {
276  // On n'affiche pas la navigation
277  $this->tpl_data = '';
278  }
279  }
280 
287  function getPageURL($page, $nombre = null)
288  {
289  $link = get_current_generic_url();
290  if (strpos($link, '[PAGE]') !== false) {
291  $link = str_replace('[PAGE]', String::rawurlencode($page), $link);
292  } elseif ($page > 1) {
293  $link .= (strstr($link, '?') ? '&' : '?') . 'page=' . urlencode($page);
294  }
295  if ($nombre !== null) {
296  if (strpos($link, '[NOMBRE]') !== false) {
297  $link = str_replace('[NOMBRE]', String::rawurlencode($nombre), $link);
298  } else {
299  $link .= (strstr($link, '?') ? '&' : '?') . 'nombre=' . urlencode($nombre) . '&multipage=' . $this->nombre_session_var_name;
300  }
301  }
302  return $link;
303  }
304 
310  function ParseTemplate($show_page_if_only_one = false)
311  {
312  if(empty($this->tpl_name) || $this->no_pagination_displayed) {
313  return false;
314  }
315  $tpl = $GLOBALS['tplEngine']->createTemplate('multipage_template_' . $this->tpl_name . '.tpl');
316  $tpl->assign('page', $GLOBALS['STR_PAGE']);
317  $tpl->assign('current_page', $this->page);
318  $tpl->assign('nbrecord', $this->nbRecord);
319  $tpl->assign('total_page', $this->pages_count);
320  $tpl->assign('colspan', $this->pages_count + ($this->AddToColspan));
321  $tpl->assign('show_page_if_only_one', $show_page_if_only_one);
322  $tpl->assign('next_page', ($this->page < $this->pages_count ? '<a href="' . String::str_form_value($this->getPageURL($this->page + 1)) . '"><img src="' . $GLOBALS['wwwroot'] . '/images/next_page.png" alt="' . $GLOBALS['STR_NEXT_PAGE'] . '" /></a>' : ''));
323  $tpl->assign('previous_page', ($this->page > 1 ? '<a href="' . String::str_form_value($this->getPageURL(min($this->page - 1, $this->pages_count))) . '"><img src="' . $GLOBALS['wwwroot'] . '/images/previous_page.png" alt="' . $GLOBALS['STR_PREVIOUS_PAGE'] . '" /></a>' : ''));
324  $tpl->assign('first_page', ($this->page != 1 ? '<a href="' . String::str_form_value($this->getPageURL(1)) . '"><img src="' . $GLOBALS['wwwroot'] . '/images/first_page.png" alt="' . $GLOBALS['STR_FIRST_PAGE'] . '" /></a>' : ''));
325  $tpl->assign('last_page', (!is_user_bot() && $this->page < $this->pages_count ? '<a href="' . String::str_form_value($this->getPageURL($this->pages_count)) . '"><img src="' . $GLOBALS['wwwroot'] . '/images/last_page.png" alt="' . $GLOBALS['STR_LAST_PAGE'] . '" /></a>' : ''));
326  if (is_user_bot()) {
327  // Pour les moteurs de recherche on retire la possibilité de changer de nombre de résultats, puisque de toutes façons ça ne peut pas marcher pour eux qui ne gèrent pas les sessions
328  $links_per_page = null;
329  } else {
330  $links_per_page = $GLOBALS['STR_PER_PAGE'] . $GLOBALS['STR_BEFORE_TWO_POINTS'] . ': ' .
331  (($this->nb1 != $this->ResultPerPage)?('<a href="' . String::str_form_value($this->getPageURL(1, $this->nb1)) . '" rel="nofollow">' . $this->nb1 . '</a>'):('<b>' . $this->nb1 . '</b>')) . ' ' .
332  (($this->nb2 != $this->ResultPerPage)?('<a href="' . String::str_form_value($this->getPageURL(1, $this->nb2)) . '" rel="nofollow">' . $this->nb2 . '</a>'):('<b>' . $this->nb2 . '</b>')) . ' ' .
333  (($this->nb3 != $this->ResultPerPage)?('<a href="' . String::str_form_value($this->getPageURL(1, $this->nb3)) . '" rel="nofollow">' . $this->nb3 . '</a>'):('<b>' . $this->nb3 . '</b>')) . ' ' .
334  (($this->nb1 != $this->ResultPerPage && $this->nb2 != $this->ResultPerPage && $this->nb3 != $this->ResultPerPage)?(' (' . $this->ResultPerPage . ')'):'');
335  }
336  $tpl->assign('results_per_page', $links_per_page);
337  $liens = array();
338  if ($this->pages_count > 1) {
339  $this->first_link_page = max(1, min($this->page - ceil($this->LinkPerPage / 2) + 1, $this->pages_count - $this->LinkPerPage + 1));
340  for ($this_page = $this->first_link_page; $this_page <= min($this->first_link_page + $this->LinkPerPage - 1, $this->pages_count) ;$this_page++) {
341  $page = '';
342  if ($this_page == $this->page) {
343  $page .= '<span class="current_page_number">' . $this_page . '</span>';
344  } else {
345  $page .= '<a href="' . String::str_form_value($this->getPageURL($this_page)) . '">' . $this_page . '</a>';
346  }
347  $liens[] = array('i' => $this_page, 'page' => $page);
348  }
349  } elseif($show_page_if_only_one) {
350  // Si il n'y a pas plus d'une page, alors on affiche uniquement la page 1 en current non cliquable
351  $this->first_link_page = 1;
352  $liens[]['page'] = array('i' => 1, 'page' => '<span class="current_page_number">1</span>');
353  }
354  $tpl->assign('first_link_page', $this->first_link_page);
355  $tpl->assign('loop', $liens);
356  $tpl->assign('STR_MULTIPAGE_SEPARATOR', $GLOBALS['STR_MULTIPAGE_SEPARATOR']);
357  $this->tpl_data = $tpl->fetch();
358  }
359 
365  function pMultipage()
366  {
367  echo $this->tpl_data;
368  }
369 
375  function GetMultipage()
376  {
377  return $this->tpl_data;
378  }
379 
385  function getHeaderRow()
386  {
387  $output = '
388  <tr>';
389  foreach($this->HeaderTitlesArray as $key => $this_title) {
390  if (!empty($last_title) && $last_title == $this_title) {
391  unset($this->HeaderTitlesArray[$last_key]);
392  $add_colspan[$key] = vn($add_colspan[$last_key]) + 1;
393  }
394  $last_title = $this_title;
395  $last_key = $key;
396  }
397  foreach($this->HeaderTitlesArray as $key => $this_title) {
398  if (!empty($add_colspan[$key])) {
399  $colspan_text = ' colspan="' . ($add_colspan[$key] + 1) . '"';
400  } else {
401  $colspan_text = '';
402  }
403  if ($this->allow_get_sort && !empty($_GET[$this->order_get_variable]) && $key === $_GET[$this->order_get_variable]) {
404  $output .= '
405  <th class="menu center multipage_selected_field"' . $colspan_text . '>';
406  } else {
407  $output .= '
408  <th class="menu center"' . $colspan_text . '>';
409  }
410  if (!is_numeric($key) && $this->allow_get_sort) {
411  $link_url = $_SERVER['REQUEST_URI'];
412  if (empty($_GET[$this->order_get_variable])) {
413  if (String::strpos($link_url, '?') === false) {
414  $link_url .= '?';
415  } else {
416  $link_url .= '&amp;';
417  }
418  $link_url .= $this->order_get_variable.'=' . $key;
419  } else {
420  $link_url = str_replace($this->order_get_variable.'=' . $_GET[$this->order_get_variable], $this->order_get_variable.'=' . $key, $link_url);
421  }
422  if (!isset($_GET[$this->sort_get_variable])) {
423  $url_desc = $link_url . '&amp;'.$this->sort_get_variable.'=desc';
424  $url_asc = $link_url . '&amp;'.$this->sort_get_variable.'=asc';
425  } else {
426  // The following code can be easily changed to be compatible with some simple URL Rewriting
427  $url_desc = str_replace($this->sort_get_variable.'=' . $_GET[$this->sort_get_variable], $this->sort_get_variable.'=desc', $link_url);
428  $url_asc = str_replace($this->sort_get_variable.'=' . $_GET[$this->sort_get_variable], $this->sort_get_variable.'=asc', $link_url);
429  }
430  $output .= '<a href="' . $url_desc . '"><img src="' . $GLOBALS['administrer_url'] . '/images/desc.gif" width="7" height="7" alt="-" /></a> ' . $this_title . ' <a href="' . $url_asc . '"><img src="' . $GLOBALS['administrer_url'] . '/images/up.gif" width="7" height="7" alt="+" /></a>';
431  } else {
432  $output .= $this_title;
433  }
434  $output .= '</th>';
435  }
436  $output .= '
437  </tr>';
438  return $output;
439  }
440 
446  function getOrderBy()
447  {
448  if (!empty($_GET[$this->sort_get_variable]) && $this->allow_get_sort) {
449  $this_sort = String::substr(String::strtoupper(word_real_escape_string($_GET[$this->sort_get_variable])), 0, 4);
450  } elseif (!empty($this->SortDefault)) {
451  $this_sort = String::substr(String::strtoupper(word_real_escape_string($this->SortDefault)), 0, 4);
452  } else {
453  $this_sort = 'ASC';
454  }
455  if(!in_array(String::strtolower($this_sort), array('asc', 'desc'))) {
456  $this_sort = 'ASC';
457  }
458  if (!empty($this->forced_before_first_order_by_string)) {
460  }
461  if ($this->forced_order_by_string === null) {
462  // Si $this->HeaderTitlesArray est défini avant appel à Query, ça permet de faire un test sur les colonnes de tri autorisées
463  // Sinon, on laisse essayer de faire le tri sur n'importe quelle colonne, ce qui est permet éventuellement un ORDER BY sur colonne qui n'existe pas et une erreur SQL
464  // => il vaut mieux toujours définir $this->HeaderTitlesArray juste après la création d'un objet Multipage
465  $columns = array_values(explode(',', str_replace(' ', '', ($this->allow_get_sort && !empty($_GET[$this->order_get_variable]) && (!isset($this->HeaderTitlesArray) || isset($this->HeaderTitlesArray[$_GET[$this->order_get_variable]]))?$_GET[$this->order_get_variable] . ',':'') . $this->OrderDefault)));
466  foreach($columns as $this_column) {
467  if (!empty($this_column)) {
468  // En cas d'ambiguïté, l'on peut avoir la forme : table.colonne
469  $this_order_by = '`' . str_replace('.', '`.`', word_real_escape_string($this_column)) . '`';
470  if(!empty($this->order_sql_prefix) && String::strpos($this_column, '.') === false) {
471  $this_order_by = word_real_escape_string($this->order_sql_prefix) . '.' . $this_order_by;
472  }
473  $order_by[] = $this_order_by;
474  }
475  }
476  } elseif (!empty($this->forced_order_by_string)) {
477  $order_by[] = $this->forced_order_by_string;
478  } elseif (!empty($this->OrderDefault)) {
479  $order_by[] = $this->OrderDefault;
480  }
481  if (!empty($this->forced_second_order_by_string)) {
483  }
484  if(!empty($order_by)) {
485  foreach($order_by as $this_key => $this_value) {
486  if(!empty($this_sort) && String::strpos($this_value, ' ') === false) {
487  // On rajoute l'ordre si pas spécifié
488  $order_by[$this_key] .= ' ' . $this_sort;
489  }
490  }
491  }
492  if (!empty($order_by)) {
493  return 'ORDER BY ' . implode(', ', $order_by);
494  } else {
495  return null;
496  }
497  }
498 }
499 
static strtoupper($string)
Returns string with all alphabetic characters converted to uppercase.
Definition: String.php:154
$HeaderTitlesArray
Definition: Multipage.php:61
setResultsNumberPerPage()
Multipage::setResultsNumberPerPage()
Definition: Multipage.php:149
static strpos($haystack, $needle, $offset=0)
Returns the numeric position of the first occurrence of needle in the haystack string.
Definition: String.php:54
pMultipage()
Affiche directement en sortie le contenu du template après traitement.
Definition: Multipage.php:365
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
Definition: fonctions.php:1743
$first_link_page
Definition: Multipage.php:72
$forced_order_by_string
Definition: Multipage.php:64
redirect_and_die($url, $permanent_redirection=false, $avoid_loop=false)
Redirige vers l'URL demandée et arrête le programme.
Definition: fonctions.php:1551
getHeaderRow()
Multipage::getHeaderRow()
Definition: Multipage.php:385
Multipage($sqlRequest, $nombre_session_var_name= 'default_results_per_page', $DefaultResultsPerPage=50, $LinkPerPage=7, $AddToColspan=0, $always_show=true, $template_name=null, $round_elements_per_page=1, $external_results_to_merge_at_beginning=null, $no_pagination_displayed=false)
Constructeur.
Definition: Multipage.php:82
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...
Definition: database.php:424
static strtolower($string)
Returns string with all alphabetic characters converted to lowercase.
Definition: String.php:135
get_current_generic_url()
get_current_generic_url()
Definition: fonctions.php:1788
$results_array
ParseTemplate($show_page_if_only_one=false)
Cherche et remplace dans le template les variables connues en lançant les traitements associés...
Definition: Multipage.php:310
getOrderBy()
Multipage::getOrderBy()
Definition: Multipage.php:446
getPageURL($page, $nombre=null)
Multipage::getPageURL()
Definition: Multipage.php:287
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(!function_exists('ipGet')) if(!function_exists('isPublicIP')) is_user_bot($ip=null, $user_agent=null)
Renvoie si le visiteur est un robot ou non.
Definition: fonctions.php:3083
$nombre_session_var_name
Definition: Multipage.php:67
Initialize()
Paramétrage et construction.
Definition: Multipage.php:122
$order_get_variable
Definition: Multipage.php:75
$no_pagination_displayed
Definition: Multipage.php:77
$DefaultResultsPerPage
Definition: Multipage.php:47
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.
Definition: database.php:158
static str_form_value($value, $flags=ENT_COMPAT)
Encode une chaine de caractères pour affichage dans un value="".
Definition: String.php:480
vb(&$var, $default=null)
Variable blanche if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:97
$external_results_to_merge_at_beginning
Definition: Multipage.php:59
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
CurrentPage($page)
Calcule les paramètres Limit de la requete SQL en fonction de la page en cours.
Definition: Multipage.php:182
fetch_object($query_result)
fetch_object()
Definition: database.php:302
fetch_assoc($query_result)
fetch_assoc()
Definition: database.php:283
Calcul($query_without_error=true)
Calcule la position - sur la barre de liens - du lien correspondant à la page en cours.
Definition: Multipage.php:242
GetMultipage()
Renvoie le résultat du template une fois parsé
Definition: Multipage.php:375
$forced_before_first_order_by_string
Definition: Multipage.php:66
$GLOBALS['page_columns_count']
vn(&$var, $default=0)
Variable nulle if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:110
$forced_second_order_by_string
Definition: Multipage.php:65
$sort_get_variable
Definition: Multipage.php:74
static substr($string, $start, $length=null)
Returns the portion of string specified by the start and length parameters.
Definition: String.php:112
static substr_count($string, $searched)
Returns the number of times the needle substring occurs in the haystack string.
Definition: String.php:194
Query($return_objects=false)
Exécute le SQL avec LIMIT pour retourner les résultats, et calcule juste après car on a besoin que FO...
Definition: Multipage.php:200
$order_sql_prefix
Definition: Multipage.php:76
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']
static rawurlencode($string, $avoid_slash=true)
Returns string compatible with Apache without the AllowEncodedSlashes directive ON => avoids systemat...
Definition: String.php:893

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