Exemple #1
0
// load classes
include_once "../WEB-INC/class.db.php";
include_once "../WEB-INC/class.auth.php";
include_once "../WEB-INC/class.data_viewer.php";
// global vars
$strPage = isset($_GET['view']) ? $_GET['view'] : null;
$intChannelID = isset($_GET['channel']) ? $_GET['channel'] : false;
$username = isset($_POST['username']) ? $_POST['username'] : null;
$password = isset($_POST['password']) ? sha1($_POST['password']) : null;
//sha1 encryption has been used here this can be changed when changed, you will also need to change the passwords in the config file.
// classes
$cDb = new db();
$cAuth = new auth();
$cDataViewer = new Viewer();
//$cDataViewer->get_last_items();
$cDataViewer->get_items(null, "NOW", null, "pubDate", "ASC", 0, 10);
for ($c = 0; $cDataViewer->last_posts['count'] > $c; $c++) {
    $channel_title = $cDataViewer->last_posts['data'][$c]['channel']['chiTitle'];
    $channel_url = $cDataViewer->last_posts['data'][$c]['channel']['chURL'];
    $channel_link = $cDataViewer->last_posts['data'][$c]['channel']['chiLink'];
    $item_id = $cDataViewer->last_posts['data'][$c]['item']['item_id'];
    $item_title = $cDataViewer->last_posts['data'][$c]['item']['title'];
    $item_link = $cDataViewer->last_posts['data'][$c]['item']['link'];
    $item_descr = $cDataViewer->last_posts['data'][$c]['item']['description'];
    $item_pubDate = date('d.m.Y h:i', strtotime($cDataViewer->last_posts['data'][$c]['item']['pubDate']));
    $item_comments = isset($cDataViewer->last_posts['data'][$c]['item']['comments']) ? $cDataViewer->last_posts['data'][$c]['item']['comments'] : null;
    $item_comments = $item_comments ? "<a href='{$item_comments}'>Читать дальше &rarr;</a>" : null;
    $return .= <<<PPH
\t\t\t<div class=item> 
\t\t\t\t<div class=date>
\t\t\t\t\t<b><font color="#999999">{$item_pubDate}</font></b>