Пример #1
0
 function render($title)
 {
     // trash the output, just in case
     @ob_end_clean();
     ob_start();
     header('Content-Type: text/xml');
     echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n" . "<rdf:RDF\n" . "\txmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n" . "\txmlns=\"http://purl.org/rss/1.0/\"\n" . "\txmlns:taxo=\"http://purl.org/rss/1.0/modules/taxonomy/\"\n" . "\txmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n" . "\txmlns:syn=\"http://purl.org/rss/1.0/modules/syndication/\"\n" . "\txmlns:admin=\"http://webns.net/mvcb/\"\n" . ">\n\n";
     echo "<channel rdf:about=\"" . $this->baselink . $this->resource . "\">\n" . "\t<title>" . htmlentities($title, ENT_QUOTES, 'UTF-8') . "</title>\n" . "\t<link>" . $this->baselink . $this->resource . "</link>\n" . "\t<description></description>\n" . "</channel>\n\n";
     if ($this->items) {
         foreach ($this->items->feeds as $feed) {
             foreach ($feed->items as $item) {
                 $xmlTitle = htmlentities($item->title, ENT_QUOTES, 'UTF-8');
                 echo "<item rdf:about=\"" . $item->url . "\">\n" . "\t<title>{$xmlTitle}</title>\n" . "\t<link>" . $item->url . "</link>\n" . "\t<dc:date>" . rss_date('Y-m-d\\TH:i:sO', $item->date) . "</dc:date>\n" . "\t<dc:subject>{$xmlTitle}</dc:subject>\n";
                 if (count($item->tags)) {
                     echo "\t<taxo:topics>\n" . "\t\t<rdf:Bag>\n";
                     foreach ($item->tags as $tag) {
                         echo "\t\t\t<rdf:li rdf:resource=\"" . $this->baselink . $tag . "\" />\n";
                     }
                     echo "\t\t</rdf:Bag>\n" . "\t</taxo:topics>\n";
                 }
                 echo "</item>\n\n";
             }
         }
     }
     echo "</rdf:RDF>\n";
 }
Пример #2
0
function plug_rssin($u)
{
    req('pop,art,tri,spe');
    Head::add('jslink', '/prog/utils.js');
    if ($_GET['rssurl']) {
        foreach ($_GET as $k => $v) {
            if ($k == "rssurl") {
                $u = $v;
            } else {
                $u .= '&' . $k . '=' . $v;
            }
        }
    }
    $u = str_replace('http://', '', $u);
    if ($u) {
        $alx = alx();
        $rss = load_xml('http://' . $u, 1);
        $ret .= bal('h1', lkt('', 'http://' . $u, preplink($u)));
        $ret .= lkt("", '/?plug=rssin&rssurl=' . $u, picto('url'));
        foreach ($rss as $k => $v) {
            if ($v[1]) {
                $ret .= pane_base($v[1], $v[0], "", rss_date($v[2]), "", $v[3], $alx);
            }
        }
    }
    return $ret;
}
Пример #3
0
?>
<feed xmlns="http://www.w3.org/2005/Atom">
        <id>urn:<?php 
echo str_replace('.', '-', $_SERVER['HTTP_HOST']) . ":feeds:atom";
?>
</id>
	<title><?php 
echo rss_header_title();
?>
</title>
	<subtitle><?php 
echo rss_header_title();
?>
</subtitle>      
        <link rel="alternate" type="text/html" href="<?php 
echo guessTransportProto() . $_SERVER['HTTP_HOST'] . getPath();
?>
" />
        <link rel="self" type="text/xml" href="<?php 
echo guessTransportProto() . $_SERVER['HTTP_HOST'] . getPath();
?>
?media=atom"/>
        <updated><?php 
echo rss_date('c', getLastModif());
?>
</updated>
	<?php 
rss_main_object();
?>
</feed>
Пример #4
0
function rss_item_date_with_format($fmt)
{
    return rss_date($fmt, $GLOBALS['rss']->currentItem->date);
}
Пример #5
0
Файл: pop.php Проект: philum/cms
function rssin_xml($f)
{
    $rss = load_xml($f);
    //p($rss);
    if ($rss) {
        foreach ($rss as $k => $v) {
            list($va, $lnk, $dat) = $v;
            $va = trim(del_n(strip_tags($va)));
            $va = clean_title($va);
            //$va=unescape($va); $va=html_entity_decode($va);
            $lnk = utmsrc($lnk);
            if ($dat) {
                $dat = rss_date($dat);
            }
            $ret[] = array($va, $lnk, $dat);
        }
    }
    return $ret;
}
Пример #6
0
    ?>
  <item>
    <title><?php 
    the_title_rss();
    ?>
</title>
    <link><?php 
    the_permalink();
    ?>
</link>
    <description><?php 
    echo '<![CDATA[' . largo_excerpt($post, 5, false, '', false) . ']]>';
    ?>
</description>
    <pubDate><?php 
    rss_date(strtotime($post->post_date_gmt));
    ?>
</pubDate>
    <guid><?php 
    the_permalink();
    ?>
</guid>
    <dc:creator><?php 
    $curuser = get_user_by('id', $post->post_author);
    echo $curuser->first_name . ' ' . $curuser->last_name;
    ?>
</dc:creator>
	<?php 
    if (get_the_post_thumbnail($post->ID)) {
        $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID));
        ?>
Пример #7
0
/**
 * builds an url for an archive link
 */
function makeArchiveUrl($ts, $channel, $cid, $dayView)
{
    $ret = getPath();
    if (getConfig('rss.output.usemodrewrite')) {
        if ($channel) {
            $ret .= "{$channel}/";
        }
        $ret .= rss_date($dayView ? 'Y/m/d/' : 'Y/m/', $ts, false);
    } else {
        $ret .= "feed.php?";
        if ($cid) {
            $ret .= "channel={$cid}&amp;";
        }
        $ret .= "y=" . rss_date('Y', $ts, false) . "&amp;m=" . rss_date('m', $ts, false) . ($dayView ? "&amp;d=" . rss_date('d', $ts, false) : "");
    }
    return $ret;
}
Пример #8
0
        <!-- Page Items -->
        <?php 
foreach ($pages as $item) {
    ?>
        <?php 
    if (!rss_syndicated($item)) {
        continue;
    }
    ?>
        <item>
            <guid><?php 
    echo $Router->GetLink($item->id);
    ?>
</guid>
            <pubDate><?php 
    echo rss_date($item->modified);
    ?>
</pubDate>
            <title><?php 
    echo $item->title;
    ?>
</title>
            <link><?php 
    echo $Router->GetLink($item->id);
    ?>
</link>
            <description><![CDATA[<?php 
    echo rss_story_text($item->story);
    ?>
]]></description>
        </item>