Changeset 2696
- Timestamp:
- 02/12/2010 12:48:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs.php
r2695 r2696 131 131 132 132 $blogs_link = $bp->loggedin_user->domain . $bp->blogs->slug . '/'; 133 134 /* Add the subnav items to the blogs nav item */135 bp_core_new_subnav_item( array( 'name' => __( 'My Blogs', 'buddypress' ), 'slug' => 'my-blogs', 'parent_url' => $blogs_link, 'parent_slug' => $bp->blogs->slug, 'screen_function' => 'bp_blogs_screen_my_blogs', 'position' => 10, 'item_css_id' => 'my-blogs-list' ) );136 bp_core_new_subnav_item( array( 'name' => __( 'Recent Posts', 'buddypress' ), 'slug' => 'recent-posts', 'parent_url' => $blogs_link, 'parent_slug' => $bp->blogs->slug, 'screen_function' => 'bp_blogs_screen_recent_posts', 'position' => 20 ) );137 bp_core_new_subnav_item( array( 'name' => __( 'Recent Comments', 'buddypress' ), 'slug' => 'recent-comments', 'parent_url' => $blogs_link, 'parent_slug' => $bp->blogs->slug, 'screen_function' => 'bp_blogs_screen_recent_comments', 'position' => 30 ) );138 133 139 134 /* Set up the component options navigation for Blog */ -
trunk/bp-core/bp-core-templatetags.php
r2695 r2696 685 685 return apply_filters( 'bp_last_activity', $last_activity ); 686 686 } 687 688 function bp_user_firstname() { 689 echo bp_get_user_firstname(); 690 } 691 function bp_get_user_firstname( $name = false ) { 692 global $bp; 693 694 if ( !$name ) 695 $name = $bp->loggedin_user->fullname; 696 697 $fullname = (array)explode( ' ', $name ); 698 699 return apply_filters( 'bp_get_user_firstname', $fullname[0], $fullname ); 700 } 687 701 688 702 function bp_user_link() { -
trunk/bp-themes/bp-default/activity/post-form.php
r2692 r2696 17 17 <h5> 18 18 <?php if ( bp_is_group() ) : ?> 19 <?php printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_ dtheme_firstname() ) ?>19 <?php printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname() ) ?> 20 20 <?php else : ?> 21 <?php printf( __( "What's new %s?", 'buddypress' ), bp_ dtheme_firstname() ) ?>21 <?php printf( __( "What's new %s?", 'buddypress' ), bp_get_user_firstname() ) ?> 22 22 <?php endif; ?> 23 23 </h5> -
trunk/bp-themes/bp-default/functions.php
r2676 r2696 22 22 wp_enqueue_script( 'dtheme-ajax-js', get_template_directory_uri() . '/_inc/global.js', array( 'jquery' ) ); 23 23 24 function bp_dtheme_firstname( $name = false, $echo = false ) { 25 global $bp; 26 27 if ( !$name ) 28 $name = $bp->loggedin_user->fullname; 29 30 $fullname = (array)explode( ' ', $name ); 31 $firstname = apply_filters( 'bp_dtheme_firstname', $fullname[0], $fullname ); 32 33 if ( $echo ) 34 echo $firstname; 35 else 36 return $firstname; 37 } 38 24 /* Add the JS needed for blog comment replies */ 39 25 function bp_dtheme_add_blog_comments_js() { 40 26 if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); … … 42 28 add_action( 'template_redirect', 'bp_dtheme_add_blog_comments_js' ); 43 29 30 /* HTML for outputting blog comments as defined by the WP comment API */ 44 31 function bp_dtheme_blog_comments( $comment, $args, $depth ) { 45 32 $GLOBALS['comment'] = $comment; ?> … … 83 70 } 84 71 72 /* Filter the dropdown for selecting the page to show on front to include "Activity Stream" */ 85 73 function bp_dtheme_wp_pages_filter( $page_html ) { 86 74 if ( 'page_on_front' != substr( $page_html, 14, 13 ) ) … … 98 86 add_filter( 'wp_dropdown_pages', 'bp_dtheme_wp_pages_filter' ); 99 87 88 /* Hijack the saving of page on front setting to save the activity stream setting */ 100 89 function bp_dtheme_page_on_front_update( $oldvalue, $newvalue ) { 101 90 if ( !is_admin() || !is_site_admin() ) … … 109 98 add_action( 'pre_update_option_page_on_front', 'bp_dtheme_page_on_front_update', 10, 2 ); 110 99 100 /* Load the activity stream template if settings allow */ 111 101 function bp_dtheme_page_on_front_template( $template ) { 112 102 global $wp_query; … … 212 202 add_action( 'init', 'bp_dtheme_add_custom_header_support' ); 213 203 214 function bp_dtheme_remove_redundant() { 215 global $bp; 216 217 /* Remove the navigation options we do not need in this theme. */ 218 bp_core_remove_subnav_item( $bp->blogs->slug, 'my-blogs' ); 219 bp_core_remove_subnav_item( $bp->blogs->slug, 'recent-posts' ); 220 bp_core_remove_subnav_item( $bp->blogs->slug, 'recent-comments' ); 221 } 222 add_action( 'init', 'bp_dtheme_remove_redundant' ); 223 204 /* Show a notice to the user in wp-admin when the theme is activated */ 224 205 function bp_dtheme_show_notice() { ?> 225 206 <div id="message" class="updated fade"> … … 230 211 <?php 231 212 } 213 if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) 214 add_action( 'admin_notices', 'bp_dtheme_show_notice' ); 232 215 233 216 /* Add words that we need to use in JS to the end of the page so they can be translated and still used. */ … … 241 224 var bp_terms_comments = '<?php _e( "comments", "buddypress" ) ?>'; 242 225 var bp_terms_close = '<?php _e( "Close", "buddypress" ) ?>'; 243 var bp_terms_mention_explain = '<?php printf( __( "%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", "buddypress" ), '@' . bp_get_displayed_user_username(), bp_ dtheme_firstname(bp_get_displayed_user_fullname()), bp_dtheme_firstname(bp_get_displayed_user_fullname()) ); ?>';226 var bp_terms_mention_explain = '<?php printf( __( "%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", "buddypress" ), '@' . bp_get_displayed_user_username(), bp_get_user_firstname(bp_get_displayed_user_fullname()), bp_get_user_firstname(bp_get_displayed_user_fullname()) ); ?>'; 244 227 </script> 245 228 <?php … … 247 230 add_action( 'wp_footer', 'bp_dtheme_js_terms' ); 248 231 249 250 /* Show a notice when the theme is activated - workaround by Ozh (http://old.nabble.com/Activation-hook-exist-for-themes--td25211004.html) */251 if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) {252 add_action( 'admin_notices', 'bp_dtheme_show_notice' );253 }254 255 256 232 ?>
Note: See TracChangeset
for help on using the changeset viewer.