Ticket #6425: better-rtl-feeds.patch
File better-rtl-feeds.patch, 17.5 KB (added by , 16 years ago) |
---|
-
feed-atom-comments.php
13 13 xml:lang="<?php echo get_option('rss_language'); ?>" 14 14 <?php do_action('atom_ns'); ?> 15 15 > 16 <title type="text"><?php 16 <title type="text"><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php 17 17 if ( is_singular() ) 18 18 printf(__('Comments on: %s'), get_the_title_rss()); 19 19 elseif ( is_search() ) 20 20 printf(__('Comments for %1$s searching on %2$s'), get_bloginfo_rss( 'name' ), attribute_escape(get_search_query())); 21 21 else 22 22 printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); 23 ?>< /title>24 <subtitle type="text"><?php bloginfo_rss('description');?></subtitle>23 ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></title> 24 <subtitle type="text"><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php bloginfo_rss('description'); ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></subtitle> 25 25 26 26 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastcommentmodified('GMT')); ?></updated> 27 27 <?php the_generator( 'atom' ); ?> … … 46 46 get_post_custom($comment_post->ID); 47 47 ?> 48 48 <entry> 49 <title><?php 49 <title><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php 50 50 if ( !is_singular() ) { 51 51 $title = get_the_title($comment_post->ID); 52 52 $title = apply_filters('the_title_rss', $title); … … 54 54 } else { 55 55 printf(__('By: %s'), get_comment_author_rss()); 56 56 } 57 ?>< /title>57 ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></title> 58 58 <link rel="alternate" href="<?php comment_link(); ?>" type="<?php bloginfo_rss('html_type'); ?>" /> 59 59 60 60 <author> 61 <name><?php comment_author_rss();?></name>61 <name><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php comment_author_rss(); ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></name> 62 62 <?php if (get_comment_author_url()) echo '<uri>' . get_comment_author_url() . '</uri>'; ?> 63 63 64 64 </author> … … 69 69 <?php if (!empty($comment_post->post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?> 70 70 <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php echo get_the_password_form(); ?>]]></content> 71 71 <?php else : // post pass ?> 72 <?php if ( get_bloginfo('text_direction') == 'ltr' ) { ?> 72 73 <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php comment_text(); ?>]]></content> 74 <?php } else { ?> 75 <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<div dir="rtl"><?php comment_text(); ?></div>]]></content> 76 <?php } ?> 77 73 78 <?php endif; // post pass 74 79 do_action('comment_atom_entry', $comment->comment_ID, $comment_post->ID); 75 80 ?> -
feed-atom.php
17 17 xml:base="<?php bloginfo_rss('home') ?>/wp-atom.php" 18 18 <?php do_action('atom_ns'); ?> 19 19 > 20 21 <?php if ( get_bloginfo('text_direction') == 'ltr' ) { ?> 20 22 <title type="text"><?php bloginfo_rss('name'); wp_title_rss(); ?></title> 21 23 <subtitle type="text"><?php bloginfo_rss("description") ?></subtitle> 24 <?php } else { ?> 25 <title type="text">‫<?php bloginfo_rss('name'); wp_title_rss(); ?>‬</title> 26 <subtitle type="text">‫<?php bloginfo_rss("description") ?>‬</subtitle> 27 <?php } ?> 22 28 23 29 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT')); ?></updated> 24 30 <?php the_generator( 'atom' ); ?> … … 31 37 <?php while (have_posts()) : the_post(); ?> 32 38 <entry> 33 39 <author> 40 <?php if ( get_bloginfo('text_direction') == 'ltr' ) { ?> 34 41 <name><?php the_author() ?></name> 42 <?php } else { ?> 43 <name>‫<?php the_author() ?>‬</name> 44 <?php } ?> 35 45 <?php $author_url = get_the_author_url(); if ( !empty($author_url) ) : ?> 36 46 <uri><?php the_author_url()?></uri> 37 47 <?php endif; ?> 38 48 </author> 49 50 <?php if ( get_bloginfo('text_direction') == 'ltr' ) { ?> 39 51 <title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title> 52 <?php } else { ?> 53 <title type="<?php html_type_rss(); ?>"><![CDATA[‫<?php the_title_rss() ?>‬]]></title> 54 <?php } ?> 55 40 56 <link rel="alternate" type="text/html" href="<?php the_permalink_rss() ?>" /> 41 57 <id><?php the_guid(); ?></id> 42 58 <updated><?php echo get_post_modified_time('Y-m-d\TH:i:s\Z', true); ?></updated> 43 59 <published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published> 44 60 <?php the_category_rss('atom') ?> 61 <?php if ( get_bloginfo('text_direction') == 'ltr' ) { ?> 45 62 <summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary> 63 <?php } else { ?> 64 <summary type="<?php html_type_rss(); ?>"><![CDATA[‫<?php the_excerpt_rss(); ?>‬]]></summary> 65 <?php } ?> 66 46 67 <?php if ( !get_option('rss_use_excerpt') ) : ?> 68 <?php if ( get_bloginfo('text_direction') == 'ltr' ) { ?> 47 69 <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content> 70 <?php } else { ?> 71 <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<div dir="rtl"><?php the_content('', 0, '') ?></div>]]></content> 72 <?php } ?> 48 73 <?php endif; ?> 74 49 75 <?php atom_enclosure(); ?> 50 76 <?php do_action('atom_entry'); ?> 51 77 <link rel="replies" type="text/html" href="<?php the_permalink_rss() ?>#comments" thr:count="<?php echo get_comments_number()?>"/> -
feed-rdf.php
20 20 <?php do_action('rdf_ns'); ?> 21 21 > 22 22 <channel rdf:about="<?php bloginfo_rss("url") ?>"> 23 <title><?php bloginfo_rss('name'); wp_title_rss();?></title>23 <title><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php bloginfo_rss('name'); wp_title_rss(); ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></title> 24 24 <link><?php bloginfo_rss('url') ?></link> 25 <description><?php bloginfo_rss('description')?></description>25 <description><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php bloginfo_rss('description') ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></description> 26 26 <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></dc:date> 27 27 <?php the_generator( 'rdf' ); ?> 28 28 <sy:updatePeriod>hourly</sy:updatePeriod> … … 39 39 </channel> 40 40 <?php rewind_posts(); while (have_posts()): the_post(); ?> 41 41 <item rdf:about="<?php the_permalink_rss() ?>"> 42 <title><?php the_title_rss()?></title>42 <title><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php the_title_rss() ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></title> 43 43 <link><?php the_permalink_rss() ?></link> 44 44 <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt, false); ?></dc:date> 45 <dc:creator><?php the_author()?></dc:creator>45 <dc:creator><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php the_author() ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></dc:creator> 46 46 <?php the_category_rss('rdf') ?> 47 47 <?php if (get_option('rss_use_excerpt')) : ?> 48 <description><?php the_excerpt_rss()?></description>48 <description><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php the_excerpt_rss() ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></description> 49 49 <?php else : ?> 50 <description><?php the_content_rss('', 0, '', get_option('rss_excerpt_length'), 2) ?></description> 50 <description><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?><?php the_content_rss('', 0, '', get_option('rss_excerpt_length'), 2) ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></description> 51 <?php if ( get_bloginfo('text_direction') == 'ltr' ) { ?> 51 52 <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded> 53 <?php } else { ?> 54 <content:encoded><![CDATA[<div dir="rtl"><?php the_content('', 0, '') ?></div>]]></content:encoded> 55 <?php } ?> 56 52 57 <?php endif; ?> 53 58 <?php do_action('rdf_item'); ?> 54 59 </item> -
feed-rss.php
13 13 <?php the_generator( 'comment' ); ?> 14 14 <rss version="0.92"> 15 15 <channel> 16 <title><?php bloginfo_rss('name'); wp_title_rss();?></title>16 <title><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php bloginfo_rss('name'); wp_title_rss(); ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></title> 17 17 <link><?php bloginfo_rss('url') ?></link> 18 <description><?php bloginfo_rss('description')?></description>18 <description><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php bloginfo_rss('description') ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></description> 19 19 <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate> 20 20 <docs>http://backend.userland.com/rss092</docs> 21 21 <language><?php echo get_option('rss_language'); ?></language> … … 23 23 24 24 <?php while (have_posts()) : the_post(); ?> 25 25 <item> 26 <title><?php the_title_rss()?></title>26 <title><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php the_title_rss() ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></title> 27 27 <?php if (get_option('rss_use_excerpt')) { ?> 28 <description><![CDATA[<?php the_excerpt_rss()?>]]></description>28 <description><![CDATA[<?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php the_excerpt_rss() ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?>]]></description> 29 29 <?php } else { // use content ?> 30 <description><?php the_content_rss('', 0, '', get_option('rss_excerpt_length'))?></description>30 <description><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php the_content_rss('', 0, '', get_option('rss_excerpt_length')) ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></description> 31 31 <?php } ?> 32 32 <link><?php the_permalink_rss() ?></link> 33 33 <?php do_action('rss_item'); ?> -
feed-rss2-comments.php
15 15 xmlns:atom="http://www.w3.org/2005/Atom" 16 16 > 17 17 <channel> 18 <title><?php 18 <title><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php 19 19 if ( is_singular() ) 20 20 printf(__('Comments on: %s'), get_the_title_rss()); 21 21 elseif ( is_search() ) 22 22 printf(__('Comments for %s searching on %s'), get_bloginfo_rss( 'name' ), attribute_escape($wp_query->query_vars['s'])); 23 23 else 24 24 printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); 25 ?>< /title>25 ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></title> 26 26 <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" /> 27 27 <link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link> 28 <description><?php bloginfo_rss("description")?></description>28 <description><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php bloginfo_rss("description") ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></description> 29 29 <pubDate><?php echo gmdate('r'); ?></pubDate> 30 30 <?php the_generator( 'rss2' ); ?> 31 31 <?php do_action('commentsrss2_head'); ?> … … 35 35 get_post_custom($comment_post->ID); 36 36 ?> 37 37 <item> 38 <title><?php 38 <title><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php 39 39 if ( !is_singular() ) { 40 40 $title = get_the_title($comment_post->ID); 41 41 $title = apply_filters('the_title_rss', $title); … … 43 43 } else { 44 44 printf(__('By: %s'), get_comment_author_rss()); 45 45 } 46 ?>< /title>46 ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></title> 47 47 <link><?php comment_link() ?></link> 48 <dc:creator><?php echo get_comment_author_rss()?></dc:creator>48 <dc:creator><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php echo get_comment_author_rss() ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></dc:creator> 49 49 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></pubDate> 50 50 <guid isPermaLink="false"><?php comment_guid() ?></guid> 51 51 <?php if (!empty($comment_post->post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?> 52 <description><?php _e('Protected Comments: Please enter your password to view comments.');?></description>52 <description><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php _e('Protected Comments: Please enter your password to view comments.'); ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></description> 53 53 <content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded> 54 54 <?php else : // post pass ?> 55 <description><?php comment_text_rss() ?></description> 55 <description><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php comment_text_rss() ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></description> 56 <?php if ( get_bloginfo('text_direction') == 'ltr' ) { ?> 56 57 <content:encoded><![CDATA[<?php comment_text() ?>]]></content:encoded> 58 <?php } else { ?> 59 <content:encoded><![CDATA[<div dir="rtl"><?php comment_text() ?></div>]]></content:encoded> 60 <?php } ?> 61 57 62 <?php endif; // post pass 58 63 do_action('commentrss2_item', $comment->comment_ID, $comment_post->ID); 59 64 ?> -
feed-rss2.php
20 20 > 21 21 22 22 <channel> 23 <title><?php bloginfo_rss('name'); wp_title_rss();?></title>23 <title><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php bloginfo_rss('name'); wp_title_rss(); ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></title> 24 24 <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" /> 25 25 <link><?php bloginfo_rss('url') ?></link> 26 <description><?php bloginfo_rss("description")?></description>26 <description><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php bloginfo_rss("description") ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></description> 27 27 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate> 28 28 <?php the_generator( 'rss2' ); ?> 29 29 <language><?php echo get_option('rss_language'); ?></language> 30 30 <?php do_action('rss2_head'); ?> 31 31 <?php while( have_posts()) : the_post(); ?> 32 32 <item> 33 <title><?php the_title_rss()?></title>33 <title><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php the_title_rss() ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></title> 34 34 <link><?php the_permalink_rss() ?></link> 35 35 <comments><?php comments_link(); ?></comments> 36 36 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate> 37 <dc:creator><?php the_author()?></dc:creator>37 <dc:creator><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php the_author() ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?></dc:creator> 38 38 <?php the_category_rss() ?> 39 39 40 40 <guid isPermaLink="false"><?php the_guid(); ?></guid> 41 41 <?php if (get_option('rss_use_excerpt')) : ?> 42 <description><![CDATA[<?php the_excerpt_rss()?>]]></description>42 <description><![CDATA[<?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php the_excerpt_rss() ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?>]]></description> 43 43 <?php else : ?> 44 <description><![CDATA[<?php the_excerpt_rss()?>]]></description>44 <description><![CDATA[<?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php the_excerpt_rss() ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?>]]></description> 45 45 <?php if ( strlen( $post->post_content ) > 0 ) : ?> 46 <?php if ( get_bloginfo('text_direction') == 'ltr' ) { ?> 47 <content:encoded><![CDATA[<div dir="rtl"><?php the_content() ?></div>]]></content:encoded> 48 <?php } else { ?> 46 49 <content:encoded><![CDATA[<?php the_content() ?>]]></content:encoded> 50 <?php } ?> 51 47 52 <?php else : ?> 48 <content:encoded><![CDATA[<?php the_excerpt_rss()?>]]></content:encoded>53 <content:encoded><![CDATA[<?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?><?php the_excerpt_rss() ?><?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‬'); }?>]]></content:encoded> 49 54 <?php endif; ?> 50 55 <?php endif; ?> 51 56 <wfw:commentRss><?php echo get_post_comments_feed_link(); ?></wfw:commentRss>