2005-01-07 17:01:59 -05:00
|
|
|
<?php
|
|
|
|
|
2005-02-25 10:52:28 -05:00
|
|
|
function get_bloginfo_rss($show = '') {
|
|
|
|
$info = strip_tags(get_bloginfo($show));
|
|
|
|
return convert_chars($info);
|
|
|
|
}
|
|
|
|
|
|
|
|
function bloginfo_rss($show = '') {
|
2005-02-27 11:42:57 -05:00
|
|
|
echo get_bloginfo_rss($show);
|
2005-01-07 17:01:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
function the_title_rss() {
|
|
|
|
$title = get_the_title();
|
|
|
|
$title = apply_filters('the_title', $title);
|
|
|
|
$title = apply_filters('the_title_rss', $title);
|
|
|
|
echo $title;
|
|
|
|
}
|
|
|
|
|
|
|
|
function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
|
|
|
|
$content = get_the_content($more_link_text, $stripteaser, $more_file);
|
2005-11-17 18:17:06 -05:00
|
|
|
$content = apply_filters('the_content_rss', $content);
|
2005-01-07 17:01:59 -05:00
|
|
|
if ($cut && !$encode_html) {
|
|
|
|
$encode_html = 2;
|
|
|
|
}
|
|
|
|
if ($encode_html == 1) {
|
|
|
|
$content = wp_specialchars($content);
|
|
|
|
$cut = 0;
|
|
|
|
} elseif ($encode_html == 0) {
|
|
|
|
$content = make_url_footnote($content);
|
|
|
|
} elseif ($encode_html == 2) {
|
|
|
|
$content = strip_tags($content);
|
|
|
|
}
|
|
|
|
if ($cut) {
|
|
|
|
$blah = explode(' ', $content);
|
|
|
|
if (count($blah) > $cut) {
|
|
|
|
$k = $cut;
|
|
|
|
$use_dotdotdot = 1;
|
|
|
|
} else {
|
|
|
|
$k = count($blah);
|
|
|
|
$use_dotdotdot = 0;
|
|
|
|
}
|
|
|
|
for ($i=0; $i<$k; $i++) {
|
|
|
|
$excerpt .= $blah[$i].' ';
|
|
|
|
}
|
|
|
|
$excerpt .= ($use_dotdotdot) ? '...' : '';
|
|
|
|
$content = $excerpt;
|
|
|
|
}
|
|
|
|
$content = str_replace(']]>', ']]>', $content);
|
|
|
|
echo $content;
|
|
|
|
}
|
|
|
|
|
|
|
|
function the_excerpt_rss() {
|
|
|
|
$output = get_the_excerpt(true);
|
|
|
|
echo apply_filters('the_excerpt_rss', $output);
|
|
|
|
}
|
|
|
|
|
|
|
|
function permalink_single_rss($file = '') {
|
|
|
|
echo get_permalink();
|
|
|
|
}
|
|
|
|
|
2005-01-31 05:06:12 -05:00
|
|
|
function comment_link() {
|
|
|
|
echo get_comment_link();
|
2005-01-07 17:01:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
function comment_author_rss() {
|
|
|
|
$author = apply_filters('comment_author_rss', get_comment_author() );
|
|
|
|
echo $author;
|
|
|
|
}
|
|
|
|
|
|
|
|
function comment_text_rss() {
|
|
|
|
$comment_text = get_comment_text();
|
|
|
|
$comment_text = apply_filters('comment_text_rss', $comment_text);
|
|
|
|
echo $comment_text;
|
|
|
|
}
|
|
|
|
|
2005-02-26 01:12:16 -05:00
|
|
|
function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = '') {
|
2005-01-07 17:01:59 -05:00
|
|
|
$url = comments_rss($commentsrssfilename);
|
|
|
|
echo "<a href='$url'>$link_text</a>";
|
|
|
|
}
|
|
|
|
|
2005-02-26 01:12:16 -05:00
|
|
|
function comments_rss($commentsrssfilename = '') {
|
2005-01-07 17:01:59 -05:00
|
|
|
global $id;
|
|
|
|
|
|
|
|
if ('' != get_settings('permalink_structure'))
|
|
|
|
$url = trailingslashit( get_permalink() ) . 'feed/';
|
|
|
|
else
|
2005-02-26 01:12:16 -05:00
|
|
|
$url = get_settings('home') . "/$commentsrssfilename?feed=rss2&p=$id";
|
2005-01-07 17:01:59 -05:00
|
|
|
|
2005-02-26 01:12:16 -05:00
|
|
|
return apply_filters('post_comments_feed_link', $url);
|
2005-01-07 17:01:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
function get_author_rss_link($echo = false, $author_id, $author_nicename) {
|
|
|
|
$auth_ID = $author_id;
|
|
|
|
$permalink_structure = get_settings('permalink_structure');
|
|
|
|
|
|
|
|
if ('' == $permalink_structure) {
|
2005-02-26 01:12:16 -05:00
|
|
|
$link = get_settings('home') . '?feed=rss2&author=' . $author_id;
|
2005-01-07 17:01:59 -05:00
|
|
|
} else {
|
2005-02-26 01:12:16 -05:00
|
|
|
$link = get_author_link(0, $author_id, $author_nicename);
|
|
|
|
$link = $link . "feed/";
|
2005-01-07 17:01:59 -05:00
|
|
|
}
|
2005-02-26 01:12:16 -05:00
|
|
|
|
|
|
|
$link = apply_filters('author_feed_link', $link);
|
2005-01-07 17:01:59 -05:00
|
|
|
|
|
|
|
if ($echo) echo $link;
|
|
|
|
return $link;
|
|
|
|
}
|
|
|
|
|
2005-04-19 13:17:36 -04:00
|
|
|
function get_category_rss_link($echo = false, $cat_ID, $category_nicename) {
|
2005-01-07 17:01:59 -05:00
|
|
|
$permalink_structure = get_settings('permalink_structure');
|
|
|
|
|
|
|
|
if ('' == $permalink_structure) {
|
2005-05-09 06:59:36 -04:00
|
|
|
$link = get_settings('home') . '?feed=rss2&cat=' . $cat_ID;
|
2005-01-07 17:01:59 -05:00
|
|
|
} else {
|
2005-05-09 06:59:36 -04:00
|
|
|
$link = get_category_link($cat_ID);
|
2005-02-26 01:12:16 -05:00
|
|
|
$link = $link . "feed/";
|
2005-01-07 17:01:59 -05:00
|
|
|
}
|
|
|
|
|
2005-02-26 01:12:16 -05:00
|
|
|
$link = apply_filters('category_feed_link', $link);
|
|
|
|
|
2005-01-07 17:01:59 -05:00
|
|
|
if ($echo) echo $link;
|
|
|
|
return $link;
|
|
|
|
}
|
|
|
|
|
|
|
|
function the_category_rss($type = 'rss') {
|
|
|
|
$categories = get_the_category();
|
|
|
|
$the_list = '';
|
|
|
|
foreach ($categories as $category) {
|
|
|
|
$category->cat_name = convert_chars($category->cat_name);
|
|
|
|
if ('rdf' == $type) {
|
|
|
|
$the_list .= "\n\t<dc:subject>$category->cat_name</dc:subject>";
|
|
|
|
} else {
|
|
|
|
$the_list .= "\n\t<category>$category->cat_name</category>";
|
|
|
|
}
|
|
|
|
}
|
2005-02-05 22:40:08 -05:00
|
|
|
echo apply_filters('the_category_rss', $the_list, $type);
|
2005-01-07 17:01:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
function rss_enclosure() {
|
2005-03-22 12:49:19 -05:00
|
|
|
global $id, $post;
|
|
|
|
if (!empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password)) return;
|
|
|
|
|
2005-01-07 17:01:59 -05:00
|
|
|
$custom_fields = get_post_custom();
|
|
|
|
if( is_array( $custom_fields ) ) {
|
|
|
|
while( list( $key, $val ) = each( $custom_fields ) ) {
|
|
|
|
if( $key == 'enclosure' ) {
|
|
|
|
if (is_array($val)) {
|
|
|
|
foreach($val as $enc) {
|
|
|
|
$enclosure = split( "\n", $enc );
|
2005-03-07 03:56:47 -05:00
|
|
|
print "<enclosure url='".trim( htmlspecialchars($enclosure[ 0 ]) )."' length='".trim( $enclosure[ 1 ] )."' type='".trim( $enclosure[ 2 ] )."'/>\n";
|
2005-01-07 17:01:59 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|