14 if (!defined(
'IN_PEEL')) {
18 if (!function_exists(
'get_article_details_html')) {
26 function get_article_details_html($article_id)
30 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'article_details_html.tpl');
31 $tpl->assign(
'is_article', (
bool)$article);
33 $tpl->assign(
'STR_NO_FIND_ART',
$GLOBALS[
'STR_NO_FIND_ART']);
35 $tpl->assign(
'titre', $article[
'titre']);
36 $tpl->assign(
'is_offline', ($article[
'etat'] == 0));
37 $tpl->assign(
'STR_OFFLINE_ART',
$GLOBALS[
'STR_OFFLINE_ART']);
39 if (!empty($article[
'image1'])) {
40 $this_thumb =
thumbs($article[
'image1'],
$GLOBALS[
'site_parameters'][
'medium_width'],
$GLOBALS[
'site_parameters'][
'medium_height'],
'fit');
41 $tpl->assign(
'main_image', array(
43 'src' =>
$GLOBALS[
'repertoire_upload'] .
'/thumbs/' . $this_thumb,
44 'is_pdf' => (pathinfo($article[
'image1'], PATHINFO_EXTENSION) ==
'pdf')
47 if(empty(
$GLOBALS[
'site_parameters'][
'chapo_in_article_page_disabled'])) {
48 $tpl->assign(
'chapo', $article[
'chapo']);
50 $tpl->assign(
'texte', $article[
'texte']);
52 if (function_exists(
'get_share_feature')) {
53 $tpl->assign(
'share_feature', get_share_feature());
55 $tpl->assign(
'tell_friends', array(
56 'src' =>
$GLOBALS[
'site_parameters'][
'general_send_email_image'],
57 'txt' =>
$GLOBALS[
'STR_TELL_FRIEND'],
58 'href' => get_tell_friends_url(
false)
61 if (
a_priv(
'admin_content',
false)) {
62 $tpl->assign(
'admin', array(
63 'href' =>
$GLOBALS[
'administrer_url'] .
'/articles.php?mode=modif&id=' . $article[
'id'],
64 'modify_article_txt' =>
$GLOBALS[
'STR_MODIFY_ARTICLE']
74 if (!function_exists(
'get_rubriques_sons_html')) {
81 function get_rubriques_sons_html(
$rubid)
84 $qid_r =
query(
"SELECT id, nom_" .
$_SESSION[
'session_langue'] .
", description_" .
$_SESSION[
'session_langue'] .
", parent_id, image
86 WHERE parent_id = '" . intval(
$rubid) .
"' AND nom_" .
$_SESSION[
'session_langue'] .
"<>'' AND etat = 1 AND r.technical_code NOT IN ('other', 'iphone_content') AND " .
get_filter_site_cond(
'rubriques',
'r') .
"
87 ORDER BY r.position " . (!empty(
$GLOBALS[
'site_parameters'][
'content_category_primary_order_by'])?
", r." .
$GLOBALS[
'site_parameters'][
'content_category_primary_order_by'] :
'') .
"
90 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'rubriques_sons_html.tpl');
91 $tpl->assign(
'list_rubriques_txt',
$GLOBALS[
'STR_LIST_RUBRIQUES'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
95 'href' => get_content_category_url($rub[
'id'], $rub[
'nom_' .
$_SESSION[
'session_langue']]),
96 'name' => $rub[
'nom_' . $_SESSION[
'session_langue']]
98 if (!empty($rub[
'image'])) {
99 $tmp[
'image_src'] = $GLOBALS[
'repertoire_upload'] .
'/thumbs/' .
thumbs($rub[
'image'], $GLOBALS[
'site_parameters'][
'small_width'], $GLOBALS[
'site_parameters'][
'small_height'],
'fit');
101 if (!empty($rub[
'image_lien'])) {
102 $tmp[
'lien_src'] = $GLOBALS[
'repertoire_upload'] .
'/thumbs/' .
thumbs($rub[
'image_lien'], $GLOBALS[
'site_parameters'][
'small_width'], $GLOBALS[
'site_parameters'][
'small_height'],
'fit');
115 if (!function_exists(
'get_articles_html')) {
123 function get_articles_html(
$rubid = 0, $get_sub_rubrique =
false) {
127 if (!empty($get_sub_rubrique)) {
130 $extra_sql .=
" AND pc.rubrique_id = '" . intval(
$rubid) .
"'";
133 $sql =
"SELECT p.id, p.on_reseller, p.surtitre_" .
$_SESSION[
'session_langue'] .
" AS surtitre, p.titre_" .
$_SESSION[
'session_langue'] .
" AS titre , p.chapo_" .
$_SESSION[
'session_langue'] .
" AS chapo, p.texte_" .
$_SESSION[
'session_langue'] .
" AS texte, p.image1, p.on_special, pc.rubrique_id, r.nom_" .
$_SESSION[
'session_langue'] .
" AS rubrique_nom
135 INNER JOIN peel_articles_rubriques pc ON p.id = pc.article_id " . $extra_sql.
"
136 INNER JOIN peel_rubriques r ON r.id = pc.rubrique_id AND " .
get_filter_site_cond(
'rubriques',
'r') .
"
139 $Links->order_sql_prefix =
'p';
140 $Links->order_get_variable =
'tri';
141 $Links->sort_get_variable =
'sort';
142 $Links->OrderDefault =
'position';
143 $Links->SortDefault =
'ASC';
144 $Links->forced_second_order_by_string =
'p.id DESC';
147 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'articles_html.tpl');
149 $tpl->assign(
'STR_MORE_DETAILS', $GLOBALS[
'STR_MORE_DETAILS']);
150 $tpl->assign(
'haut_de_page_txt', $GLOBALS[
'STR_HAUT_DE_PAGE']);
151 $tpl->assign(
'haut_de_page_href',
'#haut_de_page');
152 $tpl->assign(
'category_content_show_explicit_buttons_if_articles_more_to_read',
vb($GLOBALS[
'site_parameters'][
'category_content_show_explicit_buttons_if_articles_more_to_read'],
true));
157 if ((!
a_priv(
"admin_product") && !
a_priv(
"reve")) && $art[
'on_reseller'] == 1) {
160 if(!empty($art[
'chapo'])){
165 $chapo = str_replace(array(
'<h1',
'<h2',
'<h3',
'<h4',
'</h1',
'</h2',
'</h3',
'</h4'), array(
'<p',
'<p',
'<p',
'<p',
'</p',
'</p',
'</p',
'</p'), $chapo);
166 if($chapo == strip_tags($chapo)) {
167 $chapo =
'<p>' . $chapo .
'</p>';
170 'href' => get_content_url($art[
'id'], $art[
'titre'], $art[
'rubrique_id'], $art[
"rubrique_nom"]),
171 'src' => (!empty($art[
'image1']) ? $GLOBALS[
'repertoire_upload'] .
'/' . $art[
'image1'] :
false),
172 'titre' => $art[
'titre'],
174 'texte' => $art[
'texte'],
175 'is_texte' => !empty($art[
'texte']),
180 $tpl->assign(
'multipage',
$Links->GetMultipage());
187 if (!function_exists(
'get_articles_list_brief_html')) {
194 function get_articles_list_brief_html(
$rubid)
197 $sqlrub =
"SELECT image, description_" .
$_SESSION[
'session_langue'] .
" AS description, nom_" .
$_SESSION[
'session_langue'] .
" AS nom, articles_review, etat, technical_code
198 FROM peel_rubriques r
199 WHERE id = '" . intval(
$rubid) .
"' AND nom_" .
$_SESSION[
'session_langue'] .
" != '' AND r.technical_code NOT IN ('other', 'iphone_content') AND " .
get_filter_site_cond(
'rubriques',
'r') .
"
200 ORDER BY r.position ASC, r.id DESC";
201 $resrub =
query($sqlrub);
203 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'articles_list_brief_html.tpl');
204 $tpl->assign(
'is_not_empty', !empty($rowrub));
205 if (!empty($rowrub)){
206 if($rowrub[
'technical_code'] ==
'add_cart_by_reference') {
207 include($GLOBALS[
'dirroot'] .
"/lib/fonctions/display_caddie.php");
208 $tpl->assign(
'add_cart_by_reference', add_cart_by_reference());
210 $tpl->assign(
'name', $rowrub[
'nom']);
211 if($rowrub[
'etat'] == 0 &&
a_priv(
'admin_content',
false)) {
212 $tpl->assign(
'offline_rub_txt', $GLOBALS[
'STR_OFFLINE_RUB']);
214 if (!empty($rowrub[
'image'])) {
215 $this_thumb =
thumbs($rowrub[
'image'], $GLOBALS[
'site_parameters'][
'medium_width'], $GLOBALS[
'site_parameters'][
'medium_height'],
'fit');
216 $tpl->assign(
'main_image', array(
218 'src' => $GLOBALS[
'repertoire_upload'] .
'/thumbs/' . $this_thumb,
222 $tpl->assign(
'technical_code', $rowrub[
'technical_code']);
225 $tpl->assign(
'descriptions_clients', affiche_descriptions_clients());
228 $tpl->assign(
'reference_multipage', affiche_reference_multipage(
vn($_GET[
'refid'])));
230 if ($rowrub[
'articles_review'] ==
'1') {
232 $tpl->assign(
'articles_html', get_articles_html(
$rubid));
233 }
elseif($rowrub[
'technical_code'] ==
'tradefaire_home') {
236 WHERE technical_code="articles_home_tradefaire" AND ' .
get_filter_site_cond(
'rubriques') .
'');
238 $tpl->assign(
'stocklots_exhibitors', get_user_picture(
'STOCKLOTS_EXHIBITORS'));
239 $tpl->assign(
'user_picture', get_user_picture(
'exhibitors'));
240 $tpl->assign(
'articles_html', get_articles_html($result_articles_home_tradefaire[
'id']));
243 if (!empty($GLOBALS[
'site_parameters'][
'display_content_category_diaporama'])) {
244 $tpl->assign(
'diaporama', get_diaporama(
'content_category',
$rubid));
246 if (
vb($GLOBALS[
'site_parameters'][
'content_category_count_method'], $GLOBALS[
'site_parameters'][
'category_count_method']) ==
'global' || (empty(
$rubid) && empty($rowrub))) {
247 $tpl->assign(
'rubriques_sons_html', get_rubriques_sons_html(
$rubid));
250 $tpl->assign(
'admin', array(
251 'href' => $GLOBALS[
'administrer_url'] .
'/rubriques.php?mode=modif&id=' .
$rubid,
252 'modify_content_category_txt' => $GLOBALS[
'STR_MODIFY_CONTENT_CATEGORY']
255 if (!empty(
$rubid) && !empty($GLOBALS[
'site_parameters'][
'show_special_on_content_category'])) {
256 $sql =
"SELECT p.id, p.surtitre_" .
$_SESSION[
'session_langue'] .
" AS surtitre, p.titre_" .
$_SESSION[
'session_langue'] .
" AS titre , p.chapo_" .
$_SESSION[
'session_langue'] .
" AS chapo, p.texte_" .
$_SESSION[
'session_langue'] .
" AS texte, p.image1, p.on_special, pc.rubrique_id, r.nom_" .
$_SESSION[
'session_langue'] .
" AS rubrique_nom
258 INNER JOIN peel_articles_rubriques pc ON p.id = pc.article_id AND pc.rubrique_id = '" . intval(
$rubid) .
"'
259 INNER JOIN peel_rubriques r ON r.id = pc.rubrique_id AND " .
get_filter_site_cond(
'rubriques',
'r') .
"
260 WHERE p.etat = '1' AND p.on_special = 1 AND titre_" .
$_SESSION[
'session_langue'] .
" != '' AND " .
get_filter_site_cond(
'articles',
'p') .
"
261 ORDER BY p.position ASC, p.id DESC";
265 'src' => $GLOBALS[
'repertoire_images'] .
'/coin.png',
269 if ((!
a_priv(
"admin_product") && !
a_priv(
"reve")) && $art[
'on_reseller'] == 1) {
272 $plus[
'arts'][] = array(
273 'titre' => $art[
'titre'],
274 'texte' => $art[
'texte']
278 $tpl->assign(
'plus', $plus);
288 if (!function_exists(
'affiche_arbre_rubrique')) {
297 function affiche_arbre_rubrique(
$rubid = 0, $additional_text = null, $hidden =
false)
301 $qid =
query(
'SELECT parent_id, nom_' .
$_SESSION[
'session_langue'] .
'
302 FROM peel_rubriques r
303 WHERE id = "' . intval(
$rubid) .
'" AND etat = "1" AND r.technical_code NOT IN ("other", "iphone_content") AND ' .
get_filter_site_cond(
'rubriques',
'r') .
'');
307 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'arbre_rubrique.tpl');
309 $tpl->assign(
'href', get_content_category_url(
$rubid, $nom));
310 $tpl->assign(
'label', $nom);
311 $tpl->assign(
'hidden', $hidden);
312 $nom =
$tpl->fetch();
318 return affiche_arbre_rubrique($parent,
' > ' . $nom, $hidden);
320 return $nom . (!$hidden ? $additional_text :
'');
334 include_once $GLOBALS[
'dirroot'].
'/lib/class/Simplepie.php';
336 $feed->set_cache_location($GLOBALS[
'dirroot'].
'/'.$GLOBALS[
'site_parameters'][
'cache_folder']);
338 if(!empty($_GET[
'update']) && $_GET[
'update']==1){
339 $feed->set_cache_duration(1);
341 $feed->set_cache_duration(3600 * rand(12,16));
345 $feed->set_feed_url(html_entity_decode($feed_url));
350 $max = $feed->get_item_quantity(100);
352 if($feed->get_title()) {
354 <div class="rss_header">
355 <h3>' . $feed->get_title() .
'</h3>
356 <p>' . $feed->get_description() .
'</p>
360 for($x=0; $x<$max; $x++) {
362 $item=$feed->get_item($x);
363 $enclosure=$item->get_enclosure(0);
365 <div class="rss_content" style="margin-bottom: 10px;">
366 <h4><a href="'. $item->get_permalink().
'" onclick="return(window.open(this.href)?false:true);">'. $item->get_title().
'</a></h4>';
367 if(!empty($enclosure) && $enclosure->get_link()!=
''){
368 $output .=
'<img src="' . $enclosure->get_link() .
'" style="float: left; margin: 4px; margin-top: 8px;" />';
370 if($item->get_date()){
380 if (!function_exists(
'get_articles_in_container_html')) {
387 function get_articles_in_container_html($articles_data_array, $only_show_article_with_picture =
true)
391 if (!empty($articles_data_array[
'id']) && !empty($articles_data_array[
'etat'])) {
392 $urlprod = get_content_url($articles_data_array[
'id']);
393 $display_picture = $articles_data_array[
'image'];
394 if (!$only_show_article_with_picture || !empty($display_picture)) {
396 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'articles_in_container_html.tpl');
398 $tpl->assign(
'href', $urlprod);
399 $tpl->assign(
'name', $articles_data_array[
'name']);
400 if (!empty($display_picture)) {
401 $this_picture =
thumbs($display_picture, $GLOBALS[
'site_parameters'][
'small_width'], $GLOBALS[
'site_parameters'][
'small_height'],
"fit");
402 if($only_show_article_with_picture && empty($this_picture)) {
405 $tpl->assign(
'src', $GLOBALS[
'repertoire_upload'] .
'/thumbs/' . $this_picture);
407 $tpl->assign(
'src', null);
409 $tpl->assign(
'more_detail_label', $GLOBALS[
'STR_MORE_DETAILS']);
foreach(array('date1', 'date2', 'type', 'renewals', 'width') as $item) $data
static strip_tags($string, $allowed_tags=null)
String::strip_tags()
fetch_row($query_result)
fetch_row()
charge_article($id, $show_all_etat_if_admin=true)
charge_article()
static html_entity_decode_if_needed($string)
String::html_entity_decode_if_needed()
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(!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()
get_filter_site_cond($table_technical_code, $table_alias=null, $use_strict_rights_if_in_admin=false, $specific_site_id=null, $exclude_public_items=false, $admin_force_multisite_if_allowed=false)
Retourne la condition SQL permettant de filtrer les données pour une table.
get_category_tree_and_itself($id_or_ids_array, $mode= 'sons', $table_to_use= 'categories')
get_category_tree_and_itself()
query($query, $die_if_error=false, $database_object=null, $silent_if_error=false, $security_sql_filter=true)
The query() function is meant to be called anywhere you want to make a query.
if(!defined('IN_PEEL')) est_identifie()
Retourne true si l'utilisateur est identifié
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()
fetch_assoc($query_result)
fetch_assoc()
if(!defined('IN_PEEL')) if(!function_exists('get_article_details_html')) if(!function_exists('get_rubriques_sons_html')) if(!function_exists('get_articles_html')) if(!function_exists('get_articles_list_brief_html')) if(!function_exists('affiche_arbre_rubrique')) get_rss_feed_content($feed_url)
Récupère le contenu d'un fichier RSS.
get_file_type($filename)
get_file_type()
$GLOBALS['page_columns_count']
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 ...
check_if_module_active($module_name, $specific_file_name=null)
Renvoie si un module est présent et activé ou non - Peut être appelé avant ou après le chargement d'u...
static 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.
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...