Changeset 1518
- Timestamp:
- 06/05/2009 09:29:24 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs.php
r1506 r1518 195 195 } 196 196 } 197 add_action( 'wp', 'bp_blogs_directory_blogs_setup', 5);197 add_action( 'wp', 'bp_blogs_directory_blogs_setup', 2 ); 198 198 199 199 function bp_blogs_screen_my_blogs() { … … 758 758 $member_theme = 'bpmember'; 759 759 760 add_filter( 'theme_root', 'bp_core_ set_member_theme_root' );761 add_filter( 'theme_root_uri', 'bp_core_ set_member_theme_root_uri' );760 add_filter( 'theme_root', 'bp_core_filter_buddypress_theme_root' ); 761 add_filter( 'theme_root_uri', 'bp_core_filter_buddypress_theme_root_uri' ); 762 762 763 763 return $member_theme; … … 777 777 $member_theme = 'bpmember'; 778 778 779 add_filter( 'theme_root', 'bp_core_ set_member_theme_root' );780 add_filter( 'theme_root_uri', 'bp_core_ set_member_theme_root_uri' );779 add_filter( 'theme_root', 'bp_core_filter_buddypress_theme_root' ); 780 add_filter( 'theme_root_uri', 'bp_core_filter_buddypress_theme_root_uri' ); 781 781 782 782 return $member_theme; -
trunk/bp-core.php
r1515 r1518 38 38 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-notifications.php' ); 39 39 40 /* If BP_DISABLE_ADMIN_BAR is defined, do not load the global admin bar */ 40 41 if ( !defined( 'BP_DISABLE_ADMIN_BAR') ) 41 42 require ( 'bp-core/bp-core-adminbar.php' ); … … 139 140 140 141 /* Fetch the full name for the logged in and current user */ 141 $bp->loggedin_user->fullname = bp_core_g lobal_user_fullname( $bp->loggedin_user->id );142 $bp->displayed_user->fullname = bp_core_g lobal_user_fullname( $bp->displayed_user->id );142 $bp->loggedin_user->fullname = bp_core_get_user_displayname( $bp->loggedin_user->id ); 143 $bp->displayed_user->fullname = bp_core_get_user_displayname( $bp->displayed_user->id ); 143 144 144 145 /* Used to determine if user has admin rights on current content. If the logged in user is viewing … … 158 159 } 159 160 add_action( 'plugins_loaded', 'bp_core_setup_globals', 3 ); 160 add_action( '_admin_menu', 'bp_core_setup_globals', 1 ); // must be _admin_menu hook. 161 162 function bp_core_setup_root_components() { 161 add_action( '_admin_menu', 'bp_core_setup_globals', 3 ); // must be _admin_menu hook. 162 163 164 /** 165 * bp_core_setup_root_uris() 166 * 167 * Adds the core URIs that should run in the root of the installation. 168 * 169 * For example: http://example.org/search or http://example.org/members 170 * 171 * @package BuddyPress Core 172 * @uses bp_core_add_root_component() Adds a slug to the root components global variable. 173 */ 174 function bp_core_setup_root_uris() { 163 175 /* Add core root components */ 164 176 bp_core_add_root_component( BP_MEMBERS_SLUG ); … … 168 180 bp_core_add_root_component( BP_HOME_BLOG_SLUG ); 169 181 } 170 add_action( 'plugins_loaded', 'bp_core_setup_root_components', 1 ); 171 172 function bp_core_setup_cookies() { 173 global $bp_message, $bp_message_type; 174 175 // Render any error/success feedback on the template 176 if ( $_COOKIE['bp-message'] == '' || !isset( $_COOKIE['bp-message'] ) ) 177 return false; 178 179 $bp_message = $_COOKIE['bp-message']; 180 $bp_message_type = $_COOKIE['bp-message-type']; 181 add_action( 'template_notices', 'bp_core_render_notice' ); 182 183 setcookie( 'bp-message', false, time() - 1000, COOKIEPATH ); 184 setcookie( 'bp-message-type', false, time() - 1000, COOKIEPATH ); 185 } 186 add_action( 'wp', 'bp_core_setup_cookies', 3 ); 187 182 add_action( 'plugins_loaded', 'bp_core_setup_root_uris', 2 ); 183 184 185 /** 186 * bp_core_install() 187 * 188 * Installs the core DB tables for BuddyPress. 189 * 190 * @package BuddyPress Core 191 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() 192 * @global $wpdb WordPress DB access object. 193 * @uses dbDelta() Performs a table creation, or upgrade based on what already exists in the DB. 194 * @uses bp_core_add_illegal_names() Adds illegal blog names to the WP settings 195 */ 188 196 function bp_core_install() { 189 197 global $wpdb, $bp; … … 250 258 add_action( 'admin_menu', 'bp_core_check_installed' ); 251 259 260 261 /** 262 * bp_core_setup_cookies() 263 * 264 * Checks if there is a feedback message in the WP cookie, if so, adds a "template_notices" action 265 * so that the message can be parsed into the template and displayed to the user. 266 * 267 * After the message is displayed, it removes the message vars from the cookie so that the message 268 * is not shown to the user multiple times. 269 * 270 * @package BuddyPress Core 271 * @global $bp_message The message text 272 * @global $bp_message_type The type of message (error/success) 273 * @uses setcookie() Sets a cookie value for the user. 274 */ 275 function bp_core_setup_cookies() { 276 global $bp_message, $bp_message_type; 277 278 // Render any error/success feedback on the template 279 if ( $_COOKIE['bp-message'] == '' || !isset( $_COOKIE['bp-message'] ) ) 280 return false; 281 282 $bp_message = $_COOKIE['bp-message']; 283 $bp_message_type = $_COOKIE['bp-message-type']; 284 add_action( 'template_notices', 'bp_core_render_notice' ); 285 286 setcookie( 'bp-message', false, time() - 1000, COOKIEPATH ); 287 setcookie( 'bp-message-type', false, time() - 1000, COOKIEPATH ); 288 } 289 add_action( 'init', 'bp_core_setup_cookies' ); 290 291 252 292 /** 253 293 * bp_core_add_admin_menu() … … 328 368 add_action( 'admin_menu', 'bp_core_setup_nav', 2 ); 329 369 330 function bp_core_directory_members() { 370 /** 371 * bp_core_action_directory_members() 372 * 373 * Listens to the $bp component and action variables to determine if the user is viewing the members 374 * directory page. If they are, it will set up the directory and load the members directory template. 375 * 376 * @package BuddyPress Core 377 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() 378 * @uses wp_enqueue_script() Loads a JS script into the header of the page. 379 * @uses bp_core_load_template() Loads a specific template file. 380 */ 381 function bp_core_action_directory_members() { 331 382 global $bp; 332 383 … … 339 390 } 340 391 } 341 add_action( 'wp', 'bp_core_ directory_members', 5);392 add_action( 'wp', 'bp_core_action_directory_members', 2 ); 342 393 343 394 /** … … 486 537 487 538 if ( function_exists($function) && $user_has_access && $bp->current_action == $slug && $bp->current_component == $parent_id ) 488 add_action( 'wp', $function , 3);539 add_action( 'wp', $function ); 489 540 } 490 541 … … 543 594 if ( $bp->current_component == $parent_id && !$bp->current_action ) { 544 595 if ( function_exists($function) ) { 545 add_action( 'wp', $function , 3);596 add_action( 'wp', $function ); 546 597 } 547 598 … … 635 686 global $wpdb; 636 687 637 $sql = $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_login = %s", $username ); 638 return $wpdb->get_var($sql); 639 } 640 641 /** 642 * bp_core_get_userid_from_user_login() 643 * 644 * Returns the user_id from a user login 645 * @package BuddyPress Core 646 * @param $path str Path to check. 647 * @global $wpdb WordPress DB access object. 648 * @return false on no match 649 * @return int the user ID of the matched user. 650 */ 651 function bp_core_get_userid_from_user_login( $user_login ) { 652 global $wpdb; 653 654 if ( !empty( $user_login ) ) 655 return $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_login = %s", $user_login ) ); 656 } 688 if ( !empty( $username ) ) 689 return apply_filters( 'bp_core_get_userid', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_login = %s", $username ) ) ); 690 } 691 function bp_core_get_userid_from_user_login( $deprecated ) { 692 return bp_core_get_userid( $deprecated ); 693 } 657 694 658 695 /** … … 672 709 673 710 if ( $uid == $userdata->ID ) 674 return__( 'You', 'buddypress' );711 $username = __( 'You', 'buddypress' ); 675 712 676 713 if ( !$ud = get_userdata($uid) ) 677 714 return false; 678 715 679 return $ud->user_login; 716 $username = $ud->user_login; 717 718 return apply_filters( 'bp_core_get_username', $username ); 680 719 } 681 720 … … 700 739 $ud = get_userdata($uid); 701 740 702 return $bp->root_domain . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/';741 return apply_filters( 'bp_core_get_userurl', $bp->root_domain . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/' ); 703 742 } 704 743 … … 716 755 function bp_core_get_user_email( $uid ) { 717 756 $ud = get_userdata($uid); 718 return $ud->user_email;757 return apply_filters( 'bp_core_get_user_email', $ud->user_email ); 719 758 } 720 759 … … 750 789 751 790 if ( function_exists('bp_fetch_user_fullname') ) { 752 $display_name = bp_ fetch_user_fullname( $user_id, false);791 $display_name = bp_core_get_user_displayname( $user_id ); 753 792 754 793 if ( $with_s ) … … 759 798 } 760 799 761 // if ( $user_id == $userdata->ID && !$no_you )762 // $display_name = 'You';763 764 800 if ( $no_anchor ) 765 801 return $display_name; … … 774 810 } 775 811 776 /** 777 * bp_core_global_user_fullname() 778 * 779 * Returns the full name for the user, or the display name if Xprofile component is not installed. 780 * 781 * @package BuddyPress Core 782 * @param $user_id string The user ID of the user. 783 * @param 784 * @uses bp_fetch_user_fullname() Returns the full name for a user based on user ID. 785 * @uses get_userdata() Fetches a new userdata object for the user ID passed. 786 * @return Either the users full name, or the display name. 787 */ 788 function bp_core_global_user_fullname( $user_id ) { 789 if ( function_exists('bp_fetch_user_fullname') ) { 790 return bp_fetch_user_fullname( $user_id, false ); 791 } else { 792 $ud = get_userdata($user_id); 793 return $current_user->display_name; 794 } 795 } 812 813 /** 814 * bp_core_get_user_displayname() 815 * 816 * Fetch the display name for a user. This will use the "Name" field in xprofile if it is installed. 817 * Otherwise, it will fall back to the normal WP display_name, or user_nicename, depending on what has been set. 818 * 819 * @package BuddyPress Core 820 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() 821 * @uses wp_cache_get() Will try and fetch the value from the cache, rather than querying the DB again. 822 * @uses get_userdata() Fetches the WP userdata for a specific user. 823 * @uses xprofile_set_field_data() Will update the field data for a user based on field name and user id. 824 * @uses wp_cache_set() Adds a value to the cache. 825 * @return str The display name for the user in question. 826 */ 827 function bp_core_get_user_displayname( $user_id ) { 828 global $bp; 829 830 if ( !$user_id ) 831 return false; 832 833 if ( !$fullname = wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) { 834 if ( function_exists('xprofile_install') ) { 835 $fullname = xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id ); 836 837 if ( empty($fullname) || !$fullname ) { 838 $ud = get_userdata($user_id); 839 840 if ( empty( $ud->display_name ) ) 841 $fullname = $ud->user_nicename; 842 else 843 $fullname = $ud->display_name; 844 845 xprofile_set_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id, $fullname ); 846 } 847 } else { 848 $ud = get_userdata($user_id); 849 $fullname = $ud->display_name; 850 } 851 852 wp_cache_set( 'bp_user_fullname_' . $user_id, $fullname, 'bp' ); 853 } 854 855 return apply_filters( 'bp_core_get_user_displayname', stripslashes( trim( $fullname ) ) ); 856 } 857 /* DEPRECATED Use: bp_core_get_user_displayname */ 858 function bp_core_global_user_fullname( $user_id ) { return bp_core_get_user_displayname( $user_id ); } 859 796 860 797 861 /** … … 811 875 } 812 876 877 813 878 /** 814 879 * bp_core_get_userlink_by_username() … … 827 892 return apply_filters( 'bp_core_get_userlink_by_username', bp_core_get_userlink( $user_id, false, false, true ) ); 828 893 } 894 829 895 830 896 /** … … 849 915 } 850 916 917 918 /** 919 * bp_core_add_message() 920 * 921 * Adds a feedback (error/success) message to the WP cookie so it can be displayed after the page reloads. 922 * 923 * @package BuddyPress Core 924 */ 851 925 function bp_core_add_message( $message, $type = false ) { 852 926 if ( !$type ) … … 856 930 setcookie( 'bp-message-type', $type, time()+60*60*24, COOKIEPATH ); 857 931 } 932 858 933 859 934 /** … … 878 953 } 879 954 955 880 956 /** 881 957 * bp_core_time_since() … … 954 1030 return $output; 955 1031 } 1032 956 1033 957 1034 /** … … 1007 1084 } 1008 1085 1086 1009 1087 /** 1010 1088 * bp_core_get_all_posts_for_user() … … 1026 1104 } 1027 1105 1106 1028 1107 /** 1029 1108 * bp_core_get_site_path() … … 1041 1120 } 1042 1121 1122 /** 1123 * bp_core_redirect() 1124 * 1125 * Performs a status safe wp_redirect() that is compatible with bp_catch_uri() 1126 * 1127 * @package BuddyPress Core 1128 * @global $bp_no_status_set Makes sure that there are no conflicts with status_header() called in bp_core_do_catch_uri() 1129 * @uses get_themes() 1130 * @return An array containing all of the themes. 1131 */ 1043 1132 function bp_core_redirect( $location, $status = 302 ) { 1044 1133 global $bp_no_status_set; … … 1129 1218 } 1130 1219 1131 function bp_core_get_member_themes() { 1132 add_filter( 'theme_root', 'bp_core_set_member_theme_root' ); 1220 /** 1221 * bp_core_get_buddypress_themes() 1222 * 1223 * Gets an array of all the BuddyPress themes in the /bp-themes/ directory. 1224 * 1225 * @package BuddyPress Core 1226 * @uses get_themes() 1227 * @return An array containing all of the themes. 1228 */ 1229 function bp_core_get_buddypress_themes() { 1230 add_filter( 'theme_root', 'bp_core_filter_buddypress_theme_root' ); 1133 1231 $themes = get_themes(); 1134 1232 … … 1148 1246 return $member_themes; 1149 1247 } 1150 1151 function bp_core_set_member_theme_root() { 1152 return apply_filters( 'bp_core_set_member_theme_root', WP_CONTENT_DIR . "/bp-themes" ); 1153 } 1154 1155 function bp_core_set_member_theme_root_uri() { 1156 return apply_filters( 'bp_core_set_member_theme_root_uri', WP_CONTENT_URL . '/bp-themes' ); 1157 } 1158 1248 function bp_core_get_member_themes() { return bp_core_get_buddypress_themes(); } // DEPRECATED 1249 1250 1251 /** 1252 * bp_get_buddypress_theme_uri() 1253 * 1254 * Get the url of the selected BuddyPress theme. 1255 * 1256 * @package BuddyPress Core 1257 */ 1258 function bp_get_buddypress_theme_uri() { 1259 return apply_filters( 'bp_get_buddypress_theme_uri', WP_CONTENT_URL . '/bp-themes/' . get_site_option( 'active-member-theme' ) ); 1260 } 1261 1262 1263 /** 1264 * bp_get_buddypress_theme_path() 1265 * 1266 * Get the path of the selected BuddyPress theme. 1267 * 1268 * @package BuddyPress Core 1269 */ 1270 function bp_get_buddypress_theme_path() { 1271 return apply_filters( 'bp_get_buddypress_theme_path', WP_CONTENT_DIR . '/bp-themes/' . get_site_option( 'active-member-theme' ) ); 1272 } 1273 1274 1275 /** 1276 * bp_core_filter_buddypress_theme_root() 1277 * 1278 * Adds a filter that changes the root path of the theme directory to the bp-themes directory. 1279 * 1280 * @package BuddyPress Core 1281 */ 1282 function bp_core_filter_buddypress_theme_root() { 1283 return apply_filters( 'bp_core_filter_buddypress_theme_root', WP_CONTENT_DIR . "/bp-themes" ); 1284 } 1285 1286 1287 /** 1288 * bp_core_filter_buddypress_theme_root_uri() 1289 * 1290 * Adds a filter that changes the root URI of the theme directory to the bp-themes directory. 1291 * 1292 * @package BuddyPress Core 1293 */ 1294 function bp_core_filter_buddypress_theme_root_uri() { 1295 return apply_filters( 'bp_core_filter_buddypress_theme_root_uri', WP_CONTENT_URL . '/bp-themes' ); 1296 } 1297 1298 1299 /** 1300 * bp_core_add_illegal_names() 1301 * 1302 * Adds illegal names to WP so that root components will not conflict with 1303 * blog names on a subdirectory installation. 1304 * 1305 * For example, it would stop someone creating a blog with the slug "groups". 1306 * 1307 * @package BuddyPress Core 1308 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() 1309 */ 1159 1310 function bp_core_add_illegal_names() { 1160 1311 global $bp; … … 1192 1343 add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' ); 1193 1344 1345 1194 1346 /** 1195 1347 * bp_core_email_from_name_filter() … … 1208 1360 1209 1361 1362 /** 1363 * bp_core_delete_account() 1364 * 1365 * Allows a user to completely remove their account from the system 1366 * 1367 * @package BuddyPress Core 1368 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() 1369 * @uses check_admin_referer() Checks for a valid security nonce. 1370 * @uses is_site_admin() Checks to see if the user is a site administrator. 1371 * @uses wpmu_delete_user() Deletes a user from the system. 1372 */ 1210 1373 function bp_core_delete_account() { 1211 1374 global $bp; 1212 1375 1213 1376 // Be careful with this function! 1377 1378 if ( !check_admin_referer( 'delete-account' ) ) 1379 return false; 1380 1381 /* Site admins should not be allowed to delete their accounts */ 1382 if ( is_site_admin() ) 1383 return false; 1214 1384 1215 1385 require_once( ABSPATH . '/wp-admin/includes/mu.php' ); … … 1219 1389 } 1220 1390 1221 function bp_core_search_site() { 1222 global $bp; 1223 1391 1392 /** 1393 * bp_core_search_site() 1394 * 1395 * A javascript free implementation of the search functions in BuddyPress 1396 * 1397 * @package BuddyPress Core 1398 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() 1399 * @param $slug The slug to redirect to for searching. 1400 */ 1401 function bp_core_action_search_site( $slug = false ) { 1402 global $bp; 1403 1224 1404 if ( $bp->current_component == BP_SEARCH_SLUG ) { 1225 1405 $search_terms = $_POST['search-terms']; 1226 1406 $search_which = $_POST['search-which']; 1227 1407 1228 switch ( $search_which ) { 1229 case 'members': default: 1230 $search = BP_MEMBERS_SLUG; 1231 break; 1232 case 'groups': 1233 $search = BP_GROUPS_SLUG; 1234 break; 1235 case 'blogs': 1236 $search = BP_BLOGS_SLUG; 1237 break; 1408 if ( !$slug || empty( $slug ) ) { 1409 switch ( $search_which ) { 1410 case 'members': default: 1411 $slug = BP_MEMBERS_SLUG; 1412 break; 1413 case 'groups': 1414 $slug = BP_GROUPS_SLUG; 1415 break; 1416 case 'blogs': 1417 $slug = BP_BLOGS_SLUG; 1418 break; 1419 } 1238 1420 } 1239 1240 $search_url = apply_filters( 'bp_core_search_site', site_url( $s earch. '/?s=' . urlencode($search_terms) ), $search_terms );1421 1422 $search_url = apply_filters( 'bp_core_search_site', site_url( $slug . '/?s=' . urlencode($search_terms) ), $search_terms ); 1241 1423 1242 1424 bp_core_redirect( $search_url ); 1243 1425 } 1244 1426 } 1245 add_action( 'wp', 'bp_core_search_site', 5 ); 1427 add_action( 'init', 'bp_core_action_search_site', 5 ); 1428 1246 1429 1247 1430 /** 1248 1431 * bp_core_ucfirst() 1249 1432 * 1250 * Localization sa ve ucfirst() support.1433 * Localization safe ucfirst() support. 1251 1434 * 1252 1435 * @package BuddyPress Core … … 1261 1444 } 1262 1445 1446 1263 1447 /** 1264 1448 * bp_core_strip_username_spaces() … … 1272 1456 } 1273 1457 add_action( 'pre_user_login', 'bp_core_strip_username_spaces' ); 1458 1274 1459 1275 1460 /** … … 1292 1477 } 1293 1478 1294 function bp_core_print_version_numbers() { 1295 global $bp; 1296 1297 foreach ( $bp->version_numbers as $name => $version ) { 1298 echo ucwords($name) . ': <b>' . $version . '</b> / '; 1299 } 1300 } 1301 1479 /** 1480 * bp_core_print_generation_time() 1481 * 1482 * Prints the generation time in the footer of the site. 1483 * 1484 * @package BuddyPress Core 1485 */ 1302 1486 function bp_core_print_generation_time() { 1303 1487 global $wpdb; … … 1328 1512 add_action( 'delete_user', 'bp_core_remove_data', 1 ); 1329 1513 1514 1515 /** 1516 * bp_core_clear_user_object_cache() 1517 * 1518 * Clears all cached objects for a user, or a user is part of. 1519 * 1520 * @package BuddyPress Core 1521 */ 1330 1522 function bp_core_clear_user_object_cache( $user_id ) { 1331 1523 wp_cache_delete( 'bp_user_' . $user_id, 'bp' ); -
trunk/bp-core/bp-core-admin.php
r1473 r1518 89 89 <th scope="row"><?php _e('Select theme to use for BuddyPress generated pages', 'buddypress' ) ?>:</th> 90 90 <td> 91 <?php $themes = bp_core_get_ member_themes() ?>91 <?php $themes = bp_core_get_buddypress_themes() ?> 92 92 <?php if ( $themes ) : ?> 93 93 <select name="bp-admin[active-member-theme]" id="active-member-theme"> -
trunk/bp-core/bp-core-catchuri.php
r1501 r1518 280 280 if ( $is_member_page ) { 281 281 282 add_filter( 'theme_root', 'bp_core_ set_member_theme_root' );283 add_filter( 'theme_root_uri', 'bp_core_ set_member_theme_root_uri' );282 add_filter( 'theme_root', 'bp_core_filter_buddypress_theme_root' ); 283 add_filter( 'theme_root_uri', 'bp_core_filter_buddypress_theme_root_uri' ); 284 284 285 285 return $member_theme; … … 299 299 300 300 if ( $is_member_page ) { 301 add_filter( 'theme_root', 'bp_core_ set_member_theme_root' );302 add_filter( 'theme_root_uri', 'bp_core_ set_member_theme_root_uri' );301 add_filter( 'theme_root', 'bp_core_filter_buddypress_theme_root' ); 302 add_filter( 'theme_root_uri', 'bp_core_filter_buddypress_theme_root_uri' ); 303 303 304 304 return $member_theme; -
trunk/bp-core/bp-core-classes.php
r1408 r1518 63 63 $this->user_link = bp_core_get_userlink( $this->id ); 64 64 65 $this->fullname = bp_ fetch_user_fullname( $this->id, false);65 $this->fullname = bp_core_get_user_displayname( $this->id ); 66 66 $this->email = bp_core_get_user_email( $this->id ); 67 67 $this->last_active = bp_core_get_last_activity( get_usermeta( $this->id, 'last_activity' ), __( 'active %s ago', 'buddypress' ) ); -
trunk/bp-core/bp-core-settings.php
r1473 r1518 9 9 bp_core_add_subnav_item( 'settings', 'general', __('General', 'buddypress'), $bp->loggedin_user->domain . 'settings/', 'bp_core_screen_general_settings', false, bp_is_home() ); 10 10 bp_core_add_subnav_item( 'settings', 'notifications', __('Notifications', 'buddypress'), $bp->loggedin_user->domain . 'settings/', 'bp_core_screen_notification_settings', false, bp_is_home() ); 11 bp_core_add_subnav_item( 'settings', 'delete-account', __('Delete Account', 'buddypress'), $bp->loggedin_user->domain . 'settings/', 'bp_core_screen_delete_account', false, bp_is_home() ); 11 12 if ( !is_site_admin() ) 13 bp_core_add_subnav_item( 'settings', 'delete-account', __('Delete Account', 'buddypress'), $bp->loggedin_user->domain . 'settings/', 'bp_core_screen_delete_account', false, bp_is_home() ); 12 14 } 13 15 add_action( 'wp', 'bp_core_add_settings_nav', 2 ); -
trunk/bp-core/bp-core-templatetags.php
r1510 r1518 231 231 } 232 232 233 /* DEPRECATED Use: bp_core_get_user_displayname() */ 233 234 function bp_fetch_user_fullname( $user_id, $echo = true ) { 234 global $bp;235 236 if ( !$user_id )237 return false;238 239 if ( !$fullname = wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) {240 if ( function_exists('xprofile_install') ) {241 $fullname = xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id );242 243 if ( empty($fullname) || !$fullname ) {244 $ud = get_userdata($user_id);245 246 if ( empty( $ud->display_name ) )247 $fullname = $ud->user_nicename;248 else249 $fullname = $ud->display_name;250 251 xprofile_set_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id, $fullname );252 }253 } else {254 $ud = get_userdata($user_id);255 $fullname = $ud->display_name;256 }257 258 wp_cache_set( 'bp_user_fullname_' . $user_id, $fullname, 'bp' );259 }260 261 235 if ( $echo ) 262 echo apply_filters( 'bp_fetch_user_fullname', stripslashes( trim( $fullname )) );236 echo apply_filters( 'bp_fetch_user_fullname', bp_core_get_user_displayname( $user_id ) ); 263 237 else 264 return apply_filters( 'bp_fetch_user_fullname', stripslashes ( trim ( $fullname )) );238 return apply_filters( 'bp_fetch_user_fullname', bp_core_get_user_displayname( $user_id ) ); 265 239 } 266 240 -
trunk/bp-core/bp-core-widgets.php
r1486 r1518 183 183 <?php foreach ( (array) $users['users'] as $user ) : ?> 184 184 <div class="item-avatar"> 185 <a href="<?php echo bp_core_get_userurl($user->user_id) ?>" title="<?php bp_fetch_user_fullname( $user->user_id, true) ?>"><?php echo bp_core_get_avatar( $user->user_id, 1 ) ?></a>185 <a href="<?php echo bp_core_get_userurl($user->user_id) ?>" title="<?php echo bp_core_get_user_displayname( $user->user_id ) ?>"><?php echo bp_core_get_avatar( $user->user_id, 1 ) ?></a> 186 186 </div> 187 187 <?php endforeach; ?> -
trunk/bp-friends.php
r1517 r1518 336 336 return apply_filters( 'bp_friends_multiple_friendship_accepted_notification', '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/my-friends/newest" title="' . __( 'My Friends', 'buddypress' ) . '">' . sprintf( __('%d friends accepted your friendship requests', 'buddypress' ), (int)$total_items ) . '</a>', (int)$total_items ); 337 337 } else { 338 $user_fullname = bp_core_g lobal_user_fullname( $item_id );338 $user_fullname = bp_core_get_user_displayname( $item_id ); 339 339 $user_url = bp_core_get_userurl( $item_id ); 340 340 return apply_filters( 'bp_friends_single_friendship_accepted_notification', '<a href="' . $user_url . '?new" title="' . $user_fullname .'\'s profile">' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $user_fullname ) . '</a>', $user_fullname ); … … 346 346 return apply_filters( 'bp_friends_multiple_friendship_request_notification', '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/requests" title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have %d pending friendship requests', 'buddypress' ), (int)$total_items ) . '</a>', $total_items ); 347 347 } else { 348 $user_fullname = bp_core_g lobal_user_fullname( $item_id );348 $user_fullname = bp_core_get_user_displayname( $item_id ); 349 349 $user_url = bp_core_get_userurl( $item_id ); 350 350 return apply_filters( 'bp_friends_single_friendship_request_notification', '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/requests" title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have a friendship request from %s', 'buddypress' ), $user_fullname ) . '</a>', $user_fullname ); … … 472 472 for ( $i = 0; $i < count($friend_ids); $i++ ) { 473 473 if ( function_exists('bp_user_fullname') ) 474 $display_name = bp_ fetch_user_fullname($friend_ids[$i], false);474 $display_name = bp_core_get_user_displayname( $friend_ids[$i] ); 475 475 476 476 if ( $display_name != ' ' ) { … … 510 510 continue; 511 511 512 $display_name = bp_ fetch_user_fullname($friend_ids['friends'][$i]->user_id, false);512 $display_name = bp_core_get_user_displayname( $friend_ids['friends'][$i]->user_id ); 513 513 514 514 if ( $display_name != ' ' ) { -
trunk/bp-friends/bp-friends-notifications.php
r1366 r1518 4 4 global $bp; 5 5 6 $initiator_name = bp_ fetch_user_fullname( $initiator_id, false);6 $initiator_name = bp_core_get_user_displayname( $initiator_id ); 7 7 8 8 if ( 'no' == get_usermeta( (int)$friend_id, 'notification_friends_friendship_request' ) ) … … 43 43 $friendship = new BP_Friends_Friendship( $friendship_id, false, false ); 44 44 45 $friend_name = bp_ fetch_user_fullname( $friend_id, false);45 $friend_name = bp_core_get_user_displayname( $friend_id ); 46 46 47 47 if ( 'no' == get_usermeta( (int)$initiator_id, 'notification_friends_friendship_accepted' ) ) -
trunk/bp-groups.php
r1515 r1518 299 299 } 300 300 } 301 add_action( 'wp', 'groups_directory_groups_setup', 5);301 add_action( 'wp', 'groups_directory_groups_setup', 2 ); 302 302 303 303 /***** Screens **********/ … … 1105 1105 return apply_filters( 'bp_groups_multiple_new_membership_requests_notification', '<a href="' . $group_link . '/admin/membership-requests/" title="' . __( 'Group Membership Requests', 'buddypress' ) . '">' . sprintf( __('%d new membership requests for the group "%s"', 'buddypress' ), (int)$total_items, $group->name ) . '</a>', $group_link, $total_items, $group->name ); 1106 1106 } else { 1107 $user_fullname = bp_core_g lobal_user_fullname( $requesting_user_id );1107 $user_fullname = bp_core_get_user_displayname( $requesting_user_id ); 1108 1108 return apply_filters( 'bp_groups_single_new_membership_request_notification', '<a href="' . $group_link . '/admin/membership-requests/" title="' . $user_fullname .' requests group membership">' . sprintf( __('%s requests membership for the group "%s"', 'buddypress' ), $user_fullname, $group->name ) . '</a>', $group_link, $user_fullname, $group->name ); 1109 1109 } … … 2283 2283 $member_theme = 'bpmember'; 2284 2284 2285 add_filter( 'theme_root', 'bp_core_ set_member_theme_root' );2286 add_filter( 'theme_root_uri', 'bp_core_ set_member_theme_root_uri' );2285 add_filter( 'theme_root', 'bp_core_filter_buddypress_theme_root' ); 2286 add_filter( 'theme_root_uri', 'bp_core_filter_buddypress_theme_root_uri' ); 2287 2287 2288 2288 return $member_theme; … … 2301 2301 $member_theme = 'bpmember'; 2302 2302 2303 add_filter( 'theme_root', 'bp_core_ set_member_theme_root' );2304 add_filter( 'theme_root_uri', 'bp_core_ set_member_theme_root_uri' );2303 add_filter( 'theme_root', 'bp_core_filter_buddypress_theme_root' ); 2304 add_filter( 'theme_root_uri', 'bp_core_filter_buddypress_theme_root_uri' ); 2305 2305 2306 2306 return $member_theme; -
trunk/bp-groups/bp-groups-notifications.php
r1408 r1518 10 10 $group = new BP_Groups_Group( $group_id, false, true ); 11 11 12 $poster_name = bp_ fetch_user_fullname( $wire_post->user_id, false);12 $poster_name = bp_core_get_user_displayname( $wire_post->user_id ); 13 13 $poster_ud = get_userdata( $wire_post->user_id ); 14 14 $poster_profile_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $poster_ud->user_login; … … 95 95 return false; 96 96 97 $requesting_user_name = bp_ fetch_user_fullname( $requesting_user_id, false);97 $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id ); 98 98 $group = new BP_Groups_Group( $group_id, false, false ); 99 99 -
trunk/bp-groups/bp-groups-templatetags.php
r1487 r1518 945 945 <?php for ( $i = 0; $i < count($group_mods); $i++ ) { ?> 946 946 <li> 947 <a href="<?php echo bp_core_get_userlink( $group_mods[$i]->user_id, false, true ) ?>" title="<?php echo bp_ fetch_user_fullname( $group_mods[$i]->user->user_id ) ?>"><?php echo bp_core_get_avatar( $group_mods[$i]->user_id, 1, 50, 50 ) ?></a>947 <a href="<?php echo bp_core_get_userlink( $group_mods[$i]->user_id, false, true ) ?>" title="<?php echo bp_core_get_user_displayname( $group_mods[$i]->user->user_id ) ?>"><?php echo bp_core_get_avatar( $group_mods[$i]->user_id, 1, 50, 50 ) ?></a> 948 948 <h5><?php echo bp_core_get_userlink( $group_mods[$i]->user_id ) ?></h5> 949 949 <span class="activity"><?php _e( 'Group Mod', 'buddypress' ) ?></span> … … 1772 1772 global $members_template; 1773 1773 1774 return apply_filters( 'bp_get_group_member_name', bp_ fetch_user_fullname( $members_template->member->user_id, false) );1774 return apply_filters( 'bp_get_group_member_name', bp_core_get_user_displayname( $members_template->member->user_id ) ); 1775 1775 } 1776 1776 -
trunk/bp-messages/bp-messages-ajax.php
r1497 r1518 37 37 $ud = get_userdata($user_id); 38 38 $username = $ud->user_login; 39 echo bp_core_get_avatar( $user_id, 1, 15, 15 ) . ' ' . bp_ fetch_user_fullname( $user_id, false) . ' (' . $username . ')39 echo bp_core_get_avatar( $user_id, 1, 15, 15 ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ') 40 40 '; 41 41 } -
trunk/bp-messages/bp-messages-notifications.php
r1479 r1518 7 7 $message = new BP_Messages_Message( $item_id ); 8 8 9 $sender_name = bp_ fetch_user_fullname( $message->sender_id, false);9 $sender_name = bp_core_get_user_displayname( $message->sender_id ); 10 10 11 11 for ( $i = 0; $i < count($recipient_ids); $i++ ) { -
trunk/bp-messages/bp-messages-templatetags.php
r1503 r1518 451 451 452 452 if ( isset( $_GET['r'] ) ) { 453 $user_id = bp_core_get_userid _from_user_login( $_GET['r'] );453 $user_id = bp_core_get_userid( $_GET['r'] ); 454 454 455 455 if ( $user_id ) { -
trunk/bp-xprofile.php
r1506 r1518 577 577 return apply_filters( 'bp_xprofile_multiple_new_wire_post_notification', '<a href="' . $bp->loggedin_user->domain . $bp->wire->slug . '" title="' . __( 'Wire', 'buddypress' ) . '">' . sprintf( __( 'You have %d new posts on your wire', 'buddypress' ), (int)$total_items ) . '</a>', $total_items ); 578 578 } else { 579 $user_fullname = bp_core_g lobal_user_fullname( $item_id );579 $user_fullname = bp_core_get_user_displayname( $item_id ); 580 580 return apply_filters( 'bp_xprofile_single_new_wire_post_notification', '<a href="' . $bp->loggedin_user->domain . $bp->wire->slug . '" title="' . __( 'Wire', 'buddypress' ) . '">' . sprintf( __( '%s posted on your wire', 'buddypress' ), $user_fullname ) . '</a>', $user_fullname ); 581 581 } -
trunk/bp-xprofile/bp-xprofile-notifications.php
r1366 r1518 26 26 27 27 if ( !get_usermeta( $bp->loggedin_user->id, 'notification_profile_wire_post' ) || 'yes' == get_usermeta( $bp->loggedin_user->id, 'notification_profile_wire_post' ) ) { 28 $poster_name = bp_ fetch_user_fullname( $poster_id, false);28 $poster_name = bp_core_get_user_displayname( $poster_id ); 29 29 $wire_post = new BP_Wire_Post( $bp->profile->table_name_wire, $wire_post_id, true ); 30 30 $ud = get_userdata($user_id);
Note: See TracChangeset
for help on using the changeset viewer.