Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/12/2010 12:31:49 PM (15 years ago)
Author:
apeatling
Message:

Fixing the use of deprecated template tags in bp-default. Merged the fetching of BP runtime settings into one query to significantly reduce the number of run time database hits. Fixed #1916

File:
1 edited

Legend:

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

    r2690 r2695  
    393393    </form>
    394394<?php
    395 }
    396 
    397 function bp_home_blog_url() {
    398     global $bp, $current_blog;
    399 
    400     if ( defined( 'BP_ENABLE_MULTIBLOG' ) ) {
    401         $blog_id = $current_blog->blog_id;
    402     } else {
    403         $blog_id = BP_ROOT_BLOG;
    404     }
    405 
    406     if ( 'bphome' == get_blog_option( $blog_id, 'template' ) )
    407         echo $bp->root_domain . '/' . BP_HOME_BLOG_SLUG;
    408     else
    409         echo $bp->root_domain;
    410395}
    411396
     
    475460    echo apply_filters( 'bp_logout_nav_link', $logout_link );
    476461}
    477     /* DEPRECATED - use bp_get_loggedin_user_nav() */
    478     function bp_get_nav() { bp_get_loggedin_user_nav(); }
    479462
    480463/**
     
    508491    }
    509492}
    510     /* DEPRECATED - use bp_get_displayed_user_nav() */
    511     function bp_get_user_nav() { bp_get_displayed_user_nav(); }
    512493
    513494/**
     
    874855    global $bp, $is_member_page, $wp_query;
    875856
    876     if ( $bp->current_component == BP_HOME_BLOG_SLUG )
    877         return true;
    878 
    879857    if ( $wp_query->is_home && !$bp->is_directory )
    880858        return true;
     
    1001979    }
    1002980
    1003     if ( function_exists( 'bp_forums_setup' ) && !(int) get_site_option( 'bp-disable-forum-directory' ) ) {
     981    if ( function_exists( 'bp_forums_setup' ) && !(int) $bp->site_options['bp-disable-forum-directory'] ) {
    1004982        $selection_box .= '<option value="forums">' . __( 'Forums', 'buddypress' ) . '</option>';
    1005983    }
     
    10361014
    10371015    echo apply_filters( 'bp_logout_link', $logout_link );
    1038 }
    1039 
    1040 function bp_nav_items() {
    1041     global $bp;
    1042     // This is deprecated, you should put these navigation items in your template header.php for easy editing.
    1043 ?>
    1044     <li<?php if ( bp_is_page( 'home' ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a></li>
    1045     <li<?php if ( bp_is_page( BP_HOME_BLOG_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_HOME_BLOG_SLUG ?>" title="<?php _e( 'Blog', 'buddypress' ) ?>"><?php _e( 'Blog', 'buddypress' ) ?></a></li>
    1046     <li<?php if ( bp_is_page( BP_MEMBERS_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_MEMBERS_SLUG ?>" title="<?php _e( 'Members', 'buddypress' ) ?>"><?php _e( 'Members', 'buddypress' ) ?></a></li>
    1047 
    1048     <?php if ( function_exists( 'groups_install' ) ) { ?>
    1049         <li<?php if ( bp_is_page( $bp->groups->slug ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo $bp->groups->slug ?>" title="<?php _e( 'Groups', 'buddypress' ) ?>"><?php _e( 'Groups', 'buddypress' ) ?></a></li>
    1050     <?php } ?>
    1051 
    1052     <?php if ( function_exists( 'bp_blogs_install' ) ) { ?>
    1053         <li<?php if ( bp_is_page( $bp->blogs->slug ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo $bp->blogs->slug ?>" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a></li>
    1054     <?php } ?>
    1055 <?php
    1056     do_action( 'bp_nav_items' );
    10571016}
    10581017
     
    12401199}
    12411200    function bp_get_signup_allowed() {
     1201        global $bp;
     1202
    12421203        if ( bp_core_is_multisite() ) {
    1243             if ( in_array( get_site_option( 'registration' ), array( 'all', 'user' ) ) )
     1204            if ( in_array( $bp->site_options['registration'], array( 'all', 'user' ) ) )
    12441205                return true;
    12451206        } else {
     
    12541215}
    12551216    function bp_get_blog_signup_allowed() {
     1217        global $bp;
     1218
    12561219        if ( !bp_core_is_multisite() )
    12571220            return false;
    12581221
    1259         $status = get_site_option( 'registration' );
     1222        $status = $bp->site_options['registration'];
    12601223        if ( 'none' != $status && 'user' != $status )
    12611224            return true;
     
    12841247    }
    12851248
     1249function bp_get_option( $option_name ) {
     1250    global $bp;
     1251
     1252    return apply_filters( 'bp_get_option', $bp->site_options[$option_name] );
     1253}
    12861254
    12871255/*** CUSTOM LOOP TEMPLATE CLASSES *******************/
Note: See TracChangeset for help on using the changeset viewer.