addItem() public method

添加文章节点
public addItem ( $title, $link, $description, $date )
$title
$link
$description
$date
Beispiel #1
0
/**
 * 显示RSS2Feed
 * @api Filter_Plugin_ViewFeed_Begin
 * @return mixed
 */
function ViewFeed()
{
    global $zbp;
    foreach ($GLOBALS['Filter_Plugin_ViewFeed_Begin'] as $fpname => &$fpsignal) {
        $fpreturn = $fpname();
        if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
            $fpsignal = PLUGIN_EXITSIGNAL_NONE;
            return $fpreturn;
        }
    }
    if (!$zbp->CheckRights($GLOBALS['action'])) {
        Http404();
        die;
    }
    $rss2 = new Rss2($zbp->name, $zbp->host, $zbp->subname);
    $articles = $zbp->GetArticleList('*', array(array('=', 'log_Status', 0)), array('log_PostTime' => 'DESC'), $zbp->option['ZC_RSS2_COUNT'], null);
    foreach ($articles as $article) {
        $rss2->addItem($article->Title, $article->Url, $zbp->option['ZC_RSS_EXPORT_WHOLE'] == true ? $article->Content : $article->Intro, $article->PostTime);
    }
    header("Content-type:text/xml; Charset=utf-8");
    echo $rss2->saveXML();
}
Beispiel #2
0
<?php

/**
 * Z-Blog with PHP
 * @author
 * @copyright (C) RainbowSoft Studio
 * @version
 */
require './zb_system/function/c_system_base.php';
$zbp->CheckGzip();
$zbp->Load();
$action = 'feed';
if (!$zbp->CheckRights($action)) {
    Http404();
    die;
}
foreach ($GLOBALS['Filter_Plugin_Feed_Begin'] as $fpname => &$fpsignal) {
    $fpname();
}
$rss2 = new Rss2($zbp->name, $zbp->host, $zbp->subname);
$articles = $zbp->GetArticleList('*', array(array('=', 'log_Status', 0)), array('log_PostTime' => 'DESC'), $zbp->option['ZC_RSS2_COUNT'], null);
foreach ($articles as $article) {
    $rss2->addItem($article->Title, $article->Url, $zbp->option['ZC_RSS_EXPORT_WHOLE'] == true ? $article->Content : $article->Intro, $article->PostTime);
}
header("Content-type:text/xml; Charset=utf-8");
echo $rss2->saveXML();
RunTime();
Beispiel #3
0
<?php

/**
 * Z-Blog with PHP
 * @author 
 * @copyright (C) RainbowSoft Studio
 * @version
 */
require './zb_system/function/c_system_base.php';
$zbp->Load();
$action = 'feed';
if (!$zbp->CheckRights($action)) {
    Http404();
}
$rss2 = new Rss2($zbp->name, $zbp->host, $zbp->subname);
$articles = $zbp->GetArticleList(array('*'), array(array('=', 'log_Istop', 0), array('=', 'log_Status', 0)), array('log_PostTime' => 'DESC'), array(10), null);
foreach ($articles as $article) {
    $rss2->addItem($article->Title, $article->Url, $article->Content, $article->PostTime);
}
header("Content-type:text/xml; Charset=utf-8");
echo $rss2->saveXML();
RunTime();