<?php
# ************** LICENCE ****************
/*
	Copyright (c) PORTANEO.
*/
# ***************************************
# Display rss reader
#
# !! be careful, this file must be saved under uft8 format, and display an e accentuated here : é
# ***************************************
$not_access=1;
$granted="I";

require_once('includes_mobile.php');
require_once('../../../../db_layer/'.__DBTYPE.'/portal.php');
require_once('../includes/date.inc.php');
require_once('../includes/template.inc.php');

$articleId = $_GET['id'];
$pfid = $_GET['pfid'];
$max = $_GET['max'];
$cpt = $_GET['cpt'];
$act = $_GET['act'];

$tabs = array();
if (isset($_GET['tab']) && !empty($_GET['tab'])) {
	$selectedTab = $_GET['tab'];
}
if (isset($articleId)) {
	$DB->execute($scrfeed_setAsRead,$DB->escape($articleId),$DB->escape($_SESSION['user_id']));
}

$DB->getResults($xmlfeeds_getItem,$DB->escape($pfid),$DB->escape($articleId));
$row = $DB->fetch(0);
$title_f = $row['title'];
$link_f = $row['link'];
$descript_f = $row["description"];
$date_f = $row['pubdate'];
$status_f = $row['status'];
$image_f = $row['image'];
$video_f = $row['video'];
$audio_f = $row['audio'];
$DB->freeResults();
$convertedDate = rssToDate($date_f);
$descript_f = decodehtmlchar($descript_f);

$htmlTabs = buildTabs($selectedTab,$tabs);

$options = defineHeader();
          
echo page_begining();

echo '<div id="header">';
    echo generate_header($options);
echo '</div>';

echo '<div id="wrapper">';
echo '<div id="page">';	

echo $htmlTabs;
echo '<div class="suboptions"><a href="display_widget.php?tab='.$selectedTab.'&mod_id=86&max='.$max.'&cpt='.$cpt.'&act='.$act.'&pfid='.$pfid.'">'.lg("backToFeed").'</a></div>';
echo '   <div class="item_detail">
            <div class="title"><a href="'.$link_f.'">'.$title_f.'</a></div>
            <div class="description">'.$descript_f.'</div>
            <div class="options">';
echo '          <a href="rss_reader_iframe.php?pfid='.$pfid.'&id='.$articleId.'&tab='.$selectedTab.'&max='.$max.'&cpt='.$cpt.'&act='.$act.'">'.lg("complet").'</a>';
echo '      </div>
            <div class="options">'.$convertedDate.'</div>
        </div>';
echo '  <div id="page_footer" align="right">
            <div><a href="portal.php?tab='.$selectedTab.'">'.lg("backportal").'</a></div>
        </div>';
echo '</div>';
echo '</div>';

echo generate_footer("pages");
?>