Changeset 1262
- Timestamp:
- 03/26/2009 11:20:12 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core.php
r1250 r1262 14 14 define( 'BP_CORE_DB_VERSION', '1030' ); 15 15 16 /* Place your custom code (actions/filters) in a file called bp-custom.php and it will be loaded before anything else. */ 17 if ( file_exists( WPMU_PLUGIN_DIR . '/bp-custom.php' ) ) 18 require( WPMU_PLUGIN_DIR . '/bp-custom.php' ); 19 16 20 /* Load the language file */ 17 21 if ( file_exists( WPMU_PLUGIN_DIR . '/bp-languages/buddypress-' . get_locale() . '.mo' ) ) 18 22 load_textdomain( 'buddypress', WPMU_PLUGIN_DIR . '/bp-languages/buddypress-' . get_locale() . '.mo' ); 19 23 20 /* Place your custom code (actions/filters) in a file called bp-custom.php and it will be loaded before anything else. */ 21 if ( file_exists( WPMU_PLUGIN_DIR . '/bp-custom.php' ) ) 22 require( WPMU_PLUGIN_DIR . '/bp-custom.php' ); 23 24 /* Load the files containing functions that we globally will need. */ 24 25 require ( 'bp-core/bp-core-catchuri.php' ); 25 26 require ( 'bp-core/bp-core-classes.php' ); … … 32 33 require ( 'bp-core/bp-core-ajax.php' ); 33 34 require ( 'bp-core/bp-core-notifications.php' ); 34 require ( 'bp-core/bp-core-admin.php' );35 require ( 'bp-core/bp-core-signup.php' );36 require ( 'bp-core/bp-core-activation.php' );37 35 38 36 /* Define the slug for member pages and the members directory (e.g. domain.com/[members] ) */ … … 92 90 $bp->displayed_user->domain = bp_core_get_user_domain($displayed_user_id); 93 91 94 /* The component being used eg: http:// andy.domain.com/ [profile] */92 /* The component being used eg: http://domain.com/members/andy/ [profile] */ 95 93 $bp->current_component = $current_component; // type: string 96 94 97 /* The current action for the component eg: http:// andy.domain.com/profile/ [edit] */95 /* The current action for the component eg: http://domain.com/members/andy/profile/ [edit] */ 98 96 $bp->current_action = $current_action; // type: string 99 97 100 /* The action variables for the current action eg: http:// andy.domain.com/profile/edit/ [group] / [6] */98 /* The action variables for the current action eg: http://domain.com/members/andy/profile/edit/ [group] / [6] */ 101 99 $bp->action_variables = $action_variables; // type: array 102 100 103 /* Only used where a component has a sub item, e.g. groups: http:// andy.domain.com/groups/ [my-group] / home - manipulated in the actual component not in catch uri code.*/101 /* Only used where a component has a sub item, e.g. groups: http://domain.com/members/andy/groups/ [my-group] / home - manipulated in the actual component not in catch uri code.*/ 104 102 $bp->current_item = ''; // type: string 105 103 … … 107 105 $bp->is_single_item = false; 108 106 109 /* The default component to use if none are set and someone visits: http:// andy.domain.com/*/107 /* The default component to use if none are set and someone visits: http://domain.com/members/andy */ 110 108 $bp->default_component = 'profile'; 111 109 … … 224 222 global $wpdb, $bp; 225 223 226 if ( is_site_admin() ) { 227 /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */ 228 if ( get_site_option('bp-core-db-version') < BP_CORE_DB_VERSION ) 229 bp_core_install(); 230 } 224 if ( !is_site_admin() ) 225 return false; 226 227 require ( 'bp-core/bp-core-admin.php' ); 228 229 /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */ 230 if ( get_site_option('bp-core-db-version') < BP_CORE_DB_VERSION ) 231 bp_core_install(); 231 232 } 232 233 add_action( 'admin_menu', 'bp_core_check_installed' ); … … 246 247 global $wpdb, $bp; 247 248 248 if ( is_site_admin() ) { 249 /* Add the administration tab under the "Site Admin" tab for site administrators */ 250 add_submenu_page( 'wpmu-admin.php', __("BuddyPress", 'buddypress'), __("BuddyPress", 'buddypress'), 1, "bp_core_admin_settings", "bp_core_admin_settings" ); 251 } 249 if ( !is_site_admin() ) 250 return false; 251 252 /* Add the administration tab under the "Site Admin" tab for site administrators */ 253 add_submenu_page( 'wpmu-admin.php', __("BuddyPress", 'buddypress'), __("BuddyPress", 'buddypress'), 1, "bp_core_admin_settings", "bp_core_admin_settings" ); 254 252 255 } 253 256 add_action( 'admin_menu', 'bp_core_add_admin_menu' ); -
trunk/bp-forums.php
r1250 r1262 21 21 define ( 'BP_FORUMS_PARENT_FORUM_ID', apply_filters( 'bp_forums_parent_forum_id', 0 ) ); 22 22 23 require ( 'bp-forums/bp-forums-admin.php' );24 23 require ( 'bp-forums/bp-forums-bbpress-live.php' ); 25 24 require ( 'bp-forums/bp-forums-templatetags.php' ); 26 25 require ( 'bp-forums/bp-forums-filters.php' ); 26 27 if ( is_admin() ) 28 require ( 'bp-forums/bp-forums-admin.php' ); 27 29 28 30 function bp_forums_setup() { -
trunk/bp-forums/bp-forums-templatetags.php
r1214 r1262 297 297 $this->pag_page = isset( $_REQUEST['page'] ) ? intval( $_REQUEST['page'] ) : 1; 298 298 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $posts_per_page; 299 300 $this->posts = bp_forums_get_posts( $topic_id, $this->pag_num, $this->pag_page ); 299 300 $this->topic_id = $topic_id; 301 $forum_template->topic = (object) bp_forums_get_topic_details( $this->topic_id ); 302 303 $this->posts = bp_forums_get_posts( $this->topic_id, $this->pag_num, $this->pag_page ); 301 304 302 305 if ( !$this->posts ) { … … 305 308 } else { 306 309 $this->post_count = count( $this->posts ); 307 $this->total_post_count = count( bp_forums_get_posts( $topic_id ) ); 308 } 309 310 $this->topic_id = $topic_id; 311 $forum_template->topic = (object) bp_forums_get_topic_details( $topic_id ); 310 $this->total_post_count = (int) $forum_template->topic->topic_posts; 311 } 312 312 313 313 $this->pag_links = paginate_links( array( -
trunk/bp-friends.php
r1250 r1262 22 22 require ( 'bp-friends/bp-friends-cssjs.php' ); 23 23 require ( 'bp-friends/bp-friends-templatetags.php' ); 24 require ( 'bp-friends/bp-friends-notifications.php' );25 24 require ( 'bp-friends/bp-friends-filters.php' ); 26 25 … … 80 79 global $wpdb, $bp; 81 80 82 if ( is_site_admin() ) { 83 /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */ 84 if ( get_site_option('bp-friends-db-version') < BP_FRIENDS_DB_VERSION ) 85 friends_install(); 86 } 81 if ( !is_site_admin() ) 82 return false; 83 84 /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */ 85 if ( get_site_option('bp-friends-db-version') < BP_FRIENDS_DB_VERSION ) 86 friends_install(); 87 87 } 88 88 add_action( 'admin_menu', 'friends_check_installed' ); … … 509 509 510 510 if ( $friendship->save() ) { 511 512 // Add the on screen notification 511 513 bp_core_add_notification( $friendship->initiator_user_id, $friendship->friend_user_id, 'friends', 'friendship_request' ); 514 515 // Send the email notification 516 require_once( 'bp-friends/bp-friends-notifications.php' ); 517 friends_notification_new_request( $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id ); 518 512 519 do_action( 'friends_friendship_requested', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id ); 513 520 … … 566 573 // Record in activity streams 567 574 friends_record_activity( array( 'item_id' => $friendship_id, 'component_name' => 'friends', 'component_action' => 'friendship_accepted', 'is_private' => 0, 'user_id' => $friendship->initiator_user_id, 'secondary_user_id' => $friendship->friend_user_id ) ); 575 576 // Send the email notification 577 require_once( 'bp-friends/bp-friends-notifications.php' ); 578 friends_notification_accepted_request( $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id ); 568 579 569 580 do_action( 'friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id ); -
trunk/bp-friends/bp-friends-notifications.php
r1151 r1262 36 36 wp_mail( $to, $subject, $message ); 37 37 } 38 add_action( 'friends_friendship_requested', 'friends_notification_new_request', 10, 3 ); 38 39 39 40 40 function friends_notification_accepted_request( $friendship_id, $initiator_id, $friend_id ) { … … 71 71 wp_mail( $to, $subject, $message ); 72 72 } 73 add_action( 'friends_friendship_accepted', 'friends_notification_accepted_request', 10, 3 );74 73 75 74 -
trunk/bp-groups.php
r1255 r1262 9 9 Site Wide Only: true 10 10 */ 11 11 12 12 require_once( 'bp-core.php' ); 13 13 … … 23 23 require ( 'bp-groups/bp-groups-templatetags.php' ); 24 24 require ( 'bp-groups/bp-groups-widgets.php' ); 25 require ( 'bp-groups/bp-groups-notifications.php' );26 25 require ( 'bp-groups/bp-groups-filters.php' ); 27 require ( 'bp-groups/bp-groups-admin.php' );28 26 29 27 /************************************************************************** … … 161 159 global $wpdb, $bp; 162 160 163 if ( is_site_admin() ) { 164 /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */ 165 if ( get_site_option('bp-groups-db-version') < BP_GROUPS_DB_VERSION ) 166 groups_install(); 167 } 161 if ( !is_site_admin() ) 162 return false; 163 164 require ( 'bp-groups/bp-groups-admin.php' ); 165 166 /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */ 167 if ( get_site_option('bp-groups-db-version') < BP_GROUPS_DB_VERSION ) 168 groups_install(); 168 169 } 169 170 add_action( 'admin_menu', 'groups_check_installed' ); … … 172 173 global $wpdb, $bp; 173 174 174 if ( is_site_admin() ) { 175 /* Add the administration tab under the "Site Admin" tab for site administrators */ 176 add_submenu_page( 'wpmu-admin.php', __("Groups", 'buddypress'), __("Groups", 'buddypress'), 1, "groups_admin_settings", "groups_admin_settings" ); 177 } 175 if ( !is_site_admin() ) 176 return false; 177 178 /* Add the administration tab under the "Site Admin" tab for site administrators */ 179 add_submenu_page( 'wpmu-admin.php', __("Groups", 'buddypress'), __("Groups", 'buddypress'), 1, "groups_admin_settings", "groups_admin_settings" ); 178 180 } 179 181 add_action( 'admin_menu', 'groups_add_admin_menu' ); … … 1740 1742 return false; 1741 1743 } 1744 1745 require_once ( 'bp-groups/bp-groups-notifications.php' ); 1742 1746 1743 1747 // Send friend invites. … … 1901 1905 return false; 1902 1906 1903 if ( $notify_members ) 1907 if ( $notify_members ) { 1908 require_once ( 'bp-groups/bp-groups-notifications.php' ); 1904 1909 groups_notification_group_updated( $group->id ); 1905 1910 } 1911 1906 1912 do_action( 'groups_details_updated', $group->id ); 1907 1913 … … 2025 2031 if ( $requesting_user->save() ) { 2026 2032 $admins = groups_get_group_admins( $group_id ); 2027 2033 2034 require_once ( 'bp-groups/bp-groups-notifications.php' ); 2035 2028 2036 for ( $i = 0; $i < count( $admins ); $i++ ) { 2029 2037 // Saved okay, now send the email notification … … 2058 2066 2059 2067 /* Send a notification to the user. */ 2068 require_once ( 'bp-groups/bp-groups-notifications.php' ); 2060 2069 groups_notification_membership_request_completed( $membership->user_id, $membership->group_id, true ); 2061 2070 … … 2077 2086 2078 2087 // Send a notification to the user. 2088 require_once ( 'bp-groups/bp-groups-notifications.php' ); 2079 2089 groups_notification_membership_request_completed( $membership->user_id, $membership->group_id, false ); 2080 2090 -
trunk/bp-groups/bp-groups-ajax.php
r1250 r1262 48 48 check_ajax_referer( 'group-filter-box' ); 49 49 50 load_template( get_template_directory(). '/groups/group-loop.php' );50 load_template( TEMPLATEPATH . '/groups/group-loop.php' ); 51 51 } 52 52 add_action( 'wp_ajax_group_filter', 'groups_ajax_group_filter' ); -
trunk/bp-messages.php
r1258 r1262 22 22 require ( 'bp-messages/bp-messages-cssjs.php' ); 23 23 require ( 'bp-messages/bp-messages-templatetags.php' ); 24 require ( 'bp-messages/bp-messages-notifications.php' );25 24 require ( 'bp-messages/bp-messages-filters.php' ); 26 25 … … 131 130 global $wpdb, $bp; 132 131 133 if ( is_site_admin() ) { 134 /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */ 135 if ( get_site_option('bp-messages-db-version') < BP_MESSAGES_DB_VERSION ) 136 messages_install(); 137 } 132 if ( !is_site_admin() ) 133 return false; 134 135 /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */ 136 if ( get_site_option('bp-messages-db-version') < BP_MESSAGES_DB_VERSION ) 137 messages_install(); 138 138 } 139 139 add_action( 'admin_menu', 'messages_check_installed', 1 ); … … 478 478 $type = 'success'; 479 479 480 // Send notices to the recipients480 // Send screen notifications to the recipients 481 481 for ( $i = 0; $i < count($pmessage->recipients); $i++ ) { 482 482 if ( $pmessage->recipients[$i] != $bp->loggedin_user->id ) { … … 485 485 } 486 486 487 // Send email notifications to the recipients 488 require_once( 'bp-messages/bp-messages-notifications.php' ); 489 messages_notification_new_message( array( 'item_id' => $pmessage->id, 'recipient_ids' => $pmessage->recipients, 'thread_id' => $pmessage->thread_id, 'component_name' => 'messages', 'component_action' => 'message_sent', 'is_private' => 1 ) ); 490 487 491 do_action( 'messages_send_message', array( 'item_id' => $pmessage->id, 'recipient_ids' => $pmessage->recipients, 'thread_id' => $pmessage->thread_id, 'component_name' => 'messages', 'component_action' => 'message_sent', 'is_private' => 1 ) ); 488 492 -
trunk/bp-messages/bp-messages-notifications.php
r1058 r1262 36 36 } 37 37 } 38 add_action( 'messages_send_message', 'messages_notification_new_message' ); 38 39 39 40 40 /* This is too expensive to send on normal servers uncomment at your own risk. */ -
trunk/bp-xprofile.php
r1255 r1262 18 18 define ( 'BP_XPROFILE_SLUG', apply_filters( 'xprofile_slug', 'profile' ) ); 19 19 20 /* Database access classes and functions */21 20 require ( 'bp-xprofile/bp-xprofile-classes.php' ); 22 23 /* Functions for handling the admin area tabs for administrators */24 require ( 'bp-xprofile/bp-xprofile-admin.php' );25 26 /* Functions for applying filters to Xprofile specfic output */27 21 require ( 'bp-xprofile/bp-xprofile-filters.php' ); 28 29 /* Functions to handle the modification and saving of signup pages */30 22 require ( 'bp-xprofile/bp-xprofile-signup.php' ); 31 32 /* Template tag functions that can be used in theme template files */33 23 require ( 'bp-xprofile/bp-xprofile-templatetags.php' ); 34 35 /* Functions to handle the sending of email notifications */36 24 require ( 'bp-xprofile/bp-xprofile-notifications.php' ); 37 38 /* Functions to handle the selective inclusion of CSS and JS files */39 25 require ( 'bp-xprofile/bp-xprofile-cssjs.php' ); 40 26 … … 195 181 return false; 196 182 183 require ( 'bp-xprofile/bp-xprofile-admin.php' ); 184 197 185 /* Add the administration tab under the "Site Admin" tab for site administrators */ 198 186 add_submenu_page( 'wpmu-admin.php', __("Profile Fields", 'buddypress'), __("Profile Fields", 'buddypress'), 1, "xprofile_settings", "xprofile_admin" );
Note: See TracChangeset
for help on using the changeset viewer.