Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/06/2009 03:07:48 AM (17 years ago)
Author:
apeatling
Message:

Converted $bp as an array to $bp as an object. See this post for more info: http://buddypress.org/forums/topic.php?id=1125

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-adminbar.php

    r969 r1021  
    2727        global $bp;
    2828       
    29         echo '<a href="' . $bp['root_domain'] . '"><img id="admin-bar-logo" src="' . apply_filters( 'bp_admin_bar_logo_src', site_url( MUPLUGINDIR . '/bp-core/images/admin_bar_logo.gif' ) ) . '" alt="' . apply_filters( 'bp_admin_bar_logo_alt_text', __( 'BuddyPress', 'buddypress' ) ) . '" /></a>';
     29        echo '<a href="' . $bp->root_domain . '"><img id="admin-bar-logo" src="' . apply_filters( 'bp_admin_bar_logo_src', site_url( MUPLUGINDIR . '/bp-core/images/admin_bar_logo.gif' ) ) . '" alt="' . apply_filters( 'bp_admin_bar_logo_alt_text', __( 'BuddyPress', 'buddypress' ) ) . '" /></a>';
    3030}
    3131
     
    4949       
    5050        /* Sort the nav by key as the array has been put together in different locations */
    51         $bp['bp_nav'] = bp_core_sort_nav_items( $bp['bp_nav'] );
     51        $bp->bp_nav = bp_core_sort_nav_items( $bp->bp_nav );
    5252       
    5353        if ( is_user_logged_in() ) {
     
    6060                /* Loop through each navigation item */
    6161                $counter = 0;
    62                 foreach( $bp['bp_nav'] as $nav_item ) {
     62                foreach( $bp->bp_nav as $nav_item ) {
    6363                        $alt = ( $counter % 2 == 0 ) ? ' class="alt"' : '';
    6464                       
     
    6666                        echo '<a id="bp-admin-' . $nav_item['css_id'] . '" href="' . $nav_item['link'] . '">' . $nav_item['name'] . '</a>';
    6767
    68                         if ( is_array( $bp['bp_options_nav'][$nav_item['css_id']] ) ) {
     68                        if ( is_array( $bp->bp_options_nav[$nav_item['css_id']] ) ) {
    6969                                echo '<ul>';
    7070                                $sub_counter = 0;
    71                                 foreach( $bp['bp_options_nav'][$nav_item['css_id']] as $subnav_item ) {
     71                                foreach( $bp->bp_options_nav[$nav_item['css_id']] as $subnav_item ) {
    7272                                        $alt = ( $sub_counter % 2 == 0 ) ? ' class="alt"' : '';
    7373                                        echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '">' . $subnav_item['name'] . '</a></li>';                               
     
    126126       
    127127                if ( function_exists('bp_blogs_install') ) {
    128                         $blogs = get_blogs_of_user( $bp['loggedin_userid'] ); // find *all* blogs with any kind of role
    129 
    130                         echo '<li><a href="' . $bp['loggedin_domain'] . $bp['blogs']['slug'] . '/my-blogs">';
     128                        $blogs = get_blogs_of_user( $bp->loggedin_user->id ); // find *all* blogs with any kind of role
     129
     130                        echo '<li><a href="' . $bp->loggedin_user->domain . $bp->blogs->slug . '/my-blogs">';
    131131                       
    132132                        _e( 'My Blogs', 'buddypress' );
     
    139139                                $counter = 0;
    140140                                foreach( $blogs as $blog ) {
    141                                         $role = get_blog_role_for_user( $bp['loggedin_userid'], $blog->userblog_id );
     141                                        $role = get_blog_role_for_user( $bp->loggedin_user->id, $blog->userblog_id );
    142142
    143143                                        $alt = ( $counter % 2 == 0 ) ? ' class="alt"' : '';
     
    163163
    164164                        echo '<li' . $alt . '>';
    165                         echo '<a href="' . $bp['loggedin_domain'] . $bp['blogs']['slug'] . '/create-a-blog">' . __('Create a Blog!', 'buddypress') . '</a>';
     165                        echo '<a href="' . $bp->loggedin_user->domain . $bp->blogs->slug . '/create-a-blog">' . __('Create a Blog!', 'buddypress') . '</a>';
    166166                        echo '</li>';
    167167       
     
    177177                global $bp;
    178178               
    179                 echo '<li id="bp-admin-notifications_menu"><a href="' . $bp['loggedin_domain'] . '">';
     179                echo '<li id="bp-admin-notifications_menu"><a href="' . $bp->loggedin_user->domain . '">';
    180180                _e( 'Notifications', 'buddypress' );
    181181       
    182                 if ( $notifications = bp_core_get_notifications_for_user( $bp['loggedin_userid']) ) { ?>
     182                if ( $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id ) ) { ?>
    183183                        <span><?php echo count($notifications) ?></span>
    184184                <?php
     
    196196                        <?php } ?>
    197197                <?php } else { ?>
    198                         <li><a href="<?php echo $bp['loggedin_domain'] ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li>
     198                        <li><a href="<?php echo $bp->loggedin_user->domain ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li>
    199199                <?php
    200200                }
     
    243243                <a href="#"><?php _e( 'Visit', 'buddypress' ) ?></a>
    244244                <ul class="random-list">
    245                         <li><a href="<?php echo $bp['root_domain'] . '/' . MEMBERS_SLUG . '/?random' ?>"><?php _e( 'Random Member', 'buddypress' ) ?></a></li>
     245                        <li><a href="<?php echo $bp->root_domain . '/' . MEMBERS_SLUG . '/?random' ?>"><?php _e( 'Random Member', 'buddypress' ) ?></a></li>
    246246
    247247                        <?php if ( function_exists('groups_install') ) : ?>
    248                         <li class="alt"><a href="<?php echo $bp['root_domain'] . '/' . $bp['groups']['slug'] . '/?random' ?>"><?php _e( 'Random Group', 'buddypress' ) ?></a></li>
     248                        <li class="alt"><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug . '/?random' ?>"><?php _e( 'Random Group', 'buddypress' ) ?></a></li>
    249249                        <?php endif; ?>
    250250
    251251                        <?php if ( function_exists('bp_blogs_install') ) : ?>
    252                         <li><a href="<?php echo $bp['root_domain'] . '/' . $bp['blogs']['slug'] . '/?random-blog' ?>"><?php _e( 'Random Blog', 'buddypress' ) ?></a></li>
     252                        <li><a href="<?php echo $bp->root_domain . '/' . $bp->blogs->slug . '/?random-blog' ?>"><?php _e( 'Random Blog', 'buddypress' ) ?></a></li>
    253253                       
    254254                        <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.