14 if (!defined(
'IN_PEEL')) {
26 if (!empty($_GET[
'encoding'])) {
32 if (empty($_GET[
'limit'])) {
35 $limit = min(intval($_GET[
'limit']), 500);
42 $ad_categories = get_ad_categories();
43 if (!empty($category_id)) {
44 $Cat4XML =
vb($ad_categories[$category_id]);
48 $GLOBALS[
'meta_title'] =
$GLOBALS[
'STR_MODULE_RSS_META_RSS'] .
' ' . $Cat4XML;
51 if(empty(
$GLOBALS[
'meta_description'])){
53 $GLOBALS[
'meta_description'] =
$GLOBALS[
'STR_MODULE_ANNONCES_LAST_ADS_PUBLISHED'];
58 header(
'Content-type: application/rss+xml; charset=' .
$page_encoding);
63 if (!empty(
$GLOBALS[
'site_parameters'][
'logo_' .
$_SESSION[
'session_langue']]) &&
$GLOBALS[
'site_parameters'][
'on_logo'] == 1) {
64 $image_thumb =
thumbs(
$GLOBALS[
'site_parameters'][
'logo_' . $_SESSION[
'session_langue']], 144, 144,
'fit');
68 <url>' .
String::htmlentities(
$GLOBALS[
'repertoire_upload'] .
'/thumbs/' . $image_thumb, ENT_COMPAT, GENERAL_ENCODING,
false,
true,
true) .
'</url>
71 <width>' .
vn($size_array[0]) .
'</width>
72 <height>' .
vn($size_array[1]) .
'</height>
73 <description>' .
$GLOBALS[
'meta_description'] .
'</description>
76 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'modules/rss.tpl');
83 $tpl->assign(
'language',
String::htmlentities($_SESSION[
'session_langue'], ENT_COMPAT, GENERAL_ENCODING,
false,
true,
true));
85 $tpl->assign(
'generator',
String::htmlentities(
'Advisto RSS Generator 2.1', ENT_COMPAT, GENERAL_ENCODING,
false,
true,
true));
89 $sql =
"SELECT p.id, p.prix, p.tva, p.nom_".(!empty(
$GLOBALS[
'site_parameters'][
'product_name_forced_lang'])?
$GLOBALS[
'site_parameters'][
'product_name_forced_lang']:$_SESSION[
'session_langue']).
" AS nom, p.date_maj, p.description_" . (!empty(
$GLOBALS[
'site_parameters'][
'product_description_forced_lang'])?
$GLOBALS[
'site_parameters'][
'product_description_forced_lang']:$_SESSION[
'session_langue']) .
" AS description, p.promotion, c.id AS categorie_id, c.nom_" . $_SESSION[
'session_langue'] .
" AS categorie
91 INNER JOIN peel_produits_categories pc ON p.id = pc.produit_id
92 INNER JOIN peel_categories c ON c.id = pc.categorie_id AND " .
get_filter_site_cond(
'categories',
'c') .
"
93 WHERE p.etat='1' AND " .
get_filter_site_cond(
'produits',
'p') .
" " . (!empty($category_id)?
" AND pc.categorie_id='" . intval($category_id) .
"'":
"") .
"
95 ORDER BY p.date_maj DESC, p.id DESC
96 LIMIT " . intval($limit);
100 $desc_rss = trim(str_replace(array(
" ",
" ",
" ",
" \r",
" \n",
"\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n",
"\r\n\r\n\r\n",
"\r\n\r\n",
"\n\n\n\n\n\n",
"\n\n\n",
"\n\n"), array(
" ",
" ",
" ",
"\r",
"\n",
"\r\n",
"\r\n",
"\r\n",
"\n",
"\n",
"\n"), strip_tags(
String::html_entity_decode_if_needed(
String::htmlspecialchars_decode(
$product_object->description, ENT_QUOTES)))));
101 $promotion_rss =
$product_object->get_all_promotions_percentage(
false, 0,
true);
104 $product_affiche_prix = display_on_estimate_information(
true);
110 $this_item = array(
'title' =>
String::htmlentities(
$product_object->name .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
': ' . $product_affiche_prix, ENT_COMPAT, GENERAL_ENCODING,
false,
true,
true),
'promotion_rss' =>
String::htmlentities($promotion_rss, ENT_COMPAT, GENERAL_ENCODING,
false,
true,
true),
113 'description' =>
String::htmlentities($desc_rss, ENT_COMPAT, GENERAL_ENCODING,
false,
true,
true));
115 if(!empty($imagename)) {
116 $this_thumb =
thumbs($imagename,
$GLOBALS[
'site_parameters'][
'small_width'],
$GLOBALS[
'site_parameters'][
'small_height'],
'fit');
117 if (!empty($this_thumb)) {
120 $this_item[
'image'][
'url'] =
$GLOBALS[
'repertoire_upload'] .
'/thumbs/' . $this_thumb;
121 $this_item[
'image'][
'mime'] = $image_infos[
'mime'];
124 $tpl_items[] = $this_item;
130 $sql_cond =
"enligne='OK' " . (!empty(
$GLOBALS[
'site_parameters'][
'extra_ad_database_fields_array']) && in_array(
'date_end',
$GLOBALS[
'site_parameters'][
'extra_ad_database_fields_array']) ?
" AND (date_end LIKE '0000%' OR date_end>'" . date(
'Y-m-d H:i:00', time()) .
"')":
'') .
" AND (date_insertion NOT LIKE '0000%' AND date_insertion<'" . date(
'Y-m-d H:i:00', time() + 60) .
"')";
131 if (!empty($category_id)) {
132 $sql_cond .=
" AND id_categorie=" . intval($category_id);
134 if (!empty($seller_id)) {
135 $sql_cond .=
" AND id_personne=" . intval($seller_id);
140 ORDER BY date_insertion DESC
145 $IDP = $row_rs[
'id_personne'];
146 if (empty($category_id) && !empty($row_rs[
'categorie_id'])) {
148 $category_text = ucfirst($ad_categories[$row_rs[
'categorie_id']]) .
' - ';
150 $dateRFC = gmdate(
"r", strtotime($row_rs[
'date_insertion']));
151 $annonce_object =
new Annonce($row_rs[
'ref'], null,
false,
true);
152 $desc_rss = trim(str_replace(array(
" ",
" ",
" ",
" \r",
" \n",
"\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n",
"\r\n\r\n\r\n",
"\r\n\r\n",
"\n\n\n\n\n\n",
"\n\n\n",
"\n\n"), array(
" ",
" ",
" ",
"\r",
"\n",
"\r\n",
"\r\n",
"\r\n",
"\n",
"\n",
"\n"),
String::strip_tags(
String::html_entity_decode_if_needed(
String::htmlspecialchars_decode($annonce_object->get_description(), ENT_QUOTES)))));
154 $this_item = array(
'title' =>
String::htmlentities(
vb($category_text) .
String::str_shorten_words(
String::str_shorten(
String::ucfirst($annonce_object->get_titre()), 120,
'',
'...', 100), 40), ENT_COMPAT, GENERAL_ENCODING,
false,
true,
true),
155 'promotion_rss' => $promotion_rss,
156 'guid' =>
String::htmlentities($annonce_object->get_annonce_url(), ENT_COMPAT, GENERAL_ENCODING,
false,
true,
true),
159 $image_url = $annonce_object->get_annonce_picture(
true,
$GLOBALS[
'site_parameters'][
'medium_width'],
$GLOBALS[
'site_parameters'][
'medium_height']);
160 if(!empty($image_url)) {
163 $this_item[
'image'][
'url'] = $image_url;
164 $this_item[
'image'][
'mime'] = $image_infos[
'mime'];
166 $tpl_items[] = $this_item;
167 unset($annonce_object);
171 $tpl->assign(
'items', $tpl_items);
174 $output = str_replace(array(
'€'), array(
'€'),
$output);
if(!function_exists('desinscription_newsletter')) close_page_generation($html_page=true)
Fonction à appeler à la fin de la génération d'une page, afin d'exécuter certaines requêtes SQL qui n...
static strip_tags($string, $allowed_tags=null)
String::strip_tags()
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...
static htmlspecialchars_decode($string, $style=ENT_COMPAT)
This function is String::htmlspecialchars_decode with php4 compatibility.
static convert_encoding($string, $new_encoding, $original_encoding=null)
Converts the character encoding of string $string to $new_encoding from optionally $original_encoding...
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
static rawurldecode($string, $avoid_slash=false)
Returns rawurldecode.
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')) $GLOBALS['page_types_array']
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...
static str_shorten_words($string, $length_limit=100, $separator=" ", $force_shorten_if_special_content=false, $add_separator_instead_of_cutting=true)
On rajoute des espaces à l'intérieur des mots trop longs => à utiliser pour éviter de casser une mise...
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(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))
fetch_assoc($query_result)
fetch_assoc()
if(!check_if_module_active('search')) $page_encoding
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 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']