Skip to:
Content

BuddyPress.org

Changeset 4961


Ignore:
Timestamp:
08/10/2011 06:32:02 AM (15 years ago)
Author:
djpaul
Message:

Tidy up whitespace. Fixes #3466, props cnorris23

Location:
trunk
Files:
68 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-classes.php

    r4958 r4961  
    468468                // array of prepared integers or quoted strings
    469469                $items_prepared = array();
    470                
     470
    471471                // clean up and format each item
    472472                foreach ( $items_dirty as $item ) {
  • trunk/bp-activity/bp-activity-filters.php

    r4907 r4961  
    7474add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_make_nofollow_filter' );
    7575
    76 add_filter( 'pre_comment_content',                   'bp_activity_at_name_filter' ); 
    77 add_filter( 'group_forum_topic_text_before_save',    'bp_activity_at_name_filter' ); 
    78 add_filter( 'group_forum_post_text_before_save',     'bp_activity_at_name_filter' ); 
     76add_filter( 'pre_comment_content',                   'bp_activity_at_name_filter' );
     77add_filter( 'group_forum_topic_text_before_save',    'bp_activity_at_name_filter' );
     78add_filter( 'group_forum_post_text_before_save',     'bp_activity_at_name_filter' );
    7979
    8080add_filter( 'bp_get_activity_parent_content',        'bp_create_excerpt' );
     
    113113 *
    114114 * @param string $content The activity content
    115  * @param int $activity_id When $adjust_mention_count is true, you must provide an $activity_id, 
     115 * @param int $activity_id When $adjust_mention_count is true, you must provide an $activity_id,
    116116 *   which will be added to the list of the user's unread mentions
    117117 */
     
    136136        }
    137137
    138         // Adjust the activity count for this item     
     138        // Adjust the activity count for this item
    139139        if ( $activity_id )
    140140                bp_activity_adjust_mention_count( $activity_id, 'add' );
    141141
    142142        return $content;
    143 } 
     143}
    144144
    145145/**
     
    154154        // Only run this function once for a given activity item
    155155        remove_filter( 'bp_activity_after_save', 'bp_activity_at_name_filter_updates' );
    156        
     156
    157157        // Run the content through the linking filter, making sure to increment mention count
    158158        $activity->content = bp_activity_at_name_filter( $activity->content, $activity->id );
    159        
     159
    160160        // Resave the activity with the new content
    161161        $activity->save();
  • trunk/bp-activity/bp-activity-functions.php

    r4951 r4961  
    10531053        $bp->activity->read_more_id = $activity->id;
    10541054
    1055         add_filter( 'embed_post_id',            create_function( '', 'global $bp; return $bp->activity->read_more_id;' ) ); 
     1055        add_filter( 'embed_post_id',            create_function( '', 'global $bp; return $bp->activity->read_more_id;' ) );
    10561056        add_filter( 'bp_embed_get_cache',       'bp_embed_activity_cache',      10, 3 );
    10571057        add_action( 'bp_embed_update_cache',    'bp_embed_activity_save_cache', 10, 3 );
  • trunk/bp-activity/bp-activity-notifications.php

    r4817 r4961  
    77 *
    88 * @package BuddyPress Activity
    9  * @param str $content The content of the activity update 
     9 * @param str $content The content of the activity update
    1010 * @param int $poster_user_id The unique user_id of the user who sent the update
    1111 * @param int $activity_id The id of the activity update
     
    1818        $subject = '';
    1919        $message = '';
    20        
     20
    2121        // Add the BP notification
    2222        bp_core_add_notification( $activity_id, $receiver_user_id, 'activity', 'new_at_mention', $activity->user_id );
    23                        
     23
    2424        // Now email the user with the contents of the message (if they have enabled email notifications)
    2525        if ( 'no' != bp_get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) {
     
    6969                wp_mail( $to, $subject, $message );
    7070        }
    71        
     71
    7272        do_action( 'bp_activity_sent_mention_email', $activity, $subject, $message, $content );
    7373}
  • trunk/bp-activity/bp-activity-screens.php

    r4907 r4961  
    7979 * @uses bp_is_my_profile()
    8080 */
    81 function bp_activity_reset_my_new_mentions() { 
     81function bp_activity_reset_my_new_mentions() {
    8282        if ( bp_is_my_profile() )
    8383                bp_activity_clear_new_mentions( bp_loggedin_user_id() );
     
    9191        if ( !bp_is_activity_component() )
    9292                return false;
    93        
    94         if ( empty( $bp->current_action ) || !is_numeric( $bp->current_action ) ) 
    95                 return false; 
    96        
     93
     94        if ( empty( $bp->current_action ) || !is_numeric( $bp->current_action ) )
     95                return false;
     96
    9797        // Get the activity details
    9898        $activity = bp_activity_get_specific( array( 'activity_ids' => bp_current_action(), 'show_hidden' => true ) );
  • trunk/bp-blogs/bp-blogs-functions.php

    r4959 r4961  
    3535
    3636/**
    37  * Populates the BP blogs table with existing blogs. 
     37 * Populates the BP blogs table with existing blogs.
    3838 *
    3939 * @package BuddyPress Blogs
     
    5656                        $users          = get_users( array( 'blog_id' => $blog_id ) );
    5757                        $subscribers    = get_users( array( 'blog_id' => $blog_id, 'role' => 'subscriber' ) );
    58                        
     58
    5959                        if ( $users ) {
    6060                                foreach ( (array)$users as $user ) {
     
    103103
    104104        $is_private = !empty( $_POST['blog_public'] ) && (int)$_POST['blog_public'] ? false : true;
    105         $is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private ); 
     105        $is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private );
    106106
    107107        // Only record this activity if the blog is public
     
    166166                return false;
    167167
    168         $is_blog_public = apply_filters( 'bp_is_blog_public', (int)get_blog_option( $blog_id, 'blog_public' ) ); 
     168        $is_blog_public = apply_filters( 'bp_is_blog_public', (int)get_blog_option( $blog_id, 'blog_public' ) );
    169169
    170170        if ( 'publish' == $post->post_status && empty( $post->post_password ) ) {
  • trunk/bp-core/admin/bp-core-admin.php

    r4920 r4961  
    1919 * @since {@internal Unknown}}
    2020 */
    21 function bp_core_admin_dashboard() { 
     21function bp_core_admin_dashboard() {
    2222        $base_url = bp_get_admin_url( 'admin.php' );
    2323        $action   = add_query_arg( array( 'page' => 'bp-general-settings' ), $base_url );
     
    331331function bp_core_admin_component_options() {
    332332        global $bp_wizard;
    333        
     333
    334334        // Load core functions, if needed
    335335        if ( !function_exists( 'bp_get_option' ) )
     
    337337
    338338        $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
    339        
     339
    340340        // An array of strings looped over to create component setup markup
    341341        $optional_components = apply_filters( 'bp_admin_optional_components', array(
     
    388388                ),
    389389        ) );
    390        
     390
    391391        // On new install, set all components to be active by default
    392392        if ( !empty( $bp_wizard ) && 'install' == $bp_wizard->setup_type && empty( $active_components ) )
     
    394394
    395395        ?>
    396        
     396
    397397        <?php /* The setup wizard uses different, more descriptive text here */ ?>
    398398        <?php if ( empty( $bp_wizard ) ) : ?>
    399399
    400400                <h3><?php _e( 'Available Components', 'buddypress' ); ?></h3>
    401                                
     401
    402402                <p><?php _e( 'Each component has a unique purpose, and your community may not need each one.', 'buddypress' ); ?></p>
    403403
    404404        <?php endif ?>
    405        
     405
    406406        <table class="form-table">
    407407                <tbody>
     
    480480function bp_core_admin_page_options() {
    481481        global $bp;
    482        
     482
    483483        // Get the existing WP pages
    484484        $existing_pages = bp_core_get_directory_page_ids();
     
    492492                // Only components that need directories should be listed here
    493493                if ( isset( $bp->{$component_id} ) && !empty( $bp->{$component_id}->has_directory ) ) {
    494                        
     494
    495495                        // component->name was introduced in BP 1.5, so we must provide a fallback
    496496                        $component_name = !empty( $bp->{$component_id}->name ) ? $bp->{$component_id}->name : ucwords( $component_id );
    497                        
     497
    498498                        $directory_pages[$component_id] = $component_name;
    499499                }
    500500        }
    501        
     501
    502502        $directory_pages = apply_filters( 'bp_directory_pages', $directory_pages );
    503        
     503
    504504        ?>
    505        
     505
    506506        <h3><?php _e( 'Directories', 'buddypress' ); ?></h3>
    507        
     507
    508508        <p><?php _e( 'Associate a WordPress Page with each BuddyPress component directory.', 'buddypress' ); ?></p>
    509509
     
    513513                        <?php foreach ( $directory_pages as $name => $label ) : ?>
    514514                                <?php $disabled = !bp_is_active( $name ) ? ' disabled="disabled"' : ''; ?>
    515                                
     515
    516516                                <tr valign="top">
    517517                                        <th scope="row">
     
    520520
    521521                                        <td>
    522                                                 <?php if ( !bp_is_root_blog() ) 
     522                                                <?php if ( !bp_is_root_blog() )
    523523                                                        switch_to_blog( bp_get_root_blog_id() ) ?>
    524                                                
     524
    525525                                                <?php echo wp_dropdown_pages( array(
    526526                                                        'name'             => 'bp_pages[' . esc_attr( $name ) . ']',
     
    538538
    539539                                                <?php endif; ?>
    540                                                
    541                                                 <?php if ( !bp_is_root_blog() ) 
     540
     541                                                <?php if ( !bp_is_root_blog() )
    542542                                                        restore_current_blog() ?>
    543543
     
    552552                </tbody>
    553553        </table>
    554        
     554
    555555        <?php
    556556
  • trunk/bp-core/admin/bp-core-update.php

    r4948 r4961  
    263263        }
    264264
    265         function step_ms_update() {             
     265        function step_ms_update() {
    266266                if ( !current_user_can( 'activate_plugins' ) )
    267267                        return false;
     
    371371
    372372                $existing_pages = bp_core_update_get_page_meta();
    373                
     373
    374374                // Provide empty indexes to avoid PHP errors with wp_dropdown_pages()
    375375                $indexes = array( 'members', 'activity', 'groups', 'forums', 'blogs', 'register', 'activate' );
     
    378378                                $existing_pages[$index] = '';
    379379                }
    380                
     380
    381381                if ( !empty( $existing_pages['blogs'] ) )
    382382                        $existing_blog_page = '&selected=' . $existing_pages['blogs'];
     
    12721272function bp_core_update_do_network_admin() {
    12731273        $do_network_admin = false;
    1274        
     1274
    12751275        if ( is_multisite() && ( !defined( 'BP_ENABLE_MULTIBLOG' ) || !BP_ENABLE_MULTIBLOG ) )
    12761276                $do_network_admin = true;
    1277        
     1277
    12781278        return apply_filters( 'bp_core_do_network_admin', $do_network_admin );
    12791279}
     
    12811281function bp_core_update_admin_hook() {
    12821282        $hook = bp_core_update_do_network_admin() ? 'network_admin_menu' : 'admin_menu';
    1283        
     1283
    12841284        return apply_filters( 'bp_core_admin_hook', $hook );
    12851285}
  • trunk/bp-core/bp-core-catchuri.php

    r4920 r4961  
    181181                }
    182182        }
    183        
    184         // URLs with BP_ENABLE_ROOT_PROFILES enabled won't be caught above 
     183
     184        // URLs with BP_ENABLE_ROOT_PROFILES enabled won't be caught above
    185185        if ( empty( $matches ) && defined( 'BP_ENABLE_ROOT_PROFILES' ) && BP_ENABLE_ROOT_PROFILES ) {
    186                
     186
    187187                // Make sure there's a user corresponding to $bp_uri[0]
    188188                if ( !empty( $bp_uri[0] ) && $root_profile = get_userdatabylogin( $bp_uri[0] ) ) {
    189                        
     189
    190190                        // Force BP to recognize that this is a members page
    191191                        $matches[]  = 1;
    192192                        $match      = $bp->pages->members;
    193193                        $match->key = 'members';
    194                        
     194
    195195                        // Without the 'members' URL chunk, WordPress won't know which page to load
    196196                        // This filter intercepts the WP query and tells it to load the members page
    197197                        add_filter( 'request', create_function( '$query_args', '$query_args["pagename"] = "' . $match->name . '"; return $query_args;' ) );
    198                
    199                 }
    200        
     198
     199                }
     200
    201201        }
    202202
     
    224224
    225225        // Global the unfiltered offset to use in bp_core_load_template().
    226         // To avoid PHP warnings in bp_core_load_template(), it must always be >= 0 
     226        // To avoid PHP warnings in bp_core_load_template(), it must always be >= 0
    227227        $bp_unfiltered_uri_offset = $uri_offset >= 0 ? $uri_offset : 0;
    228228
     
    238238                        // Viewing a specific user
    239239                        if ( !empty( $bp_uri[$uri_offset + 1] ) ) {
    240                                
     240
    241241                                // Switch the displayed_user based on compatbility mode
    242242                                if ( bp_is_username_compatibility_mode() )
     
    247247                                if ( empty( $bp->displayed_user->id ) ) {
    248248                                        // Prevent components from loading their templates
    249                                         $bp->current_component = ''; 
     249                                        $bp->current_component = '';
    250250
    251251                                        bp_do_404();
     
    263263                                        $bp->current_component = '';
    264264                                }
    265                                
     265
    266266                                // Reset the offset
    267267                                $uri_offset = 0;
  • trunk/bp-core/bp-core-component.php

    r4920 r4961  
    3434         */
    3535        var $slug;
    36        
    37         /**
    38          * @var bool Does this component need a top-level directory? 
     36
     37        /**
     38         * @var bool Does this component need a top-level directory?
    3939         */
    4040        var $has_directory;
     
    139139                        foreach ( $r['global_tables'] as $global_name => $table_name )
    140140                                $this->$global_name = $table_name;
    141                
     141
    142142                /** BuddyPress ********************************************************/
    143143
  • trunk/bp-core/bp-core-cssjs.php

    r4820 r4961  
    7878        $image = apply_filters( 'bp_inline_cropper_image', getimagesize( bp_core_avatar_upload_path() . $bp->avatar_admin->image->dir ) );
    7979        $aspect_ratio = 1;
    80        
     80
    8181        $full_height = bp_core_avatar_full_height();
    8282        $full_width  = bp_core_avatar_full_width();
    83        
     83
    8484        // Calculate Aspect Ratio
    8585        if ( $full_height && ( $full_width != $full_height ) )
  • trunk/bp-core/bp-core-filters.php

    r4915 r4961  
    7777                $themes['bp-default'] = 1;
    7878        }
    79        
     79
    8080        return $themes;
    8181}
     
    279279        if ( !empty( $bp->displayed_user->fullname ) && !is_404() ) {
    280280                // translators: "displayed user's name | canonicalised component name"
    281                 $title = strip_tags( sprintf( __( '%1$s | %2$s', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( bp_current_component() ) ) ); 
     281                $title = strip_tags( sprintf( __( '%1$s | %2$s', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( bp_current_component() ) ) );
    282282
    283283        // A single group
     
    314314        } elseif ( bp_is_create_blog() ) {
    315315                $title = __( 'Create a Site', 'buddypress' );
    316         }       
     316        }
    317317
    318318        // Some BP nav items contain item counts. Remove them
  • trunk/bp-core/bp-core-functions.php

    r4933 r4961  
    130130function bp_core_get_directory_pages() {
    131131        global $wpdb, $bp;
    132        
     132
    133133        // Set pages as standard class
    134134        $pages = new stdClass;
     
    979979function bp_core_get_root_options() {
    980980        global $wpdb;
    981        
     981
    982982        // These options come from the root blog options table
    983983        $root_blog_options = apply_filters( 'bp_core_site_options', array(
    984        
     984
    985985        // BuddyPress core settings
    986986        'bp-deactivated-components'       => serialize( array( ) ),
     
    995995        'bb-config-location'              => ABSPATH,
    996996        'hide-loggedout-adminbar'         => '0',
    997        
     997
    998998        // Useful WordPress settings
    999999        'registration'                    => '0',
    10001000        'avatar_default'                  => 'mysteryman'
    10011001        ) );
    1002        
     1002
    10031003        $root_blog_option_keys  = array_keys( $root_blog_options );
    10041004        $blog_options_keys      = implode( "', '", (array) $root_blog_option_keys );
    10051005        $blog_options_query     = sprintf( "SELECT option_name AS name, option_value AS value FROM {$wpdb->options} WHERE option_name IN ('%s')", $blog_options_keys );
    10061006        $root_blog_options_meta = $wpdb->get_results( $blog_options_query );
    1007        
     1007
    10081008        // On Multisite installations, some options must always be fetched from sitemeta
    10091009        if ( is_multisite() ) {
     
    10131013                        'fileupload_maxk' => '1500'
    10141014                ) );
    1015                
     1015
    10161016                $network_option_keys    = array_keys( $network_options );
    10171017                $sitemeta_options_keys  = implode( "','", (array) $network_option_keys );
    10181018                $sitemeta_options_query = sprintf( "SELECT meta_key AS name, meta_value AS value FROM {$wpdb->sitemeta} WHERE meta_key IN ('%s')", $sitemeta_options_keys );
    10191019                $network_options_meta   = $wpdb->get_results( $sitemeta_options_query );
    1020                
     1020
    10211021                // Sitemeta comes second in the merge, so that network 'registration' value wins
    10221022                $root_blog_options_meta = array_merge( $root_blog_options_meta, $network_options_meta );
    10231023        }
    1024        
     1024
    10251025        // Missing some options, so do some one-time fixing
    10261026        if ( empty( $root_blog_options_meta ) || ( count( $root_blog_options_meta ) < count( $root_blog_option_keys ) ) ) {
    1027        
     1027
    10281028        // Unset the query - We'll be resetting it soon
    10291029        unset( $root_blog_options_meta );
    1030        
     1030
    10311031        // Loop through options
    10321032        foreach ( $root_blog_options as $old_meta_key => $old_meta_default ) {
    10331033                // Clear out the value from the last time around
    10341034                unset( $old_meta_value );
    1035                
     1035
    10361036                // Get old site option
    10371037                if ( is_multisite() )
    10381038                        $old_meta_value = get_site_option( $old_meta_key );
    1039                
     1039
    10401040                // No site option so look in root blog
    10411041                if ( empty( $old_meta_value ) )
    10421042                        $old_meta_value = bp_get_option( $old_meta_key, $old_meta_default );
    1043                
     1043
    10441044                // Update the root blog option
    10451045                bp_update_option( $old_meta_key, $old_meta_value );
    1046                
     1046
    10471047                // Update the global array
    10481048                $root_blog_options_meta[$old_meta_key] = $old_meta_value;
    10491049        }
    1050        
     1050
    10511051        // We're all matched up
    10521052        } else {
     
    10541054                foreach ( $root_blog_options_meta as $root_blog_option )
    10551055                        $root_blog_options[$root_blog_option->name] = $root_blog_option->value;
    1056                
     1056
    10571057                // Copy the options no the return val
    10581058                $root_blog_options_meta = $root_blog_options;
    1059                
     1059
    10601060                // Clean up our temporary copy
    10611061                unset( $root_blog_options );
    10621062        }
    1063        
     1063
    10641064        return apply_filters( 'bp_core_get_root_options', $root_blog_options_meta );
    10651065}
     
    10911091                $bp->add_root[] = $slug;
    10921092        }
    1093        
     1093
    10941094        // Make sure that this component is registered as requiring a top-level directory
    10951095        if ( isset( $bp->{$slug} ) ) {
  • trunk/bp-core/bp-core-hooks.php

    r4820 r4961  
    3535// Setup widgets
    3636add_action( 'bp_loaded',  'bp_setup_widgets'           );
    37        
     37
    3838// Setup admin bar
    3939add_action( 'bp_loaded',  'bp_core_load_admin_bar'     );
  • trunk/bp-core/bp-core-loader.php

    r4920 r4961  
    2525
    2626// Move active components from sitemeta, if necessary
    27 // Provides backpat with earlier versions of BP 
     27// Provides backpat with earlier versions of BP
    2828if ( is_multisite() && $active_components = get_site_option( 'bp-active-components' ) )
    2929        bp_update_option( 'bp-active-components', $active_components );
  • trunk/bp-core/bp-core-template.php

    r4907 r4961  
    495495function bp_action_variable( $position = 0 ) {
    496496        $action_variables = bp_action_variables();
    497        
     497
    498498        $action_variable = isset( $action_variables[$position] ) ? $action_variables[$position] : false;
    499        
     499
    500500        return apply_filters( 'bp_action_variable', $action_variable, $position );
    501501}
     
    669669                } elseif ( isset( $bp->{$component}->slug ) && $bp->{$component}->slug == $bp->current_component ) {
    670670                        $is_current_component = true;
    671                        
     671
    672672                // Next, check to see whether $component is a canonical,
    673673                // non-translatable component name. If so, we can return its
     
    677677                                $is_current_component = true;
    678678
    679                 // If we haven't found a match yet, check against the root_slugs 
     679                // If we haven't found a match yet, check against the root_slugs
    680680                // created by $bp->pages, as well as the regular slugs
    681681                } else {
     
    752752 *   the function will return true if the $action_variable is found *anywhere* in the action
    753753 *   variables array.
    754  * @return bool 
     754 * @return bool
    755755 */
    756756function bp_is_action_variable( $action_variable = '', $position = false ) {
    757757        $is_action_variable = false;
    758        
     758
    759759        if ( false !== $position ) {
    760                 // When a $position is specified, check that slot in the action_variables array         
     760                // When a $position is specified, check that slot in the action_variables array
    761761                if ( $action_variable ) {
    762762                        $is_action_variable = $action_variable == bp_action_variable( $position );
     
    770770                $is_action_variable = in_array( $action_variable, (array)bp_action_variables() );
    771771        }
    772        
     772
    773773        return apply_filters( 'bp_is_action_variable', $is_action_variable, $action_variable, $position );
    774774}
     
    829829function bp_is_root_component( $component_name ) {
    830830        global $bp;
    831        
     831
    832832        if ( !isset( $bp->active_components ) )
    833833                return false;
     
    10301030        if ( bp_is_current_component( 'xprofile' ) && bp_is_current_action( 'edit' ) )
    10311031                return true;
    1032                
     1032
    10331033        return false;
    10341034}
  • trunk/bp-core/css/admin.dev.css

    r4487 r4961  
    9292                top: 5px;
    9393        }
    94        
     94
    9595div#bp-admin div.prev-next, div#bp-admin div.prev-next p,
    9696div#bp-admin div.submit, div#bp-admin div.submit p {
  • trunk/bp-core/deprecated/1.5.php

    r4907 r4961  
    218218 */
    219219function bp_page_title() {
    220         echo bp_get_page_title(); 
     220        echo bp_get_page_title();
    221221}
    222222        /**
     
    260260function groups_at_message_notification( $content, $poster_user_id, $group_id, $activity_id ) {
    261261        global $bp;
    262        
     262
    263263        _deprecated_function( __FUNCTION__, '1.5', 'bp_activity_at_message_notification()' );
    264264
     
    337337 * In BP 1.5, these functions were renamed for greater consistency
    338338 */
    339 function bp_forum_directory_permalink() { 
     339function bp_forum_directory_permalink() {
    340340        _deprecated_function( __FUNCTION__, '1.5', 'bp_forums_directory_permalink()' );
    341341        bp_forums_directory_permalink();
    342 } 
    343         function bp_get_forum_directory_permalink() { 
     342}
     343        function bp_get_forum_directory_permalink() {
    344344                _deprecated_function( __FUNCTION__, '1.5', 'bp_get_forums_directory_permalink()' );
    345345                return bp_get_forums_directory_permalink();
    346346        }
    347        
     347
    348348/** Theme *********************************************************************/
    349349
  • trunk/bp-forums/bp-forums-admin.php

    r4920 r4961  
    1616
    1717function bp_forums_bbpress_admin() {
    18         global $bp; 
    19        
     18        global $bp;
     19
    2020        $action = bp_get_admin_url( 'admin.php?page=bb-forums-setup&reinstall=1' );
    2121        ?>
     
    100100                                                // Just write the contents to screen
    101101                                                _e( '<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>', 'buddypress' ); ?>
    102                                        
     102
    103103                                                <textarea style="display:block; margin-top: 30px; width: 80%;" rows="50"><?php echo htmlspecialchars( $result ); ?></textarea>
    104104
  • trunk/bp-forums/bp-forums-filters.php

    r4907 r4961  
    157157function bp_forums_add_replied_distinct_sql( $sql ) {
    158158        global $wpdb;
    159        
     159
    160160        $sql = $wpdb->prepare( "DISTINCT t.topic_id, " );
    161        
     161
    162162        return $sql;
    163163}
     
    178178function bp_forums_add_replied_join_sql( $sql ) {
    179179        global $bbdb, $wpdb;
    180        
     180
    181181        $sql .= $wpdb->prepare( " LEFT JOIN $bbdb->posts p ON p.topic_id = t.topic_id " );
    182        
     182
    183183        return $sql;
    184184}
     
    198198function bp_forums_add_replied_where_sql( $sql ) {
    199199        global $wpdb;
    200        
     200
    201201        $sql .= $wpdb->prepare( " AND p.poster_id = %s ", bp_displayed_user_id() );
    202202
  • trunk/bp-forums/bp-forums-loader.php

    r4920 r4961  
    106106                if ( !is_user_logged_in() && !isset( $bp->displayed_user->id ) )
    107107                        return;
    108                
     108
    109109                // Add 'Forums' to the main navigation
    110110                $main_nav = array(
  • trunk/bp-friends/bp-friends-activity.php

    r4822 r4961  
    7171                case 'friendship_accepted':
    7272                        $link = bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/newest';
    73                        
     73
    7474                        // Set up the string and the filter
    7575                        if ( (int)$total_items > 1 ) {
     
    8080                                $filter = 'bp_friends_single_friendship_accepted_notification';
    8181                        }
    82                        
     82
    8383                        break;
    8484
    8585                case 'friendship_request':
    8686                        $link = bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests?new';
    87                        
     87
    8888                        // Set up the string and the filter
    8989                        if ( (int)$total_items > 1 ) {
     
    9494                                $filter = 'bp_friends_single_friendship_request_notification';
    9595                        }
    96                
     96
    9797                        break;
    9898        }
    99                
     99
    100100        // Return either an HTML link or an array, depending on the requested format
    101101        if ( 'string' == $format ) {
  • trunk/bp-friends/bp-friends-functions.php

    r4822 r4961  
    257257function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) {
    258258        global $bp;
    259        
     259
    260260        if ( 'add' == $status ) {
    261261                bp_update_user_meta( $initiator_user_id, 'total_friend_count', (int)bp_get_user_meta( $initiator_user_id, 'total_friend_count', true ) + 1 );
  • trunk/bp-friends/bp-friends-notifications.php

    r4822 r4961  
    3535
    3636        $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
    37        
     37
    3838        /* Send the message */
    3939        $to = apply_filters( 'friends_notification_new_request_to', $to );
  • trunk/bp-friends/bp-friends-template.php

    r4907 r4961  
    7676function bp_friends_filter_title() {
    7777        $current_filter = bp_action_variable( 0 );
    78        
     78
    7979        switch ( $current_filter ) {
    8080                case 'recently-active': default:
     
    144144                wp_cache_set( 'friends_random_users', $user_ids, 'bp' );
    145145        }
    146        
     146
    147147        ?>
    148148
  • trunk/bp-groups/bp-groups-actions.php

    r4872 r4961  
    103103                                bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $bp->groups->current_create_step . '/' );
    104104                        }
    105                        
    106                         // Set the invite status                       
     105
     106                        // Set the invite status
    107107                        // Checked against a whitelist for security
    108108                        $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
    109109                        $invite_status         = in_array( $_POST['group-invite-status'], (array)$allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
    110                        
     110
    111111                        groups_update_groupmeta( $bp->groups->new_group_id, 'invite_status', $invite_status );
    112112                }
  • trunk/bp-groups/bp-groups-activity.php

    r4954 r4961  
    9494                                $filter = 'bp_groups_multiple_new_membership_requests_notification';
    9595                                $notification_link = $group_link . 'admin/membership-requests/?n=1';
    96                                
     96
    9797                                if ( 'string' == $format ) {
    9898                                        return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Group Membership Requests', 'buddypress' ) . '">' . $text . '</a>', $group_link, $total_items, $group->name, $text, $notification_link );
     
    108108                                $filter = 'bp_groups_single_new_membership_request_notification';
    109109                                $notification_link = $group_link . 'admin/membership-requests/?n=1';
    110                                
     110
    111111                                if ( 'string' == $format ) {
    112112                                        return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . sprintf( __( '%s requests group membership', 'buddypress' ), $user_fullname ) . '">' . $text . '</a>', $group_link, $user_fullname, $group->name, $text, $notification_link );
     
    118118                                }
    119119                        }
    120                        
     120
    121121                        break;
    122122
     
    129129                        if ( (int)$total_items > 1 ) {
    130130                                $text = sprintf( __( '%d accepted group membership requests', 'buddypress' ), (int)$total_items, $group->name );
    131                                 $filter = 'bp_groups_multiple_membership_request_accepted_notification';                               
     131                                $filter = 'bp_groups_multiple_membership_request_accepted_notification';
    132132                                $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/?n=1';
    133                                
     133
    134134                                if ( 'string' == $format ) {
    135135                                        return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name, $text, $notification_link );
     
    144144                                $filter = 'bp_groups_single_membership_request_accepted_notification';
    145145                                $notification_link = $group_link . '?n=1';
    146                                
     146
    147147                                if ( 'string' == $format ) {
    148148                                        return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
     
    162162                        $group = new BP_Groups_Group( $group_id );
    163163                        $group_link = bp_get_group_permalink( $group );
    164                        
     164
    165165                        if ( (int)$total_items > 1 ) {
    166166                                $text = sprintf( __( '%d rejected group membership requests', 'buddypress' ), (int)$total_items, $group->name );
    167167                                $filter = 'bp_groups_multiple_membership_request_rejected_notification';
    168168                                $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/?n=1';
    169                                
     169
    170170                                if ( 'string' == $format ) {
    171171                                        return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name );
     
    180180                                $filter = 'bp_groups_single_membership_request_rejected_notification';
    181181                                $notification_link = $group_link . '?n=1';
    182                                
     182
    183183                                if ( 'string' == $format ) {
    184184                                        return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
     
    203203                                $filter = 'bp_groups_multiple_member_promoted_to_admin_notification';
    204204                                $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '?n=1';
    205                                
     205
    206206                                if ( 'string' == $format ) {
    207207                                        return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link );
     
    216216                                $filter = 'bp_groups_single_member_promoted_to_admin_notification';
    217217                                $notification_link = $group_link . '?n=1';
    218                                
     218
    219219                                if ( 'string' == $format ) {
    220220                                        return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
     
    239239                                $filter = 'bp_groups_multiple_member_promoted_to_mod_notification';
    240240                                $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '?n=1';
    241                                
     241
    242242                                if ( 'string' == $format ) {
    243243                                        return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link );
     
    252252                                $filter = 'bp_groups_single_member_promoted_to_mod_notification';
    253253                                $notification_link = $group_link . '?n=1';
    254                                
     254
    255255                                if ( 'string' == $format ) {
    256256                                        return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
     
    267267                case 'group_invite':
    268268                        $group_id = $item_id;
    269                         $group = new BP_Groups_Group( $group_id );     
    270                         $group_link = bp_get_group_permalink( $group );
    271                        
     269                        $group = new BP_Groups_Group( $group_id );
     270                        $group_link = bp_get_group_permalink( $group );
     271
    272272                        $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/?n=1';
    273273
     
    275275                                $text = sprintf( __( 'You have %d new group invitations', 'buddypress' ), (int)$total_items );
    276276                                $filter = 'bp_groups_multiple_group_invite_notification';
    277                                
     277
    278278                                if ( 'string' == $format ) {
    279279                                        return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Group Invites', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link );
     
    287287                                $text = sprintf( __( 'You have an invitation to the group: %s', 'buddypress' ), $group->name );
    288288                                $filter = 'bp_groups_single_group_invite_notification';
    289                                
     289
    290290                                if ( 'string' == $format ) {
    291291                                        return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
  • trunk/bp-groups/bp-groups-adminbar.php

    r4907 r4961  
    5050                'href'  => bp_get_group_permalink( $bp->groups->current_group )
    5151        ) );
    52        
     52
    5353        // Group Admin > Edit details
    5454        $wp_admin_bar->add_menu( array(
     
    5858                'href'   =>  bp_get_groups_action_link( 'admin/edit-details' )
    5959        ) );
    60        
     60
    6161        // Group Admin > Group settings
    6262        $wp_admin_bar->add_menu( array(
     
    6666                'href'   =>  bp_get_groups_action_link( 'admin/group-settings' )
    6767        ) );
    68        
     68
    6969        // Group Admin > Group avatar
    7070        $wp_admin_bar->add_menu( array(
     
    7474                'href'   =>  bp_get_groups_action_link( 'admin/group-avatar' )
    7575        ) );
    76        
     76
    7777        // Group Admin > Manage invitations
    7878        if ( bp_is_active( 'friends' ) ) {
     
    8484                ) );
    8585        }
    86        
     86
    8787        // Group Admin > Manage members
    8888        $wp_admin_bar->add_menu( array(
     
    9292                'href'   =>  bp_get_groups_action_link( 'admin/manage-members' )
    9393        ) );
    94        
     94
    9595        // Group Admin > Membership Requests
    9696        if ( bp_get_group_status( $bp->groups->current_group ) == 'private' ) {
     
    101101                        'href'   =>  bp_get_groups_action_link( 'admin/membership-requests' )
    102102                ) );
    103         }       
    104        
     103        }
     104
    105105        // Delete Group
    106106        $wp_admin_bar->add_menu( array(
  • trunk/bp-groups/bp-groups-buddybar.php

    r4823 r4961  
    1818                <ul>
    1919                        <li><a href="<?php bp_groups_action_link( 'admin/edit-details' ); ?>"><?php _e( 'Edit Details', 'buddypress' ); ?></a></li>
    20                        
     20
    2121                        <li><a href="<?php bp_groups_action_link( 'admin/group-settings' );  ?>"><?php _e( 'Group Settings', 'buddypress' ); ?></a></li>
    22                        
     22
    2323                        <li><a href="<?php bp_groups_action_link( 'admin/group-avatar' ); ?>"><?php _e( 'Group Avatar', 'buddypress' ); ?></a></li>
    2424
  • trunk/bp-groups/bp-groups-classes.php

    r4907 r4961  
    294294                        if ( is_array( $include ) )
    295295                                $include = implode( ',', $include );
    296                                
     296
    297297                        $include = $wpdb->escape( $include );
    298298                        $sql['include'] = " AND g.id IN ({$include})";
     
    302302                        if ( is_array( $exclude ) )
    303303                                $exclude = implode( ',', $exclude );
    304                                
     304
    305305                        $exclude = $wpdb->escape( $exclude );
    306306                        $sql['exclude'] = " AND g.id NOT IN ({$exclude})";
     
    598598                return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0", $group_id ) );
    599599        }
    600        
    601        
     600
     601
    602602        /**
    603603         * Get a total count of all topics of a given status, across groups/forums
     
    611611        function get_global_topic_count( $status = 'public', $search_terms = false ) {
    612612                global $bbdb, $wpdb, $bp;
    613                
     613
    614614                switch ( $status ) {
    615615                        case 'all' :
    616616                                $status_sql = '';
    617617                                break;
    618                                
     618
    619619                        case 'hidden' :
    620620                                $status_sql = $wpdb->prepare( "AND g.status = 'hidden'" );
    621621                                break;
    622                                
     622
    623623                        case 'private' :
    624624                                $status_sql = $wpdb->prepare( "AND g.status = 'private'" );
    625625                                break;
    626                                
     626
    627627                        case 'public' :
    628628                        default :
     
    630630                                break;
    631631                }
    632                
     632
    633633                $sql = array();
    634                
     634
    635635                $sql['select'] = "SELECT COUNT(t.topic_id)";
    636                
     636
    637637                $sql['from'] = "FROM {$bbdb->topics} AS t INNER JOIN {$bp->groups->table_name_groupmeta} AS gm ON t.forum_id = gm.meta_value INNER JOIN {$bp->groups->table_name} AS g ON gm.group_id = g.id";
    638                
     638
    639639                $sql['where'] = "WHERE gm.meta_key = 'forum_id' {$status_sql} AND t.topic_status = '0' AND t.topic_sticky != '2'";
    640                
     640
    641641                if ( $search_terms ) {
    642642                        $st = like_escape( $search_terms );
    643643                        $sql['where'] .= " AND (  t.topic_title LIKE '%{$st}%' )";
    644644                }
    645                
     645
    646646                return $wpdb->get_var( implode( ' ', $sql ) );
    647647        }
     
    667667                $this->__construct($user_id,$group_id,$id,$populate);
    668668        }
    669        
     669
    670670        function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
    671671                if ( $user_id && $group_id && !$id ) {
     
    772772        function ban() {
    773773                global $bp;
    774                
     774
    775775                if ( $this->is_admin )
    776776                        return false;
     
    790790        function unban() {
    791791                global $bp;
    792                
     792
    793793                if ( $this->is_admin )
    794794                        return false;
     
    804804        function accept_invite() {
    805805                global $bp;
    806                
     806
    807807                $this->inviter_id    = 0;
    808808                $this->is_confirmed  = 1;
     
    814814        function accept_request() {
    815815                global $bp;
    816                
     816
    817817                $this->is_confirmed = 1;
    818818                $this->date_modified = bp_core_current_time();
     
    958958                if ( !$user_id )
    959959                        return false;
    960                
     960
    961961                $sql = "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id != 0";
    962                
     962
    963963                if ( 'sent' == $type )
    964964                        $sql .= " AND invite_sent = 1";
     
    12151215        function _register() {
    12161216                global $bp;
    1217                
     1217
    12181218                if ( !empty( $this->enable_create_step ) ) {
    12191219                        // Insert the group creation step for the new group extension
     
    12451245                                add_action( $this->display_hook, array( &$this, 'widget_display' ) );
    12461246                }
    1247                
     1247
    12481248                // Construct the admin edit tab for the new group extension
    12491249                if ( !empty( $this->enable_edit_item ) && !empty( $bp->is_item_admin ) ) {
  • trunk/bp-groups/bp-groups-filters.php

    r4907 r4961  
    8080function groups_add_forum_tables_sql( $sql = '' ) {
    8181        global $bp;
    82        
     82
    8383        $sql .= 'JOIN ' . $bp->groups->table_name . ' AS g LEFT JOIN ' . $bp->groups->table_name_groupmeta . ' AS gm ON g.id = gm.group_id ';
    84        
     84
    8585        return $sql;
    8686}
  • trunk/bp-groups/bp-groups-forums.php

    r4941 r4961  
    214214                        // The activity item for the initial topic
    215215                        bp_activity_delete( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_topic' ) );
    216                        
     216
    217217                        // The activity item for each post
    218218                        foreach ( (array)$posts as $post ) {
  • trunk/bp-groups/bp-groups-functions.php

    r4907 r4961  
    427427function groups_get_current_group() {
    428428        global $bp;
    429        
     429
    430430        $current_group = isset( $bp->groups->current_group ) ? $bp->groups->current_group : false;
    431        
     431
    432432        return apply_filters( 'groups_get_current_group', $current_group );
    433433}
  • trunk/bp-groups/bp-groups-loader.php

    r4920 r4961  
    9494
    9595                        $bp->is_single_item  = true;
    96                         $current_group_class = apply_filters( 'bp_groups_current_group_class', 'BP_Groups_Group' ); 
     96                        $current_group_class = apply_filters( 'bp_groups_current_group_class', 'BP_Groups_Group' );
    9797                        $this->current_group = apply_filters( 'bp_groups_current_group_object', new $current_group_class( $group_id ) );
    9898
     
    163163                        return;
    164164                }
    165                
     165
    166166                // Group access control
    167167                if ( bp_is_groups_component() && !empty( $this->current_group ) && !empty( $bp->current_action ) && !$this->current_group->user_has_access ) {
    168168                        if ( is_user_logged_in() ) {
    169169                                // Off-limits to this user. Throw an error and redirect to the
    170                                 // group's home page                   
     170                                // group's home page
    171171                                bp_core_no_access( array(
    172172                                        'message'  => __( 'You do not have access to this group.', 'buddypress' ),
  • trunk/bp-groups/bp-groups-notifications.php

    r4823 r4961  
    247247
    248248                wp_mail( $to, $subject, $message );
    249                                
     249
    250250                do_action( 'bp_groups_sent_invited_email', $invited_user_id, $subject, $message, $group );
    251251        }
  • trunk/bp-groups/bp-groups-screens.php

    r4844 r4961  
    509509                if ( isset( $_POST['save'] ) ) {
    510510                        $enable_forum   = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0;
    511                        
     511
    512512                        // Checked against a whitelist for security
    513513                        $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) );
    514514                        $status         = ( in_array( $_POST['group-status'], (array)$allowed_status ) ) ? $_POST['group-status'] : 'public';
    515                        
     515
    516516                        // Checked against a whitelist for security
    517517                        $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
     
    615615                                $user_id = bp_action_variable( 3 );
    616616                                $status  = bp_action_variable( 2 );
    617                                
     617
    618618                                // Check the nonce first.
    619619                                if ( !check_admin_referer( 'groups_promote_member' ) )
     
    653653                        if ( bp_is_action_variable( 'ban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
    654654                                $user_id = bp_action_variable( 2 );
    655                                
     655
    656656                                // Check the nonce first.
    657657                                if ( !check_admin_referer( 'groups_ban_member' ) )
     
    671671                        if ( bp_is_action_variable( 'unban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
    672672                                $user_id = bp_action_variable( 2 );
    673                                
     673
    674674                                // Check the nonce first.
    675675                                if ( !check_admin_referer( 'groups_unban_member' ) )
     
    689689                        if ( bp_is_action_variable( 'remove', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
    690690                                $user_id = bp_action_variable( 2 );
    691                                
     691
    692692                                // Check the nonce first.
    693693                                if ( !check_admin_referer( 'groups_remove_member' ) )
  • trunk/bp-loader.php

    r4926 r4961  
    3131// Define on which blog ID BuddyPress should run
    3232if ( !defined( 'BP_ROOT_BLOG' ) ) {
    33        
     33
    3434        // Root blog is the main site on this network
    3535        if ( is_multisite() && !defined( 'BP_ENABLE_MULTIBLOG' ) ) {
    3636                $current_site = get_current_site();
    3737                $root_blog_id = $current_site->blog_id;
    38                
     38
    3939        // Root blog is every site on this network
    4040        } elseif ( is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) ) {
    4141                $root_blog_id = get_current_blog_id();
    42                
     42
    4343        // Root blog is the only blog on this network
    4444        } elseif( !is_multisite() ) {
     
    9898if ( !function_exists( 'bp_loader_activate' ) ) :
    9999/**
    100  * Defines BP's activation routine. 
    101  * 
    102  * Most of BP's crucial setup is handled by the setup wizard. This function takes care of some 
    103  * issues with incompatible legacy themes, and provides a hook for other functions to know that 
    104  * BP has been activated. 
    105  * 
    106  * @package BuddyPress Core 
    107 */ 
     100 * Defines BP's activation routine.
     101 *
     102 * Most of BP's crucial setup is handled by the setup wizard. This function takes care of some
     103 * issues with incompatible legacy themes, and provides a hook for other functions to know that
     104 * BP has been activated.
     105 *
     106 * @package BuddyPress Core
     107*/
    108108function bp_loader_activate() {
    109109        // Force refresh theme roots.
  • trunk/bp-members/bp-members-actions.php

    r4946 r4961  
    107107                // Allow plugins to do neat things
    108108                do_action( 'bp_core_action_set_spammer_status', bp_displayed_user_id(), $is_spam );
    109                
     109
    110110                // Redirect back to where we came from
    111111                bp_core_redirect( wp_get_referer() );
  • trunk/bp-members/bp-members-adminbar.php

    r4920 r4961  
    111111                'href'   => bp_get_members_component_link( 'profile', 'edit' )
    112112        ) );
    113        
     113
    114114        // User Admin > Edit this user's avatar
    115115        $wp_admin_bar->add_menu( array(
     
    119119                'href'   => bp_get_members_component_link( 'profile', 'change-avatar' )
    120120        ) );
    121        
     121
    122122        // User Admin > Spam/unspam
    123123        if ( !bp_core_is_user_spammer( bp_displayed_user_id() ) ) {
     
    127127                        'title'  => __( 'Mark as Spammer', 'buddypress' ),
    128128                        'href'   => wp_nonce_url( bp_displayed_user_domain() . 'admin/mark-spammer/', 'mark-unmark-spammer' ),
    129                         'meta'   => array( 'onclick' => 'confirm(" ' . __( 'Are you sure you want to mark this user as a spammer?', 'buddypress' ) . '");' ) 
    130                 ) );   
     129                        'meta'   => array( 'onclick' => 'confirm(" ' . __( 'Are you sure you want to mark this user as a spammer?', 'buddypress' ) . '");' )
     130                ) );
    131131        } else {
    132132                $wp_admin_bar->add_menu( array(
     
    135135                        'title'  => __( 'Not a Spammer', 'buddypress' ),
    136136                        'href'   => wp_nonce_url( bp_displayed_user_domain() . 'admin/unmark-spammer/', 'mark-unmark-spammer' ),
    137                         'meta'   => array( 'onclick' => 'confirm(" ' . __( 'Are you sure you want to mark this user as not a spammer?', 'buddypress' ) . '");' ) 
    138                 ) );
    139         }
    140        
     137                        'meta'   => array( 'onclick' => 'confirm(" ' . __( 'Are you sure you want to mark this user as not a spammer?', 'buddypress' ) . '");' )
     138                ) );
     139        }
     140
    141141        // User Admin > Delete Account
    142142        $wp_admin_bar->add_menu( array(
     
    145145                'title'  => __( 'Delete Account', 'buddypress' ),
    146146                'href'   => wp_nonce_url( bp_displayed_user_domain() . 'admin/delete-user/', 'delete-user' ),
    147                 'meta'   => array( 'onclick' => 'confirm(" ' . __( "Are you sure you want to delete this user's account?", 'buddypress' ) . '");' ) 
     147                'meta'   => array( 'onclick' => 'confirm(" ' . __( "Are you sure you want to delete this user's account?", 'buddypress' ) . '");' )
    148148        ) );
    149149}
     
    161161        if ( !is_user_logged_in() )
    162162                return false;
    163                
     163
    164164        if ( $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id(), 'object' ) ) {
    165165                $menu_title = sprintf( __( 'Notifications <span id="ab-pending-notifications" class="pending-count">%s</span>', 'buddypress' ), count( $notifications ) );
     
    167167                $menu_title = __( 'Notifications', 'buddypress' );
    168168        }
    169        
     169
    170170        // Add the top-level Notifications button
    171171        $wp_admin_bar->add_menu( array(
     
    174174                'href'  => bp_loggedin_user_domain()
    175175        ) );
    176        
     176
    177177        if ( !empty( $notifications ) ) {
    178178                foreach ( (array)$notifications as $notification ) {
     
    192192                ) );
    193193        }
    194        
     194
    195195        return;
    196196}
  • trunk/bp-members/bp-members-buddybar.php

    r4824 r4961  
    100100
    101101        <li id="bp-adminbar-adminoptions-menu">
    102                
     102
    103103                <a href=""><?php _e( 'Admin Options', 'buddypress' ) ?></a>
    104104
     
    109109
    110110                        <?php endif ?>
    111                        
     111
    112112                        <li><a href="<?php bp_members_component_link( 'profile', 'change-avatar' ); ?>"><?php printf( __( "Edit %s's Avatar", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ) ?></a></li>
    113                        
     113
    114114                        <?php if ( !bp_core_is_user_spammer( $bp->displayed_user->id ) ) : ?>
    115115
     
    120120                                <li><a href="<?php echo wp_nonce_url( $bp->displayed_user->domain . 'admin/unmark-spammer/', 'mark-unmark-spammer' ) ?>" class="confirm"><?php _e( "Not a Spammer", 'buddypress' ) ?></a></li>
    121121
    122                         <?php endif; ?>                 
    123        
     122                        <?php endif; ?>
     123
    124124                        <li><a href="<?php echo wp_nonce_url( $bp->displayed_user->domain . 'admin/delete-user/', 'delete-user' ) ?>" class="confirm"><?php printf( __( "Delete %s's Account", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ); ?></a></li>
    125125
  • trunk/bp-members/bp-members-functions.php

    r4945 r4961  
    510510        if ( empty( $user ) ) {
    511511                $is_spammer = false;
    512                
     512
    513513        // User found
    514514        } else {
     
    548548        if ( empty( $user ) ) {
    549549                $is_deleted = true;
    550                
     550
    551551        // User found
    552552        } else {
  • trunk/bp-members/bp-members-notifications.php

    r4907 r4961  
    5959        if ( empty( $grouped_notifications ) )
    6060                return false;
    61        
     61
    6262        $renderable = array();
    63        
     63
    6464        // Calculate a renderable output for each notification type
    6565        foreach ( (array)$grouped_notifications as $component_name => $action_arrays ) {
     
    7676                        if ( isset( $bp->{$component_name}->format_notification_function ) && function_exists( $bp->{$component_name}->format_notification_function ) ) {
    7777                                $renderable[] = call_user_func( $bp->{$component_name}->format_notification_function, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count );
    78                         } elseif ( isset( $bp->{$component_name}->notification_callback ) && function_exists( $bp->{$component_name}->notification_callback ) ) { 
     78                        } elseif ( isset( $bp->{$component_name}->notification_callback ) && function_exists( $bp->{$component_name}->notification_callback ) ) {
    7979                                if ( 'object' == $format ) {
    8080                                        $content = call_user_func( $bp->{$component_name}->notification_callback, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count, 'array' );
    81                                        
     81
    8282                                        $notification_object = new stdClass;
    83                                        
     83
    8484                                        // Minimal backpat with non-compatible notification
    8585                                        // callback functions
     
    9191                                                $notification_object->href    = $content['link'];
    9292                                        }
    93                                        
     93
    9494                                        $notification_object->id = $component_action_items[0]->id;
    95                                        
     95
    9696                                        $renderable[]     = $notification_object;
    9797                                } else {
  • trunk/bp-members/bp-members-signup.php

    r4830 r4961  
    374374        if ( is_multisite() ) {
    375375                wpmu_signup_user( $user_login, $user_email, $usermeta );
    376                
     376
    377377                // On multisite, the user id is not created until the user activates the account
    378378                // but we need to cast $user_id to pass to the filters
  • trunk/bp-members/bp-members-template.php

    r4955 r4961  
    896896        function bp_get_displayed_user_username() {
    897897                global $bp;
    898                
     898
    899899                if ( !empty( $bp->displayed_user->id ) ) {
    900900                        $username = bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login );
     
    902902                        $username = '';
    903903                }
    904                
     904
    905905                return apply_filters( 'bp_get_displayed_user_username', $username );
    906906        }
     
    911911        function bp_get_loggedin_user_username() {
    912912                global $bp;
    913                
     913
    914914                if ( !empty( $bp->loggedin_user->id ) ) {
    915915                        $username = bp_core_get_username( $bp->loggedin_user->id, $bp->loggedin_user->userdata->user_nicename, $bp->loggedin_user->userdata->user_login );
     
    917917                        $username = '';
    918918                }
    919                
     919
    920920                return apply_filters( 'bp_get_loggedin_user_username', $username );
    921921        }
  • trunk/bp-messages/bp-messages-actions.php

    r4902 r4961  
    1616
    1717        $thread_id = (int)bp_action_variable( 0 );
    18        
     18
    1919        if ( !$thread_id || !messages_is_valid_thread( $thread_id ) || ( !messages_check_thread_access( $thread_id ) && !is_super_admin() ) )
    2020                bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() );
     
    3737        // Mark message read
    3838        messages_mark_thread_read( $thread_id );
    39        
     39
    4040        // Decrease the unread count in the nav before it's rendered
    4141        $name = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() );
    42        
     42
    4343        $bp->bp_nav[$bp->messages->slug]['name'] = $name;
    4444
     
    6767
    6868        $thread_id = bp_action_variable( 1 );
    69        
     69
    7070        if ( !$thread_id || !is_numeric( $thread_id ) || !messages_check_thread_access( $thread_id ) ) {
    7171                bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() );
  • trunk/bp-messages/bp-messages-classes.php

    r4825 r4961  
    9595                elseif ( $type == 'read' )
    9696                        $type_sql = $wpdb->prepare( " AND r.unread_count = 0 " );
    97                
     97
    9898                if ( 'sentbox' == $box ) {
    9999                        $thread_ids = $wpdb->get_results( $wpdb->prepare( "SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND m.sender_id = %d AND r.is_deleted = 0 GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}", $user_id ) );
     
    254254                $this->__construct( $id );
    255255        }
    256        
     256
    257257        function __construct( $id = null ) {
    258258                global $bp;
     
    379379                $this->__construct($id);
    380380        }
    381        
     381
    382382        function __construct( $id = null ) {
    383383                if ( $id ) {
  • trunk/bp-messages/bp-messages-functions.php

    r4928 r4961  
    5757
    5858                $recipient_ids      = array();
    59                
     59
    6060                // Invalid recipients are added to an array, for future enhancements
    6161                $invalid_recipients = array();
     
    7272
    7373                        } else {
    74                                 if ( bp_is_username_compatibility_mode() ) 
    75                                         $recipient_id = bp_core_get_userid( $recipient ); 
     74                                if ( bp_is_username_compatibility_mode() )
     75                                        $recipient_id = bp_core_get_userid( $recipient );
    7676                                else
    7777                                        $recipient_id = bp_core_get_userid_from_nicename( $recipient );
    7878                        }
    79                        
     79
    8080                        if ( !$recipient_id )
    8181                                $invalid_recipients[] = $recipient;
     
    236236                $link  = bp_loggedin_user_domain() . bp_get_messages_slug() . '/inbox';
    237237                $title = __( 'Inbox', 'buddypress' );
    238                
     238
    239239                if ( (int)$total_items > 1 ) {
    240240                        $text = sprintf( __('You have %d new messages', 'buddypress' ), (int)$total_items );
  • trunk/bp-messages/bp-messages-loader.php

    r4928 r4961  
    6969                        'table_name_recipients' => $bp->table_prefix . 'bp_messages_recipients'
    7070                );
    71                
     71
    7272                // All globals for messaging component.
    7373                // Note that global_tables is included in this array.
  • trunk/bp-messages/bp-messages-screens.php

    r4842 r4961  
    9292
    9393        $notice_id = (int)bp_action_variable( 1 );
    94        
     94
    9595        if ( !empty( $notice_id ) && is_numeric( $notice_id ) ) {
    9696                $notice = new BP_Messages_Notice( $notice_id );
  • trunk/bp-themes/bp-default/_inc/css/default-rtl.css

    r4916 r4961  
    11/*--------------------------------------------------------------
    22Hello, this is the BuddyPress Default rtl stylesheet.
    3 Right to left styles. This will transform the theme to read from 
     3Right to left styles. This will transform the theme to read from
    44right to left for languages that support this method.
    55----------------------------------------------------------------
     
    3434        5.7 - Topics and Tables - Forums and General
    3535        5.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums
    36         5.9 - Private Messaging Threads 
     36        5.9 - Private Messaging Threads
    3737--------------------------------------------------------------*/
    3838/*--------------------------------------------------------------
     
    239239        float: right;
    240240}
    241 #nav li li { 
     241#nav li li {
    242242        margin-left: auto;
    243         margin-right: 0; 
     243        margin-right: 0;
    244244}
    245245#nav ul,
  • trunk/bp-themes/bp-default/_inc/css/default.css

    r4916 r4961  
    13071307        border-radius: 3px;
    13081308        color: #fff;
    1309         font-size: 90%; 
     1309        font-size: 90%;
    13101310        margin-left: 2px;
    13111311        padding: 0 5px;
     
    21882188}
    21892189div.item-list-tabs ul li a span {
    2190         background: #1fb3dd; 
     2190        background: #1fb3dd;
    21912191        -moz-border-radius: 3px;
    21922192        -webkit-border-radius: 3px;
     
    21942194        color: #fff;
    21952195        display: inline;
    2196         font-size: 90%; 
     2196        font-size: 90%;
    21972197        margin-left: 2px;
    21982198        padding: 1px 6px;
  • trunk/bp-themes/bp-default/_inc/global.js

    r4956 r4961  
    929929
    930930                                        jq('a#user-messages span').html( inboxcount );
    931                                        
     931
    932932                                        if ( i != checkboxes.length - 1 ) {
    933933                                                checkboxes_tosend += ','
  • trunk/bp-themes/bp-default/activity/comment.php

    r4930 r4961  
    1010 * @subpackage bp-default
    1111 */
    12  
     12
    1313?>
    1414
  • trunk/bp-themes/bp-default/activity/entry.php

    r4849 r4961  
    9191
    9292                <div class="activity-comments">
    93                        
     93
    9494                        <?php bp_activity_comments(); ?>
    9595
  • trunk/bp-themes/bp-default/groups/create.php

    r4722 r4961  
    108108
    109109                                        <hr />
    110                                        
    111                                         <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4> 
    112 
    113                                         <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ) ?></p> 
    114                                
    115                                         <div class="radio"> 
    116                                                 <label> 
    117                                                         <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ) ?> /> 
    118                                                         <strong><?php _e( 'All group members', 'buddypress' ) ?></strong> 
    119                                                 </label> 
    120                                
    121                                                 <label> 
    122                                                         <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ) ?> /> 
    123                                                         <strong><?php _e( 'Group admins and mods only', 'buddypress' ) ?></strong> 
    124                                                 </label>
    125                                                
    126                                                 <label> 
    127                                                         <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ) ?> /> 
    128                                                         <strong><?php _e( 'Group admins only', 'buddypress' ) ?></strong> 
    129                                                 </label> 
    130                                         </div> 
    131                                
    132                                         <hr /> 
     110
     111                                        <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4>
     112
     113                                        <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ) ?></p>
     114
     115                                        <div class="radio">
     116                                                <label>
     117                                                        <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ) ?> />
     118                                                        <strong><?php _e( 'All group members', 'buddypress' ) ?></strong>
     119                                                </label>
     120
     121                                                <label>
     122                                                        <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ) ?> />
     123                                                        <strong><?php _e( 'Group admins and mods only', 'buddypress' ) ?></strong>
     124                                                </label>
     125
     126                                                <label>
     127                                                        <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ) ?> />
     128                                                        <strong><?php _e( 'Group admins only', 'buddypress' ) ?></strong>
     129                                                </label>
     130                                        </div>
     131
     132                                        <hr />
    133133
    134134                                        <?php do_action( 'bp_after_group_settings_creation_step' ); ?>
  • trunk/bp-themes/bp-default/groups/single/forum/edit.php

    r4803 r4961  
    5252                                        <label for="topic_text"><?php _e( 'Content:', 'buddypress' ); ?></label>
    5353                                        <textarea name="topic_text" id="topic_text"><?php bp_the_topic_text(); ?></textarea>
    54                                        
     54
    5555                                        <label><?php _e( 'Tags (comma separated):', 'buddypress' ) ?></label>
    5656                                        <input type="text" name="topic_tags" id="topic_tags" value="<?php bp_forum_topic_tag_list() ?>" />
  • trunk/bp-themes/bp-default/groups/single/forum/topic.php

    r4812 r4961  
    2424                <div id="topic-meta">
    2525                        <h3><?php bp_the_topic_title() ?> (<?php bp_the_topic_total_post_count() ?>)</h3>
    26                        
     26
    2727                        <?php if ( bp_forum_topic_has_tags() ) : ?>
    28                                
     28
    2929                                <div class="topic-tags">
    30                                
     30
    3131                                        <?php _e( 'Topic tags:', 'buddypress' ) ?> <?php bp_forum_topic_tag_list() ?>
    32                                
     32
    3333                                </div>
    34                                
     34
    3535                        <?php endif; ?>
    3636
  • trunk/bp-themes/bp-default/groups/single/home.php

    r4347 r4961  
    3939                                        locate_template( array( 'groups/single/send-invites.php' ), true );
    4040
    41                                         elseif ( bp_is_group_forum() && bp_group_is_visible() && bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) : 
     41                                        elseif ( bp_is_group_forum() && bp_group_is_visible() && bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) :
    4242                                                locate_template( array( 'groups/single/forum.php' ), true );
    4343
  • trunk/bp-themes/bp-default/index.php

    r4854 r4961  
    55
    66                <?php do_action( 'bp_before_blog_home' ) ?>
    7                
     7
    88                <?php do_action( 'template_notices' ) ?>
    99
  • trunk/bp-themes/bp-default/members/single/activity.php

    r4466 r4961  
    1616
    1717                <li id="activity-filter-select" class="last">
    18                         <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label> 
     18                        <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
    1919                        <select id="activity-filter-by">
    2020                                <option value="-1"><?php _e( 'Everything', 'buddypress' ) ?></option>
  • trunk/bp-themes/bp-default/members/single/forums/topics.php

    r3933 r4961  
    11<?php
    2 /* 
     2/*
    33 * To change this template, choose Tools | Templates
    44 * and open the template in the editor.
  • trunk/bp-themes/bp-default/members/single/home.php

    r4347 r4961  
    3838
    3939                                <?php do_action( 'bp_before_member_body' );
    40                                
     40
    4141                                if ( bp_is_user_activity() || !bp_current_component() ) :
    4242                                        locate_template( array( 'members/single/activity.php' ), true );
  • trunk/bp-xprofile/bp-xprofile-actions.php

    r4840 r4961  
    2323function xprofile_action_delete_avatar() {
    2424        global $bp;
    25        
     25
    2626        if ( !bp_is_current_component( 'profile' ) || !bp_is_current_action( 'change-avatar' ) || !bp_is_action_variable( 'delete-avatar', 0 ) )
    2727                return false;
  • trunk/bp-xprofile/bp-xprofile-activity.php

    r4827 r4961  
    116116function bp_xprofile_new_avatar_activity() {
    117117        global $bp;
    118        
     118
    119119        if ( !bp_is_active( 'activity' ) )
    120120                return false;
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r4920 r4961  
    168168                        if ( !empty( $field_ids ) )
    169169                                $field_data = $wpdb->get_results( $wpdb->prepare( "SELECT field_id, value FROM {$bp->profile->table_name_data} WHERE field_id IN ( {$field_ids_sql} ) AND user_id = %d", $user_id ) );
    170                                
     170
    171171                        // Remove data-less fields, if necessary
    172172                        if ( $hide_empty_fields ) {
    173                        
     173
    174174                                // Loop through the results and find the fields that have data.
    175175                                foreach( (array)$field_data as $data ) {
     
    179179                                        }
    180180                                }
    181                                
     181
    182182                                // The remaining members of $field_ids are empty. Remove them.
    183183                                foreach( $fields as $field_key => $field ) {
     
    186186                                        }
    187187                                }
    188                                
     188
    189189                                // Reset indexes
    190190                                $fields = array_values( $fields );
    191                                
    192                         }
    193                        
     191
     192                        }
     193
    194194                        // Field data was found
    195195                        if ( !empty( $field_data ) && !is_wp_error( $field_data ) ) {
    196                                
     196
    197197                                // Loop through fields
    198198                                foreach( (array)$fields as $field_key => $field ) {
    199                                        
     199
    200200                                        // Loop throught the data in each field
    201201                                        foreach( (array)$field_data as $data ) {
    202                                        
     202
    203203                                                // Assign correct data value to the field
    204204                                                if ( $field->id == $data->field_id )
    205205                                                        $fields[$field_key]->data->value = $data->value;
    206                                         }       
    207                                 }       
     206                                        }
     207                                }
    208208                        }
    209209                }
     
    215215                                        $groups[$group_key]->fields[] = $field;
    216216                        }
    217                        
     217
    218218                        // When we unset fields above, we may have created empty groups.
    219219                        // Remove them, if necessary.
     
    221221                                unset( $groups[$group_key] );
    222222                        }
    223                        
     223
    224224                        // Reset indexes
    225225                        $groups = array_values( $groups );
     
    328328        var $message = null;
    329329        var $message_type = 'err';
    330        
     330
    331331        function bp_xprofile_field( $id = null, $user_id = null, $get_data = true ) {
    332332                $this->__construct( $id, $user_id, $get_data );
    333333        }
    334        
     334
    335335        function __construct( $id = null, $user_id = null, $get_data = true ) {
    336336                if ( $id )
     
    794794        var $value;
    795795        var $last_updated;
    796        
     796
    797797        function bp_xprofile_profiledata( $field_id = null, $user_id = null ) {
    798                 $this->__construct( $field_id, $user_id );             
    799         }
    800        
     798                $this->__construct( $field_id, $user_id );
     799        }
     800
    801801        function __construct( $field_id = null, $user_id = null ) {
    802802                if ( $field_id )
  • trunk/bp-xprofile/bp-xprofile-filters.php

    r4827 r4961  
    9898                        $filtered_value         = wp_rel_nofollow( force_balance_tags( $kses_field_value ) );
    9999                        $filtered_values[] = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_value, $value );
    100                        
     100
    101101                }
    102102
  • trunk/bp-xprofile/bp-xprofile-screens.php

    r4840 r4961  
    1515 * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename)
    1616 */
    17 function xprofile_screen_display_profile() {   
     17function xprofile_screen_display_profile() {
    1818        $new = isset( $_GET['new'] ) ? $_GET['new'] : '';
    1919
  • trunk/bp-xprofile/bp-xprofile-template.php

    r4958 r4961  
    196196        function bp_get_field_css_class( $class = false ) {
    197197                global $profile_template;
    198                
     198
    199199                $css_classes = array();
    200200
     
    710710                if ( !$group_id = bp_action_variable( 1 ) )
    711711                        $group_id = 1;
    712                        
     712
    713713                if ( !is_numeric( $group_id ) )
    714714                        $group_id = 1;
Note: See TracChangeset for help on using the changeset viewer.