Skip to:
Content

BuddyPress.org

Changeset 388


Ignore:
Timestamp:
10/10/2008 11:47:28 PM (16 years ago)
Author:
apeatling
Message:

Fixed issues with 404's on group pages with sub directory installations.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r375 r388  
    22/* Define the current version number for checking if DB tables are up to date. */
    33define( 'BP_CORE_VERSION', '0.2.5' );
     4
     5/* These components are accessed via the root, and not under a blog name or home base.
     6   e.g Groups is accessed via: http://domain.com/groups/group-name NOT http://domain.com.andy/groups/group-name */
     7define( 'BP_CORE_ROOT_COMPONENTS', 'groups' );
    48
    59/* Require all needed files */
     
    104108        'image_base' => site_url() . '/wp-content/mu-plugins/bp-core/images',
    105109    );
    106 
    107 
     110   
    108111    if ( !$bp['current_component'] )
    109112        $bp['current_component'] = $bp['default_component'];
  • trunk/bp-core/bp-core-catchuri.php

    r375 r388  
    2525 *
    2626 * @package BuddyPress Core
    27  * @global $menu WordPress admin navigation array global
    28  * @global $submenu WordPress admin sub navigation array global
    29  * @global $thirdlevel BuddyPress admin third level navigation
    30  * @uses add_menu_page() WordPress function to add a new top level admin navigation tab
    3127 */
    3228function bp_core_set_uri_globals() {
    3329    global $current_component, $current_action, $action_variables;
     30   
     31    /* Fetch the current URI and explode each part seperated by '/' into an array */
     32    $bp_uri = explode( "/", $_SERVER['REQUEST_URI'] );
     33
     34    /* This is used to determine where the component and action indexes should start */
     35    $root_components = explode( ',', BP_CORE_ROOT_COMPONENTS );
     36    $is_root_component = in_array( $bp_uri[1], $root_components );
    3437   
    3538    /* Set the indexes, these are incresed by one if we are not on a VHOST install */
     
    3740    $action_index = 1;
    3841
    39     if ( VHOST == 'no' ) {
     42    if ( VHOST == 'no' && !$is_root_component ) {
    4043        $component_index++;
    4144        $action_index++;
    4245    }
    43 
    44     /* Fetch the current URI and explode each part seperated by '/' into an array */
    45     $bp_uri = explode( "/", $_SERVER['REQUEST_URI'] );
    4646
    4747    /* Take empties off the end */
  • trunk/bp-groups.php

    r380 r388  
    232232function groups_get_group_theme() {
    233233    global $current_component, $current_action, $is_single_group;
    234    
     234       
    235235    // The theme filter does not recognize any globals, where as the stylesheet filter does.
    236236    // We have to set up the globals to use manually.
     
    800800                do_action( 'groups_created_group', array( 'group_id' => $group->id ) );
    801801               
    802                 header( "Location: " . $bp['loggedin_domain'] . $bp['groups']['slug'] . "/" . $group->slug );
     802                header( "Location: " . bp_group_permalink( $group, false ) );
    803803               
    804804            break;
Note: See TracChangeset for help on using the changeset viewer.