PEEL Shopping
Open source ecommerce : PEEL Shopping
url_standard.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: url_standard.php 46935 2015-09-18 08:49:48Z gboussin $
14 if (!defined('IN_PEEL')) {
15  die();
16 }
17 
18 if (!function_exists('get_product_url')) {
28  function get_product_url($id, $name=null, $category_id=null, $category_name=null, $add_get_suffixe = false, $html_encode = false)
29  {
30  $url_prod = get_url("/achat/produit_details.php", array('id' => intval($id)));
31  if ($add_get_suffixe) {
32  if ($html_encode) {
33  $url_prod .= '&amp;';
34  } else {
35  $url_prod .= '&';
36  }
37  }
38  return $url_prod;
39  }
40 }
41 
42 if (!function_exists('get_product_category_url')) {
52  function get_product_category_url($id = null, $name = null, $add_get_suffixe = false, $html_encode = false)
53  {
54  $get_array = array();
55  if (!empty($id)) {
56  $get_array['catid'] = intval($id);
57  }
58  $url_cat = get_url('/achat/', $get_array, null);
59  if ($add_get_suffixe) {
60  if (empty($id)) {
61  $url_cat .= '?';
62  } elseif ($html_encode) {
63  $url_cat .= '&amp;';
64  } else {
65  $url_cat .= '&';
66  }
67  }
68  return $url_cat;
69  }
70 }
71 
72 if (!function_exists('get_content_url')) {
82  function get_content_url($id, $title = null, $category_id = null, $category_name = null, $add_get_suffixe = false, $html_encode = false)
83  {
84  $url_art = get_url("/lire/article_details.php", array('rubid' => $id));
85  if ($add_get_suffixe) {
86  if ($html_encode) {
87  $url_art .= '&amp;';
88  } else {
89  $url_art .= '&';
90  }
91  }
92  return $url_art;
93  }
94 }
95 
96 if (!function_exists('get_content_category_url')) {
106  function get_content_category_url($id = null, $name = null, $add_get_suffixe = false, $html_encode = false)
107  {
108  if(!empty($id)) {
109  $url_rub = get_url('/lire/', array('rubid' => intval($id)));
110  if ($add_get_suffixe) {
111  if ($html_encode) {
112  $url_rub .= '&amp;';
113  } else {
114  $url_rub .= '&';
115  }
116  }
117  }else{
118  $url_rub = get_url('/lire/');
119  if ($add_get_suffixe) {
120  $url_rub .= '?';
121  }
122  }
123  return $url_rub;
124  }
125 }
126 
127 if (!function_exists('get_lang_rewrited_wwwroot')) {
136  function get_lang_rewrited_wwwroot($this_lang, $this_wwwroot = null, $this_rewriting = null)
137  {
138  return vb($this_wwwroot, $GLOBALS['wwwroot_main']);
139  }
140 }
141 
142 if (!function_exists('get_map_site_url')) {
151  function get_map_site_url($add_get_suffixe = false, $html_encode = false)
152  {
153  $url_map_site_url = get_url('sitemap');
154 
155  if ($add_get_suffixe) {
156  $url_map_site_url .= '?';
157 
158  return $url_map_site_url;
159  }
160  }
161 }
162 
163 if (!function_exists('get_contact_url')) {
171  function get_contact_url($add_get_suffixe = false, $html_encode = false)
172  {
173  $url_contact_url = get_url('/utilisateurs/contact.php');
174 
175  if ($add_get_suffixe) {
176  $url_contact_url .= '?';
177  }
178  return $url_contact_url;
179  }
180 }
181 
182 if (!function_exists('get_account_url')) {
188  function get_account_url($add_get_suffixe = false, $html_encode = false, $force_logged_in_status = null)
189  {
190  if($force_logged_in_status || ($force_logged_in_status === null && est_identifie())){
191  $url_account_url = get_url('compte');
192  } else {
193  $url_account_url = get_url('membre');
194  }
195  if ($add_get_suffixe) {
196  $url_account_url .= '?';
197  }
198 
199  return $url_account_url;
200  }
201 }
202 
203 if (!function_exists('get_account_register_url')) {
211  function get_account_register_url($add_get_suffixe = false, $html_encode = false)
212  {
213  $url_account_register = get_url('/utilisateurs/enregistrement.php');
214  if ($add_get_suffixe) {
215  $url_account_register .= '?';
216  }
217  return $url_account_register;
218  }
219 }
220 
221 if (!function_exists('get_cgv_url')) {
228  function get_cgv_url($html_encode = false)
229  {
230  $url_cgv = get_url('cgv');
231  return $url_cgv;
232  }
233 }
234 
235 if (!function_exists('get_tell_friends_url')) {
242  function get_tell_friends_url($html_encode = false)
243  {
244  $url_tell_friends = get_url('/modules/direaunami/direaunami.php');
245  return $url_tell_friends;
246  }
247 }
248 
249 if (!function_exists('get_url')) {
260  function get_url($uri, $get_array = array(), $lang = null, $forced_site_id = null) {
261  $uri_by_technical_code = array('caddie_affichage' => '/achat/caddie_affichage.php', 'achat_maintenant' => '/achat/achat_maintenant.php');
262  if(!empty($uri_by_technical_code[$uri])){
263  $uri = $uri_by_technical_code[$uri];
264  }
265  if(empty($lang)) {
266  $lang = $_SESSION['session_langue'];
267  }
268  if(empty($get_array)) {
269  $get_array = array();
270  }
271  if(strpos($uri, '/') === false && strpos($uri, '.') === false) {
272  $uri .= '.php';
273  }
274  if(function_exists('convertHrefUri') && empty($forced_site_id)) {
275  $url = convertHrefUri($uri, $get_array, $lang);
276  } else {
277  if(substr($uri, 0, 1) !== '/') {
278  $uri = '/' . $uri;
279  }
280  if (count($get_array) > 0) {
281  foreach ($get_array as $key => $value) {
282  $queryString[] = $key . '=' . urlencode($value);
283  }
284  $uri .= '?' . implode('&', $queryString);
285  }
286  $url = handle_setup_redirections(get_site_wwwroot($forced_site_id, $lang) . $uri, 'value');
287  }
288  return $url;
289  }
290 }
$lang
Definition: spellchecker.php:9
handle_setup_redirections($url, $mode= 'redirect')
Gère les redirections définies dans $GLOBALS['site_parameters']['redirections'].
Definition: fonctions.php:2462
if(!defined('IN_PEEL')) est_identifie()
Retourne true si l'utilisateur est identifié
Definition: user.php:23
vb(&$var, $default=null)
Variable blanche if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:97
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
$GLOBALS['page_columns_count']
get_site_wwwroot($site_id, $lang=null)
Renvoie l'URL d'un site donné
Definition: fonctions.php:4873
$id
Definition: articles.php:22
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']

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