<?php
///////////////////////////////////////////////////////////////////////////////////////////
///Script PHP/MYSQL of management of classifieds ads developed by Script PAG
///Script PAG all rights reserved. Use under license. http://www.script-pag.com
///////////////////////////////////////////////////////////////////////////////////////////

############################################################

require_once __DIR__.'/includes/all_fns.php';

$shop = isset($_GET['shop']) ? get_shop($_GET['shop']) : null;

if(isset($_GET['shop']) && !$shop) redirect('index.php');

$title_feed = isset($shop) ? htmlspecialchars($shop['title']) : htmlspecialchars($param_meta_tags['title_'.$_SESSION['code_lang']]);
$document_path = __DIR__;
$language_feed = $_SESSION['code_lang'];
$url_website = URL;
$link_feed = URL.(isset($language_feed) ? '/'.$language_feed : '').'/'.$language['router_slug_rss'].(isset($shop) ? '?shop='.$shop['id_shop'] : '');
$logo = isset($shop) && file_exists(__DIR__.'/upload/logo/'.$shop['logo_name']) ? URL.'/upload/logo/'.$shop['logo_name'] : URL.'/template/images/logo.png';
$description = isset($shop) ? htmlspecialchars($shop['description']) : htmlspecialchars($param_meta_tags['desc_'.$_SESSION['code_lang']]);

$sql = make_sql('', '');
$options = make_options('');
$items = isset($shop) ? get_ads_shop($sql['sql'], $shop['id_acc'], 0, $param_gen['nb_flux_shops']) : get_ads_search($sql['sql'], $options, 0, 0, $param_gen['nb_flux_gl'], 1, 0);

pool::execute('beforestart');

header('Content-type: text/xml; charset=utf-8');	
header("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 10 Jul 1990 05:00:00 GMT");

require_once __DIR__.'/template/tpl_rss_feed.php';