Skip to:
Content

BuddyPress.org

Changeset 3365


Ignore:
Timestamp:
11/06/2010 07:04:00 PM (16 years ago)
Author:
djpaul
Message:

Fixes quite a lot more WP_DEBUG warnings.

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r3337 r3365  
    247247                                $redirect = bp_get_group_permalink( $group ) . $bp->activity->slug . '/' . $activity->id . '/';
    248248                }
    249         } else
     249        } else {
    250250                $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . $bp->activity->slug . '/' . $activity->id;
     251        }
    251252
    252253        $redirect = apply_filters( 'bp_activity_permalink_redirect_url', $redirect, &$activity );
  • trunk/bp-activity/bp-activity-classes.php

    r3345 r3365  
    179179                        return false;
    180180
     181                $pag_sql = '';
    181182                if ( $per_page && $page )
    182183                        $pag_sql = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $per_page ), intval( $per_page ) );
     
    337338                global $bp, $wpdb;
    338339
     340                $activity_comments = array();
     341
    339342                /* Now fetch the activity comments and parse them into the correct position in the activities array. */
    340343                foreach( (array)$activities as $activity ) {
     
    345348                /* Merge the comments with the activity items */
    346349                foreach( (array)$activities as $key => $activity )
    347                         $activities[$key]->children = $activity_comments[$activity->id];
     350                        if ( isset( $activity_comments[$activity->id] ) )
     351                                $activities[$key]->children = $activity_comments[$activity->id];
    348352
    349353                return $activities;
  • trunk/bp-activity/bp-activity-templatetags.php

    r3337 r3365  
    642642                global $activities_template, $bp;
    643643
    644                 if ( !$activities_template->activity->children )
     644                if ( !isset( $activities_template->activity->children ) || !$activities_template->activity->children )
    645645                        return false;
    646646
     
    690690                global $activities_template, $bp;
    691691
    692                 if ( !$activities_template->activity->children )
     692                if ( !isset( $activities_template->activity->children ) || !$activities_template->activity->children )
    693693                        return 0;
    694694
     
    724724        function bp_get_activity_comment_form_nojs_display() {
    725725                global $activities_template;
    726                 if ( $_GET['ac'] == $activities_template->activity->id . '/' )
     726                if ( isset( $_GET['ac'] ) && $_GET['ac'] == $activities_template->activity->id . '/' )
    727727                        return 'style="display: block"';
    728728
     
    932932                        return false;
    933933
    934                 return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->activity->slug . '/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );
     934                return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->activity->slug . '/?r=' . bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );
    935935        }
    936936
  • trunk/bp-core.php

    r3358 r3365  
    13411341        global $bp;
    13421342
    1343         if ( $bp->template_message ) {
     1343        if ( isset( $bp->template_message ) && $bp->template_message ) {
    13441344                $type = ( 'success' == $bp->template_message_type ) ? 'updated' : 'error';
    13451345        ?>
     
    19371937function bp_core_add_ajax_hook() {
    19381938        /* Theme only, we already have the wp_ajax_ hook firing in wp-admin */
    1939         if ( !defined( 'WP_ADMIN' ) )
     1939        if ( !defined( 'WP_ADMIN' ) && isset( $_REQUEST['action'] ) )
    19401940                do_action( 'wp_ajax_' . $_REQUEST['action'] );
    19411941}
  • trunk/bp-core/bp-core-adminbar.php

    r3358 r3365  
    77                return false;
    88
    9         if ( (int)$bp->site_options['hide-loggedout-adminbar'] && !is_user_logged_in() )
     9        if ( isset( $bp->site_options['hide-loggedout-adminbar'] ) && (int)$bp->site_options['hide-loggedout-adminbar'] && !is_user_logged_in() )
    1010                return false;
    1111
     
    7676
    7777                        foreach( (array)$bp->bp_options_nav[$nav_item['slug']] as $subnav_item ) {
    78                                 $link = str_replace( $bp->displayed_user->domain, $bp->loggedin_user->domain, $subnav_item['link'] );
    79                                 $name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );
     78                                $link = $subnav_item['link'];
     79                                $name = $subnav_item['name'];
     80
     81                                if ( isset( $bp->displayed_user->domain ) )
     82                                        $link = str_replace( $bp->displayed_user->domain, $bp->loggedin_user->domain, $subnav_item['link'] );
     83
     84                                if ( isset( $bp->displayed_user->userdata->user_login ) )
     85                                        $name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );
     86
    8087                                $alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
    8188                                echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $link . '">' . $name . '</a></li>';
  • trunk/bp-core/bp-core-signup.php

    r3362 r3365  
    614614/* Kill the wp-signup.php if custom registration signup templates are present */
    615615function bp_core_wpsignup_redirect() {
    616         if ( false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php') && $_GET['action'] != 'register' )
     616        $action = '';
     617        if ( isset( $_GET['action'] ) )
     618                $action = $_GET['action'];
     619
     620        if ( false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php' ) && $action != 'register' )
    617621                return false;
    618622
  • trunk/bp-core/bp-core-templatetags.php

    r3360 r3365  
    13081308        global $bp;
    13091309
    1310         $bp->ajax_querystring = apply_filters( 'bp_ajax_querystring', $query_string, $object );
    1311         return $bp->ajax_querystring;
     1310        if ( !isset( $bp->ajax_querystring ) )
     1311                $bp->ajax_querystring = '';
     1312
     1313        return apply_filters( 'bp_ajax_querystring', $bp->ajax_querystring, $object );
    13121314}
    13131315
     
    16501652        global $bp;
    16511653
    1652         if ( BP_XPROFILE_SLUG == $bp->current_component || $bp->core->profile->slug == $bp->current_component )
     1654        if ( defined( 'BP_XPROFILE_SLUG' ) && BP_XPROFILE_SLUG == $bp->current_component || isset( $bp->core->profile->slug ) && $bp->core->profile->slug == $bp->current_component )
    16531655                return true;
    16541656
     
    16861688        global $bp;
    16871689
    1688         if ( BP_GROUPS_SLUG == $bp->current_component && $bp->groups->current_group )
     1690        if ( BP_GROUPS_SLUG == $bp->current_component && isset( $bp->groups->current_group ) && $bp->groups->current_group )
    16891691                return true;
    16901692
  • trunk/bp-forums.php

    r3357 r3365  
    3636        global $bp;
    3737
    38         if ( file_exists( $bp->forums->bbconfig ) )
     38        if ( isset( $bp->forums->bbconfig ) && file_exists( $bp->forums->bbconfig ) )
    3939                return true;
    4040
  • trunk/bp-groups/bp-groups-classes.php

    r3300 r3365  
    293293                global $wpdb, $bp;
    294294
     295                $pag_sql = '';
    295296                if ( $limit && $page )
    296297                        $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    297298
     299                $hidden_sql = '';
    298300                if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) )
    299301                        $hidden_sql = "AND g.status != 'hidden'";
    300302
     303                $search_sql = '';
    301304                if ( $search_terms ) {
    302305                        $search_terms = like_escape( $wpdb->escape( $search_terms ) );
     
    313316                }
    314317
     318                $group_ids = array();
    315319                if ( !empty( $populate_extras ) ) {
    316320                        foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
     
    605609                global $wpdb, $bp;
    606610
     611                $hidden_sql = '';
    607612                if ( !is_super_admin() )
    608613                        $hidden_sql = "WHERE status != 'hidden'";
  • trunk/bp-groups/bp-groups-templatetags.php

    r3335 r3365  
    148148        /* Type */
    149149        if ( 'my-groups' == $bp->current_action ) {
    150                 if ( 'most-popular' == $order )
     150                if ( 'most-popular' == $order ) {
    151151                        $type = 'popular';
    152                 else if ( 'alphabetically' == $order )
     152                } elseif ( 'alphabetically' == $order ) {
    153153                        $type = 'alphabetical';
    154         } else if ( 'invites' == $bp->current_action ) {
     154                }
     155        } elseif ( 'invites' == $bp->current_action ) {
    155156                $type = 'invites';
    156         } else if ( $bp->groups->current_group->slug ) {
     157        } elseif ( isset( $bp->groups->current_group->slug ) && $bp->groups->current_group->slug ) {
    157158                $type = 'single-group';
    158159                $slug = $bp->groups->current_group->slug;
  • trunk/bp-messages/bp-messages-templatetags.php

    r3300 r3365  
    505505                        return false;
    506506
    507                 return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );
     507                return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );
    508508        }
    509509
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r3364 r3365  
    6060        $query_string = empty( $qs ) ? '' : join( '&', (array)$qs );
    6161
    62         return apply_filters( 'bp_dtheme_ajax_querystring', $query_string, $object, $_BP_COOKIE['bp-' . $object . '-filter'], $_BP_COOKIE['bp-' . $object . '-scope'], $_BP_COOKIE['bp-' . $object . '-page'], $_BP_COOKIE['bp-' . $object . '-search-terms'], $_BP_COOKIE['bp-' . $object . '-extras'] );
     62        $object_filter = '';
     63        if ( isset( $_BP_COOKIE['bp-' . $object . '-filter'] ) )
     64                $object_filter = $_BP_COOKIE['bp-' . $object . '-filter'];
     65
     66        $object_scope = '';
     67        if ( isset( $_BP_COOKIE['bp-' . $object . '-scope'] ) )
     68                $object_scope = $_BP_COOKIE['bp-' . $object . '-scope'];
     69
     70        $object_page = '';
     71        if ( isset( $_BP_COOKIE['bp-' . $object . '-page'] ) )
     72                $object_page = $_BP_COOKIE['bp-' . $object . '-page'];
     73
     74        $object_search_terms = '';
     75        if ( isset( $_BP_COOKIE['bp-' . $object . '-search-terms'] ) )
     76                $object_search_terms = $_BP_COOKIE['bp-' . $object . '-search-terms'];
     77
     78        $object_extras = '';
     79        if ( isset( $_BP_COOKIE['bp-' . $object . '-extras'] ) )
     80                $object_extras = $_BP_COOKIE['bp-' . $object . '-extras'];
     81
     82        return apply_filters( 'bp_dtheme_ajax_querystring', $query_string, $object, $object_filter, $object_scope, $object_page, $object_search_terms, $object_extras );
    6383}
    6484add_filter( 'bp_ajax_querystring', 'bp_dtheme_ajax_querystring', 10, 2 );
  • trunk/bp-themes/bp-default/functions.php

    r3325 r3365  
    3434        'show_all'          => __( 'Show all', 'buddypress' ),
    3535        'comments'          => __( 'comments', 'buddypress' ),
    36         'close'             => __( 'Close', 'buddypress' ),
    37         'mention_explain'   => sprintf( __( "%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", 'buddypress' ), '@' . bp_get_displayed_user_username(), bp_get_user_firstname( bp_get_displayed_user_fullname() ), bp_get_user_firstname( bp_get_displayed_user_fullname() ) )
     36        'close'             => __( 'Close', 'buddypress' )
    3837);
     38
     39if ( bp_is_profile_component() && !bp_is_directory() )
     40        $params['mention_explain'] = sprintf( __( "%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", 'buddypress' ), '@' . bp_get_displayed_user_username(), bp_get_user_firstname( bp_get_displayed_user_fullname() ), bp_get_user_firstname( bp_get_displayed_user_fullname() ) );
     41
    3942wp_localize_script( 'dtheme-ajax-js', 'BP_DTheme', $params );
    4043
  • trunk/bp-xprofile.php

    r3346 r3365  
    1818function xprofile_setup_globals() {
    1919        global $bp, $wpdb;
     20
     21        if ( isset( $bp->profile->id ) )
     22                return;
    2023
    2124        if ( !defined( 'BP_XPROFILE_SLUG' ) )
     
    601604        global $bp;
    602605
     606        // This is required because of a call to bp_core_get_user_displayname() in bp_core_setup_globals()
     607        if ( !isset( $bp->profile->id ) )
     608                xprofile_setup_globals();
     609
    603610        if ( !$user_id )
    604611                $user_id = $bp->displayed_user->id;
  • trunk/bp-xprofile/bp-xprofile-cssjs.php

    r2884 r3365  
    77
    88function xprofile_add_admin_js() {
    9         if ( strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
     9        if ( isset( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
    1010                wp_enqueue_script( 'jquery-ui-core' );
    1111                wp_enqueue_script( 'jquery-ui-tabs' );
Note: See TracChangeset for help on using the changeset viewer.