Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/27/2009 10:41:10 AM (16 years ago)
Author:
apeatling
Message:

Single WP support. Yes, you read that correctly.

File:
1 edited

Legend:

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

    r2199 r2209  
    11<?php
    2 
    32/***
    43 * Members template loop that will allow you to loop all members or friends of a member
     
    902901
    903902function bp_has_custom_signup_page() {
    904     if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/register.php') )
    905         return true;
    906 
    907     if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/registration/register.php') )
    908         return true;
    909 
    910     return false;
    911 }
    912 
    913 function bp_signup_page( $deprecated = true ) {
    914     if ( !$deprecated )
    915         return bp_get_signup_page();
    916     else
    917         echo bp_get_signup_page();
     903    if ( locate_template( array( 'register.php' ), false ) || locate_template( array( '/registration/register.php' ), false ) )
     904        return true;
     905
     906    return false;
     907}
     908
     909function bp_signup_page() {
     910    echo bp_get_signup_page();
    918911}
    919912    function bp_get_signup_page() {
    920913        global $bp;
    921914
    922         if ( bp_has_custom_signup_page() ) {
    923                 return apply_filters( 'bp_get_signup_page', $bp->root_domain . '/' . BP_REGISTER_SLUG );
    924         } else {
    925                 return apply_filters( 'bp_get_signup_page', $bp->root_domain . '/wp-signup.php' );
    926         }
     915        if ( bp_has_custom_signup_page() )
     916            $page = $bp->root_domain . '/' . BP_REGISTER_SLUG;
     917        else
     918            $page = $bp->root_domain . '/wp-signup.php';
     919
     920        return apply_filters( 'bp_get_signup_page', $page );
    927921    }
    928922
     
    937931}
    938932
    939 function bp_activation_page( $echo = true ) {
    940     global $bp;
    941 
    942     if ( bp_has_custom_activation_page() ) {
    943         if ( $echo )
    944             echo $bp->root_domain . '/' . BP_ACTIVATION_SLUG;
     933function bp_activation_page() {
     934    echo bp_get_activation_page();
     935}
     936    function bp_get_activation_page() {
     937        global $bp;
     938
     939        if ( bp_has_custom_activation_page() )
     940            $page = $bp->root_domain . '/' . BP_ACTIVATION_SLUG;
    945941        else
    946             return $bp->root_domain . '/' . BP_ACTIVATION_SLUG;
    947     } else {
    948         if ( $echo )
    949             echo $bp->root_domain . '/wp-activate.php';
    950         else
    951             return $bp->root_domain . '/wp-activate.php';
    952     }
    953 }
     942            $page = $bp->root_domain . '/wp-activate.php';
     943
     944        return apply_filters( 'bp_get_activation_page', $page );
     945    }
    954946
    955947function bp_search_form_action() {
     
    12191211}
    12201212    function bp_get_signup_allowed() {
    1221         return get_site_option( 'registration' );
     1213        if ( bp_core_is_multiblog_install() )
     1214            return get_site_option( 'registration' );
     1215        else {
     1216            if ( (int)get_option( 'users_can_register') )
     1217                return 'user';
     1218        }
     1219
     1220        return false;
    12221221    }
    12231222
     
    12261225
    12271226    return $bp->activation_complete;
     1227}
     1228
     1229function bp_registration_needs_activation() {
     1230    return apply_filters( 'bp_registration_needs_activation', bp_core_is_multiblog_install() );
    12281231}
    12291232
Note: See TracChangeset for help on using the changeset viewer.