Beispiel #1
0
function create_rss($search, $limit)
{
    $title = 'uBook';
    if ($search) {
        $title .= ' - Suche nach "' . $search . '"';
    }
    $link = WEBDIR;
    $desc = 'Neue Angebote bei uBook.';
    $lang = 'de-de';
    $copyright = 'uBook';
    $rss = new RssChannel($title, $link, $desc, $lang, $copyright);
    $imageUrl = 'http://ubook.asta-bielefeld.de/ubook_small.gif';
    $rss->addImage($imageUrl, $title, $link);
    $query = BookQuery::searchQuery($search);
    $query .= ' order by created desc';
    if ($limit > 0) {
        $query .= ' limit ' . $limit;
    }
    $mysqlResult = mysql_query($query);
    while ($book = Book::fromMySql($mysqlResult)) {
        $title = $book->get('title');
        $desc = 'Neues Buchangebot:' . "\n" . $book->asText();
        $desc = nl2br(Parser::text2html($desc));
        $id = $link = WEBDIR . 'book.php?id=' . $book->get('id');
        $author = 'ubook@asta-bielefeld.de (uBook-Team)';
        $date = $book->get('created');
        $rss->addItem($id, $title, $desc, $link, $author, $date);
    }
    return $rss;
}
 public function Generate()
 {
     $rssChannel = new RssChannel($this->channelTitle, $this->channelLink, $this->channelDescription);
     $this->ApplyOrderingToDataset();
     $this->ApplyLimitCountToDataset();
     $this->dataset->Open();
     while ($this->dataset->Next()) {
         $item = new RssItem(FormatDatasetFieldsTemplate($this->dataset, $this->itemTitleTemplate), FormatDatasetFieldsTemplate($this->dataset, $this->itemLinkTemplate), FormatDatasetFieldsTemplate($this->dataset, $this->itemDescriptionTemplate));
         $this->SetItemPublicationDate($item);
         $rssChannel->AddItem($item);
     }
     $this->dataset->Close();
     return $rssChannel->GenerateRss();
 }
/*
 * LinkorCMS 1.4
 * © 2012 LinkorCMS Development Group
 */
define('RSS_SCRIPT', true);
define('VALID_RUN', true);
require 'config/init.php';
// Конфигурация и инициализация
@header("Content-Type: text/xml");
@header("Cache-Control: no-cache");
@header("Pragma: no-cache");
$rss_title = 'Новости на ' . System::config('general/site_url');
$rss_link = System::config('general/site_url');
$rss_description = 'RSS канал сайта ' . System::config('general/site_url') . '.';
$rss = new RssChannel($rss_title, $rss_link, $rss_description);
$rss->pubDate = gmdate('D, d M Y H:i:s') . ' GMT';
$rss->generator = CMS_NAME . ' ' . CMS_VERSION;
$rss->managingEditor = '*****@*****.**';
$rss->webMaster = System::config('general/site_email');
$num = 10;
// Пока максимум 10 заголовков по умолчанию
$news = System::database()->Select('news', "`enabled`='1'", $num, 'date', true);
foreach ($news as $s) {
    $title = SafeDB($s['title'], 255, str);
    $description = SafeDB($s['start_text'], 4048, str);
    $link = HtmlChars(GetSiteUrl() . Ufu('index.php?name=news&op=readfull&news=' . $s['id'] . '&topic=' . $s['topic_id'], 'news/{topic}/{news}/'));
    $pubDate = gmdate('D, d M Y H:i:s', $s['date']) . ' GMT';
    $rss->AddItem($title, $description, $link, $pubDate, $link);
}
echo $rss->Generate();
Beispiel #4
0
        $rss_channel = new RssChannel($forum->get_attribute("DATE_TITLE"), PATH_URL . "weblog/" . $_GET["id"] . "/", "");
        $rss_channel->generate_http_header();
        print $rss_channel->generate_xml_header();
        $max_items = 20;
        $discussion = lms_weblog::get_item_data($object);
        print $rss_channel->generate_item($discussion["OBJ_NAME"] . " " . gettext("by") . " " . $discussion["AUTHOR"], "", BBCode($discussion["CONTENT"]), $discussion["AUTHOR"], $discussion["DATE_START_DATE"], "", PATH_URL . "weblog/" . $_GET["id"] . "/#comment" . $discussion["OBJ_ID"]);
        $cache = get_cache_function($_GET["id"], 600);
        $discussions = $cache->call("lms_steam::get_annotations", $_GET["id"]);
        while ((list($id, $discussion) = each($discussions)) && $max_items > 0) {
            print $rss_channel->generate_item(gettext("Comment by ") . $discussion["OBJ_CREATOR"], "", BBCode($discussion["CONTENT"]), $discussion["OBJ_CREATOR"], $discussion["OBJ_CREATION_TIME"], "", PATH_URL . "weblog/" . $_GET["id"] . "/#comment" . $forum->get_id());
            $max_items--;
        }
        print $rss_channel->generate_xml_footer();
    } else {
        // Generate RSS for the Weblog container
        $rss_channel = new RssChannel($forum->get_name(), PATH_URL . "weblog/" . $_GET["id"] . "/", "");
        $rss_channel->generate_http_header();
        print $rss_channel->generate_xml_header();
        $cache = get_cache_function($_GET["id"], 600);
        $discussions = $cache->call("lms_weblog::get_items", $_GET["id"]);
        $max_items = 20;
        while ((list($id, $discussion) = each($discussions)) && $max_items > 0) {
            print $rss_channel->generate_item($discussion["OBJ_NAME"], "", BBCode($discussion["CONTENT"]), $discussion["AUTHOR"], $discussion["DATE_START_DATE"], "", PATH_URL . "weblog/" . $discussion["OBJ_ID"] . "/");
            $max_items--;
        }
        print $rss_channel->generate_xml_footer();
    }
} else {
    $rss_channel = new PodcastRSS("Access denied", PATH_SERVER . $_SERVER["REQUEST_URI"], "You are not allowed to access this RSS Feed. Please check your username and password");
    $rss_channel->generate_http_header();
    $rss_channel->generate_xml_header(TRUE);
Beispiel #5
0
<?php

require_once "../../../etc/koala.conf.php";
require_once PATH_LIB . "format_handling.inc.php";
//lms_steam::connect(); //http_auth function is used instead
require_once PATH_LIB . "http_auth_handling.inc.php";
if (http_auth()) {
    if (!($discussion = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["id"]))) {
        include PATH_PUBLIC . "bad_link.php";
        exit;
    }
    $rss_channel = new RssChannel($discussion->get_name(), PATH_URL . "doc/" . $_GET["id"] . "/", "");
    $rss_channel->generate_http_header();
    print $rss_channel->generate_xml_header();
    $object = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["id"]);
    if (is_object($object)) {
        $data_tnr["ATTRIBUTES"] = $object->get_attributes(array(OBJ_NAME, OBJ_CREATION_TIME, OBJ_DESC), TRUE);
        $data_tnr["CREATOR"] = $object->get_creator(TRUE);
        $data_result = $GLOBALS["STEAM"]->buffer_flush();
        $creator = $data_result[$data_tnr["CREATOR"]];
        steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), array($creator), array(USER_FULLNAME, USER_FIRSTNAME));
        print $rss_channel->generate_item($data_result[$data_tnr["ATTRIBUTES"]][OBJ_NAME] . " " . gettext("by") . " " . $creator->get_attribute(USER_FIRSTNAME) . " " . $creator->get_attribute(USER_FULLNAME), "", BBCode($data_result[$data_tnr["ATTRIBUTES"]][OBJ_DESC]), $creator->get_attribute(USER_FIRSTNAME) . " " . $creator->get_attribute(USER_FULLNAME), $data_result[$data_tnr["ATTRIBUTES"]][OBJ_CREATION_TIME], "", PATH_URL . "doc/" . $_GET["id"] . "/#comment" . $object->get_id());
    }
    $cache = get_cache_function($_GET["id"], 600);
    $discussions = $cache->call("lms_steam::get_annotations", $_GET["id"]);
    foreach ($discussions as $discussion) {
        print $rss_channel->generate_item(gettext("Post by ") . $discussion["OBJ_CREATOR"], "", BBCode($discussion["CONTENT"]), $discussion["OBJ_CREATOR"], $discussion["OBJ_CREATION_TIME"], "", PATH_URL . "doc/" . $_GET["id"] . "/#comment" . $discussion["OBJ_ID"]);
    }
    print $rss_channel->generate_xml_footer();
} else {
    $rss_channel = new PodcastRSS("Access denied", PATH_SERVER . $_SERVER["REQUEST_URI"], "You are not allowed to access this RSS Feed. Please check your username and password");
Beispiel #6
0
<?php

require_once "../../../etc/koala.conf.php";
require_once PATH_LIB . "format_handling.inc.php";
//lms_steam::connect(); //http_auth function is used instead
require_once PATH_LIB . "http_auth_handling.inc.php";
if (http_auth()) {
    if (!($forum = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["id"]))) {
        include PATH_PUBLIC . "bad_link.php";
        exit;
    }
    $rss_channel = new RssChannel($forum->get_name(), PATH_URL . "/forums/" . $_GET["id"] . "/", "");
    $rss_channel->generate_http_header();
    print $rss_channel->generate_xml_header();
    $cache = get_cache_function($_GET["id"], 600);
    $discussions = $cache->call("lms_forum::get_discussions", $_GET["id"]);
    $max_items = 20;
    while ((list($id, $discussion) = each($discussions)) && $max_items > 0) {
        print $rss_channel->generate_item($discussion["OBJ_NAME"], "", BBCode($discussion["CONTENT"]), $discussion["LATEST_POST_AUTHOR"], $discussion["LATEST_POST_TS"], "", PATH_URL . "forums/" . $discussion["OBJ_ID"] . "/");
        $max_items--;
    }
    print $rss_channel->generate_xml_footer();
} else {
    $rss_channel = new PodcastRSS("Access denied", PATH_SERVER . $_SERVER["REQUEST_URI"], "You are not allowed to access this RSS Feed. Please check your username and password");
    $rss_channel->generate_http_header();
    $rss_channel->generate_xml_header(TRUE);
    exit;
}
Beispiel #7
0
<?php

require_once "../../../etc/koala.conf.php";
require_once PATH_LIB . "format_handling.inc.php";
//lms_steam::connect(); //http_auth function is used instead
require_once PATH_LIB . "http_auth_handling.inc.php";
if (http_auth()) {
    if (!($discussion = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["id"]))) {
        include PATH_PUBLIC . "bad_link.php";
        exit;
    }
    $rss_channel = new RssChannel($discussion->get_name(), PATH_URL . "forums/" . $_GET["id"] . "/", "");
    $rss_channel->generate_http_header();
    print $rss_channel->generate_xml_header();
    $object = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["id"]);
    if (is_object($object) && !$object instanceof steam_messageboard) {
        $discussion = lms_steam::get_annotation_data($object);
        print $rss_channel->generate_item($discussion["OBJ_NAME"] . " " . gettext("by") . " " . $discussion["OBJ_CREATOR"], "", BBCode($discussion["CONTENT"]), $discussion["OBJ_CREATOR"], $discussion["OBJ_CREATION_TIME"], "", PATH_URL . "forums/" . $_GET["id"] . "/#comment" . $discussion["OBJ_ID"]);
    }
    $cache = get_cache_function($_GET["id"], 600);
    $discussions = $cache->call("lms_steam::get_annotations", $_GET["id"]);
    foreach ($discussions as $discussion) {
        print $rss_channel->generate_item(gettext("Post by ") . $discussion["OBJ_CREATOR"], "", BBCode($discussion["CONTENT"]), $discussion["OBJ_CREATOR"], $discussion["OBJ_CREATION_TIME"], "", PATH_URL . "forums/" . $_GET["id"] . "/#comment" . $discussion["OBJ_ID"]);
    }
    print $rss_channel->generate_xml_footer();
} else {
    $rss_channel = new PodcastRSS("Access denied", PATH_SERVER . $_SERVER["REQUEST_URI"], "You are not allowed to access this RSS Feed. Please check your username and password");
    $rss_channel->generate_http_header();
    $rss_channel->generate_xml_header(TRUE);
    exit;
}