Changeset 1021 for trunk/bp-activity.php
- Timestamp:
- 02/06/2009 03:07:48 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/bp-activity.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r1017 r1021 27 27 global $wpdb, $bp; 28 28 29 if ( !$bp ['current_userid'])29 if ( !$bp->displayed_user->id ) 30 30 return false; 31 31 … … 33 33 $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; 34 34 35 $sql[] = "CREATE TABLE ". $bp ['activity']['table_name_current_user']." (35 $sql[] = "CREATE TABLE ". $bp->activity->table_name_current_user ." ( 36 36 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, 37 37 item_id int(11) NOT NULL, … … 49 49 ) {$charset_collate};"; 50 50 51 $sql[] = "CREATE TABLE ". $bp ['activity']['table_name_current_user_cached']." (51 $sql[] = "CREATE TABLE ". $bp->activity->table_name_current_user_cached ." ( 52 52 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, 53 53 item_id int(11) NOT NULL, … … 67 67 ) {$charset_collate};"; 68 68 69 $sql[] = "CREATE TABLE ". $bp ['activity']['table_name_current_user_friends_cached']." (69 $sql[] = "CREATE TABLE ". $bp->activity->table_name_current_user_friends_cached ." ( 70 70 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, 71 71 user_id int(11) NOT NULL, … … 85 85 dbDelta($sql); 86 86 87 update_usermeta( $bp ['current_userid'], 'bp-activity-db-version', BP_ACTIVITY_DB_VERSION );87 update_usermeta( $bp->displayed_user->id, 'bp-activity-db-version', BP_ACTIVITY_DB_VERSION ); 88 88 } 89 89 … … 94 94 $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; 95 95 96 $sql[] = "CREATE TABLE ". $bp ['activity']['table_name_sitewide']." (96 $sql[] = "CREATE TABLE ". $bp->activity->table_name_sitewide ." ( 97 97 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, 98 98 user_id int(11) NOT NULL, … … 117 117 // dbDelta won't change character sets, so we need to do this seperately. 118 118 // This will only be in here pre v1.0 119 $wpdb->query( $wpdb->prepare( "ALTER TABLE " . $bp ['activity']['table_name_sitewide']. " DEFAULT CHARACTER SET %s", $wpdb->charset ) );119 $wpdb->query( $wpdb->prepare( "ALTER TABLE " . $bp->activity->table_name_sitewide . " DEFAULT CHARACTER SET %s", $wpdb->charset ) ); 120 120 121 121 update_site_option( 'bp-activity-db-version', BP_ACTIVITY_DB_VERSION ); … … 132 132 global $bp, $wpdb, $current_blog; 133 133 134 $bp['activity'] = array( 135 'table_name_loggedin_user' => $wpdb->base_prefix . 'user_' . $bp['loggedin_userid'] . '_activity', 136 'table_name_loggedin_user_cached' => $wpdb->base_prefix . 'user_' . $bp['loggedin_userid'] . '_activity_cached', 137 138 'table_name_current_user' => $wpdb->base_prefix . 'user_' . $bp['current_userid'] . '_activity', 139 'table_name_current_user_cached' => $wpdb->base_prefix . 'user_' . $bp['current_userid'] . '_activity_cached', 140 141 'table_name_loggedin_user_friends_cached' => $wpdb->base_prefix . 'user_' . $bp['loggedin_userid'] . '_friends_activity_cached', 142 'table_name_current_user_friends_cached' => $wpdb->base_prefix . 'user_' . $bp['current_userid'] . '_friends_activity_cached', 143 144 'table_name_sitewide' => $wpdb->base_prefix . 'bp_activity_sitewide', 145 146 'image_base' => site_url( MUPLUGINDIR . '/bp-activity/images' ), 147 'slug' => BP_ACTIVITY_SLUG 148 ); 149 150 $bp['version_numbers'][$bp['activity']['slug']] = BP_ACTIVITY_VERSION; 151 152 if ( $bp['current_userid'] ) { 134 $bp->activity->table_name_loggedin_user = $wpdb->base_prefix . 'user_' . $bp->loggedin_user->id . '_activity'; 135 $bp->activity->table_name_loggedin_user_cached = $wpdb->base_prefix . 'user_' . $bp->loggedin_user->id . '_activity_cached'; 136 137 $bp->activity->table_name_current_user = $wpdb->base_prefix . 'user_' . $bp->displayed_user->id . '_activity'; 138 $bp->activity->table_name_current_user_cached = $wpdb->base_prefix . 'user_' . $bp->displayed_user->id . '_activity_cached'; 139 140 $bp->activity->table_name_loggedin_user_friends_cached = $wpdb->base_prefix . 'user_' . $bp->loggedin_user->id . '_friends_activity_cached'; 141 $bp->activity->table_name_current_user_friends_cached = $wpdb->base_prefix . 'user_' . $bp->displayed_user->id . '_friends_activity_cached'; 142 143 $bp->activity->table_name_sitewide = $wpdb->base_prefix . 'bp_activity_sitewide'; 144 145 $bp->activity->image_base = site_url( MUPLUGINDIR . '/bp-activity/images' ); 146 $bp->activity->slug = BP_ACTIVITY_SLUG; 147 148 $bp->version_numbers->activity = BP_ACTIVITY_VERSION; 149 150 if ( $bp->displayed_user->id ) { 153 151 /* Check to see if the current user has their activity table set up. If not, set them up. */ 154 if ( !$wpdb->get_var("SHOW TABLES LIKE '%" . $bp ['activity']['table_name_current_user'] . "%'") || get_usermeta( $bp['current_userid'], 'bp-activity-db-version' ) < BP_ACTIVITY_VERSION )152 if ( !$wpdb->get_var("SHOW TABLES LIKE '%" . $bp->activity->table_name_current_user . "%'") || get_usermeta( $bp->displayed_user->id, 'bp-activity-db-version' ) < BP_ACTIVITY_VERSION ) 155 153 bp_activity_user_install(); 156 154 } … … 158 156 if ( is_site_admin() && $current_blog->blog_id == 1 ) { 159 157 /* Check to see if the site wide activity table is set up. */ 160 if ( !$wpdb->get_var("SHOW TABLES LIKE '%" . $bp ['activity']['table_name_sitewide']. "%'") || get_site_option( 'bp-activity-db-version' ) < BP_ACTIVITY_VERSION )158 if ( !$wpdb->get_var("SHOW TABLES LIKE '%" . $bp->activity->table_name_sitewide . "%'") || get_site_option( 'bp-activity-db-version' ) < BP_ACTIVITY_VERSION ) 161 159 bp_activity_sitewide_install(); 162 160 } … … 176 174 177 175 /* Add 'Activity' to the main navigation */ 178 bp_core_add_nav_item( __('Activity', 'buddypress'), $bp ['activity']['slug']);179 bp_core_add_nav_default( $bp ['activity']['slug'], 'bp_activity_screen_my_activity', 'just-me' );176 bp_core_add_nav_item( __('Activity', 'buddypress'), $bp->activity->slug ); 177 bp_core_add_nav_default( $bp->activity->slug, 'bp_activity_screen_my_activity', 'just-me' ); 180 178 181 $activity_link = $bp ['loggedin_domain'] . $bp['activity']['slug']. '/';179 $activity_link = $bp->loggedin_user->domain . $bp->activity->slug . '/'; 182 180 183 181 /* Add the subnav items to the activity nav item */ 184 bp_core_add_subnav_item( $bp ['activity']['slug'], 'just-me', __('Just Me', 'buddypress'), $activity_link, 'bp_activity_screen_my_activity' );185 bp_core_add_subnav_item( $bp ['activity']['slug'], 'my-friends', __('My Friends', 'buddypress'), $activity_link, 'bp_activity_screen_friends_activity', 'activity-my-friends', bp_is_home() );186 187 if ( $bp ['current_component'] == $bp['activity']['slug']) {182 bp_core_add_subnav_item( $bp->activity->slug, 'just-me', __('Just Me', 'buddypress'), $activity_link, 'bp_activity_screen_my_activity' ); 183 bp_core_add_subnav_item( $bp->activity->slug, 'my-friends', __('My Friends', 'buddypress'), $activity_link, 'bp_activity_screen_friends_activity', 'activity-my-friends', bp_is_home() ); 184 185 if ( $bp->current_component == $bp->activity->slug ) { 188 186 if ( bp_is_home() ) { 189 $bp ['bp_options_title'] = __('My Activity', 'buddypress');187 $bp->bp_options_title = __( 'My Activity', 'buddypress' ); 190 188 } else { 191 $bp ['bp_options_avatar'] = bp_core_get_avatar( $bp['current_userid'], 1 );192 $bp ['bp_options_title'] = $bp['current_fullname'];189 $bp->bp_options_avatar = bp_core_get_avatar( $bp->displayed_user->id, 1 ); 190 $bp->bp_options_title = $bp->displayed_user->fullname; 193 191 } 194 192 } … … 215 213 216 214 if ( !$user_id ) 217 $user_id = $bp ['loggedin_userid'];215 $user_id = $bp->loggedin_user->id; 218 216 219 217 $recorded_time = time(); … … 255 253 global $bp; 256 254 257 if ( $bp ['current_component'] != $bp['activity']['slug'] || $bp['current_action'] != 'feed' || $bp['current_userid'])255 if ( $bp->current_component != $bp->activity->slug || $bp->current_action != 'feed' || $bp->displayed_user->id ) 258 256 return false; 259 257 … … 266 264 global $bp; 267 265 268 if ( $bp ['current_component'] != $bp['activity']['slug'] || !$bp['current_userid'] || $bp['current_action']!= 'feed' )266 if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'feed' ) 269 267 return false; 270 268 … … 277 275 global $bp; 278 276 279 if ( $bp ['current_component'] != $bp['activity']['slug'] || !$bp['current_userid'] || $bp['current_action'] != 'my-friends' || $bp['action_variables'][0] != 'feed' )277 if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'my-friends' || $bp->action_variables[0] != 'feed' ) 280 278 return false; 281 279
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)