Example #1
0
            $date = $item->date;
            $i = new StdClass();
            $i->_type = 'date';
            $i->date = $item->date;
            $newlist[] = $i;
        }
        $newlist[] = $item;
    }
    $list = $newlist;
    header('Content-Type: text/xml');
    echo template_simple('rss_author.spt', array('list' => $list, 'rss_title' => appconf('rss_title'), 'rss_description' => appconf('rss_description'), 'rss_date' => date('Y-m-d\\TH:i:s') . news_timezone(date('Z'))));
} else {
    // main list
    if (!$parameters['limit']) {
        $parameters['limit'] = 5;
    }
    $story->limit($parameters['limit']);
    $story->orderBy('date desc, rank desc, id desc');
    if (!isset($parameters['sec'])) {
        $params = array();
    } else {
        $params = array('category' => $parameters['sec']);
    }
    $list = $story->find($params);
    if (!$list) {
        $list = array();
    }
    header('Content-Type: text/xml');
    echo template_simple('rss_frontpage.spt', array('list' => $list, 'date' => $parameters['date'], 'rss_title' => appconf('rss_title'), 'rss_description' => appconf('rss_description'), 'rss_date' => date('Y-m-d\\TH:i:s') . news_timezone(date('Z'))));
}
exit;
Example #2
0
    // Add these lines to the very top of any file you don't want people to
    // be able to access directly.
    header('HTTP/1.1 404 Not Found');
    echo "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n" . "<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n" . "The requested URL " . $PHP_SELF . " was not found on this server.<p>\n<hr>\n" . $_SERVER['SERVER_SIGNATURE'] . "</body></html>";
    exit;
}
// END KEEPOUT CHECKING
// show an rss newsfeed of files from the specified path
if (!isset($parameters['path'])) {
    $parameters['path'] = '';
}
if (session_admin()) {
    $acl = session_allowed_sql();
} else {
    $acl = session_approved_sql();
}
$res = db_fetch_array('select name, extension
	from sitellite_filesystem
	where
		path = ? and
		' . $acl, $parameters['path']);
if (count($res) == 0) {
    //return;
}
if (!empty($parameters['path'])) {
    $parameters['path'] .= '/';
}
loader_import('news.Functions');
header('Content-Type: text/xml');
echo template_simple('filesystem_rss.spt', array('path' => $parameters['path'], 'rss_title' => $parameters['path'] ? $parameters['path'] : 'default', 'list' => $res, 'rss_date' => date('Y-m-d\\TH:i:s') . news_timezone(date('Z'))));
exit;