Changeset 1718
- Timestamp:
- 08/27/2009 09:18:10 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r1707 r1718 60 60 $bp->activity->table_name = $wpdb->base_prefix . 'bp_activity_user_activity_cached'; 61 61 $bp->activity->slug = BP_ACTIVITY_SLUG; 62 63 /* Register this in the active components array */ 64 $bp->active_components[$bp->activity->slug] = $bp->activity->id; 62 65 } 63 66 add_action( 'plugins_loaded', 'bp_activity_setup_globals', 5 ); … … 82 85 83 86 /* Add 'Activity' to the main navigation */ 84 bp_core_new_nav_item( array( 'name' => __( 'Activity', 'buddypress' ), 'slug' => $bp->activity->slug, 'position' => 10, 'screen_function' => 'bp_activity_screen_my_activity', 'default_subnav_slug' => 'just-me' ) );87 bp_core_new_nav_item( array( 'name' => __( 'Activity', 'buddypress' ), 'slug' => $bp->activity->slug, 'position' => 10, 'screen_function' => 'bp_activity_screen_my_activity', 'default_subnav_slug' => 'just-me', 'item_css_id' => $bp->activity->id ) ); 85 88 86 89 $activity_link = $bp->loggedin_user->domain . $bp->activity->slug . '/'; -
trunk/bp-blogs.php
r1705 r1718 117 117 $bp->blogs->format_notification_function = 'bp_blogs_format_notifications'; 118 118 $bp->blogs->slug = BP_BLOGS_SLUG; 119 120 /* Register this in the active components array */ 121 $bp->active_components[$bp->blogs->slug] = $bp->blogs->id; 119 122 } 120 123 add_action( 'plugins_loaded', 'bp_blogs_setup_globals', 5 ); … … 140 143 141 144 /* Add 'Blogs' to the main navigation */ 142 bp_core_new_nav_item( array( 'name' => __( 'Blogs', 'buddypress' ), 'slug' => $bp->blogs->slug, 'position' => 30, 'screen_function' => 'bp_blogs_screen_my_blogs', 'default_subnav_slug' => 'my-blogs' ) );145 bp_core_new_nav_item( array( 'name' => __( 'Blogs', 'buddypress' ), 'slug' => $bp->blogs->slug, 'position' => 30, 'screen_function' => 'bp_blogs_screen_my_blogs', 'default_subnav_slug' => 'my-blogs', 'item_css_id' => $bp->blogs->id ) ); 143 146 144 147 $blogs_link = $bp->loggedin_user->domain . $bp->blogs->slug . '/'; -
trunk/bp-core.php
r1717 r1718 136 136 /* Sets up container used for the avatar of the current component being viewed. Rendered by bp_get_options_avatar() */ 137 137 $bp->bp_options_avatar = ''; 138 139 /* Contains an array of all the active components. The key is the slug, value the internal ID of the component */ 140 $bp->active_components = array(); 138 141 139 142 /* Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar */ … … 553 556 'parent_url' => false, // URL of the parent item 554 557 'item_css_id' => false, // The CSS ID to apply to the HTML of the nav item 555 'user_has_access' => true, // Can the user see this nav item?558 'user_has_access' => true, // Can the logged in user see this nav item? 556 559 'site_admin_only' => false, // Can only site admins see this nav item? 557 'position' => 90, // Index of where should this nav itembe positioned560 'position' => 90, // Index of where this nav item should be positioned 558 561 'screen_function' => false // The name of the function to run when clicked 559 562 ); … … 579 582 'css_id' => $item_css_id, 580 583 'position' => $position 581 ); 584 ); 582 585 583 586 if ( $bp->current_action == $slug && $bp->current_component == $parent_slug && $user_has_access ) { … … 649 652 650 653 /** 651 * bp_core_add_nav_default()652 *653 * Set a default action for a nav item, when a sub nav item has not yet been selected.654 *655 * @package BuddyPress Core656 * @param $parent_id The id of the parent navigation item.657 * @param $function The function to run when this sub nav item is selected.658 * @param $slug The slug of the sub nav item to highlight.659 * @uses is_site_admin() returns true if the current user is a site admin, false if not660 * @uses bp_is_home() Returns true if the current user being viewed is equal the logged in user661 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()662 */663 function bp_core_add_nav_default( $parent_id, $function, $slug = false, $user_has_access = true, $admin_only = false ) {664 global $bp;665 666 if ( !$user_has_access && !bp_is_home() )667 return false;668 669 if ( $admin_only && !is_site_admin() )670 return false;671 672 if ( $bp->current_component == $parent_id && !$bp->current_action ) {673 if ( function_exists($function) ) {674 add_action( 'wp', $function, 3 );675 }676 677 if ( $slug )678 $bp->current_action = $slug;679 }680 }681 682 /**683 654 * bp_core_load_template() 684 655 * -
trunk/bp-core/bp-core-catchuri.php
r1715 r1718 115 115 unset($bp_uri[2]); 116 116 } 117 117 118 118 /* Reset the keys by merging with an empty array */ 119 119 $bp_uri = array_merge( array(), $bp_uri ); 120 120 121 } 121 122 -
trunk/bp-core/bp-core-settings.php
r1687 r1718 1 1 <?php 2 3 if ( !defined( 'BP_SETTINGS_SLUG' ) ) 4 define( 'BP_SETTINGS_SLUG', 'settings' ); 5 2 6 function bp_core_add_settings_nav() { 3 7 global $bp; 8 9 /* Set up settings as a sudo-component for identification and nav selection */ 10 $bp->settings->id = 'settings'; 11 $bp->settings->slug = BP_SETTINGS_SLUG; 12 13 /* Register this in the active components array */ 14 $bp->active_components[$bp->settings->slug] = $bp->settings->id; 4 15 5 16 /* Add the settings navigation item */ 6 bp_core_new_nav_item( array( 'name' => __('Settings', 'buddypress'), 'slug' => 'settings', 'position' => 100, 'show_for_displayed_user' => false, 'screen_function' => 'bp_core_screen_general_settings', 'default_subnav_slug' => 'general' ) );17 bp_core_new_nav_item( array( 'name' => __('Settings', 'buddypress'), 'slug' => $bp->settings->slug, 'position' => 100, 'show_for_displayed_user' => false, 'screen_function' => 'bp_core_screen_general_settings', 'default_subnav_slug' => 'general' ) ); 7 18 8 19 $settings_link = $bp->loggedin_user->domain . 'settings/'; 9 20 10 bp_core_new_subnav_item( array( 'name' => __( 'General', 'buddypress' ), 'slug' => 'general', 'parent_url' => $settings_link, 'parent_slug' => 'settings', 'screen_function' => 'bp_core_screen_general_settings', 'position' => 10, 'user_has_access' => bp_is_home() ) );11 bp_core_new_subnav_item( array( 'name' => __( 'Notifications', 'buddypress' ), 'slug' => 'notifications', 'parent_url' => $settings_link, 'parent_slug' => 'settings', 'screen_function' => 'bp_core_screen_notification_settings', 'position' => 20, 'user_has_access' => bp_is_home() ) );21 bp_core_new_subnav_item( array( 'name' => __( 'General', 'buddypress' ), 'slug' => 'general', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_general_settings', 'position' => 10, 'user_has_access' => bp_is_home() ) ); 22 bp_core_new_subnav_item( array( 'name' => __( 'Notifications', 'buddypress' ), 'slug' => 'notifications', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_notification_settings', 'position' => 20, 'user_has_access' => bp_is_home() ) ); 12 23 13 24 if ( !is_site_admin() ) 14 bp_core_new_subnav_item( array( 'name' => __( 'Delete Account', 'buddypress' ), 'slug' => 'delete-account', 'parent_url' => $settings_link, 'parent_slug' => 'settings', 'screen_function' => 'bp_core_screen_delete_account', 'position' => 90, 'user_has_access' => bp_is_home() ) );25 bp_core_new_subnav_item( array( 'name' => __( 'Delete Account', 'buddypress' ), 'slug' => 'delete-account', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_delete_account', 'position' => 90, 'user_has_access' => bp_is_home() ) ); 15 26 } 16 27 add_action( 'wp', 'bp_core_add_settings_nav', 2 ); … … 21 32 function bp_core_screen_general_settings() { 22 33 global $current_user, $bp_settings_updated, $pass_error; 34 35 $bp_settings_updated = false; 36 $pass_error = false; 37 38 if ( isset($_POST['submit']) && check_admin_referer('bp_settings_general') ) { 39 require_once( WPINC . '/registration.php' ); 40 41 // Form has been submitted and nonce checks out, lets do it. 42 43 if ( $_POST['email'] != '' ) 44 $current_user->user_email = wp_specialchars( trim( $_POST['email'] ) ); 45 46 if ( $_POST['pass1'] != '' && $_POST['pass2'] != '' ) { 47 if ( $_POST['pass1'] == $_POST['pass2'] && !strpos( " " . $_POST['pass1'], "\\" ) ) 48 $current_user->user_pass = $_POST['pass1']; 49 else 50 $pass_error = true; 51 } else if ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) || !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) { 52 $pass_error = true; 53 } else { 54 unset( $current_user->user_pass ); 55 } 56 57 if ( !$pass_error && wp_update_user( get_object_vars( $current_user ) ) ) 58 $bp_settings_updated = true; 59 } 60 61 add_action( 'bp_template_title', 'bp_core_screen_general_settings_title' ); 62 add_action( 'bp_template_content', 'bp_core_screen_general_settings_content' ); 63 64 bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'plugin-template' ) ); 65 } 66 67 function bp_core_screen_general_settings_title() { 68 _e( 'General Settings', 'buddypress' ); 69 } 70 71 function bp_core_screen_general_settings_content() { 72 global $bp, $current_user, $bp_settings_updated, $pass_error; ?> 73 74 <?php if ( $bp_settings_updated && !$pass_error ) { ?> 75 <div id="message" class="updated fade"> 76 <p><?php _e( 'Changes Saved.', 'buddypress' ) ?></p> 77 </div> 78 <?php } ?> 79 80 <?php if ( $pass_error && !$bp_settings_updated ) { ?> 81 <div id="message" class="error fade"> 82 <p><?php _e( 'Your passwords did not match', 'buddypress' ) ?></p> 83 </div> 84 <?php } ?> 85 86 <form action="<?php echo $bp->loggedin_user->domain . 'settings/general' ?>" method="post" class="standard-form" id="settings-form"> 87 <label for="email"><?php _e( 'Account Email', 'buddypress' ) ?></label> 88 <input type="text" name="email" id="email" value="<?php echo attribute_escape( $current_user->user_email ); ?>" class="settings-input" /> 89 90 <label for="pass1"><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ) ?></label> 91 <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" /> <?php _e( 'New Password', 'buddypress' ) ?> 92 <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /> <?php _e( 'Repeat New Password', 'buddypress' ) ?> 93 94 <p class="submit"><input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?>" id="submit" class="auto"/></p> 95 <?php wp_nonce_field('bp_settings_general') ?> 96 </form> 97 <?php 98 } 99 100 /***** NOTIFICATION SETTINGS ******/ 101 102 function bp_core_screen_notification_settings() { 103 global $current_user, $bp_settings_updated; 104 105 $bp_settings_updated = false; 106 107 if ( $_POST['submit'] && check_admin_referer('bp_settings_notifications') ) { 108 if ( $_POST['notifications'] ) { 109 foreach ( $_POST['notifications'] as $key => $value ) { 110 update_usermeta( (int)$current_user->id, $key, $value ); 111 } 112 } 113 114 $bp_settings_updated = true; 115 } 116 117 add_action( 'bp_template_title', 'bp_core_screen_notification_settings_title' ); 118 add_action( 'bp_template_content', 'bp_core_screen_notification_settings_content' ); 119 120 bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'plugin-template' ) ); 121 } 122 123 function bp_core_screen_notification_settings_title() { 124 _e( 'Notification Settings', 'buddypress' ); 125 } 126 127 function bp_core_screen_notification_settings_content() { 128 global $bp, $current_user, $bp_settings_updated; ?> 129 130 <?php if ( $bp_settings_updated ) { ?> 131 <div id="message" class="updated fade"> 132 <p><?php _e( 'Changes Saved.', 'buddypress' ) ?></p> 133 </div> 134 <?php } ?> 135 136 <form action="<?php echo $bp->loggedin_user->domain . 'settings/notifications' ?>" method="post" id="settings-form"> 137 <h3><?php _e( 'Email Notifications', 'buddypress' ) ?></h3> 138 <p><?php _e( 'Send a notification by email when:', 'buddypress' ) ?></p> 139 140 <?php do_action( 'bp_notification_settings' ) ?> 141 142 <p class="submit"><input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?>" id="submit" class="auto"/></p> 143 144 <?php wp_nonce_field('bp_settings_notifications') ?> 145 146 </form> 147 <?php 148 } 149 150 /**** DELETE ACCOUNT ****/ 151 152 function bp_core_screen_delete_account() { 153 global $current_user, $bp_settings_updated, $pass_error; 154 155 if ( isset( $_POST['delete-account-button'] ) && check_admin_referer('delete-account') ) { 156 if ( !check_admin_referer( 'delete-account' ) ) 157 return false; 158 159 // delete the users account 160 if ( bp_core_delete_account() ) 161 bp_core_redirect( site_url() ); 162 } 23 163 24 164 $bp_settings_updated = false; … … 50 190 } 51 191 52 add_action( 'bp_template_title', 'bp_core_screen_general_settings_title' );53 add_action( 'bp_template_content', 'bp_core_screen_general_settings_content' );54 55 bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'plugin-template' ) );56 }57 58 function bp_core_screen_general_settings_title() {59 _e( 'General Settings', 'buddypress' );60 }61 62 function bp_core_screen_general_settings_content() {63 global $bp, $current_user, $bp_settings_updated, $pass_error; ?>64 65 <?php if ( $bp_settings_updated && !$pass_error ) { ?>66 <div id="message" class="updated fade">67 <p><?php _e( 'Changes Saved.', 'buddypress' ) ?></p>68 </div>69 <?php } ?>70 71 <?php if ( $pass_error && !$bp_settings_updated ) { ?>72 <div id="message" class="error fade">73 <p><?php _e( 'Your passwords did not match', 'buddypress' ) ?></p>74 </div>75 <?php } ?>76 77 <form action="<?php echo $bp->loggedin_user->domain . 'settings/general' ?>" method="post" class="standard-form" id="settings-form">78 <label for="email"><?php _e( 'Account Email', 'buddypress' ) ?></label>79 <input type="text" name="email" id="email" value="<?php echo attribute_escape( $current_user->user_email ); ?>" class="settings-input" />80 81 <label for="pass1"><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ) ?></label>82 <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" /> <?php _e( 'New Password', 'buddypress' ) ?>83 <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /> <?php _e( 'Repeat New Password', 'buddypress' ) ?>84 85 <p class="submit"><input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?>" id="submit" class="auto"/></p>86 <?php wp_nonce_field('bp_settings_general') ?>87 </form>88 <?php89 }90 91 /***** NOTIFICATION SETTINGS ******/92 93 function bp_core_screen_notification_settings() {94 global $current_user, $bp_settings_updated;95 96 $bp_settings_updated = false;97 98 if ( $_POST['submit'] && check_admin_referer('bp_settings_notifications') ) {99 if ( $_POST['notifications'] ) {100 foreach ( $_POST['notifications'] as $key => $value ) {101 update_usermeta( (int)$current_user->id, $key, $value );102 }103 }104 105 $bp_settings_updated = true;106 }107 108 add_action( 'bp_template_title', 'bp_core_screen_notification_settings_title' );109 add_action( 'bp_template_content', 'bp_core_screen_notification_settings_content' );110 111 bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'plugin-template' ) );112 }113 114 function bp_core_screen_notification_settings_title() {115 _e( 'Notification Settings', 'buddypress' );116 }117 118 function bp_core_screen_notification_settings_content() {119 global $bp, $current_user, $bp_settings_updated; ?>120 121 <?php if ( $bp_settings_updated ) { ?>122 <div id="message" class="updated fade">123 <p><?php _e( 'Changes Saved.', 'buddypress' ) ?></p>124 </div>125 <?php } ?>126 127 <form action="<?php echo $bp->loggedin_user->domain . 'settings/notifications' ?>" method="post" id="settings-form">128 <h3><?php _e( 'Email Notifications', 'buddypress' ) ?></h3>129 <p><?php _e( 'Send a notification by email when:', 'buddypress' ) ?></p>130 131 <?php do_action( 'bp_notification_settings' ) ?>132 133 <p class="submit"><input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?>" id="submit" class="auto"/></p>134 135 <?php wp_nonce_field('bp_settings_notifications') ?>136 137 </form>138 <?php139 }140 141 /**** DELETE ACCOUNT ****/142 143 function bp_core_screen_delete_account() {144 global $current_user, $bp_settings_updated, $pass_error;145 146 if ( isset( $_POST['delete-account-button'] ) && check_admin_referer('delete-account') ) {147 if ( !check_admin_referer( 'delete-account' ) )148 return false;149 150 // delete the users account151 if ( bp_core_delete_account() )152 bp_core_redirect( site_url() );153 }154 155 $bp_settings_updated = false;156 $pass_error = false;157 158 if ( isset($_POST['submit']) && check_admin_referer('bp_settings_general') ) {159 require_once( WPINC . '/registration.php' );160 161 // Form has been submitted and nonce checks out, lets do it.162 163 if ( $_POST['email'] != '' ) {164 $current_user->user_email = wp_specialchars( trim( $_POST['email'] ));165 }166 167 if ( $_POST['pass1'] != '' && $_POST['pass2'] != '' ) {168 if ( $_POST['pass1'] == $_POST['pass2'] && !strpos( " " . $_POST['pass1'], "\\" ) ) {169 $current_user->user_pass = $_POST['pass1'];170 } else {171 $pass_error = true;172 }173 } else if ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) || !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) {174 $pass_error = true;175 } else {176 unset( $current_user->user_pass );177 }178 179 if ( !$pass_error && wp_update_user( get_object_vars( $current_user ) ) )180 $bp_settings_updated = true;181 }182 183 192 add_action( 'bp_template_title', 'bp_core_screen_delete_account_title' ); 184 193 add_action( 'bp_template_content', 'bp_core_screen_delete_account_content' ); -
trunk/bp-core/bp-core-templatetags.php
r1714 r1718 22 22 foreach( (array) $bp->bp_nav as $nav_item ) { 23 23 /* If the current component matches the nav item id, then add a highlight CSS class. */ 24 if ( $bp-> current_component== $nav_item['css_id'] ) {24 if ( $bp->active_components[$bp->current_component] == $nav_item['css_id'] ) { 25 25 $selected = ' class="current"'; 26 26 } else { … … 35 35 36 36 if ( function_exists('friends_install') ) { 37 if ( $nav_item['css_id'] == $bp->friends-> slug) {37 if ( $nav_item['css_id'] == $bp->friends->id ) { 38 38 if ( friends_check_friendship( $bp->loggedin_user->id, $bp->displayed_user->id ) ) 39 39 $selected = ' class="current"'; -
trunk/bp-core/deprecated/bp-core-deprecated.php
r1655 r1718 940 940 } 941 941 942 /* DEPRECATED - use the param 'default_subnav_slug' in bp_core_new_nav_item() */ 943 function bp_core_add_nav_default( $parent_id, $function, $slug = false, $user_has_access = true, $admin_only = false ) { 944 global $bp; 945 946 if ( !$user_has_access && !bp_is_home() ) 947 return false; 948 949 if ( $admin_only && !is_site_admin() ) 950 return false; 951 952 if ( $bp->current_component == $parent_id && !$bp->current_action ) { 953 if ( function_exists($function) ) { 954 add_action( 'wp', $function, 3 ); 955 } 956 957 if ( $slug ) 958 $bp->current_action = $slug; 959 } 960 } 961 -
trunk/bp-forums.php
r1705 r1718 3 3 /* Define the parent forum ID */ 4 4 if ( !defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ) 5 define ( 'BP_FORUMS_PARENT_FORUM_ID', 1 ); 5 define( 'BP_FORUMS_PARENT_FORUM_ID', 1 ); 6 7 if ( !defined( 'BP_FORUMS_SLUG' ) ) 8 define( 'BP_FORUMS_SLUG', 'forums' ); 6 9 7 10 require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-bbpress.php' ); … … 18 21 $bp->forums->image_base = BP_PLUGIN_URL . '/bp-forums/images'; 19 22 $bp->forums->bbconfig = get_site_option( 'bb-config-location' ); 23 $bp->forums->slug = BP_FORUMS_SLUG; 24 25 /* Register this in the active components array */ 26 $bp->active_components[$bp->forums->slug] = $bp->forums->id; 20 27 } 21 28 add_action( 'plugins_loaded', 'bp_forums_setup', 5 ); -
trunk/bp-friends.php
r1705 r1718 48 48 $bp->friends->slug = BP_FRIENDS_SLUG; 49 49 50 /* Register this in the active components array */ 51 $bp->active_components[$bp->friends->slug] = $bp->friends->id; 50 52 } 51 53 add_action( 'plugins_loaded', 'friends_setup_globals', 5 ); … … 68 70 69 71 /* Add 'Friends' to the main navigation */ 70 bp_core_new_nav_item( array( 'name' => __('Friends', 'buddypress'), 'slug' => $bp->friends->slug, 'position' => 60, 'screen_function' => 'friends_screen_my_friends', 'default_subnav_slug' => 'my-friends' ) );72 bp_core_new_nav_item( array( 'name' => __('Friends', 'buddypress'), 'slug' => $bp->friends->slug, 'position' => 60, 'screen_function' => 'friends_screen_my_friends', 'default_subnav_slug' => 'my-friends', 'item_css_id' => $bp->friends->id ) ); 71 73 72 74 $friends_link = $bp->loggedin_user->domain . $bp->friends->slug . '/'; -
trunk/bp-groups.php
r1714 r1718 131 131 $bp->groups->format_notification_function = 'groups_format_notifications'; 132 132 $bp->groups->slug = BP_GROUPS_SLUG; 133 133 134 /* Register this in the active components array */ 135 $bp->active_components[$bp->groups->slug] = $bp->groups->id; 136 134 137 if ( function_exists('bp_wire_install') ) 135 138 $bp->groups->table_name_wire = $wpdb->base_prefix . 'bp_groups_wire'; … … 209 212 210 213 /* Add 'Groups' to the main navigation */ 211 bp_core_new_nav_item( array( 'name' => __('Groups', 'buddypress'), 'slug' => $bp->groups->slug, 'position' => 70, 'screen_function' => 'groups_screen_my_groups', 'default_subnav_slug' => 'my-groups' ) );214 bp_core_new_nav_item( array( 'name' => __('Groups', 'buddypress'), 'slug' => $bp->groups->slug, 'position' => 70, 'screen_function' => 'groups_screen_my_groups', 'default_subnav_slug' => 'my-groups', 'item_css_id' => $bp->groups->id ) ); 212 215 213 216 $groups_link = $bp->loggedin_user->domain . $bp->groups->slug . '/'; … … 277 280 278 281 if ( $bp->groups->current_group->enable_wire && function_exists('bp_wire_install') ) 279 bp_core_new_subnav_item( array( 'name' => __( 'Wire', 'buddypress' ), 'slug' => 'wire', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_wire', 'position' => 50, 'user_has_access' => $bp->groups->current_group->user_has_access, 'item_css_id' => 'group-wire' ) );282 bp_core_new_subnav_item( array( 'name' => __( 'Wire', 'buddypress' ), 'slug' => BP_WIRE_SLUG, 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_wire', 'position' => 50, 'user_has_access' => $bp->groups->current_group->user_has_access, 'item_css_id' => 'group-wire' ) ); 280 283 281 284 bp_core_new_subnav_item( array( 'name' => __( 'Members', 'buddypress' ), 'slug' => 'members', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_members', 'position' => 60, 'user_has_access' => $bp->groups->current_group->user_has_access, 'item_css_id' => 'group-members' ) ); -
trunk/bp-groups/bp-groups-classes.php
r1706 r1718 12 12 var $enable_forum; 13 13 var $date_created; 14 15 var $avatar_thumb; 16 var $avatar_full; 17 14 18 15 var $user_dataset; 19 16 … … 52 49 $this->date_created = strtotime($group->date_created); 53 50 $this->total_member_count = groups_get_groupmeta( $this->id, 'total_member_count' ); 54 55 $gravatar_url = apply_filters( 'bp_gravatar_url', 'http://www.gravatar.com/avatar/' );56 57 if ( !$group->avatar_thumb || strpos( $group->avatar_thumb, 'none-thumbnail' ) )58 $this->avatar_thumb = $gravatar_url . md5( $this->id . '@' . $bp->root_domain ) . '?d=identicon&s=50';59 else60 $this->avatar_thumb = $group->avatar_thumb;61 62 if ( !$group->avatar_full || strpos( $group->avatar_thumb, 'none-' ) )63 $this->avatar_full = $gravatar_url . md5( $this->id . '@' . $bp->root_domain ) . '?d=identicon&s=150';64 else65 $this->avatar_full = $group->avatar_full;66 51 67 52 if ( $get_user_dataset ) { … … 95 80 $this->enable_forum = apply_filters( 'groups_group_enable_forum_before_save', $this->enable_forum, $this->id ); 96 81 $this->date_created = apply_filters( 'groups_group_date_created_before_save', $this->date_created, $this->id ); 97 $this->avatar_thumb = apply_filters( 'groups_group_avatar_thumb_before_save', $this->avatar_thumb, $this->id );98 $this->avatar_full = apply_filters( 'groups_group_avatar_full_before_save', $this->avatar_full, $this->id );99 82 100 83 do_action( 'groups_group_before_save', $this ); … … 111 94 enable_wire = %d, 112 95 enable_forum = %d, 113 date_created = FROM_UNIXTIME(%d), 114 avatar_thumb = %s, 115 avatar_full = %s 96 date_created = FROM_UNIXTIME(%d) 116 97 WHERE 117 98 id = %d … … 125 106 $this->enable_wire, 126 107 $this->enable_forum, 127 $this->date_created, 128 $this->avatar_thumb, 129 $this->avatar_full, 108 $this->date_created, 130 109 $this->id 131 110 ); … … 141 120 enable_wire, 142 121 enable_forum, 143 date_created, 144 avatar_thumb, 145 avatar_full 122 date_created 146 123 ) VALUES ( 147 %d, %s, %s, %s, %s, %s, %d, %d, FROM_UNIXTIME(%d) , %s, %s124 %d, %s, %s, %s, %s, %s, %d, %d, FROM_UNIXTIME(%d) 148 125 )", 149 126 $this->creator_id, … … 155 132 $this->enable_wire, 156 133 $this->enable_forum, 157 $this->date_created, 158 $this->avatar_thumb, 159 $this->avatar_full 134 $this->date_created 160 135 ); 161 136 } -
trunk/bp-messages.php
r1705 r1718 85 85 $bp->messages->format_notification_function = 'messages_format_notifications'; 86 86 $bp->messages->slug = BP_MESSAGES_SLUG; 87 88 /* Register this in the active components array */ 89 $bp->active_components[$bp->messages->slug] = $bp->messages->id; 87 90 } 88 91 add_action( 'plugins_loaded', 'messages_setup_globals', 5 ); … … 111 114 112 115 /* Add 'Messages' to the main navigation */ 113 bp_core_new_nav_item( array( 'name' => __('Messages', 'buddypress'), 'slug' => $bp->messages->slug, 'position' => 50, 'show_for_displayed_user' => false, 'screen_function' => 'messages_screen_inbox', 'default_subnav_slug' => 'inbox' 116 bp_core_new_nav_item( array( 'name' => __('Messages', 'buddypress'), 'slug' => $bp->messages->slug, 'position' => 50, 'show_for_displayed_user' => false, 'screen_function' => 'messages_screen_inbox', 'default_subnav_slug' => 'inbox', 'item_css_id' => $bp->messages->id ) ); 114 117 115 118 $messages_link = $bp->loggedin_user->domain . $bp->messages->slug . '/'; -
trunk/bp-status.php
r1687 r1718 5 5 require ( BP_PLUGIN_DIR . '/bp-status/bp-status-templatetags.php' ); 6 6 require ( BP_PLUGIN_DIR . '/bp-status/bp-status-filters.php' ); 7 8 function bp_status_setup_globals() { 9 global $bp, $wpdb; 10 11 /* For internal identification */ 12 $bp->status->id = 'status'; 13 $bp->status->slug = BP_STATUS_SLUG; 14 15 /* Register this in the active components array */ 16 $bp->active_components[$bp->status->slug] = $bp->status->id; 17 } 18 add_action( 'plugins_loaded', 'bp_status_setup_globals', 5 ); 19 add_action( 'admin_menu', 'bp_status_setup_globals', 1 ); 7 20 8 21 function bp_status_record_activity( $user_id, $content, $primary_link ) { -
trunk/bp-wire.php
r1705 r1718 24 24 25 25 $bp->wire->slug = BP_WIRE_SLUG; 26 27 /* Register this in the active components array */ 28 $bp->active_components[$bp->wire->slug] = $bp->wire->id; 26 29 } 27 30 add_action( 'plugins_loaded', 'bp_wire_setup_globals', 5 ); … … 32 35 33 36 /* Add 'Wire' to the main navigation */ 34 bp_core_new_nav_item( array( 'name' => __('Wire', 'buddypress'), 'slug' => $bp->wire->slug, 'position' => 40, 'screen_function' => 'bp_wire_screen_latest', 'default_subnav_slug' => 'all-posts', ' ') );37 bp_core_new_nav_item( array( 'name' => __('Wire', 'buddypress'), 'slug' => $bp->wire->slug, 'position' => 40, 'screen_function' => 'bp_wire_screen_latest', 'default_subnav_slug' => 'all-posts', 'item_css_id' => $bp->wire->id ) ); 35 38 36 39 $wire_link = $bp->loggedin_user->domain . $bp->wire->slug . '/'; -
trunk/bp-wire/bp-wire-templatetags.php
r1691 r1718 29 29 30 30 } else { 31 $this->table_name = $bp->{$ component_slug}->table_name_wire;31 $this->table_name = $bp->{$bp->active_components[$component_slug]}->table_name_wire; 32 32 } 33 33 … … 83 83 return true; 84 84 } elseif ( $this->current_wire_post + 1 == $this->wire_post_count ) { 85 do_action(' loop_end');85 do_action('bp_wire_loop_end'); 86 86 // Do some cleaning up after the loop 87 87 $this->rewind_wire_posts(); … … 99 99 100 100 if ( 0 == $this->current_wire_post ) // loop has just started 101 do_action(' loop_start');101 do_action('bp_wire_loop_start'); 102 102 } 103 103 } … … 316 316 return apply_filters( 'bp_get_wire_get_action', $bp->displayed_user->domain . $bp->wire->slug . '/post/' ); 317 317 } else { 318 return apply_filters( 'bp_get_wire_get_action', site_url() . '/' . $bp->{$bp-> current_component}->slug . '/' . $uri . '/' . $bp->wire->slug . '/post/' );318 return apply_filters( 'bp_get_wire_get_action', site_url() . '/' . $bp->{$bp->active_components[$bp->current_component]}->slug . '/' . $uri . '/' . $bp->wire->slug . '/post/' ); 319 319 } 320 320 } -
trunk/bp-xprofile.php
r1715 r1718 141 141 $bp->profile->format_notification_function = 'xprofile_format_notifications'; 142 142 $bp->profile->slug = BP_XPROFILE_SLUG; 143 143 144 /* Register this in the active components array */ 145 $bp->active_components[$bp->profile->slug] = $bp->profile->id; 146 144 147 $bp->profile->field_types = apply_filters( 'xprofile_field_types', array( 'textbox', 'textarea', 'radio', 'checkbox', 'selectbox', 'multiselectbox', 'datebox' ) ); 145 148 … … 200 203 201 204 /* Add 'Profile' to the main navigation */ 202 bp_core_new_nav_item( array( 'name' => __('Profile', 'buddypress'), 'slug' => $bp->profile->slug, 'position' => 20, 'screen_function' => 'xprofile_screen_display_profile', 'default_subnav_slug' => 'public' ) );205 bp_core_new_nav_item( array( 'name' => __('Profile', 'buddypress'), 'slug' => $bp->profile->slug, 'position' => 20, 'screen_function' => 'xprofile_screen_display_profile', 'default_subnav_slug' => 'public', 'item_css_id' => $bp->profile->id ) ); 203 206 204 207 $profile_link = $bp->loggedin_user->domain . $bp->profile->slug . '/';
Note: See TracChangeset
for help on using the changeset viewer.