$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 the_permalink_rss() {
echo apply_filters('the_permalink_rss', get_permalink());
}
function comment_link() {
echo get_comment_link();
}
function get_comment_author_rss() {
return apply_filters('comment_author_rss', get_comment_author() );
}
function comment_author_rss() {
echo get_comment_author_rss();
}
function comment_text_rss() {
$comment_text = get_comment_text();
$comment_text = apply_filters('comment_text_rss', $comment_text);
echo $comment_text;
}
function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = 'nolongerused') {
$url = get_post_comments_feed_link();
echo "$link_text";
}
function comments_rss($commentsrssfilename = 'nolongerused') {
return get_post_comments_feed_link();
}
function get_author_rss_link($echo = false, $author_id, $author_nicename) {
$auth_ID = (int) $author_id;
$permalink_structure = get_option('permalink_structure');
if ( '' == $permalink_structure ) {
$link = get_option('home') . '?feed=rss2&author=' . $author_id;
} else {
$link = get_author_posts_url($author_id, $author_nicename);
$link = trailingslashit($link) . user_trailingslashit('feed', 'feed');
}
$link = apply_filters('author_feed_link', $link);
if ( $echo )
echo $link;
return $link;
}
function get_category_rss_link($echo = false, $cat_ID, $category_nicename) {
$permalink_structure = get_option('permalink_structure');
if ( '' == $permalink_structure ) {
$link = get_option('home') . '?feed=rss2&cat=' . $cat_ID;
} else {
$link = get_category_link($cat_ID);
$link = trailingslashit($link) . user_trailingslashit('feed', 'feed');
}
$link = apply_filters('category_feed_link', $link);
if ( $echo )
echo $link;
return $link;
}
function get_the_category_rss($type = 'rss') {
$categories = get_the_category();
$tags = get_the_tags();
$home = get_bloginfo_rss('home');
$the_list = '';
$cat_names = array();
$filter = 'rss';
if ( 'atom' == $type )
$filter = 'raw';
if ( !empty($categories) ) foreach ( (array) $categories as $category ) {
$cat_names[] = sanitize_term_field('name', $category->name, $category->term_id, 'category', $filter);
}
if ( !empty($tags) ) foreach ( (array) $tags as $tag ) {
$cat_names[] = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter);
}
$cat_names = array_unique($cat_names);
foreach ( $cat_names as $cat_name ) {
if ( 'rdf' == $type )
$the_list .= "\n\t\t\n";
elseif ( 'atom' == $type )
$the_list .= sprintf( '', attribute_escape( apply_filters( 'get_bloginfo_rss', get_bloginfo( 'url' ) ) ), attribute_escape( $cat_name ) );
else
$the_list .= "\n\t\t\n";
}
return apply_filters('the_category_rss', $the_list, $type);
}
function the_category_rss($type = 'rss') {
echo get_the_category_rss($type);
}
function get_tag_feed_link($tag_id, $feed = 'rss2') {
$tag_id = (int) $tag_id;
$tag = get_tag($tag_id);
if ( empty($tag) || is_wp_error($tag) )
return false;
$permalink_structure = get_option('permalink_structure');
if ( '' == $permalink_structure ) {
$link = get_option('home') . "?feed=$feed&tag=" . $tag->slug;
} else {
$link = get_tag_link($tag->term_id);
if ( 'rss2' == $feed )
$feed_link = 'feed';
else
$feed_link = "feed/$feed";
$link = $link . user_trailingslashit($feed_link, 'feed');
}
$link = apply_filters('tag_feed_link', $link, $feed);
return $link;
}
function html_type_rss() {
$type = get_bloginfo('html_type');
if (strpos($type, 'xhtml') !== false)
$type = 'xhtml';
else
$type = 'html';
echo $type;
}
function rss_enclosure() {
global $id, $post;
if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) )
return;
foreach (get_post_custom() as $key => $val) {
if ($key == 'enclosure') {
foreach ((array)$val as $enc) {
$enclosure = split("\n", $enc);
echo apply_filters('rss_enclosure', '' . "\n");
}
}
}
}
function atom_enclosure() {
global $id, $post;
if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) )
return;
foreach (get_post_custom() as $key => $val) {
if ($key == 'enclosure') {
foreach ((array)$val as $enc) {
$enclosure = split("\n", $enc);
echo apply_filters('atom_enclosure', '' . "\n");
}
}
}
}
?>