Skip to:
Content

BuddyPress.org

Ticket #172: buddypress_l18n_blogs_theme.patch

File buddypress_l18n_blogs_theme.patch, 8.7 KB (added by GIGALinux, 16 years ago)

Patch for blogs themes

  • bp-blogs/bp-blogs-templatetags.php

     
    220220        return $posts_template->the_post();
    221221}
    222222
    223 function bp_post_title() {
     223function bp_post_title( $echo = true ) {
    224224        global $posts_template;
    225         echo $posts_template->post->post_title;
     225       
     226        if ( $echo == true )
     227                echo $posts_template->post->post_title;
     228        else
     229                return $posts_template->post->post_title;
    226230}
    227231
    228232function bp_post_permalink() {
     
    248252        echo $posts_template->post->post_status;       
    249253}
    250254
    251 function bp_post_date( $date_format = null ) {
     255function bp_post_date( $date_format = null, $echo = true ) {
    252256        global $posts_template;
    253257       
    254258        if ( !$date_format )
    255259                $date_format = get_option('date_format');
    256260               
    257         echo mysql2date( $date_format, $posts_template->post->post_date );
     261        if ( $echo == true )
     262                echo mysql2date( $date_format, $posts_template->post->post_date );
     263        else
     264                return mysql2date( $date_format, $posts_template->post->post_date );
    258265}
    259266
    260267function bp_post_comment_count() {
     
    299306        echo '</a>';
    300307}
    301308
    302 function bp_post_author() {
     309function bp_post_author( $echo = true ) {
    303310        global $posts_template;
    304         echo bp_core_get_userlink( $posts_template->post->post_author );       
     311       
     312        if( $echo == true)
     313                echo bp_core_get_userlink( $posts_template->post->post_author );
     314        else
     315                return bp_core_get_userlink( $posts_template->post->post_author );
    305316}
    306317
    307318function bp_post_id() {
     
    309320        echo $posts_template->post->ID;
    310321}
    311322
    312 function bp_post_category( $separator = '', $parents='', $post_id = false ) {
     323function bp_post_category( $separator = '', $parents='', $post_id = false, $echo = true ) {
    313324        global $posts_template;
    314         echo get_the_category_list($separator, $parents, $posts_template->post->ID );   
     325       
     326        if ( $echo == true )
     327                echo get_the_category_list($separator, $parents, $posts_template->post->ID );
     328        else
     329                return get_the_category_list($separator, $parents, $posts_template->post->ID );
    315330}
    316331
    317332function bp_post_tags( $before = '', $sep = ', ', $after = '' ) {
     
    555570        echo $comments_template->comment->comment_ID;
    556571}
    557572
    558 function bp_comment_post_permalink() {
     573function bp_comment_post_permalink( $echo = true ) {
    559574        global $comments_template;
    560         echo bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID;
     575       
     576        if ( $echo == true )
     577                echo bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID;
     578        else
     579                return bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID;
    561580}
    562581
    563 function bp_comment_post_title() {
     582function bp_comment_post_title( $echo = true ) {
    564583        global $comments_template;
    565         echo $comments_template->comment->post->post_title;
     584       
     585        if ( $echo == true )
     586                echo $comments_template->comment->post->post_title;
     587        else
     588                return $comments_template->comment->post->post_title;
    566589}
    567590
    568 function bp_comment_author() {
    569         global $comments_template;     
    570         echo bp_core_get_userlink( $comments_template->comment->user_id );
     591function bp_comment_author( $echo = true ) {
     592        global $comments_template;
     593       
     594        if ( $echo == true )
     595                echo bp_core_get_userlink( $comments_template->comment->user_id );
     596        else
     597                return bp_core_get_userlink( $comments_template->comment->user_id );
    571598}
    572599
    573600function bp_comment_content() {
     
    578605        echo $content;
    579606}
    580607
    581 function bp_comment_date( $date_format = null ) {
     608function bp_comment_date( $date_format = null, $echo = true ) {
    582609        global $comments_template;
    583610       
    584611        if ( !$date_format )
    585612                $date_format = get_option('date_format');
    586613               
    587         echo mysql2date( $date_format, $comments_template->comment->post->post_date );
     614        if ( $echo == true )
     615                echo mysql2date( $date_format, $comments_template->comment->post->post_date );
     616        else
     617                return mysql2date( $date_format, $comments_template->comment->post->post_date );
    588618}
    589619
    590 function bp_comment_blog_permalink() {
     620function bp_comment_blog_permalink( $echo = true ) {
    591621        global $comments_template;
    592         echo get_blog_option( $comments_template->comment->blog_id, 'siteurl' );
     622       
     623        if ( $echo == true )
     624                echo get_blog_option( $comments_template->comment->blog_id, 'siteurl' );
     625        else
     626                return get_blog_option( $comments_template->comment->blog_id, 'siteurl' );
    593627}
    594628
    595 function bp_comment_blog_name() {
     629function bp_comment_blog_name( $echo = true ) {
    596630        global $comments_template;
    597         echo get_blog_option( $comments_template->comment->blog_id, 'blogname' );
     631       
     632        if ( $echo == true )
     633                echo get_blog_option( $comments_template->comment->blog_id, 'blogname' );
     634        else
     635                return get_blog_option( $comments_template->comment->blog_id, 'blogname' );
    598636}
    599637
    600638
  • buddypress-theme/buddypress-member/blogs/create.php

     
    1212        <?php else: ?>
    1313
    1414                <div id="message" class="info">
    15                         <p>Blog registration is currently disabled</p>
     15                        <p><?php _e("Blog registration is currently disabled", "buddypress"); ?></p>
    1616                </div>
    1717
    1818        <?php endif; ?>
  • buddypress-theme/buddypress-member/blogs/recent-comments.php

     
    22</div>
    33
    44<div id="content">
    5         <h2>Recent Comments</h2>
     5        <h2><?php _e("Recent Comments", "buddypress"); ?></h2>
    66        <?php do_action( 'template_notices' ) // (error/success feedback) ?>
    77
    88        <?php if ( bp_has_comments() ) : ?>
    99                <ul id="comment-list">
    1010                <?php while ( bp_comments() ) : bp_the_comment(); ?>
    1111                        <li id="comment-<?php bp_comment_id() ?>">
    12                                 <span class="small">On <?php bp_comment_date('F jS, Y') ?> <?php bp_comment_author() ?> said:</span>
     12                                <span class="small"><?php printf(__('On %1$s %2$s said:', 'buddypress'), bp_comment_date(__('F jS, Y', 'buddypress'), false), bp_comment_author(false)); ?></span>
    1313                                <p><?php bp_comment_content() ?></p>
    14                                 <span class="small">Commented on the post <a href="<?php bp_comment_post_permalink() ?>"><?php bp_comment_post_title() ?></a> on the blog <a href="<?php bp_comment_blog_permalink() ?>"><?php bp_comment_blog_name() ?></a>.</span>
     14                                <span class="small"><?php printf(__('Commented on the post <a href="%1$s">%2$s</a> on the blog <a href="%3$s">%4$s</a>.', 'buddypress'), bp_comment_post_permalink(false), bp_comment_post_title(false), bp_comment_blog_permalink(false), bp_comment_blog_name(false)); ?></span>
    1515                        </li>
    1616                <?php endwhile; ?>
    1717                </ul>
  • buddypress-theme/buddypress-member/blogs/recent-posts.php

     
    22</div>
    33
    44<div id="content">
    5         <h2>Recent Posts</h2>
     5        <h2><?php _e("Recent Posts", "buddypress"); ?></h2>
    66        <?php do_action( 'template_notices' ) // (error/success feedback) ?>
    77
    88        <?php if ( bp_has_posts() ) : ?>
    99                <?php while ( bp_posts() ) : bp_the_post(); ?>
    1010                        <div class="post" id="post-<?php bp_post_id(); ?>">
    11                                 <h2><a href="<?php bp_post_permalink() ?>" rel="bookmark" title="Permanent Link to <?php bp_post_title(); ?>"><?php bp_post_title(); ?></a></h2>
    12                                 <p class="date"><?php bp_post_date('F jS, Y') ?> <em>in <?php bp_post_category(', ') ?> by <?php bp_post_author() ?></em></p>
    13                                 <?php bp_post_content('Read the rest of this entry &raquo;'); ?>
    14                                 <p class="postmetadata"><?php bp_post_tags('<span class="tags">', ', ', '</span>'); ?>  <span class="comments"><?php bp_post_comments('No Comments', '1 Comment', '% Comments'); ?></span></p>
     11                                <h2><a href="<?php bp_post_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'buddypress'), bp_post_title(false)); ?>"><?php bp_post_title(); ?></a></h2>
     12                                <p class="date"><?php printf(__('%1$s <em>in %2$s by %3$s</em>', 'buddypress'), bp_post_date(__('F jS, Y', 'buddypress'), false), bp_post_category(', ', '', null, false), bp_post_author(false)); ?></p>
     13                                <?php bp_post_content(__('Read the rest of this entry &raquo;')); ?>
     14                                <p class="postmetadata"><?php bp_post_tags('<span class="tags">', ', ', '</span>'); ?>  <span class="comments"><?php bp_post_comments(__('No Comments'), __('1 Comment'), __('% Comments')); ?></span></p>
    1515                                <hr />
    1616                        </div>
    1717                        <?php endwhile; ?>