Skip to:
Content

BuddyPress.org

Changeset 2227


Ignore:
Timestamp:
12/30/2009 03:18:18 PM (17 years ago)
Author:
apeatling
Message:

Fixed support for single WP in a subdirectory.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r2224 r2227  
    14781478 */
    14791479function bp_core_get_site_path() {
    1480         global $current_site;
    1481 
    1482         return $current_site->path;
     1480        global $bp, $current_site;
     1481
     1482        if ( bp_core_is_multiblog_install() )
     1483                $path = $current_site->path;
     1484        else {
     1485                $site_path = (array) explode( '/', site_url() );
     1486
     1487                if ( count( $site_path ) < 2 )
     1488                        $site_path = '/';
     1489                else {
     1490                        /* Unset the first three segments (http(s):// part) */
     1491                        unset( $site_path[0] );
     1492                        unset( $site_path[1] );
     1493                        unset( $site_path[2] );
     1494
     1495                        $site_path = implode( '/', $site_path );
     1496                }
     1497        }
     1498
     1499        return apply_filters( 'bp_core_get_site_path', $site_path );
    14831500}
    14841501
  • trunk/bp-core/bp-core-cssjs.php

    r2209 r2227  
    169169
    170170        echo
    171 '<script type="text/javascript">var ajaxurl = "' . $bp->root_domain . str_replace( 'index.php', 'wp-load.php', $_SERVER['SCRIPT_NAME'] ) . '";</script>
     171'<script type="text/javascript">var ajaxurl = "' . site_url( 'wp-load.php' ) . '";</script>
    172172';
    173173}
  • trunk/bp-core/bp-core-templatetags.php

    r2224 r2227  
    852852        } else if ( bp_is_blog_page() ) {
    853853                if ( is_single() ) {
    854                         $title = __( 'Blog &#8212; ' . $post->post_title, 'buddypress' );
     854                        $title = __( 'Blog &#124; ' . $post->post_title, 'buddypress' );
    855855                } else if ( is_category() ) {
    856                         $title = __( 'Blog &#8212; Categories &#8212; ' . ucwords( $wp_query->query_vars['category_name'] ), 'buddypress' );
     856                        $title = __( 'Blog &#124; Categories &#124; ' . ucwords( $wp_query->query_vars['category_name'] ), 'buddypress' );
    857857                } else if ( is_tag() ) {
    858                         $title = __( 'Blog &#8212; Tags &#8212; ' . ucwords( $wp_query->query_vars['tag'] ), 'buddypress' );
     858                        $title = __( 'Blog &#124; Tags &#124; ' . ucwords( $wp_query->query_vars['tag'] ), 'buddypress' );
    859859                } else
    860860                        $title = __( 'Blog', 'buddypress' );
    861861
    862862        } else if ( !empty( $bp->displayed_user->fullname ) ) {
    863                 $title = strip_tags( $bp->displayed_user->fullname . ' &#8212; ' . ucwords( $bp->current_component ) . ' &#8212; ' . $bp->bp_options_nav[$bp->current_component][$bp->current_action]['name'] );
     863                $title = strip_tags( $bp->displayed_user->fullname . ' &#124; ' . ucwords( $bp->current_component ) . ' &#124; ' . $bp->bp_options_nav[$bp->current_component][$bp->current_action]['name'] );
    864864        } else if ( $bp->is_single_item ) {
    865                 $title = ucwords( $bp->current_component ) . ' &#8212; ' . $bp->bp_options_title;
     865                $title = ucwords( $bp->current_component ) . ' &#124; ' . $bp->bp_options_title;
    866866        } else if ( $bp->is_directory ) {
    867867                if ( !$bp->current_component )
     
    880880        }
    881881
    882         return apply_filters( 'bp_page_title', $blog_title . ' &#8212; ' . attribute_escape( $title ), attribute_escape( $title ) );
     882        return apply_filters( 'bp_page_title', $blog_title . ' &#124; ' . attribute_escape( $title ), attribute_escape( $title ) );
    883883}
    884884
Note: See TracChangeset for help on using the changeset viewer.