Changeset 2068
- Timestamp:
- 01/07/2005 10:01:59 PM (20 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-atom.php
r2046 r2068 16 16 xmlns:dc="http://purl.org/dc/elements/1.1/"> 17 17 <title><?php bloginfo_rss('name') ?></title> 18 <link rel="alternate" type="text/html" href="<?php bloginfo_rss(' url') ?>" />18 <link rel="alternate" type="text/html" href="<?php bloginfo_rss('home') ?>" /> 19 19 <tagline><?php bloginfo_rss("description") ?></tagline> 20 20 <modified><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT')); ?></modified> 21 21 <copyright>Copyright <?php echo mysql2date('Y', get_lastpostdate('blog')); ?></copyright> 22 <generator url="http://wordpress.org/" version="<?php echo $wp_version?>">WordPress</generator>22 <generator url="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator> 23 23 24 24 <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?> … … 29 29 <title><?php the_title_rss() ?></title> 30 30 <link rel="alternate" type="text/html" href="<?php permalink_single_rss() ?>" /> 31 <id><?php bloginfo_rss("url") ?>?p=<?php echo $id; ?></id>32 <modified><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_modified_gmt); ?></modified>33 <issued> <?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt); ?></issued>31 <id><?php the_guid(); ?></id> 32 <modified><?php the_time('Y-m-d\TH:i:s\Z'); ?></modified> 33 <issued> <?php the_time('Y-m-d\TH:i:s\Z'); ?></issued> 34 34 <?php the_category_rss('rdf') ?> 35 <summary type="text/html" mode="escaped"><?php the_excerpt_rss( get_settings('rss_excerpt_length'), 2)?></summary>35 <summary type="text/html" mode="escaped"><?php the_excerpt_rss(); ?></summary> 36 36 <?php if (!get_settings('rss_use_excerpt')) : ?> 37 37 <?php if ( strlen( $post->post_content ) ) : ?> … … 41 41 <?php endif; ?> 42 42 <?php else : ?> 43 <content type="text/html" mode="escaped" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_excerpt_rss( '', 2) ?>]]></content>43 <content type="text/html" mode="escaped" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_excerpt_rss() ?>]]></content> 44 44 <?php endif; ?> 45 45 </entry> -
trunk/wp-includes/comment-functions.php
r2060 r2068 59 59 function comments_link( $file = '', $echo = true ) { 60 60 echo get_comments_link(); 61 }62 63 function comment_link_rss() {64 echo get_comments_link();65 61 } 66 62 … … 146 142 } 147 143 148 function comment_author_rss() {149 $author = apply_filters('comment_author_rss', get_comment_author() );150 echo $author;151 }152 153 144 function get_comment_author_email() { 154 145 global $comment; … … 245 236 } 246 237 247 function comment_text_rss() {248 $comment_text = get_comment_text();249 $comment_text = apply_filters('comment_text_rss', $comment_text);250 echo $comment_text;251 }252 253 238 function get_comment_excerpt() { 254 239 global $comment; … … 298 283 function comment_time( $d = '' ) { 299 284 echo get_comment_time(); 300 }301 302 function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = 'wp-commentsrss2.php') {303 $url = comments_rss($commentsrssfilename);304 echo "<a href='$url'>$link_text</a>";305 }306 307 function comments_rss($commentsrssfilename = 'wp-commentsrss2.php') {308 global $id;309 global $querystring_start, $querystring_equal, $querystring_separator;310 311 if ('' != get_settings('permalink_structure'))312 $url = trailingslashit( get_permalink() ) . 'feed/';313 else314 $url = get_settings('siteurl') . "/$commentsrssfilename?p=$id";315 316 return $url;317 285 } 318 286 -
trunk/wp-includes/template-functions-author.php
r1997 r2068 141 141 } 142 142 143 function get_author_rss_link($echo = false, $author_id, $author_nicename) {144 global $querystring_start, $querystring_equal;145 $auth_ID = $author_id;146 $permalink_structure = get_settings('permalink_structure');147 148 if ('' == $permalink_structure) {149 $file = get_settings('siteurl') . '/wp-rss2.php';150 $link = $file . $querystring_start . 'author' . $querystring_equal . $author_id;151 } else {152 $link = get_author_link(0, $author_id, $author_nicename);153 $link = $link . "feed/";154 }155 156 if ($echo) echo $link;157 return $link;158 }159 160 143 function wp_list_authors($args = '') { 161 144 parse_str($args, $r); -
trunk/wp-includes/template-functions-category.php
r2045 r2068 42 42 if ($echo) echo $catlink; 43 43 return $catlink; 44 }45 46 function get_category_rss_link($echo = false, $category_id, $category_nicename) {47 global $querystring_start, $querystring_equal;48 $cat_ID = $category_id;49 $permalink_structure = get_settings('permalink_structure');50 51 if ('' == $permalink_structure) {52 $file = get_settings('siteurl') . '/wp-rss2.php';53 $link = $file . $querystring_start . 'cat' . $querystring_equal . $category_id;54 } else {55 $link = get_category_link(0, $category_id, $category_nicename);56 $link = $link . "feed/";57 }58 59 if ($echo) echo $link;60 return $link;61 44 } 62 45 … … 119 102 } 120 103 121 function the_category_rss($type = 'rss') {122 $categories = get_the_category();123 $the_list = '';124 foreach ($categories as $category) {125 $category->cat_name = convert_chars($category->cat_name);126 if ('rdf' == $type) {127 $the_list .= "\n\t<dc:subject>$category->cat_name</dc:subject>";128 } else {129 $the_list .= "\n\t<category>$category->cat_name</category>";130 }131 }132 echo apply_filters('the_category_rss', $the_list);133 }134 135 104 function get_the_category_by_ID($cat_ID) { 136 105 global $cache_categories, $wpdb; -
trunk/wp-includes/template-functions-general.php
r2032 r2068 59 59 $info = get_bloginfo($show); 60 60 $info = apply_filters('bloginfo', $info); 61 echo convert_chars($info);62 }63 64 function bloginfo_rss($show='') {65 $info = strip_tags(get_bloginfo($show));66 echo convert_chars($info);67 }68 69 function bloginfo_unicode($show='') {70 $info = get_bloginfo($show);71 61 echo convert_chars($info); 72 62 } … … 612 602 } 613 603 614 function the_time($d='', $echo = true) { 615 global $id, $post; 616 if ($d=='') { 617 $the_time = mysql2date(get_settings('time_format'), $post->post_date); 618 } else { 619 $the_time = mysql2date($d, $post->post_date); 620 } 621 $the_time = apply_filters('the_time', $the_time); 622 if ($echo) { 623 echo $the_time; 624 } else { 625 return $the_time; 626 } 604 function the_time( $d = '' ) { 605 echo apply_filters('the_time', get_the_time( $d ) ); 606 } 607 608 function get_the_time( $d = '' ) { 609 global $id, $post; 610 if ( '' == $d ) 611 $the_time = date( get_settings('time_format'), get_post_time() ); 612 else 613 $the_time = mysql2date( $d, get_post_time() ); 614 return apply_filters('get_the_time', $the_time); 615 } 616 617 function get_post_time( $gmt = false ) { // returns timestamp 618 global $post; 619 if ( $gmt ) 620 $time = mysql2date('U', $post->post_date_gmt); 621 else 622 $time = mysql2date('U', $post->post_date); 623 return apply_filters('get_the_time', $time); 627 624 } 628 625 -
trunk/wp-includes/template-functions-links.php
r1997 r2068 21 21 break; 22 22 } 23 }24 25 function permalink_single_rss($file = '') {26 echo get_permalink();27 23 } 28 24 -
trunk/wp-includes/template-functions-post.php
r2046 r2068 40 40 } 41 41 42 function the_title_rss() {43 $title = get_the_title();44 $title = apply_filters('the_title', $title);45 $title = apply_filters('the_title_rss', $title);46 echo $title;47 }48 49 42 function get_the_title($id = 0) { 50 43 global $post, $wpdb; … … 59 52 return $title; 60 53 } 54 55 function get_the_guid( $id = 0 ) { 56 global $post, $wpdb; 57 $guid = $post->guid; 58 59 if ( 0 != $id ) 60 $title = $wpdb->get_var("SELECT guid FROM $wpdb->posts WHERE ID = $id"); 61 $guid = apply_filters('get_the_guid', $guid); 62 return $guid; 63 } 64 65 function the_guid( $id = 0 ) { 66 echo get_the_guid(); 67 } 68 61 69 62 70 function the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') { … … 65 73 $content = str_replace(']]>', ']]>', $content); 66 74 echo $content; 67 }68 69 function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {70 $content = get_the_content($more_link_text, $stripteaser, $more_file);71 $content = apply_filters('the_content', $content);72 if ($cut && !$encode_html) {73 $encode_html = 2;74 }75 if ($encode_html == 1) {76 $content = wp_specialchars($content);77 $cut = 0;78 } elseif ($encode_html == 0) {79 $content = make_url_footnote($content);80 } elseif ($encode_html == 2) {81 $content = strip_tags($content);82 }83 if ($cut) {84 $blah = explode(' ', $content);85 if (count($blah) > $cut) {86 $k = $cut;87 $use_dotdotdot = 1;88 } else {89 $k = count($blah);90 $use_dotdotdot = 0;91 }92 for ($i=0; $i<$k; $i++) {93 $excerpt .= $blah[$i].' ';94 }95 $excerpt .= ($use_dotdotdot) ? '...' : '';96 $content = $excerpt;97 }98 $content = str_replace(']]>', ']]>', $content);99 echo $content;100 75 } 101 76 … … 141 116 function the_excerpt() { 142 117 echo apply_filters('the_excerpt', get_the_excerpt()); 143 }144 145 function the_excerpt_rss($cut = 0, $encode_html = FALSE) {146 $output = get_the_excerpt(true);147 148 $output = convert_chars($output);149 if ($cut && !$encode_html) {150 $encode_html = 2;151 }152 if ($encode_html == 1) {153 $output = wp_specialchars($output);154 $cut = 0;155 } elseif ($encode_html === 0) {156 $output = make_url_footnote($output);157 } elseif ($encode_html == 2) {158 $output = strip_tags($output);159 $output = str_replace('&', '&', $output);160 }161 if ($cut) {162 $excerpt = '';163 $blah = explode(' ', $output);164 if (count($blah) > $cut) {165 $k = $cut;166 $use_dotdotdot = 1;167 } else {168 $k = count($blah);169 $use_dotdotdot = 0;170 }171 for ($i=0; $i<$k; $i++) {172 $excerpt .= $blah[$i].' ';173 }174 $excerpt .= ($use_dotdotdot) ? '...' : '';175 $output = $excerpt;176 }177 $output = str_replace(']]>', ']]>', $output);178 echo apply_filters('the_excerpt_rss', $output);179 118 } 180 119 -
trunk/wp-includes/template-functions.php
r1967 r2068 20 20 require($curpath . 'comment-functions.php'); 21 21 22 require($curpath . 'feed-functions.php'); 23 22 24 ?> -
trunk/wp-includes/vars.php
r2059 r2068 159 159 160 160 add_filter('comment_excerpt', 'convert_chars'); 161 add_filter('the_excerpt_rss', 'convert_chars'); 161 162 162 163 // Places to balance tags on input -
trunk/wp-rdf.php
r1888 r2068 47 47 <?php the_category_rss('rdf') ?> 48 48 <?php if (get_settings('rss_use_excerpt')) : ?> 49 <description><?php the_excerpt_rss( get_settings('rss_excerpt_length'), 2) ?></description>49 <description><?php the_excerpt_rss() ?></description> 50 50 <?php else : ?> 51 51 <description><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length'), 2) ?></description> -
trunk/wp-rss.php
r1888 r2068 27 27 if (get_settings('rss_use_excerpt')) { 28 28 ?> 29 <description><?php the_excerpt_rss( get_settings('rss_excerpt_length'), 2) ?></description>29 <description><?php the_excerpt_rss() ?></description> 30 30 <?php 31 31 } else { // use content -
trunk/wp-rss2.php
r2046 r2068 13 13 <?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.'>'; ?> 14 14 15 <!-- generator="wordpress/<?php echo $wp_version?>" -->15 <!-- generator="wordpress/<?php bloginfo_rss('version') ?>" --> 16 16 <rss version="2.0" 17 17 xmlns:content="http://purl.org/rss/1.0/modules/content/" … … 20 20 21 21 <channel> 22 <title><?php bloginfo_rss('name') ?></title>22 <title><?php bloginfo_rss('name'); ?></title> 23 23 <link><?php bloginfo_rss('url') ?></link> 24 24 <description><?php bloginfo_rss("description") ?></description> 25 <copyright>Copyright <?php echo mysql2date('Y', get_lastpostdate()); ?></copyright>26 25 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), 0); ?></pubDate> 27 <generator>http://wordpress.org/?v=<?php echo $wp_version?></generator>26 <generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator> 28 27 29 28 <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?> … … 32 31 <link><?php permalink_single_rss() ?></link> 33 32 <comments><?php comments_link(); ?></comments> 34 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', $post->post_date_gmt, 0); ?></pubDate>33 <pubDate><?php the_time('D, d M Y H:i:s +0000'); ?></pubDate> 35 34 <?php the_category_rss() ?> 35 36 36 <guid><?php the_permalink($id); ?></guid> 37 37 <?php if (get_settings('rss_use_excerpt')) : ?> 38 <description><?php the_excerpt_rss( '', 2) ?></description>38 <description><?php the_excerpt_rss() ?></description> 39 39 <?php else : ?> 40 <description><?php the_excerpt_rss(get_settings('rss_excerpt_length'), 2) ?></description> 41 <?php if ( strlen( $post->post_content ) ) : ?> 40 <description><?php the_excerpt_rss() ?></description> 42 41 <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded> 43 <?php else : ?>44 <content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded>45 <?php endif; ?>46 42 <?php endif; ?> 47 43 <wfw:commentRSS><?php echo comments_rss(); ?></wfw:commentRSS> 48 <?php 49 $custom_fields = get_post_custom(); 50 if( is_array( $custom_fields ) ) { 51 while( list( $key, $val ) = each( $custom_fields ) ) { 52 if( $key == 'enclosure' ) { 53 if (is_array($val)) { 54 foreach($val as $enc) { 55 $enclosure = split( "\n", $enc ); 56 print "<enclosure url='".trim( $enclosure[ 0 ] )."' length='".trim( $enclosure[ 1 ] )."' type='".trim( $enclosure[ 2 ] )."'/>\n"; 57 } 58 } 59 } 60 } 61 } 62 ?> 44 <?php rss_enclosure(); ?> 63 45 </item> 64 46 <?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
Note: See TracChangeset
for help on using the changeset viewer.