Changeset 9936 for trunk/src/bp-forums/bp-forums-loader.php
- Timestamp:
- 06/11/2015 06:53:59 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-forums/bp-forums-loader.php
r9819 r9936 50 50 51 51 // Define the parent forum ID 52 if ( ! defined( 'BP_FORUMS_PARENT_FORUM_ID' ) )52 if ( ! defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ) { 53 53 define( 'BP_FORUMS_PARENT_FORUM_ID', 1 ); 54 } 54 55 55 56 // Define a slug, if necessary 56 if ( ! defined( 'BP_FORUMS_SLUG' ) )57 if ( ! defined( 'BP_FORUMS_SLUG' ) ) { 57 58 define( 'BP_FORUMS_SLUG', $this->id ); 59 } 58 60 59 61 // The location of the bbPress stand-alone config file 60 62 $bbconfig = bp_core_get_root_option( 'bb-config-location' ); 61 if ( '' !== $bbconfig ) 63 if ( '' !== $bbconfig ) { 62 64 $this->bbconfig = $bbconfig; 65 } 63 66 64 67 // All globals for messaging component. … … 95 98 96 99 // bbPress stand-alone 97 if ( ! defined( 'BB_PATH' ) )100 if ( ! defined( 'BB_PATH' ) ) { 98 101 $includes[] = 'bbpress-sa'; 102 } 99 103 100 104 // Admin-specific code … … 122 126 123 127 // Stop if forums haven't been set up yet 124 if ( ! bp_forums_is_installed_correctly() )128 if ( ! bp_forums_is_installed_correctly() ) { 125 129 return; 130 } 126 131 127 132 // Stop if there is no user displayed or logged in 128 if ( ! is_user_logged_in() && !bp_displayed_user_id() )133 if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { 129 134 return; 130 131 // Add 'Forums' to the main navigation 132 $main_nav = array( 133 'name' => __( 'Forums', 'buddypress' ), 134 'slug' => $this->slug, 135 'position' => 80, 136 'screen_function' => 'bp_member_forums_screen_topics', 137 'default_subnav_slug' => 'topics', 138 'item_css_id' => $this->id 139 ); 135 } 140 136 141 137 // Determine user to use … … 149 145 150 146 // User link 151 $forums_link = trailingslashit( $user_domain . $this->slug ); 152 153 // Additional menu if friends is active 147 $slug = bp_get_forums_slug(); 148 $forums_link = trailingslashit( $user_domain . $slug ); 149 150 // Add 'Forums' to the main navigation 151 $main_nav = array( 152 'name' => __( 'Forums', 'buddypress' ), 153 'slug' => $slug, 154 'position' => 80, 155 'screen_function' => 'bp_member_forums_screen_topics', 156 'default_subnav_slug' => 'topics', 157 'item_css_id' => $this->id 158 ); 159 160 // Topics started 154 161 $sub_nav[] = array( 155 162 'name' => __( 'Topics Started', 'buddypress' ), 156 163 'slug' => 'topics', 157 164 'parent_url' => $forums_link, 158 'parent_slug' => $ this->slug,165 'parent_slug' => $slug, 159 166 'screen_function' => 'bp_member_forums_screen_topics', 160 167 'position' => 20, … … 162 169 ); 163 170 164 // Additional menu if friends is active171 // Topics replied to 165 172 $sub_nav[] = array( 166 173 'name' => __( 'Replied To', 'buddypress' ), 167 174 'slug' => 'replies', 168 175 'parent_url' => $forums_link, 169 'parent_slug' => $ this->slug,176 'parent_slug' => $slug, 170 177 'screen_function' => 'bp_member_forums_screen_replies', 171 178 'position' => 40, … … 192 199 193 200 // Setup the logged in user variables 194 $forums_link = trailingslashit( bp_loggedin_user_domain() . $this->slug);201 $forums_link = trailingslashit( bp_loggedin_user_domain() . bp_get_forums_slug() ); 195 202 196 203 // Add the "My Account" sub menus … … 199 206 'id' => 'my-account-' . $this->id, 200 207 'title' => __( 'Forums', 'buddypress' ), 201 'href' => trailingslashit( $forums_link )208 'href' => $forums_link 202 209 ); 203 210 … … 207 214 'id' => 'my-account-' . $this->id . '-topics-started', 208 215 'title' => __( 'Topics Started', 'buddypress' ), 209 'href' => trailingslashit( $forums_link . 'topics' )216 'href' => $forums_link 210 217 ); 211 218 … … 234 241 */ 235 242 public function setup_title() { 236 $bp = buddypress();237 243 238 244 // Adjust title based on view 239 245 if ( bp_is_forums_component() ) { 246 $bp = buddypress(); 247 240 248 if ( bp_is_my_profile() ) { 241 249 $bp->bp_options_title = __( 'Forums', 'buddypress' );
Note: See TracChangeset
for help on using the changeset viewer.