Skip to:
Content

BuddyPress.org

Changeset 2678


Ignore:
Timestamp:
02/11/2010 03:48:07 PM (15 years ago)
Author:
apeatling
Message:

Moving blog and comment template loops to the backwards compatibility plugin since they are deprecated by the activity stream filters. Also moved classic template filters since the classic theme no longer exists in the core.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r2668 r2678  
    10641064}
    10651065
    1066 /**
    1067  * bp_activity_filter_template_paths()
    1068  *
    1069  * Add fallback for the bp-sn-parent theme template locations used in BuddyPress versions
    1070  * older than 1.2.
    1071  *
    1072  * @package BuddyPress Core
    1073  */
    1074 function bp_activity_filter_template_paths() {
    1075     if ( 'bp-sn-parent' != basename( TEMPLATEPATH ) && !defined( 'BP_CLASSIC_TEMPLATE_STRUCTURE' ) )
    1076         return false;
    1077 
    1078     add_filter( 'bp_activity_template_my_activity', create_function( '', 'return "activity/just-me";' ) );
    1079     add_filter( 'bp_activity_template_friends_activity', create_function( '', 'return "activity/my-friends";' ) );
    1080     add_filter( 'bp_activity_template_profile_activity_permalink', create_function( '', 'return "activity/single";' ) );
    1081 }
    1082 add_action( 'widgets_init', 'bp_activity_filter_template_paths' );
    1083 
    10841066function bp_activity_remove_data( $user_id ) {
    10851067    // Clear the user's activity from the sitewide stream and clear their activity tables
  • trunk/bp-blogs.php

    r2656 r2678  
    7575    global $wpdb, $bp, $userdata;
    7676
     77    /* Only create the bp-blogs tables if this is a multisite install */
    7778    if ( is_site_admin() && bp_core_is_multisite() ) {
    7879        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
     
    798799}
    799800
    800 /**
    801  * bp_blogs_filter_template_paths()
    802  *
    803  * Add fallback for the bp-sn-parent theme template locations used in BuddyPress versions
    804  * older than 1.2.
    805  *
    806  * @package BuddyPress Core
    807  */
    808 function bp_blogs_filter_template_paths() {
    809     if ( 'bp-sn-parent' != basename( TEMPLATEPATH ) && !defined( 'BP_CLASSIC_TEMPLATE_STRUCTURE' ) )
    810         return false;
    811 
    812     add_filter( 'bp_blogs_template_directory_blogs_setup', create_function( '', 'return "directories/blogs/index";' ) );
    813     add_filter( 'bp_blogs_template_my_blogs', create_function( '', 'return "blogs/my-blogs";' ) );
    814     add_filter( 'bp_blogs_template_recent_posts', create_function( '', 'return "blogs/recent-posts";' ) );
    815     add_filter( 'bp_blogs_template_recent_comments', create_function( '', 'return "blogs/recent-comments";' ) );
    816     add_filter( 'bp_blogs_template_create_a_blog', create_function( '', 'return "blogs/create";' ) );
    817 }
    818 add_action( 'init', 'bp_blogs_filter_template_paths' );
    819 
    820801function bp_blogs_remove_data( $user_id ) {
    821802    /* If this is regular blog, delete all data for that blog. */
  • trunk/bp-blogs/bp-blogs-templatetags.php

    r2580 r2678  
    298298    add_filter( 'bp_get_total_blog_count_for_user', 'bp_core_number_format' );
    299299
    300 /***
    301  * Technically the template loops for blog posts and comments are deprecated.
    302  * Instead you should be using the activity stream template loop and filtering
    303  * on blog posts and blog comments either with or without a user_id.
    304  *
    305  * They remain here because they are used in the bp-sn-parent theme, but they
    306  * are running on thin ice.
    307  */
    308 
    309 /**********************************************************************
    310  * User Blog Posts listing template class
    311  */
    312 
    313 class BP_Blogs_Blog_Post_Template {
    314     var $current_post = -1;
    315     var $post_count;
    316     var $posts;
    317     var $post;
    318 
    319     var $in_the_loop;
    320 
    321     var $pag_page;
    322     var $pag_num;
    323     var $pag_links;
    324     var $total_post_count;
    325 
    326     function bp_blogs_blog_post_template( $user_id, $per_page, $max ) {
    327         global $bp;
    328 
    329         if ( !$user_id )
    330             $user_id = $bp->displayed_user->id;
    331 
    332         $this->pag_page = isset( $_GET['fpage'] ) ? intval( $_GET['fpage'] ) : 1;
    333         $this->pag_num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $per_page;
    334 
    335         if ( !$this->posts = wp_cache_get( 'bp_user_posts_' . $user_id, 'bp' ) ) {
    336             $this->posts = bp_blogs_get_posts_for_user( $user_id );
    337             wp_cache_set( 'bp_user_posts_' . $user_id, $this->posts, 'bp' );
    338         }
    339 
    340         if ( !$max || $max >= (int)$this->posts['count'] )
    341             $this->total_post_count = (int)$this->posts['count'];
    342         else
    343             $this->total_post_count = (int)$max;
    344 
    345         $this->posts = array_slice( (array)$this->posts['posts'], intval( ( $this->pag_page - 1 ) * $this->pag_num), intval( $this->pag_num ) );
    346 
    347         if ( $max ) {
    348             if ( $max >= count($this->posts) )
    349                 $this->post_count = count($this->posts);
    350             else
    351                 $this->post_count = (int)$max;
    352         } else {
    353             $this->post_count = count($this->posts);
    354         }
    355 
    356         $this->pag_links = paginate_links( array(
    357             'base' => add_query_arg( 'fpage', '%#%' ),
    358             'format' => '',
    359             'total' => ceil($this->total_post_count / $this->pag_num),
    360             'current' => $this->pag_page,
    361             'prev_text' => '←',
    362             'next_text' => '→',
    363             'mid_size' => 1
    364         ));
    365     }
    366 
    367     function has_posts() {
    368         if ( $this->post_count )
    369             return true;
    370 
    371         return false;
    372     }
    373 
    374     function next_post() {
    375         $this->current_post++;
    376         $this->post = $this->posts[$this->current_post];
    377 
    378         return $this->post;
    379     }
    380 
    381     function rewind_posts() {
    382         $this->current_post = -1;
    383         if ( $this->post_count > 0 ) {
    384             $this->post = $this->posts[0];
    385         }
    386     }
    387 
    388     function user_posts() {
    389         if ( $this->current_post + 1 < $this->post_count ) {
    390             return true;
    391         } elseif ( $this->current_post + 1 == $this->post_count ) {
    392             do_action('loop_end');
    393             // Do some cleaning up after the loop
    394             $this->rewind_posts();
    395         }
    396 
    397         $this->in_the_loop = false;
    398         return false;
    399     }
    400 
    401     function the_post() {
    402         global $post;
    403 
    404         $this->in_the_loop = true;
    405         $post = $this->next_post();
    406 
    407         if ( 0 == $this->current_post ) // loop has just started
    408             do_action('loop_start');
    409     }
    410 }
    411 
    412 function bp_has_posts( $args = '' ) {
    413     global $posts_template;
    414 
    415     $defaults = array(
    416         'user_id' => false,
    417         'per_page' => 10,
    418         'max' => false
    419     );
    420 
    421     $r = wp_parse_args( $args, $defaults );
    422     extract( $r, EXTR_SKIP );
    423 
    424     $posts_template = new BP_Blogs_Blog_Post_Template( $user_id, $per_page, $max );
    425     return apply_filters( 'bp_has_posts', $posts_template->has_posts(), &$posts_template );
    426 }
    427 
    428 function bp_posts() {
    429     global $posts_template;
    430     return $posts_template->user_posts();
    431 }
    432 
    433 function bp_the_post() {
    434     global $posts_template;
    435     return $posts_template->the_post();
    436 }
    437 
    438 function bp_post_pagination_count() {
    439     global $bp, $posts_template;
    440 
    441     $from_num = bp_core_number_format( intval( ( $posts_template->pag_page - 1 ) * $posts_template->pag_num ) + 1 );
    442     $to_num = bp_core_number_format( ( $from_num + ( $posts_template->pag_num - 1 ) > $posts_template->total_post_count ) ? $posts_template->total_post_count : $from_num + ( $posts_template->pag_num - 1 ) );
    443 
    444     echo sprintf( __( 'Viewing post %s to %s (of %s posts)', 'buddypress' ), $from_num, $to_num, $posts_template->total_post_count ); ?> &nbsp;
    445     <span class="ajax-loader"></span><?php
    446 }
    447 
    448 function bp_post_pagination_links() {
    449     echo bp_get_post_pagination_links();
    450 }
    451     function bp_get_post_pagination_links() {
    452         global $posts_template;
    453 
    454         return apply_filters( 'bp_get_post_pagination_links', $posts_template->pag_links );
    455     }
    456 
    457 function bp_post_id() {
    458     echo bp_get_post_id();
    459 }
    460     function bp_get_post_id() {
    461         global $posts_template;
    462         return apply_filters( 'bp_get_post_id', $posts_template->post->ID );
    463     }
    464 
    465 function bp_post_title( $deprecated = true ) {
    466     if ( !$deprecated )
    467         bp_get_post_title();
    468     else
    469         echo bp_get_post_title();
    470 }
    471     function bp_get_post_title() {
    472         global $posts_template;
    473 
    474         return apply_filters( 'bp_get_post_title', $posts_template->post->post_title );
    475     }
    476 
    477 function bp_post_permalink() {
    478     global $posts_template;
    479 
    480     echo bp_post_get_permalink();
    481 }
    482 
    483 function bp_post_excerpt() {
    484     echo bp_get_post_excerpt();
    485 }
    486     function bp_get_post_excerpt() {
    487         global $posts_template;
    488         echo apply_filters( 'bp_get_post_excerpt', $posts_template->post->post_excerpt );
    489     }
    490 
    491 function bp_post_content() {
    492     echo bp_get_post_content();
    493 }
    494     function bp_get_post_content() {
    495         global $posts_template;
    496         $content = $posts_template->post->post_content;
    497         $content = apply_filters('the_content', $content);
    498         $content = str_replace(']]>', ']]&gt;', $content);
    499         return apply_filters( 'bp_get_post_content', $content );
    500     }
    501 
    502 function bp_post_status() {
    503     echo bp_get_post_status();
    504 }
    505     function bp_get_post_status() {
    506         global $posts_template;
    507         return apply_filters( 'bp_get_post_status', $posts_template->post->post_status );
    508     }
    509 
    510 function bp_post_date( $date_format = null, $deprecated = true ) {
    511     if ( !$date_format )
    512         $date_format = get_option('date_format');
    513 
    514     if ( !$deprecated )
    515         return bp_get_post_date( $date_format );
    516     else
    517         echo bp_get_post_date();
    518 }
    519     function bp_get_post_date( $date_format = null ) {
    520         global $posts_template;
    521 
    522         if ( !$date_format )
    523             $date_format = get_option('date_format');
    524 
    525         echo apply_filters( 'bp_get_post_date', mysql2date( $date_format, $posts_template->post->post_date ) );
    526     }
    527 
    528 function bp_post_comment_count() {
    529     echo bp_get_post_comment_count();
    530 }
    531     function bp_get_post_comment_count() {
    532         global $posts_template;
    533         return apply_filters( 'bp_get_post_comment_count', $posts_template->post->comment_count );
    534     }
    535 
    536 function bp_post_comments( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $css_class = '', $none = 'Comments Off' ) {
    537     global $posts_template, $wpdb;
    538 
    539     $number = (int)$posts_template->post->comment_count;
    540 
    541     if ( 0 == $number && 'closed' == $posts_template->postcomment_status && 'closed' == $posts_template->postping_status ) {
    542         echo '<span' . ((!empty($css_class)) ? ' class="' . $css_class . '"' : '') . '>' . $none . '</span>';
    543         return;
    544     }
    545 
    546     if ( !empty($posts_template->postpost_password) ) { // if there's a password
    547         if ( !isset($_COOKIE['wp-postpass_' . COOKIEHASH]) || $_COOKIE['wp-postpass_' . COOKIEHASH] != $posts_template->postpost_password ) {  // and it doesn't match the cookie
    548             echo __('Enter your password to view comments', 'buddypress');
    549             return;
    550         }
    551     }
    552 
    553     echo '<a href="';
    554 
    555     if ( 0 == $number )
    556         echo bp_post_get_permalink() . '#respond';
    557     else
    558         echo bp_post_get_permalink() . '#comments';
    559     echo '"';
    560 
    561     if ( !empty( $css_class ) ) {
    562         echo ' class="'.$css_class.'" ';
    563     }
    564     $title = attribute_escape( $posts_template->post->post_title );
    565 
    566     echo apply_filters( 'comments_popup_link_attributes', '' );
    567 
    568     echo ' title="' . sprintf( __('Comment on %s', 'buddypress'), $title ) . '">';
    569 
    570     if ( 1 == $number )
    571         printf( __( '%d Comment', 'buddypress' ), $number );
    572     else
    573         printf( __( '%d Comments', 'buddypress' ), $number );
    574 
    575     echo '</a>';
    576 }
    577 
    578 function bp_post_author( $deprecated = true ) {
    579     if ( !$deprecated )
    580         return bp_get_post_author();
    581     else
    582         echo bp_get_post_author();
    583 }
    584     function bp_get_post_author() {
    585         global $posts_template;
    586 
    587         return apply_filters( 'bp_get_post_author', bp_core_get_userlink( $posts_template->post->post_author ) );
    588     }
    589 
    590 function bp_post_category( $separator = '', $parents = '', $post_id = false, $deprecated = true ) {
    591     global $posts_template;
    592 
    593     if ( !$deprecated )
    594         return bp_get_post_category( $separator, $parents, $post_id );
    595     else
    596         echo bp_get_post_category();
    597 }
    598     function bp_get_post_category( $separator = '', $parents = '', $post_id = false ) {
    599         global $posts_template;
    600 
    601         if ( !$post_id )
    602             $post_id = $posts_template->post->ID;
    603 
    604         return apply_filters( 'bp_get_post_category', get_the_category_list( $separator, $parents, $post_id ) );
    605     }
    606 
    607 function bp_post_tags( $before = '', $sep = ', ', $after = '' ) {
    608     global $posts_template, $wpdb;
    609 
    610     /* Disabling this for now as it's too expensive and there is no global tags directory */
    611     return false;
    612 
    613     switch_to_blog( $posts_template->post->blog_id );
    614     $terms = bp_post_get_term_list( $before, $sep, $after );
    615     restore_current_blog();
    616 }
    617 
    618 function bp_post_blog_id() {
    619     echo bp_get_post_blog_id();
    620 }
    621     function bp_get_post_blog_id() {
    622         global $posts_template;
    623 
    624         return apply_filters( 'bp_get_post_blog_id', $posts_template->post->blog_id );
    625     }
    626 
    627 function bp_post_blog_name() {
    628     echo bp_get_post_blog_name();
    629 }
    630     function bp_get_post_blog_name() {
    631         global $posts_template;
    632         return apply_filters( 'bp_get_post_blog_name', get_blog_option( $posts_template->post->blog_id, 'blogname' ) );
    633     }
    634 
    635 function bp_post_blog_permalink() {
    636     echo bp_get_post_blog_permalink();
    637 }
    638     function bp_get_post_blog_permalink() {
    639         global $posts_template;
    640         return apply_filters( 'bp_get_post_blog_permalink', get_blog_option( $posts_template->post->blog_id, 'siteurl' ) );
    641     }
    642 
    643 function bp_post_get_permalink( $post = null, $blog_id = null ) {
    644     global $current_blog, $posts_template;
    645 
    646     if ( !$post )
    647         $post = $posts_template->post;
    648 
    649     if ( !$blog_id )
    650         $blog_id = $posts_template->post->blog_id;
    651 
    652     if ( !$post || !$blog_id )
    653         return false;
    654 
    655     $rewritecode = array(
    656         '%year%',
    657         '%monthnum%',
    658         '%day%',
    659         '%hour%',
    660         '%minute%',
    661         '%second%',
    662         $leavename? '' : '%postname%',
    663         '%post_id%',
    664         '%category%',
    665         '%author%',
    666         $leavename? '' : '%pagename%',
    667     );
    668 
    669     if ( 'page' == $post->post_type )
    670         return get_page_link($post->ID, $leavename);
    671     else if ( 'attachment' == $post->post_type )
    672         return get_attachment_link($post->ID);
    673 
    674     $permalink = get_blog_option( $blog_id, 'permalink_structure' );
    675     $site_url = get_blog_option( $blog_id, 'siteurl' );
    676 
    677     if ( '' != $permalink && !in_array($post->post_status, array('draft', 'pending')) ) {
    678         $unixtime = strtotime($post->post_date);
    679 
    680         $category = '';
    681         if ( false !== strpos($permalink, '%category%') ) {
    682             $cats = get_the_category($post->ID);
    683             if ( $cats )
    684                 usort($cats, '_usort_terms_by_ID'); // order by ID
    685             $category = $cats[0]->slug;
    686             if ( $parent=$cats[0]->parent )
    687                 $category = get_category_parents($parent, FALSE, '/', TRUE) . $category;
    688 
    689             // show default category in permalinks, without
    690             // having to assign it explicitly
    691             if ( empty($category) ) {
    692                 $default_category = get_category( get_option( 'default_category' ) );
    693                 $category = is_wp_error( $default_category ) ? '' : $default_category->slug;
    694             }
    695         }
    696 
    697         $author = '';
    698         if ( false !== strpos($permalink, '%author%') ) {
    699             $authordata = get_userdata($post->post_author);
    700             $author = $authordata->user_nicename;
    701         }
    702 
    703         $date = explode(" ",date('Y m d H i s', $unixtime));
    704         $rewritereplace =
    705         array(
    706             $date[0],
    707             $date[1],
    708             $date[2],
    709             $date[3],
    710             $date[4],
    711             $date[5],
    712             $post->post_name,
    713             $post->ID,
    714             $category,
    715             $author,
    716             $post->post_name,
    717         );
    718         $permalink = $site_url . str_replace($rewritecode, $rewritereplace, $permalink);
    719         $permalink = user_trailingslashit($permalink, 'single');
    720         return apply_filters('post_link', $permalink, $post);
    721     } else { // if they're not using the fancy permalink option
    722         $permalink = $site_url . '/?p=' . $post->ID;
    723         return apply_filters('post_link', $permalink, $post);
    724     }
    725 }
    726 
    727 function bp_post_get_term_list( $before = '', $sep = '', $after = '' ) {
    728     global $posts_template;
    729 
    730     $terms = get_the_terms( $posts_template->post->ID, 'post_tag' );
    731 
    732     if ( is_wp_error($terms) )
    733         return $terms;
    734 
    735     if ( empty( $terms ) )
    736         return false;
    737 
    738     foreach ( (array)$terms as $term ) {
    739         $link = get_blog_option( BP_ROOT_BLOG, 'siteurl') . '/tag/' . $term->slug;
    740         $link = apply_filters('term_link', $link);
    741 
    742         $term_links[] = '<a href="' . $link . '" rel="tag">' . $term->name . '</a>';
    743     }
    744 
    745     $term_links = apply_filters( "term_links-$taxonomy", $term_links );
    746 
    747     echo $before . join($sep, $term_links) . $after;
    748 }
    749 
    750 
    751 /**********************************************************************
    752  * User Blog Comments listing template class
    753  */
    754 
    755 class BP_Blogs_Post_Comment_Template {
    756     var $current_comment = -1;
    757     var $comment_count;
    758     var $comments;
    759     var $comment;
    760 
    761     var $in_the_loop;
    762 
    763     var $pag_page;
    764     var $pag_num;
    765     var $pag_links;
    766     var $total_comment_count;
    767 
    768     function bp_blogs_post_comment_template( $user_id, $per_page, $max ) {
    769         global $bp;
    770 
    771         if ( !$user_id )
    772             $user_id = $bp->displayed_user->id;
    773 
    774         $this->pag_page = isset( $_GET['compage'] ) ? intval( $_GET['compage'] ) : 1;
    775         $this->pag_num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $per_page;
    776 
    777         if ( !$this->comments = wp_cache_get( 'bp_user_comments_' . $user_id, 'bp' ) ) {
    778             $this->comments = bp_blogs_get_comments_for_user( $user_id );
    779             wp_cache_set( 'bp_user_comments_' . $user_id, $this->comments, 'bp' );
    780         }
    781 
    782         if ( !$max || $max >= (int)$this->comments['count'] )
    783             $this->total_comment_count = (int)$this->comments['count'];
    784         else
    785             $this->total_comment_count = (int)$max;
    786 
    787         $this->comments = array_slice( (array)$this->comments['comments'], intval( ( $this->pag_page - 1 ) * $this->pag_num), intval( $this->pag_num ) );
    788 
    789         if ( $max ) {
    790             if ( $max >= count($this->comments) )
    791                 $this->comment_count = count($this->comments);
    792             else
    793                 $this->comment_count = (int)$max;
    794         } else {
    795             $this->comment_count = count($this->comments);
    796         }
    797 
    798         $this->pag_links = paginate_links( array(
    799             'base' => add_query_arg( 'compage', '%#%' ),
    800             'format' => '',
    801             'total' => ceil($this->total_comment_count / $this->pag_num),
    802             'current' => $this->pag_page,
    803             'prev_text' => '&laquo;',
    804             'next_text' => '&raquo;',
    805             'mid_size' => 1
    806         ));
    807 
    808     }
    809 
    810     function has_comments() {
    811         if ( $this->comment_count )
    812             return true;
    813 
    814         return false;
    815     }
    816 
    817     function next_comment() {
    818         $this->current_comment++;
    819         $this->comment = $this->comments[$this->current_comment];
    820 
    821         return $this->comment;
    822     }
    823 
    824     function rewind_comments() {
    825         $this->current_comment = -1;
    826         if ( $this->comment_count > 0 ) {
    827             $this->comment = $this->comments[0];
    828         }
    829     }
    830 
    831     function user_comments() {
    832         if ( $this->current_comment + 1 < $this->comment_count ) {
    833             return true;
    834         } elseif ( $this->current_comment + 1 == $this->comment_count ) {
    835             do_action('loop_end');
    836             // Do some cleaning up after the loop
    837             $this->rewind_comments();
    838         }
    839 
    840         $this->in_the_loop = false;
    841         return false;
    842     }
    843 
    844     function the_comment() {
    845         global $comment;
    846 
    847         $this->in_the_loop = true;
    848         $comment = $this->next_comment();
    849 
    850         if ( 0 == $this->current_comment ) // loop has just started
    851             do_action('loop_start');
    852     }
    853 }
    854 
    855 function bp_has_comments( $args = '' ) {
    856     global $comments_template;
    857 
    858     $defaults = array(
    859         'user_id' => false,
    860         'per_page' => 10,
    861         'max' => false
    862     );
    863 
    864     $r = wp_parse_args( $args, $defaults );
    865     extract( $r, EXTR_SKIP );
    866 
    867     $comments_template = new BP_Blogs_Post_Comment_Template( $user_id, $per_page, $max );
    868     return apply_filters( 'bp_has_comments', $comments_template->has_comments(), &$comments_template );
    869 }
    870 
    871 function bp_comments() {
    872     global $comments_template;
    873     return $comments_template->user_comments();
    874 }
    875 
    876 function bp_the_comment() {
    877     global $comments_template;
    878     return $comments_template->the_comment();
    879 }
    880 
    881 function bp_comments_pagination() {
    882     echo bp_get_comments_pagination();
    883 }
    884     function bp_get_comments_pagination() {
    885         global $comments_template;
    886 
    887         return apply_filters( 'bp_get_comments_pagination', $comments_template->pag_links );
    888     }
    889 
    890 function bp_comment_id() {
    891     echo bp_get_comment_id();
    892 }
    893     function bp_get_comment_id() {
    894         global $comments_template;
    895         echo apply_filters( 'bp_get_comment_id', $comments_template->comment->comment_ID );
    896     }
    897 
    898 function bp_comment_post_permalink( $depricated = true ) {
    899     if ( !$depricated )
    900         return bp_get_comment_post_permalink();
    901     else
    902         echo bp_get_comment_post_permalink();
    903 }
    904     function bp_get_comment_post_permalink() {
    905         global $comments_template;
    906 
    907         return apply_filters( 'bp_get_comment_post_permalink', bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID );
    908     }
    909 
    910 function bp_comment_post_title( $deprecated = true ) {
    911     if ( !$deprecated )
    912         return bp_get_comment_post_title();
    913     else
    914         echo bp_get_comment_post_title();
    915 }
    916     function bp_get_comment_post_title( $deprecated = true ) {
    917         global $comments_template;
    918 
    919         return apply_filters( 'bp_get_comment_post_title', $comments_template->comment->post->post_title );
    920     }
    921 
    922 function bp_comment_author( $deprecated = true ) {
    923     global $comments_template;
    924 
    925     if ( !$deprecated )
    926         return bp_get_comment_author();
    927     else
    928         echo bp_get_comment_author();
    929 }
    930     function bp_get_comment_author() {
    931         global $comments_template;
    932 
    933         return apply_filters( 'bp_get_comment_author', bp_core_get_userlink( $comments_template->comment->user_id ) );
    934     }
    935 
    936 function bp_comment_content() {
    937     echo bp_get_comment_content();
    938 }
    939     function bp_get_comment_content() {
    940         global $comments_template;
    941         $content = $comments_template->comment->comment_content;
    942         $content = apply_filters('the_content', $content);
    943         $content = str_replace(']]>', ']]&gt;', $content);
    944         echo apply_filters( 'bp_get_comment_content', $content );
    945     }
    946 
    947 function bp_comment_date( $date_format = null, $deprecated = true ) {
    948     if ( !$date_format )
    949         $date_format = get_option('date_format');
    950 
    951     if ( !$deprecated )
    952         return bp_get_comment_date( $date_format );
    953     else
    954         echo bp_get_comment_date( $date_format );
    955 }
    956     function bp_get_comment_date( $date_format = null ) {
    957         global $comments_template;
    958 
    959         if ( !$date_format )
    960             $date_format = get_option('date_format');
    961 
    962         return apply_filters( 'bp_get_comment_date', mysql2date( $date_format, $comments_template->comment->comment_date ) );
    963     }
    964 
    965 function bp_comment_blog_permalink( $deprecated = true ) {
    966     if ( !$deprecated )
    967         return bp_get_comment_blog_permalink();
    968     else
    969         echo bp_get_comment_blog_permalink();
    970 }
    971     function bp_get_comment_blog_permalink() {
    972         global $comments_template;
    973 
    974         return apply_filters( 'bp_get_comment_blog_permalink', get_blog_option( $comments_template->comment->blog_id, 'siteurl' ) );
    975     }
    976 
    977 function bp_comment_blog_name( $deprecated = true ) {
    978     global $comments_template;
    979 
    980     if ( !$deprecated )
    981         return bp_get_comment_blog_permalink();
    982     else
    983         echo bp_get_comment_blog_permalink();
    984 }
    985     function bp_get_comment_blog_name( $deprecated = true ) {
    986         global $comments_template;
    987 
    988         return apply_filters( 'bp_get_comment_blog_name', get_blog_option( $comments_template->comment->blog_id, 'blogname' ) );
    989     }
    990 
    991300
    992301/* Blog registration template tags */
  • trunk/bp-core.php

    r2657 r2678  
    19081908
    19091909/**
    1910  * bp_core_filter_template_paths()
    1911  *
    1912  * Add fallback for the bp-sn-parent theme template locations used in BuddyPress versions
    1913  * older than 1.2.
    1914  *
    1915  * @package BuddyPress Core
    1916  */
    1917 function bp_core_filter_template_paths() {
    1918     if ( 'bp-sn-parent' != basename( TEMPLATEPATH ) && !defined( 'BP_CLASSIC_TEMPLATE_STRUCTURE' ) )
    1919         return false;
    1920 
    1921     add_filter( 'bp_core_template_directory_members', create_function( '', 'return "directories/members/index";' ) );
    1922     add_filter( 'bp_core_template_plugin', create_function( '', 'return "plugin-template";' ) );
    1923 }
    1924 add_action( 'init', 'bp_core_filter_template_paths' );
    1925 
    1926 /**
    19271910 * bp_core_filter_parent_theme()
    19281911 *
  • trunk/bp-forums.php

    r2661 r2678  
    521521add_filter( 'user_has_cap', 'bp_forums_filter_caps' );
    522522
    523 /**
    524  * bp_forums_filter_template_paths()
    525  *
    526  * Add fallback for the bp-sn-parent theme template locations used in BuddyPress versions
    527  * older than 1.2.
    528  *
    529  * @package BuddyPress Core
    530  */
    531 function bp_forums_filter_template_paths() {
    532     if ( 'bp-sn-parent' != basename( TEMPLATEPATH ) && !defined( 'BP_CLASSIC_TEMPLATE_STRUCTURE' ) )
    533         return false;
    534 
    535     add_filter( 'bp_forums_template_directory_forums_setup', create_function( '', 'return "directories/forums/index";' ) );
    536 }
    537 add_action( 'init', 'bp_forums_filter_template_paths' );
    538 
    539523
    540524/********************************************************************************
  • trunk/bp-friends.php

    r2656 r2678  
    594594}
    595595
    596 /**
    597  * friends_filter_template_paths()
    598  *
    599  * Add fallback for the bp-sn-parent theme template locations used in BuddyPress versions
    600  * older than 1.2.
    601  *
    602  * @package BuddyPress Core
    603  */
    604 function friends_filter_template_paths() {
    605     if ( 'bp-sn-parent' != basename( TEMPLATEPATH ) && !defined( 'BP_CLASSIC_TEMPLATE_STRUCTURE' ) )
    606         return false;
    607 
    608     add_filter( 'friends_template_my_friends', create_function( '', 'return "friends/index";' ) );
    609     add_filter( 'friends_template_requests', create_function( '', 'return "friends/requests";' ) );
    610 }
    611 add_action( 'init', 'friends_filter_template_paths' );
    612 
    613596function friends_remove_data( $user_id ) {
    614597    BP_Friends_Friendship::delete_all_for_user($user_id);
  • trunk/bp-groups.php

    r2675 r2678  
    25262526/*** Group Cleanup Functions ****************************************************/
    25272527
    2528 /**
    2529  * groups_filter_template_paths()
    2530  *
    2531  * Add fallback for the bp-sn-parent theme template locations used in BuddyPress versions
    2532  * older than 1.2.
    2533  *
    2534  * @package BuddyPress Core
    2535  */
    2536 function groups_filter_template_paths() {
    2537     if ( 'bp-sn-parent' != basename( TEMPLATEPATH ) && !defined( 'BP_CLASSIC_TEMPLATE_STRUCTURE' ) )
    2538         return false;
    2539 
    2540     add_filter( 'groups_template_directory_groups', create_function( '', 'return "directories/groups/index";' ) );
    2541     add_filter( 'groups_template_my_groups', create_function( '', 'return "groups/index";' ) );
    2542     add_filter( 'groups_template_group_invites', create_function( '', 'return "groups/invites";' ) );
    2543     add_filter( 'groups_template_group_admin', create_function( '', 'return "groups/single/admin";' ) );
    2544     add_filter( 'groups_template_group_forum_topic_edit', create_function( '', 'return "groups/single/forum/edit";' ) );
    2545     add_filter( 'groups_template_group_forum_topic', create_function( '', 'return "groups/single/forum/topic";' ) );
    2546     add_filter( 'groups_template_group_forum', create_function( '', 'return "groups/single/forum/index";' ) );
    2547     add_filter( 'groups_template_group_leave', create_function( '', 'return "groups/single/leave-confirm";' ) );
    2548     add_filter( 'groups_template_group_request_membership', create_function( '', 'return "groups/single/request-membership";' ) );
    2549     add_filter( 'groups_template_group_invite', create_function( '', 'return "groups/single/send-invite";' ) );
    2550     add_filter( 'groups_template_group_members', create_function( '', 'return "groups/single/members";' ) );
    2551     add_filter( 'groups_template_group_admin_settings', create_function( '', 'return "groups/single/admin";' ) );
    2552     add_filter( 'groups_template_group_admin_avatar', create_function( '', 'return "groups/single/admin";' ) );
    2553     add_filter( 'groups_template_group_admin_manage_members', create_function( '', 'return "groups/single/admin";' ) );
    2554     add_filter( 'groups_template_group_admin_requests', create_function( '', 'return "groups/single/admin";' ) );
    2555     add_filter( 'groups_template_group_admin_delete_group', create_function( '', 'return "groups/single/admin";' ) );
    2556 }
    2557 add_action( 'init', 'groups_filter_template_paths' );
    2558 
    25592528function groups_remove_data_for_user( $user_id ) {
    25602529    BP_Groups_Member::delete_all_for_user($user_id);
  • trunk/bp-messages.php

    r2656 r2678  
    571571}
    572572
    573 /**
    574  * messages_filter_template_paths()
    575  *
    576  * Add fallback for the bp-sn-parent theme template locations used in BuddyPress versions
    577  * older than 1.2.
    578  *
    579  * @package BuddyPress Core
    580  */
    581 function messages_filter_template_paths() {
    582     if ( 'bp-sn-parent' != basename( TEMPLATEPATH ) && !defined( 'BP_CLASSIC_TEMPLATE_STRUCTURE' ) )
    583         return false;
    584 
    585     add_filter( 'messages_template_compose', create_function( '', 'return "messages/compose";' ) );
    586     add_filter( 'messages_template_sentbox', create_function( '', 'return "messages/sentbox";' ) );
    587     add_filter( 'messages_template_inbox', create_function( '', 'return "messages/index";' ) );
    588     add_filter( 'messages_template_notices', create_function( '', 'return "messages/notices";' ) );
    589     add_filter( 'messages_template_view_message', create_function( '', 'return "messages/view";' ) );
    590 }
    591 add_action( 'init', 'messages_filter_template_paths' );
    592 
    593573
    594574/********************************************************************************
  • trunk/bp-themes/bp-default/_inc/css/default.css

    r2647 r2678  
    767767        }
    768768            form.standard-form#signup_form div.submit { float: right; }
    769             form.standard-form#signup_form div.signup-avatar { margin-right: 15px; }
     769            div#signup-avatar img { margin: 0 15px 10px 0; }
    770770
    771771    form.standard-form textarea {
  • trunk/bp-xprofile.php

    r2668 r2678  
    908908add_action( 'bp_activity_screen_single_activity_permalink', 'xprofile_remove_screen_notifications' );
    909909
    910 /**
    911  * xprofile_filter_template_paths()
    912  *
    913  * Add fallback for the bp-sn-parent theme template locations used in BuddyPress versions
    914  * older than 1.2.
    915  *
    916  * @package BuddyPress Core
    917  */
    918 function xprofile_filter_template_paths() {
    919     if ( 'bp-sn-parent' != basename( TEMPLATEPATH ) && !defined( 'BP_CLASSIC_TEMPLATE_STRUCTURE' ) )
    920         return false;
    921 
    922     add_filter( 'xprofile_template_display_profile', create_function( '', 'return "profile/index";' ) );
    923     add_filter( 'xprofile_template_edit_profile', create_function( '', 'return "profile/edit";' ) );
    924     add_filter( 'xprofile_template_change_avatar', create_function( '', 'return "profile/change-avatar";' ) );
    925 }
    926 add_action( 'init', 'xprofile_filter_template_paths' );
    927910
    928911/**
Note: See TracChangeset for help on using the changeset viewer.