Changeset 2276
- Timestamp:
- 01/09/2010 09:31:33 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
-
bp-activity/bp-activity-templatetags.php (modified) (1 diff)
-
bp-core.php (modified) (8 diffs)
-
bp-core/bp-core-classes.php (modified) (1 diff)
-
bp-core/bp-core-wpabstraction.php (modified) (2 diffs)
-
bp-friends.php (modified) (1 diff)
-
bp-friends/bp-friends-templatetags.php (modified) (1 diff)
-
bp-messages/bp-messages-templatetags.php (modified) (2 diffs)
-
bp-themes/bp-default/_inc/css/default.css (modified) (1 diff)
-
bp-themes/bp-default/_inc/global.js (modified) (1 diff)
-
bp-themes/bp-default/activity/post-form.php (modified) (1 diff)
-
bp-themes/bp-default/functions.php (modified) (1 diff)
-
bp-themes/bp-default/members/single/member-header.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-templatetags.php
r2273 r2276 666 666 } 667 667 668 function bp_send_public_message_link() { 669 echo bp_get_send_public_message_link(); 670 } 671 function bp_get_send_public_message_link() { 672 global $bp; 673 674 return apply_filters( 'bp_get_send_public_message_link', $bp->loggedin_user->domain . $bp->activity->slug . '/?r=' . $bp->displayed_user->userdata->user_login ); 675 } 668 676 669 677 /* RSS Feed Template Tags ***************************/ -
trunk/bp-core.php
r2274 r2276 103 103 104 104 /* The domain for the user currently logged in. eg: http://domain.com/members/andy */ 105 $bp->loggedin_user->domain = bp_core_get_user_domain($current_user->ID); 105 $bp->loggedin_user->domain = bp_core_get_user_domain( $bp->loggedin_user->id ); 106 107 /* The core userdata of the user who is currently logged in. */ 108 $bp->loggedin_user->userdata = bp_core_get_core_userdata( $bp->loggedin_user->id ); 106 109 107 110 /* The user id of the user currently being viewed, set in /bp-core/bp-core-catchuri.php */ … … 109 112 110 113 /* The domain for the user currently being displayed */ 111 $bp->displayed_user->domain = bp_core_get_user_domain($displayed_user_id); 114 $bp->displayed_user->domain = bp_core_get_user_domain( $bp->displayed_user->id ); 115 116 /* The core userdata of the user who is currently being displayed */ 117 $bp->displayed_user->userdata = bp_core_get_core_userdata( $bp->displayed_user->id ); 112 118 113 119 /* The component being used eg: http://domain.com/members/andy/ [profile] */ … … 161 167 162 168 /* Used to determine if user has admin rights on current content. If the logged in user is viewing 163 their own profile and wants to delete a post on their wire, is_item_admin is used. This is a164 generic variable so it can be used inother components. It can also be modified, so when viewing a group169 their own profile and wants to delete something, is_item_admin is used. This is a 170 generic variable so it can be used by other components. It can also be modified, so when viewing a group 165 171 'is_item_admin' would be 1 if they are a group admin, 0 if they are not. */ 166 $bp->is_item_admin = bp_is_ home();172 $bp->is_item_admin = bp_is_my_profile(); 167 173 168 174 /* Used to determine if the logged in user is a moderator for the current content. */ … … 185 191 * Adds the core URIs that should run in the root of the installation. 186 192 * 187 * For example: http://example.org/search or http://example.org/members193 * For example: http://example.org/search/ or http://example.org/members/ 188 194 * 189 195 * @package BuddyPress Core … … 558 564 559 565 /** 566 * bp_core_get_core_userdata() 567 * 568 * Fetch everything in the wp_users table for a user, without any usermeta. 569 * 570 * @package BuddyPress Core 571 * @param user_id The ID of the user. 572 * @uses BP_Core_User::get_core_userdata() Performs the query. 573 */ 574 function bp_core_get_core_userdata( $user_id ) { 575 if ( empty( $user_id ) ) 576 return false; 577 578 return apply_filters( 'bp_core_get_core_userdata', BP_Core_User::get_core_userdata( $user_id ) ); 579 } 580 581 /** 560 582 * bp_core_get_root_domain() 561 583 * … … 1022 1044 $email = $ud->user_email; 1023 1045 } 1046 1047 wp_cache_set( 'bp_user_email_' . $uid, $email, 'bp' ); 1048 1024 1049 return apply_filters( 'bp_core_get_user_email', $email ); 1025 1050 } … … 1048 1073 */ 1049 1074 function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false, $deprecated = false, $with_s = false ) { 1050 global $userdata; 1051 1052 $ud = get_userdata($user_id); 1053 1054 if ( !$ud ) 1055 return false; 1056 1057 if ( function_exists( 'bp_core_get_user_displayname' ) ) { 1058 $display_name = bp_core_get_user_displayname( $user_id ); 1059 1060 if ( $with_s ) 1061 $display_name = sprintf( __( "%s's", 'buddypress' ), $display_name ); 1062 1063 } else { 1064 $display_name = $ud->display_name; 1065 } 1075 1076 $display_name = bp_core_get_user_displayname( $user_id ); 1077 1078 if ( $with_s ) 1079 $display_name = sprintf( __( "%s's", 'buddypress' ), $display_name ); 1066 1080 1067 1081 if ( $no_anchor ) … … 1102 1116 $fullname = xprofile_get_field_data( 1, $user_id ); 1103 1117 1104 if ( empty($fullname) || !$fullname) {1105 $ud = get_userdata( $user_id);1118 if ( empty($fullname) ) { 1119 $ud = get_userdata( $user_id ); 1106 1120 1107 1121 if ( !empty( $ud->display_name ) ) -
trunk/bp-core/bp-core-classes.php
r2273 r2276 358 358 return $paged_users; 359 359 } 360 361 function get_core_userdata( $user_id ) { 362 global $wpdb; 363 364 if ( !$user = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE ID = %d LIMIT 1", $user_id ) ) ) 365 return false; 366 367 return $user; 368 } 360 369 } 361 370 -
trunk/bp-core/bp-core-wpabstraction.php
r2274 r2276 33 33 34 34 if ( !function_exists( 'get_site_option' ) ) { 35 function get_site_option( $option_value ) {36 return get_option( $option_value );35 function get_site_option( $option_value, $default = false ) { 36 return get_option( $option_value, $default ); 37 37 } 38 38 } … … 51 51 52 52 if ( !function_exists( 'get_blog_option' ) ) { 53 function get_blog_option( $blog_id, $option_name ) {54 return get_option( $option_name );53 function get_blog_option( $blog_id, $option_name, $default = false ) { 54 return get_option( $option_name, $default ); 55 55 } 56 56 } -
trunk/bp-friends.php
r2223 r2276 475 475 } 476 476 477 function friends_check_friendship_status( $user_id, $possible_friend_id ) { 478 /* Returns - 'is_friend', 'not_friends', 'pending' */ 479 return BP_Friends_Friendship::check_is_friend( $user_id, $possible_friend_id ); 480 } 481 477 482 function friends_get_total_friend_count( $user_id = false ) { 478 483 global $bp; -
trunk/bp-friends/bp-friends-templatetags.php
r2198 r2276 121 121 global $bp, $friends_template; 122 122 123 $button = false; 124 125 if ( is_user_logged_in() ) { 126 127 if ( !$potential_friend_id && $friends_template->friendship->friend ) 128 $potential_friend_id = $friends_template->friendship->friend->id; 129 else if ( !$potential_friend_id && !$friends_template->friendship->friend ) 130 $potential_friend_id = $bp->displayed_user->id; 131 132 if ( $bp->loggedin_user->id == $potential_friend_id ) 133 return false; 134 135 $friend_status = BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $potential_friend_id ); 136 137 $button = '<div class="generic-button friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">'; 138 if ( 'pending' == $friend_status ) { 139 $button .= '<a class="requested" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '">' . __( 'Friendship Requested', 'buddypress' ) . '</a>'; 140 } else if ( 'is_friend' == $friend_status ) { 141 $button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id, 'friends_remove_friend' ) . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>'; 142 } else { 143 $button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id, 'friends_add_friend' ) . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" class="add">' . __('Add Friend', 'buddypress') . '</a>'; 144 } 145 $button .= '</div>'; 123 if ( !is_user_logged_in() ) 124 return false; 125 126 if ( !$potential_friend_id && $friends_template->friendship->friend ) 127 $potential_friend_id = $friends_template->friendship->friend->id; 128 else if ( !$potential_friend_id && !$friends_template->friendship->friend ) 129 $potential_friend_id = $bp->displayed_user->id; 130 131 if ( $bp->loggedin_user->id == $potential_friend_id ) 132 return false; 133 134 $friend_status = friends_check_friendship_status( $bp->loggedin_user->id, $potential_friend_id ); 135 136 $button = '<div class="generic-button friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">'; 137 if ( 'pending' == $friend_status ) { 138 $button .= '<a class="requested" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/">' . __( 'Friendship Requested', 'buddypress' ) . '</a>'; 139 } else if ( 'is_friend' == $friend_status ) { 140 $button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ) . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>'; 141 } else { 142 $button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ) . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" class="add">' . __('Add Friend', 'buddypress') . '</a>'; 146 143 } 144 $button .= '</div>'; 147 145 148 146 return apply_filters( 'bp_get_add_friend_button', $button ); -
trunk/bp-messages/bp-messages-templatetags.php
r2209 r2276 436 436 } 437 437 438 function bp_send_private_message_link() { 439 echo bp_get_send_private_message_link(); 440 } 441 function bp_get_send_private_message_link() { 442 global $bp; 443 444 return apply_filters( 'bp_get_send_public_message_link', $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . $bp->displayed_user->userdata->user_login ); 445 } 446 438 447 function bp_send_message_button() { 439 448 echo bp_get_send_message_button(); … … 445 454 return false; 446 455 447 $ud = get_userdata( $bp->displayed_user->id ); 448 449 return apply_filters( 'bp_get_send_message_button', '<div class="generic-button"><a class="send-message" title="' . __( 'Send Message', 'buddypress' ) . '" href="' . $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . $ud->user_login . '">' . __( 'Send Message', 'buddypress' ) . '</a></div>' ); 456 return apply_filters( 'bp_get_send_message_button', '<div class="generic-button"><a class="send-message" title="' . __( 'Send Message', 'buddypress' ) . '" href="' . $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . $bp->displayed_user->userdata->user_login . '">' . __( 'Send Message', 'buddypress' ) . '</a></div>' ); 450 457 } 451 458 -
trunk/bp-themes/bp-default/_inc/css/default.css
r2271 r2276 358 358 } 359 359 360 div#item-header div.generic-button {360 div#item-header div.generic-button, div#item-header a.button { 361 361 float: left; 362 362 margin: 10px 10px 0 0; -
trunk/bp-themes/bp-default/_inc/global.js
r2266 r2276 26 26 j('div#new-topic-post').hide(); 27 27 bp_filter_request( j.cookie('bp-forums-type'), j.cookie('bp-forums-filter'), 'forums', 'div.forums', j.cookie('bp-forums-page'), j.cookie('bp-forums-search-terms') ); 28 } 29 30 /* @message Compose Scrolling */ 31 if ( j.query.get('r') ) { 32 if ( j('textarea#whats-new').length ) { 33 j.scrollTo( j('textarea#whats-new'), 500, { offset:-75, easing:'easeout' } ); 34 j('textarea#whats-new').focus(); 35 } 28 36 } 29 37 -
trunk/bp-themes/bp-default/activity/post-form.php
r2188 r2276 15 15 <div id="whats-new-content"> 16 16 <div id="whats-new-textarea"> 17 <textarea name="whats-new" id="whats-new" value="" />< /textarea>17 <textarea name="whats-new" id="whats-new" value="" /><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_attr( $_GET['r'] ) ?> <?php endif; ?></textarea> 18 18 </div> 19 19 -
trunk/bp-themes/bp-default/functions.php
r2251 r2276 3 3 /* Stop the theme from killing WordPress if BuddyPress is not enabled. */ 4 4 if ( !class_exists( 'BP_Core_User' ) ) 5 return false;5 return; 6 6 7 7 /* Register the widget columns */ -
trunk/bp-themes/bp-default/members/single/member-header.php
r2191 r2276 9 9 10 10 <div id="item-buttons"> 11 <?php if ( function_exists( 'bp_add_friend_button') ) : ?>11 <?php if ( function_exists( 'bp_add_friend_button' ) ) : ?> 12 12 <?php bp_add_friend_button() ?> 13 13 <?php endif; ?> 14 14 15 <?php if ( function_exists('bp_send_message_button') ) : ?> 16 <?php bp_send_message_button() ?> 15 <?php if ( is_user_logged_in() && !bp_is_my_profile() && function_exists( 'bp_send_public_message_link' ) ) : ?> 16 <div class="generic-button" id="send-public-message"> 17 <a href="<?php bp_send_public_message_link() ?>" title="<?php _e( 'Send a public message to this user', 'buddypress' ) ?>"><?php _e( 'Send Public Message', 'buddypress' ) ?></a> 18 </div> 19 <?php endif; ?> 20 21 <?php if ( is_user_logged_in() && !bp_is_my_profile() && function_exists( 'bp_send_private_message_link' ) ) : ?> 22 <div class="generic-button" id="send-private-message"> 23 <a href="<?php bp_send_private_message_link() ?>" title="<?php _e( 'Send a private message to this user', 'buddypress' ) ?>"><?php _e( 'Send Private Message', 'buddypress' ) ?></a> 24 </div> 17 25 <?php endif; ?> 18 26 </div>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)