Skip to:
Content

BuddyPress.org

Changeset 1025


Ignore:
Timestamp:
02/06/2009 10:44:01 PM (18 years ago)
Author:
apeatling
Message:

Syntax cleanup.

Location:
trunk
Files:
2 deleted
44 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r1021 r1025  
    3434       
    3535        $sql[] = "CREATE TABLE ". $bp->activity->table_name_current_user ." (
    36                                 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    37                                 item_id int(11) NOT NULL,
    38                                 secondary_item_id int(11) NOT NULL,
    39                                 user_id int(11) NOT NULL,
     36                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     37                                item_id bigint(20) NOT NULL,
     38                                secondary_item_id bigint(20) NOT NULL,
     39                                user_id bigint(20) NOT NULL,
    4040                                component_name varchar(75) NOT NULL,
    4141                                component_action varchar(75) NOT NULL,
    … …  
    5050
    5151        $sql[] = "CREATE TABLE ". $bp->activity->table_name_current_user_cached ." (
    52                                 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    53                                 item_id int(11) NOT NULL,
    54                                 secondary_item_id int(11) NOT NULL,
     52                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     53                                item_id bigint(20) NOT NULL,
     54                                secondary_item_id bigint(20) NOT NULL,
    5555                                content longtext NOT NULL,
    5656                                primary_link varchar(150) NOT NULL,
    … …  
    6868       
    6969        $sql[] = "CREATE TABLE ". $bp->activity->table_name_current_user_friends_cached ." (
    70                                 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    71                                 user_id int(11) NOT NULL,
     70                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     71                                user_id bigint(20) NOT NULL,
    7272                                content longtext NOT NULL,
    7373                                primary_link varchar(150) NOT NULL,
    … …  
    9595       
    9696        $sql[] = "CREATE TABLE ". $bp->activity->table_name_sitewide ." (
    97                                 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    98                                 user_id int(11) NOT NULL,
    99                                 item_id int(11) NOT NULL,
    100                                 secondary_item_id int(11),
     97                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     98                                user_id bigint(20) NOT NULL,
     99                                item_id bigint(20) NOT NULL,
     100                                secondary_item_id bigint(20),
    101101                                content longtext NOT NULL,
    102102                                primary_link varchar(150) NOT NULL,
    … …  
    154154        }
    155155       
    156         if ( is_site_admin() && $current_blog->blog_id == 1 ) {
     156        if ( is_site_admin() && 1 == $current_blog->blog_id ) {
    157157                /* Check to see if the site wide activity table is set up. */
    158158                if ( !$wpdb->get_var("SHOW TABLES LIKE '%" . $bp->activity->table_name_sitewide . "%'") || get_site_option( 'bp-activity-db-version' ) < BP_ACTIVITY_VERSION  )
  • trunk/bp-activity/bp-activity-classes.php

    r1021 r1025  
    320320               
    321321                for ( $i = 0; $i < count($activity_array); $i++ ) {
    322                         if ( $activity_array[$i]['content'] == '' ) continue;
     322                        if ( empty( $activity_array[$i]['content'] ) ) continue;
    323323                       
    324324                        // Cache that sucka...
  • trunk/bp-activity/bp-activity-templatetags.php

    r1021 r1025  
    2626                        $user_id = $bp->displayed_user->id;
    2727
    28                 if ( $bp->current_component != $bp->activity->slug || ( $bp->current_component == $bp->activity->slug && $bp->current_action == 'just-me' || $bp->current_action == 'feed' ) ) {
     28                if ( $bp->current_component != $bp->activity->slug || ( $bp->current_component == $bp->activity->slug && 'just-me' == $bp->current_action || 'feed' == $bp->current_action ) ) {
    2929                        $this->activities = BP_Activity_Activity::get_activity_for_user( $user_id, $limit );
    3030                } else {
    … …  
    9999        global $bp, $activities_template, $bp_activity_user_id, $bp_activity_limit;
    100100       
    101         if ( $bp->current_action == 'my-friends' )
     101        if ( 'my-friends' == $bp->current_action )
    102102                $filter_content = false;
    103103        else
    … …  
    165165        // The "You" and "Your" conversion is only done in english, if a translation file is present
    166166        // then do not translate as it causes problems in other languages.
    167         if ( get_locale() == '' ) {
     167        if ( '' == get_locale() ) {
    168168                /* Switch 'their/your' depending on whether the user is logged in or not and viewing their profile */
    169169                if ( $filter_words ) {
    … …  
    206206        global $bp;
    207207       
    208         if ( ( $bp->current_component == $bp->profile->slug ) || $bp->current_action == 'just-me' )
     208        if ( ( $bp->current_component == $bp->profile->slug ) || 'just-me' == $bp->current_action )
    209209                echo apply_filters( 'bp_activities_member_rss_link', $bp->displayed_user->domain . $bp->activity->slug . '/feed' );
    210210        else
  • trunk/bp-activity/bp-activity-widgets.php

    r1021 r1025  
    2424               
    2525        <?php
    26         if ( $options['max_items'] == '' ) {
     26        if ( empty( $options['max_items'] ) ) {
    2727                $options['max_items'] = 20;
    2828        }
  • trunk/bp-blogs.php

    r1021 r1025  
    3232       
    3333        $sql[] = "CREATE TABLE {$bp->blogs->table_name} (
    34                                 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    35                                 user_id int(11) NOT NULL,
    36                                 blog_id int(11) NOT NULL,
     34                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     35                                user_id bigint(20) NOT NULL,
     36                                blog_id bigint(20) NOT NULL,
    3737                                KEY user_id (user_id),
    3838                                KEY blog_id (blog_id)
    … …  
    4040
    4141        $sql[] = "CREATE TABLE {$bp->blogs->table_name_blog_posts} (
    42                                 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    43                                 user_id int(11) NOT NULL,
    44                                 blog_id int(11) NOT NULL,
    45                                 post_id int(11) NOT NULL,
     42                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     43                                user_id bigint(20) NOT NULL,
     44                                blog_id bigint(20) NOT NULL,
     45                                post_id bigint(20) NOT NULL,
    4646                                date_created datetime NOT NULL,
    4747                                KEY user_id (user_id),
    … …  
    5151
    5252        $sql[] = "CREATE TABLE {$bp->blogs->table_name_blog_comments} (
    53                                 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    54                                 user_id int(11) NOT NULL,
    55                                 blog_id int(11) NOT NULL,
    56                                 comment_id int(11) NOT NULL,
    57                                 comment_post_id int(11) NOT NULL,
     53                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     54                                user_id bigint(20) NOT NULL,
     55                                blog_id bigint(20) NOT NULL,
     56                                comment_id bigint(20) NOT NULL,
     57                                comment_post_id bigint(20) NOT NULL,
    5858                                date_created datetime NOT NULL,
    5959                                KEY user_id (user_id),
    … …  
    6464       
    6565        $sql[] = "CREATE TABLE {$bp->blogs->table_name_blogmeta} (
    66                         id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    67                         blog_id int(11) NOT NULL,
     66                        id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     67                        blog_id bigint(20) NOT NULL,
    6868                        meta_key varchar(255) DEFAULT NULL,
    6969                        meta_value longtext DEFAULT NULL,
    … …  
    110110        if ( is_site_admin() ) {
    111111                /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    112                 if ( ( $wpdb->get_var("SHOW TABLES LIKE '%" . $bp->blogs->table_name . "%'") == false ) || ( get_site_option('bp-blogs-db-version') < BP_BLOGS_DB_VERSION )  )
     112                if ( ( false == $wpdb->get_var("SHOW TABLES LIKE '%" . $bp->blogs->table_name . "%'") ) || ( get_site_option('bp-blogs-db-version') < BP_BLOGS_DB_VERSION )  )
    113113                        bp_blogs_install();
    114114        }
    … …  
    173173       
    174174        /* Set up the component options navigation for Blog */
    175         if ( $bp->current_component == 'blogs' ) {
     175        if ( 'blogs' == $bp->current_component ) {
    176176                if ( bp_is_home() ) {
    177177                        if ( function_exists('xprofile_setup_nav') ) {
    … …  
    409409       
    410410        if ( !$is_recorded = BP_Blogs_Post::is_recorded( $post_id, $blog_id, $user_id ) ) {
    411                 if ( $post->post_status == 'publish' ) {
     411                if ( 'publish' == $post->post_status ) {
    412412                       
    413413                        /**
    … …  
    515515                         * to remove the record of the post.
    516516                         */
    517                         if ( !$comment->comment_approved || $comment->comment_approved == 'spam' )
     517                        if ( !$comment->comment_approved || 'spam' == $comment->comment_approved )
    518518                                BP_Blogs_Comment::delete( $comment_id, $blog_id );     
    519519                }
    … …  
    766766        $metas = array_map('maybe_unserialize', $metas);
    767767
    768         if ( count($metas) == 1 )
     768        if ( 1 == count($metas) )
    769769                return $metas[0];
    770770        else
  • trunk/bp-blogs/bp-blogs-templatetags.php

    r1021 r1025  
    8080                $blog = $this->next_blog();
    8181               
    82                 if ( $this->current_blog == 0 ) // loop has just started
     82                if ( 0 == $this->current_blog ) // loop has just started
    8383                        do_action('loop_start');
    8484        }
    … …  
    199199                $post = $this->next_post();
    200200               
    201                 if ( $this->current_post == 0 ) // loop has just started
     201                if ( 0 == $this->current_post ) // loop has just started
    202202                        do_action('loop_start');
    203203        }
    … …  
    384384        );
    385385
    386         if ( $post->post_type == 'page' )
     386        if ( 'page' == $post->post_type )
    387387                return get_page_link($post->ID, $leavename);
    388         elseif ($post->post_type == 'attachment')
     388        else if ( 'attachment' == $post->post_type )
    389389                return get_attachment_link($post->ID);
    390390
    … …  
    396396
    397397                $category = '';
    398                 if ( strpos($permalink, '%category%') !== false ) {
     398                if ( false !== strpos($permalink, '%category%') ) {
    399399                        $cats = get_the_category($post->ID);
    400400                        if ( $cats )
    … …  
    413413
    414414                $author = '';
    415                 if ( strpos($permalink, '%author%') !== false ) {
     415                if ( false !== strpos($permalink, '%author%') ) {
    416416                        $authordata = get_userdata($post->post_author);
    417417                        $author = $authordata->user_nicename;
    … …  
    547547                $comment = $this->next_comment();
    548548               
    549                 if ( $this->current_comment == 0 ) // loop has just started
     549                if ( 0 == $this->current_comment ) // loop has just started
    550550                        do_action('loop_start');
    551551        }
    … …  
    616616                $date_format = get_option('date_format');
    617617               
    618         if ( $echo == true )
     618        if ( $echo )
    619619                echo apply_filters( 'bp_comment_date', mysql2date( $date_format, $comments_template->comment->comment_date ) );
    620620        else
    … …  
    651651        $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user"
    652652       
    653         if ( $active_signup == 'none' || $active_signup == 'user' )
     653        if ( 'none' == $active_signup || 'user' == $active_signup )
    654654                return false;
    655655       
    … …  
    701701       
    702702        // Blog name
    703         if( constant( "VHOST" ) == 'no' )
     703        if( 'no' == constant( "VHOST" ) )
    704704                echo '<label for="blogname">' . __('Blog Name:', 'buddypress') . '</label>';
    705705        else
    … …  
    710710        <?php }
    711711
    712         if( constant( "VHOST" ) == 'no' ) {
     712        if( 'no' == constant( "VHOST" ) ) {
    713713                echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span><input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /><br />';
    714714        } else {
    … …  
    717717        if ( !is_user_logged_in() ) {
    718718                print '(<strong>' . __( 'Your address will be ' , 'buddypress');
    719                 if( constant( "VHOST" ) == 'no' ) {
     719                if( 'no' == constant( "VHOST" ) ) {
    720720                        print $current_site->domain . $current_site->path . __( 'blogname' , 'buddypress');
    721721                } else {
    … …  
    739739                <div style="clear:both;"></div>
    740740                <label class="checkbox" for="blog_public_on">
    741                         <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if( !isset( $_POST['blog_public'] ) || $_POST['blog_public'] == '1' ) { ?>checked="checked"<?php } ?> />
     741                        <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if( !isset( $_POST['blog_public'] ) || '1' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
    742742                        <strong><?php _e( 'Yes' , 'buddypress'); ?></strong>
    743743                </label>
    744744                <label class="checkbox" for="blog_public_off">
    745                         <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if( isset( $_POST['blog_public'] ) && $_POST['blog_public'] == '0' ) { ?>checked="checked"<?php } ?> />
     745                        <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
    746746                        <strong><?php _e( 'No' , 'buddypress'); ?></strong>
    747747                </label>
    … …  
    818818?>
    819819        <ul class="content-header-nav">
    820                 <li<?php if ( $current_tab == 'my-blogs' || $current_tab == '' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->blogs->slug ?>/my-blogs"><?php printf( __( "%s's Blogs", 'buddypress' ), $bp->displayed_user->fullname )  ?></a></li>
    821                 <li<?php if ( $current_tab == 'recent-posts' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->blogs->slug ?>/recent-posts"><?php printf( __( "%s's Recent Posts", 'buddypress' ), $bp->displayed_user->fullname )  ?></a></li>
    822                 <li<?php if ( $current_tab == 'recent-comments' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->blogs->slug ?>/recent-comments"><?php printf( __( "%s's Recent Comments", 'buddypress' ), $bp->displayed_user->fullname )  ?></a></li>     
     820                <li<?php if ( 'my-blogs' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->blogs->slug ?>/my-blogs"><?php printf( __( "%s's Blogs", 'buddypress' ), $bp->displayed_user->fullname )  ?></a></li>
     821                <li<?php if ( 'recent-posts' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->blogs->slug ?>/recent-posts"><?php printf( __( "%s's Recent Posts", 'buddypress' ), $bp->displayed_user->fullname )  ?></a></li>
     822                <li<?php if ( 'recent-comments' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->blogs->slug ?>/recent-comments"><?php printf( __( "%s's Recent Comments", 'buddypress' ), $bp->displayed_user->fullname )  ?></a></li>     
    823823        </ul>
    824824<?php
  • trunk/bp-blogs/directories/bp-blogs-directory-blogs.php

    r1021 r1025  
    33        global $bp, $current_blog;
    44       
    5         if ( $bp->current_component == $bp->blogs->slug && $bp->current_action == '' ) {
     5        if ( $bp->current_component == $bp->blogs->slug && empty( $bp->current_action ) ) {
    66                add_action( 'bp_template_content', 'bp_blogs_directory_blogs_content' );
    77                add_action( 'bp_template_sidebar', 'bp_blogs_directory_blogs_sidebar' );
  • trunk/bp-core.php

    r1021 r1025  
    193193       
    194194        $sql[] = "CREATE TABLE $bp->core->table_name_notifications (
    195                                 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    196                                 user_id int(11) NOT NULL,
    197                                 item_id int(11) NOT NULL,
    198                                 secondary_item_id int(11),
     195                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     196                                user_id bigint(20) NOT NULL,
     197                                item_id bigint(20) NOT NULL,
     198                                secondary_item_id bigint(20),
    199199                                component_name varchar(75) NOT NULL,
    200200                                component_action varchar(75) NOT NULL,
    201201                                date_notified datetime NOT NULL,
    202                                 is_new tinyint(1) NOT NULL,
    203202                            KEY item_id (item_id),
    204203                                KEY secondary_item_id (secondary_item_id),
    205204                                KEY user_id (user_id),
    206                             KEY is_new (is_new),
    207205                                KEY component_name (component_name),
    208206                                KEY component_action (component_action)
    … …  
    240238        if ( is_site_admin() ) {
    241239                /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    242                 if ( ( $wpdb->get_var("show tables like '%{$bp->core->table_name_notifications}%'") == false ) || ( get_site_option('bp-core-db-version') < BP_CORE_DB_VERSION )  )
     240                if ( ( false == $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->core->table_name_notifications}%'" ) ) || ( get_site_option('bp-core-db-version') < BP_CORE_DB_VERSION )  )
    243241                        bp_core_install();
    244242        }
    … …  
    308306                bp_core_add_subnav_item( 'profile', 'public', __('Public', 'buddypress'), $profile_link, 'xprofile_screen_display_profile' );
    309307
    310                 if ( $bp->current_component == 'profile' ) {
     308                if ( 'profile' == $bp->current_component ) {
    311309                        if ( bp_is_home() ) {
    312310                                $bp->bp_options_title = __('My Profile', 'buddypress');
    … …  
    833831 */
    834832function bp_is_serialized( $data ) {
    835    if ( trim($data) == "" ) {
     833   if ( '' == trim($data) ) {
    836834      return false;
    837835   }
    … …  
    881879function bp_core_render_notice() {
    882880        if ( $_SESSION['message'] ) {
    883                 $type = ( $_SESSION['message_type'] == 'success' ) ? 'updated' : 'error';
     881                $type = ( 'success' == $_SESSION['message_type'] ) ? 'updated' : 'error';
    884882        ?>
    885883                <div id="message" class="<?php echo $type; ?>">
    … …  
    925923        /* $newer_date will equal false if we want to know the time elapsed between a date and the current time */
    926924        /* $newer_date will have a value if we want to work out time elapsed between two known dates */
    927         $newer_date = ( $newer_date == false ) ? ( time() + ( 60*60*0 ) ) : $newer_date;
     925        $newer_date = ( !$newer_date ) ? ( time() + ( 60*60*0 ) ) : $newer_date;
    928926
    929927        /* Difference in seconds */
    … …  
    947945
    948946        /* Set output var */
    949         $output = ( $count == 1 ) ? '1 '. $chunks[$i][1] : $count . ' ' . $chunks[$i][2];
     947        $output = ( 1 == $count ) ? '1 '. $chunks[$i][1] : $count . ' ' . $chunks[$i][2];
    950948
    951949        /* Step two: the second chunk */
    … …  
    958956                if ( ( $count2 = floor( ( $since - ( $seconds * $count ) ) / $seconds2 ) ) != 0 ) {
    959957                        /* Add to output var */
    960                         $output .= ($count2 == 1) ? ', 1 '. $chunks[$i + 1][1] : ", " . $count2 . ' ' . $chunks[$i + 1][2];
     958                        $output .= ( 1 == $count2 ) ? ', 1 '. $chunks[$i + 1][1] : ", " . $count2 . ' ' . $chunks[$i + 1][2];
    961959                }
    962960        }
  • trunk/bp-core/bp-core-activation.php

    r837 r1025  
    9191
    9292        // Send email with activation link.
    93         if( constant( "VHOST" ) == 'no' ) {
     93        if ( 'no' == constant( "VHOST" ) ) {
    9494                $activate_url = bp_activation_page( false ) . "?key=$key";
    9595        } else {
    … …  
    100100        $admin_email = get_site_option( "admin_email" );
    101101       
    102         if ( $admin_email == '' )
     102        if ( empty( $admin_email ) )
    103103                $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    104104       
    105         $from_name = get_site_option( "site_name" ) == '' ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) );
     105        $from_name = ( '' == get_site_option( "site_name" ) ) ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) );
    106106        $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    107107        $message = sprintf(__("To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your blog here:\n\n%s", 'buddypress' ), $activate_url, clean_url("http://{$domain}{$path}"));
    … …  
    121121        $admin_email = get_site_option( "admin_email" );
    122122       
    123         if ( $admin_email == '' )
     123        if ( empty( $admin_email ) )
    124124                $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    125125       
    126         $from_name = get_site_option( "site_name" ) == '' ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) );
     126        $from_name = ( '' == get_site_option( "site_name" ) ) ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) );
    127127        $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    128128        $message = sprintf(__( apply_filters( 'wpmu_signup_user_notification_email', "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n" ) ), clean_url( bp_activation_page( false ) . "?key=$key") );
  • trunk/bp-core/bp-core-admin.php

    r1021 r1025  
    1414                       
    1515                        if ( function_exists( 'xprofile_install' ) ) {
    16                                 if ( $key == 'bp-xprofile-base-group-name' ) {
     16                                if ( 'bp-xprofile-base-group-name' == $key ) {
    1717                                        $wpdb->query( $wpdb->prepare( "UPDATE $bp->profile->table_name_groups SET name = %s WHERE name = %s AND id = 1", $value, stripslashes( get_site_option('bp-xprofile-base-group-name') ) ) );
    1818                                }
    1919                               
    20                                 if ( $key == 'bp-xprofile-fullname-field-name' ) {
     20                                if ( 'bp-xprofile-fullname-field-name' == $key ) {
    2121                                        $wpdb->query( $wpdb->prepare( "UPDATE $bp->profile->table_name_fields SET name = %s WHERE name = %s AND group_id = 1", $value, stripslashes( get_site_option('bp-xprofile-fullname-field-name') ) ) );
    2222                                }
  • trunk/bp-core/bp-core-adminbar.php

    r1021 r1025  
    6161                $counter = 0;
    6262                foreach( $bp->bp_nav as $nav_item ) {
    63                         $alt = ( $counter % 2 == 0 ) ? ' class="alt"' : '';
     63                        $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
    6464                       
    6565                        echo '<li' . $alt . '>';
    … …  
    7070                                $sub_counter = 0;
    7171                                foreach( $bp->bp_options_nav[$nav_item['css_id']] as $subnav_item ) {
    72                                         $alt = ( $sub_counter % 2 == 0 ) ? ' class="alt"' : '';
     72                                        $alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
    7373                                        echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '">' . $subnav_item['name'] . '</a></li>';                               
    7474                                        $sub_counter++;
    … …  
    8282                }
    8383       
    84                 $alt = ( $counter % 2 == 0 ) ? ' class="alt"' : '';
     84                $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
    8585
    8686                if ( function_exists('wp_logout_url') ) {
    … …  
    141141                                        $role = get_blog_role_for_user( $bp->loggedin_user->id, $blog->userblog_id );
    142142
    143                                         $alt = ( $counter % 2 == 0 ) ? ' class="alt"' : '';
     143                                        $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
    144144                                        echo '<li' . $alt . '>';
    145145                                        echo '<a href="' . $blog->siteurl . '">' . $blog->blogname . ' (' . $role . ')</a>';
    146                                         if (!('Subscriber' == $role)) { // then they have something to display on the flyout menu
     146                                        if ( !( 'Subscriber' == $role ) ) { // then they have something to display on the flyout menu
    147147                                                echo '<ul>';
    148148                                                echo '<li class="alt"><a href="' . $blog->siteurl  . '/wp-admin/">' . __('Dashboard', 'buddypress') . '</a></li>';
    … …  
    150150                                                echo '<li class="alt"><a href="' . $blog->siteurl  . '/wp-admin/edit.php">' . __('Manage Posts', 'buddypress') . '</a></li>';
    151151                                                echo '<li class="alt"><a href="' . $blog->siteurl  . '/wp-admin/edit-comments.php">' . __('Manage Comments', 'buddypress') . '</a></li>';                                       
    152                                                 if ('Admin' == $role) {
     152                                                if ( 'Admin' == $role ) {       
    153153                                                        echo '<li><a href="' . $blog->siteurl  . '/wp-admin/themes.php">' . __('Switch Theme', 'buddypress') . '</a></li>';
    154154                                                }                                       
    … …  
    160160                        }
    161161       
    162                         $alt = ( $counter % 2 == 0 ) ? ' class="alt"' : '';
     162                        $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
    163163
    164164                        echo '<li' . $alt . '>';
    … …  
    191191                        <?php $counter = 0; ?>
    192192                        <?php for ( $i = 0; $i < count($notifications); $i++ ) { ?>
    193                                 <?php $alt = ( $counter % 2 == 0 ) ? ' class="alt"' : ''; ?>
     193                                <?php $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>
    194194                                <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li>
    195195                                <?php $counter++; ?>
  • trunk/bp-core/bp-core-ajax.php

    r1021 r1025  
    3333                                                <span class="activity">
    3434                                                        <?php
    35                                                         if ( $_POST['filter'] == 'newest-members') {
     35                                                        if ( 'newest-members' == $_POST['filter'] ) {
    3636                                                                echo bp_core_get_last_activity( $user->user_registered, __( 'registered %s ago', 'buddypress' ) );
    37                                                         } else if ( $_POST['filter'] == 'recently-active-members') {
     37                                                        } else if ( 'recently-active-members' == $_POST['filter'] ) {
    3838                                                                echo bp_core_get_last_activity( get_usermeta( $user->user_id, 'last_activity' ), __( 'active %s ago', 'buddypress' ) );
    39                                                         } else if ( $_POST['filter'] == 'popular-members') {
    40                                                                 if ( get_usermeta( $user->user_id, 'total_friend_count' ) == 1 )
     39                                                        } else if ( 'popular-members' == $_POST['filter'] ) {
     40                                                                if ( 1 == get_usermeta( $user->user_id, 'total_friend_count' ) )
    4141                                                                        echo get_usermeta( $user->user_id, 'total_friend_count' ) . __(' friend', 'buddypress');
    4242                                                                else
  • trunk/bp-core/bp-core-avatars.php

    r1021 r1025  
    4848                if ( empty( $grav_option ) ) {
    4949                        $default_grav = 'wavatar';
    50                 } else if ( $grav_option == 'mystery' ) {
     50                } else if ( 'mystery' == $grav_option ) {
    5151                        $default_grav = site_url( MUPLUGINDIR . '/bp-core/images/mystery-man.jpg');
    5252                } else {
    … …  
    6666function bp_core_get_avatar_filter( $avatar, $id_or_email, $size, $default ) {
    6767        $str = '';
    68         $ver = ( $size == 1 || $size == 2 ) ? $size : 1;
    69        
    70         if ( CORE_AVATAR_V2_W == false && CORE_AVATAR_V2_H == false )
     68        $ver = ( 1 == $size || 2 == $size ) ? $size : 1;
     69       
     70        if ( !CORE_AVATAR_V2_W && !CORE_AVATAR_V2_H )
    7171                $ver = 1;
    7272               
    … …  
    111111                }
    112112
    113         } else if ( isset($_POST['slick_avatars_action']) && $_POST['slick_avatars_action'] == 'upload' ) {
     113        } else if ( isset($_POST['slick_avatars_action']) && 'upload' == $_POST['slick_avatars_action'] ) {
    114114       
    115115                // Confirm that the nonce is valid
    … …  
    147147                bp_core_render_avatar_cropper($original, $canvas, $action);
    148148
    149         } else if ( isset($_POST['slick_avatars_action']) && $_POST['slick_avatars_action'] == 'crop' ) {
     149        } else if ( isset($_POST['slick_avatars_action']) && 'crop' == $_POST['slick_avatars_action'] ) {
    150150                // Crop, save, store
    151151               
    … …  
    167167                echo '<span class="crop-img">' . bp_core_get_avatar( get_current_user_id(), 1 ) . '</span>';
    168168               
    169                 if ( CORE_AVATAR_V2_W !== false && CORE_AVATAR_V2_H !== false ) {
     169                if ( CORE_AVATAR_V2_W && CORE_AVATAR_V2_H ) {
    170170                        echo '<span class="crop-img">' . bp_core_get_avatar( get_current_user_id(), 2 ) . '</span>';
    171171                }
    172172
    173         } else if ( isset($_GET['slick_avatars_action']) && $_GET['slick_avatars_action'] == 'delete' ) {
     173        } else if ( isset($_GET['slick_avatars_action']) && 'delete' == $_GET['slick_avatars_action'] ) {
    174174                // Delete an avatar
    175175
  • trunk/bp-core/bp-core-catchuri.php

    r1021 r1025  
    4444       
    4545        /* Take empties off the end of complete URI */
    46         if ( $bp_uri[count($bp_uri) - 1] == "" )
     46        if ( empty( $bp_uri[count($bp_uri) - 1] ) )
    4747                array_pop( $bp_uri );
    4848
    4949        /* Take empties off the start of complete URI */
    50         if ( $bp_uri[0] == "" )
     50        if ( empty( $bp_uri[0] ) )
    5151                array_shift( $bp_uri );
    5252               
    … …  
    6767
    6868        /* Take empties off the end of path */
    69         if ( $paths[count($paths) - 1] == "" )
     69        if ( empty( $paths[count($paths) - 1] ) )
    7070                array_pop( $paths );
    7171
    7272        /* Take empties off the start of path */
    73         if ( $paths[0] == "" )
     73        if ( empty( $paths[0] ) )
    7474                array_shift( $paths );
    7575
    … …  
    112112                $is_root_component = in_array( $bp_uri[0], $root_components );
    113113
    114         if ( VHOST == 'no' && !$is_root_component ) {
     114        if ( 'no' == VHOST && !$is_root_component ) {
    115115                $component_index++;
    116116                $action_index++;
    … …  
    131131
    132132        /* Remove the username from action variables if this is not a VHOST install */
    133         if ( VHOST == 'no' && !$is_root_component )
     133        if ( 'no' == VHOST && !$is_root_component )
    134134                array_shift($action_variables);
    135135       
  • trunk/bp-core/bp-core-classes.php

    r1021 r1025  
    8686
    8787                        if ( $this->total_friends ) {
    88                                 if ( $this->total_friends == 1 )
     88                                if ( 1 == $this->total_friends )
    8989                                        $this->total_friends .= ' ' . __( 'friend', 'buddypress' );
    9090                                else
    … …  
    9797                if ( function_exists('bp_blogs_install') ) {           
    9898                        if ( $this->total_blogs ) {
    99                                 if ( $this->total_blogs == 1 )
     99                                if ( 1 == $this->total_blogs )
    100100                                        $this->total_blogs .= ' ' . __( 'blog', 'buddypress' );
    101101                                else
    … …  
    110110                       
    111111                        if ( $this->total_groups ) {
    112                                 if ( $this->total_groups == 1 )
     112                                if ( 1 == $this->total_groups )
    113113                                        $this->total_groups .= ' ' . __( 'group', 'buddypress' );
    114114                                else
    … …  
    239239        var $component_action;
    240240        var $date_notified;
    241         var $is_new;
    242241       
    243242        function bp_core_notification( $id = false ) {
    … …  
    258257                        $this->component_action = $notification->component_action;
    259258                        $this->date_notified = $notification->date_notified;
    260                         $this->is_new = $notification->is_new;
    261259                }
    262260        }       
    … …  
    267265                if ( $this->id ) {
    268266                        // Update
    269                         $sql = $wpdb->prepare( "UPDATE {$bp->core->table_name_notifications} SET item_id = %d, secondary_item_id = %d, user_id = %d, component_name = %s, component_action = %d, date_notified = FROM_UNIXTIME(%d), is_new = %d ) WHERE id = %d", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new, $this->id );
     267                        $sql = $wpdb->prepare( "UPDATE {$bp->core->table_name_notifications} SET item_id = %d, secondary_item_id = %d, user_id = %d, component_name = %s, component_action = %d, date_notified = FROM_UNIXTIME(%d) ) WHERE id = %d", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->id );
    270268                } else {
    271269                        // Save
    272                         $sql = $wpdb->prepare( "INSERT INTO {$bp->core->table_name_notifications} ( item_id, secondary_item_id, user_id, component_name, component_action, date_notified, is_new ) VALUES ( %d, %d, %d, %s, %s, FROM_UNIXTIME(%d), %d )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new );
     270                        $sql = $wpdb->prepare( "INSERT INTO {$bp->core->table_name_notifications} ( item_id, secondary_item_id, user_id, component_name, component_action, date_notified ) VALUES ( %d, %d, %d, %s, %s, FROM_UNIXTIME(%d) )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified );
    273271                }
    274272
    … …  
    291289                global $wpdb, $bp;
    292290
    293                 return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND is_new = 1", $user_id ) );
     291                return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE user_id = %d", $user_id ) );
    294292        }
    295293       
  • trunk/bp-core/bp-core-cssjs.php

    r806 r1025  
    4444                wp_enqueue_style( 'bp-admin-bar', site_url( MUPLUGINDIR . '/bp-core/css/admin-bar.css' ) );
    4545               
    46                 if ( get_bloginfo('text_direction') == 'rtl' && file_exists( ABSPATH . MUPLUGINDIR . '/bp-core/css/admin-bar-rtl.css' ) )
     46                if ( 'rtl' == get_bloginfo('text_direction') && file_exists( ABSPATH . MUPLUGINDIR . '/bp-core/css/admin-bar-rtl.css' ) )
    4747                        wp_enqueue_style( 'bp-admin-bar-rtl', site_url( MUPLUGINDIR . '/bp-core/css/admin-bar-rtl.css' ) );     
    4848        }
     49       
     50        // Enable a sitewide CSS file that will apply styles to both the home blog theme
     51        // and the member theme.
     52        if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( 1, 'stylesheet' ) . '/css/site-wide.css' ) )
     53                wp_enqueue_style( 'site-wide-styles', WP_CONTENT_URL . '/themes/' . get_blog_option( 1, 'stylesheet' ) . '/css/site-wide.css' );
    4954       
    5055        wp_print_styles();
    … …  
    7580 */
    7681function bp_core_add_admin_js() {
    77         if ( strpos( $_GET['page'], 'bp-core' ) !== false ) {
     82        if ( false !== strpos( $_GET['page'], 'bp-core' ) ) {
    7883                wp_enqueue_script( 'bp-account-admin-js', site_url( MUPLUGINDIR . '/bp-core/js/account-admin.js' ) );
    7984        }
    8085       
    81         if ( strpos( $_GET['page'], 'bp-core/admin-mods' ) !== false ) {
     86        if ( false !== strpos( $_GET['page'], 'bp-core/admin-mods' ) ) {
    8287                wp_enqueue_script('password-strength-meter');
    8388        }
    … …  
    139144                }
    140145
    141                 <?php if (CORE_AVATAR_V2_W !== false && CORE_AVATAR_V2_H !== false) { ?>
     146                <?php if ( CORE_AVATAR_V2_W !== false && CORE_AVATAR_V2_H !== false ) { ?>
    142147                function v2Cropper() {
    143148                        v1Crop = new Cropper.ImgWithPreview(
  • trunk/bp-core/bp-core-notifications.php

    r1021 r1025  
    1313        $notification->component_action = $component_action;
    1414        $notification->date_notified = $date_notified;
    15         $notification->is_new = 1;
    1615
    1716        if ( $secondary_item_id )
    … …  
    5958                                continue;
    6059                       
    61                         $item_id = ( $action_item_count == 1 ) ? $component_action_items[0]->item_id : false;
    62                         $secondary_item_id = ( $action_item_count == 1 ) ? $component_action_items[0]->secondary_item_id : false;
     60                        $item_id = ( 1 == $action_item_count ) ? $component_action_items[0]->item_id : false;
     61                        $secondary_item_id = ( 1 == $action_item_count ) ? $component_action_items[0]->secondary_item_id : false;
    6362                       
    6463                        if ( function_exists( $component_name . '_format_notifications' ) ) {
  • trunk/bp-core/bp-core-signup.php

    r966 r1025  
    3333       
    3434                // Blog name
    35                 if( constant( "VHOST" ) == 'no' )
     35                if ( 'no' == constant( "VHOST" ) )
    3636                        echo '<label for="blogname">' . __('Blog Name:', 'buddypress') . '</label>';
    3737                else
    … …  
    4242                <?php }
    4343
    44                 if( constant( "VHOST" ) == 'no' ) {
     44                if ( 'no' == constant( "VHOST" ) ) {
    4545                        echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span><input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /><br />';
    4646                } else {
    4747                        echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /><span class="suffix_address">.' . $current_site->domain . $current_site->path . '</span><br />';
    4848                }
     49               
    4950                if ( !is_user_logged_in() ) {
    5051                        echo '<p class="help-text">';
    5152                        print '(<strong>' . __( 'Your address will be ', 'buddypress'  );
    52                         if( constant( "VHOST" ) == 'no' ) {
     53                        if( 'no' == constant( "VHOST" ) ) {
    5354                                print $current_site->domain . $current_site->path . __( 'blogname', 'buddypress'  );
    5455                        } else {
    … …  
    7273                        <?php _e( 'I would like my blog to appear in search engines like Google and Technorati, and in public listings around this site.', 'buddypress' ); ?>
    7374                        <label class="checkbox" for="blog_public_on">
    74                                 <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if( !isset( $_POST['blog_public'] ) || $_POST['blog_public'] == '1' ) { ?>checked="checked"<?php } ?> />
     75                                <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if( !isset( $_POST['blog_public'] ) || '1' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
    7576                                 &nbsp;<?php _e( 'Yes', 'buddypress' ); ?>
    7677                        </label>
    7778                        <label class="checkbox" for="blog_public_off">
    78                                 <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if( isset( $_POST['blog_public'] ) && $_POST['blog_public'] == '0' ) { ?>checked="checked"<?php } ?> />
     79                                <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
    7980                                 &nbsp;<?php _e( 'No', 'buddypress' ); ?>
    8081                        </label>
    … …  
    218219                <?php bp_core_signup_show_user_form($user_name, $user_email, $errors); ?>
    219220               
    220                 <?php if( $active_signup == 'blog' ) { ?>
     221                <?php if( 'blog' == $active_signup ) { ?>
    221222                        <input id="signupblog" type="hidden" name="signup_for" value="blog" />
    222                 <?php } elseif( $active_signup == 'user' ) { ?>
     223                <?php } elseif( 'user' == $active_signup ) { ?>
    223224                        <input id="signupblog" type="hidden" name="signup_for" value="user" />
    224225                <?php } else { ?>
  • trunk/bp-forums.php

    r1021 r1025  
    1919        global $bp, $bbpress_live;
    2020
    21         if ( get_usermeta( $bp->loggedin_user->id, 'bb_capabilities' ) == '' )
     21        if ( '' == get_usermeta( $bp->loggedin_user->id, 'bb_capabilities' ) )
    2222                bp_forums_make_user_active_member( $bp->loggedin_user->id );
    2323       
  • trunk/bp-friends.php

    r1021 r1025  
    1212include_once( 'bp-friends/bp-friends-cssjs.php' );
    1313include_once( 'bp-friends/bp-friends-templatetags.php' );
    14 include_once( 'bp-friends/bp-friends-widgets.php' );
    1514include_once( 'bp-friends/bp-friends-notifications.php' );
    1615include_once( 'bp-friends/bp-friends-filters.php' );
    … …  
    3029               
    3130        $sql[] = "CREATE TABLE {$bp->friends->table_name} (
    32                                 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    33                                 initiator_user_id int(11) NOT NULL,
    34                                 friend_user_id int(11) NOT NULL,
     31                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     32                                initiator_user_id bigint(20) NOT NULL,
     33                                friend_user_id bigint(20) NOT NULL,
    3534                                is_confirmed bool DEFAULT 0,
    3635                                is_limited bool DEFAULT 0,
    … …  
    7271        if ( is_site_admin() ) {
    7372                /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    74                 if ( ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->friends->table_name}%'") == false ) || ( get_site_option('bp-friends-db-version') < BP_FRIENDS_DB_VERSION )  )
     73                if ( ( false == $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->friends->table_name}%'") ) || ( get_site_option('bp-friends-db-version') < BP_FRIENDS_DB_VERSION )  )
    7574                        friends_install();
    7675        }
    … …  
    125124        global $bp;
    126125                       
    127         if ( isset($bp->action_variables) && $bp->action_variables[0] == 'accept' && is_numeric($bp->action_variables[1]) ) {
     126        if ( isset($bp->action_variables) && 'accept' == $bp->action_variables[0] && is_numeric($bp->action_variables[1]) ) {
    128127               
    129128                if ( friends_accept_friendship( $bp->action_variables[1] ) ) {
    … …  
    134133                bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action );
    135134               
    136         } else if ( isset($bp->action_variables) && $bp->action_variables[0] == 'reject' && is_numeric($bp->action_variables[1]) ) {
     135        } else if ( isset($bp->action_variables) && 'reject' == $bp->action_variables[0] && is_numeric($bp->action_variables[1]) ) {
    137136               
    138137                if ( friends_reject_friendship( $bp->action_variables[1] ) ) {
    … …  
    166165                        <td></td>
    167166                        <td><?php _e( 'A member sends you a friendship request', 'buddypress' ) ?></td>
    168                         <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php if ( !get_usermeta( $current_user->id,'notification_friends_friendship_request') || get_usermeta( $current_user->id,'notification_friends_friendship_request') == 'yes' ) { ?>checked="checked" <?php } ?>/></td>
     167                        <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php if ( !get_usermeta( $current_user->id,'notification_friends_friendship_request') || 'yes' == get_usermeta( $current_user->id,'notification_friends_friendship_request') ) { ?>checked="checked" <?php } ?>/></td>
    169168                        <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" value="no" <?php if ( get_usermeta( $current_user->id,'notification_friends_friendship_request') == 'no' ) { ?>checked="checked" <?php } ?>/></td>
    170169                </tr>
    … …  
    172171                        <td></td>
    173172                        <td><?php _e( 'A member accepts your friendship request', 'buddypress' ) ?></td>
    174                         <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php if ( !get_usermeta( $current_user->id,'notification_friends_friendship_accepted') || get_usermeta( $current_user->id,'notification_friends_friendship_accepted') == 'yes' ) { ?>checked="checked" <?php } ?>/></td>
    175                         <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php if ( get_usermeta( $current_user->id,'notification_friends_friendship_accepted') == 'no' ) { ?>checked="checked" <?php } ?>/></td>
     173                        <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php if ( !get_usermeta( $current_user->id,'notification_friends_friendship_accepted') || 'yes' == get_usermeta( $current_user->id,'notification_friends_friendship_accepted') ) { ?>checked="checked" <?php } ?>/></td>
     174                        <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id,'notification_friends_friendship_accepted') ) { ?>checked="checked" <?php } ?>/></td>
    176175                </tr>
    177176               
    … …  
    468467        global $bp;
    469468               
    470         if ( BP_Friends_Friendship::check_is_friend( $user_id, $possible_friend_id ) == 'is_friend' )
     469        if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( $user_id, $possible_friend_id ) )
    471470                return true;
    472471       
    … …  
    573572
    574573function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) {
    575         if ( $status == 'add' ) {
     574        if ( 'add' == $status ) {
    576575                update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count' ) + 1 );
    577576                update_usermeta( $friend_user_id, 'total_friend_count', (int)get_usermeta( $friend_user_id, 'total_friend_count' ) + 1 );
  • trunk/bp-friends/bp-friends-ajax.php

    r1021 r1025  
    1313        global $bp;
    1414
    15         if ( BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $_POST['fid'] ) == 'is_friend' ) {
     15        if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
    1616                if ( !friends_remove_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
    1717                        echo __("Friendship could not be canceled.", 'buddypress');
    … …  
    1919                        echo '<a id="friend-' . $_POST['fid'] . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $_POST['fid'] . '">' . __( 'Add Friend', 'buddypress' ) . '</a>';
    2020                }
    21         } else if ( BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $_POST['fid'] ) == 'not_friends' ) {
     21        } else if ( 'not_friends' == BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
    2222                if ( !friends_add_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
    2323                        echo __("Friendship could not be requested.", 'buddypress');
    2424                } else {
    2525                        echo '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '" class="requested">' . __( 'Friendship Requested', 'buddypres' ) . '</a>';
    26                         //echo '<a id="friend-' . $_POST['fid'] . '" class="remove" rel="remove" title="' . __( 'Remove Friend', 'buddypress' ) . '" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $_POST['fid'] . '">' . __( 'Remove Friend', 'buddypress' ) . '</a>';
    2726                }
    2827        } else {
    29                 echo __('Request Pending', 'buddypress');
     28                echo __( 'Request Pending', 'buddypress' );
    3029        }
    3130       
  • trunk/bp-friends/bp-friends-classes.php

    r1021 r1025  
    174174               
    175175                if ( $result ) {
    176                         if ( (int)$result[0]->is_confirmed == 0 ) {
     176                        if ( 0 == (int)$result[0]->is_confirmed ) {
    177177                                return 'pending';
    178178                        } else {
  • trunk/bp-friends/bp-friends-notifications.php

    r884 r1025  
    66        $initiator_name = bp_fetch_user_fullname( $initiator_id, false );
    77
    8         if ( get_usermeta( (int)$friend_id, 'notification_friends_friendship_request' ) == 'no' )
     8        if ( 'no' == get_usermeta( (int)$friend_id, 'notification_friends_friendship_request' ) )
    99                return false;
    1010       
    … …  
    4545        $friend_name = bp_fetch_user_fullname( $friend_id, false );
    4646
    47         if ( get_usermeta( (int)$initiator_id, 'notification_friends_friendship_accepted' ) == 'no' )
     47        if ( 'no' == get_usermeta( (int)$initiator_id, 'notification_friends_friendship_accepted' ) )
    4848                return false;
    4949       
  • trunk/bp-friends/bp-friends-templatetags.php

    r1021 r1025  
    2020                $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : 10;
    2121
    22                 if ( $bp->current_action == 'my-friends' && $_POST['friend-search-box'] != '' ) {
     22                if ( 'my-friends' == $bp->current_action && !empty( $_POST['friend-search-box'] ) ) {
    2323                       
    2424                        // Search results
    … …  
    2727                        $this->friendships = $this->friendships['friends'];
    2828               
    29                 } else if ( $bp->current_action == 'requests' ) {
     29                } else if ( 'requests' == $bp->current_action ) {
    3030               
    3131                        // Friendship Requests
    … …  
    3737                        $order = $bp->action_variables[0];
    3838                       
    39                         if ( $order == 'newest' ) {
     39                        if ( 'newest' == $order ) {
    4040                                $this->friendships = friends_get_newest( $bp->displayed_user->id, $this->pag_num, $this->pag_page );
    41                         } else if ( $order == 'alphabetically' ) {
     41                        } else if ( 'alphabetically' == $order ) {
    4242                                $this->friendships = friends_get_alphabetically( $bp->displayed_user->id, $this->pag_num, $this->pag_page );                           
    4343                        } else {
    … …  
    102102                $this->friendship = $this->next_friendship();
    103103               
    104                 if ( $bp->current_action == 'requests' ) {
     104                if ( 'requests' == $bp->current_action ) {
    105105                        $this->friendship = new BP_Friends_Friendship( $this->friendship );
    106106                } else {
    … …  
    109109                }
    110110               
    111                 if ( $this->current_friendship == 0 ) // loop has just started
     111                if ( 0 == $this->current_friendship ) // loop has just started
    112112                        do_action('loop_start');
    113113        }
    … …  
    315315
    316316                echo '<div class="friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">';
    317                 if ( $friend_status == 'pending' ) {
     317                if ( 'pending' == $friend_status ) {
    318318                        echo '<a class="requested" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '">' . __( 'Friendship Requested', 'buddypress' ) . '</a>';
    319                 } else if ( $friend_status == 'is_friend') {
     319                } else if ( 'is_friend' == $friend_status ) {
    320320                        echo '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>';
    321321                } else {
    … …  
    333333        global $bp, $create_group_step, $completed_to_step;
    334334?>
    335         <li<?php if ( !isset($bp->action_variables[0]) || $bp->action_variables[0] == 'recently-active' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>/my-friends/recently-active"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
    336         <li<?php if ( $bp->action_variables[0] == 'newest' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>/my-friends/newest"><?php _e( 'Newest', 'buddypress' ) ?></a></li>
    337         <li<?php if ( $bp->action_variables[0] == 'alphabetically' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>/my-friends/alphabetically""><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
     335        <li<?php if ( !isset($bp->action_variables[0]) || 'recently_active' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>/my-friends/recently-active"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
     336        <li<?php if ( 'newest' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>/my-friends/newest"><?php _e( 'Newest', 'buddypress' ) ?></a></li>
     337        <li<?php if ( 'alphabetically' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>/my-friends/alphabetically""><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
    338338<?php
    339339        do_action( 'friends_header_tabs' );
  • trunk/bp-groups.php

    r1021 r1025  
    3131       
    3232        $sql[] = "CREATE TABLE {$bp->groups->table_name} (
    33                         id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    34                         creator_id int(11) NOT NULL,
     33                        id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     34                        creator_id bigint(20) NOT NULL,
    3535                        name varchar(100) NOT NULL,
    3636                        slug varchar(100) NOT NULL,
    … …  
    5252       
    5353        $sql[] = "CREATE TABLE {$bp->groups->table_name_members} (
    54                         id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    55                         group_id int(11) NOT NULL,
    56                         user_id int(11) NOT NULL,
    57                         inviter_id int(11) NOT NULL,
     54                        id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     55                        group_id bigint(20) NOT NULL,
     56                        user_id bigint(20) NOT NULL,
     57                        inviter_id bigint(20) NOT NULL,
    5858                        is_admin tinyint(1) NOT NULL DEFAULT '0',
    5959                        is_mod tinyint(1) NOT NULL DEFAULT '0',
    … …  
    7373
    7474        $sql[] = "CREATE TABLE {$bp->groups->table_name_groupmeta} (
    75                         id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    76                         group_id int(11) NOT NULL,
     75                        id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     76                        group_id bigint(20) NOT NULL,
    7777                        meta_key varchar(255) DEFAULT NULL,
    7878                        meta_value longtext DEFAULT NULL,
    … …  
    9494       
    9595        $sql[] = "CREATE TABLE {$bp->groups->table_name_wire} (
    96                         id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    97                         item_id int(11) NOT NULL,
    98                         user_id int(11) NOT NULL,
     96                        id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     97                        item_id bigint(20) NOT NULL,
     98                        user_id bigint(20) NOT NULL,
    9999                        content longtext NOT NULL,
    100100                        date_posted datetime NOT NULL,
    … …  
    150150        if ( is_site_admin() ) {
    151151                /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    152                 if ( ( $wpdb->get_var("SHOW TABLES LIKE '%" . $bp->groups->table_name . "%'") == false ) || ( get_site_option('bp-groups-db-version') < BP_GROUPS_DB_VERSION )  )
     152                if ( false == ( $wpdb->get_var("SHOW TABLES LIKE '%" . $bp->groups->table_name . "%'") ) || ( get_site_option('bp-groups-db-version') < BP_GROUPS_DB_VERSION )  )
    153153                        groups_install();
    154154                       
    155                 if ( ( function_exists('bp_wire_install') && $wpdb->get_var("SHOW TABLES LIKE '%" . $bp->groups->table_name_wire . "%'") == false ) || ( get_site_option('bp-groups-db-version') < BP_GROUPS_DB_VERSION ) )
     155                if ( ( function_exists('bp_wire_install') && false == $wpdb->get_var("SHOW TABLES LIKE '%" . $bp->groups->table_name_wire . "%'") ) || ( get_site_option('bp-groups-db-version') < BP_GROUPS_DB_VERSION ) )
    156156                        groups_wire_install();
    157157        }
    … …  
    199199       
    200200                /* Should this group be visible to the logged in user? */
    201                 $is_visible = ( $group_obj->status == 'public' || $is_member ) ? true : false;
     201                $is_visible = ( 'public' == $group_obj->status || $is_member ) ? true : false;
    202202        }
    203203
    … …  
    242242                       
    243243                        // If this is a private or hidden group, does the user have access?
    244                         if ( $group_obj->status == 'private' || $group_obj->status == 'hidden' ) {
     244                        if ( 'private' == $group_obj->status || 'hidden' == $group_obj->status ) {
    245245                                if ( groups_is_user_member( $bp->loggedin_user->id, $group_obj->id ) && is_user_logged_in() )
    246246                                        $has_access = true;
    … …  
    366366
    367367                // If the user skipped the avatar step, move onto the next step and don't save anything.
    368                 if ( isset( $_POST['skip'] ) && $create_group_step == "3" ) {
     368                if ( isset( $_POST['skip'] ) && 3 == (int)$create_group_step ) {
    369369                        $create_group_step++;
    370370                        $completed_to_step++;
    … …  
    373373                       
    374374                        // We're done.
    375                         if ( $create_group_step == 4 )
     375                        if ( 4 == (int)$create_group_step )
    376376                                bp_core_redirect( bp_group_permalink( $group_obj, false ) );
    377377                       
    … …  
    455455               
    456456        if ( $is_single_group ) {
    457                 if ( $wire_action == 'post' && BP_Groups_Member::check_is_member( $bp->loggedin_user->id, $group_obj->id ) ) {
     457                if ( 'post' == $wire_action && BP_Groups_Member::check_is_member( $bp->loggedin_user->id, $group_obj->id ) ) {
    458458
    459459                        if ( !groups_new_wire_post( $group_obj->id, $_POST['wire-post-textarea'] ) ) {
    … …  
    469469                        }
    470470       
    471                 } else if ( $wire_action == 'delete' && BP_Groups_Member::check_is_member( $bp->loggedin_user->id, $group_obj->id ) ) {
     471                } else if ( 'delete' == $wire_action && BP_Groups_Member::check_is_member( $bp->loggedin_user->id, $group_obj->id ) ) {
    472472                        $wire_message_id = $bp->action_variables[1];
    473473
    … …  
    484484                        }
    485485               
    486                 } else if ( ( !$wire_action || $bp->action_variables[1] == 'latest' ) ) {
     486                } else if ( ( !$wire_action || 'latest' == $bp->action_variables[1] ) ) {
    487487                        bp_core_load_template( 'groups/wire' );
    488488                } else {
    … …  
    518518       
    519519        if ( $is_single_group ) {
    520                 if ( isset($bp->action_variables) && $bp->action_variables[0] == 'send' ) {
     520                if ( isset($bp->action_variables) && 'send' == $bp->action_variables[0] ) {
    521521                        // Send the invites.
    522522                        groups_send_invites($group_obj);
    … …  
    538538       
    539539        if ( $is_single_group ) {
    540                 if ( isset($bp->action_variables) && $bp->action_variables[0] == 'yes' ) {
     540                if ( isset($bp->action_variables) && 'yes' == $bp->action_variables[0] ) {
    541541                       
    542542                        // Check if the user is the group admin first.
    … …  
    555555                        }
    556556                       
    557                 } else if ( isset($bp->action_variables) && $bp->action_variables[0] == 'no' ) {
     557                } else if ( isset($bp->action_variables) && 'no' == $bp->action_variables[0] ) {
    558558                       
    559559                        bp_core_redirect( bp_group_permalink( $group_obj, false) );
    … …  
    576576                return false;
    577577       
    578         if ( $group_obj->status == 'private' ) {
     578        if ( 'private' == $group_obj->status ) {
    579579                // If the user has submitted a request, send it.
    580580                if ( isset( $_POST['group-request-send']) ) {
    … …  
    608608        global $bp, $group_obj;
    609609       
    610         if ( $bp->current_component == $bp->groups->slug && $bp->action_variables[0] == 'edit-details' ) {
     610        if ( $bp->current_component == $bp->groups->slug && 'edit-details' == $bp->action_variables[0] ) {
    611611       
    612612                if ( $bp->is_item_admin || $bp->is_item_mod  ) {
    … …  
    638638        global $bp, $group_obj;
    639639       
    640         if ( $bp->current_component == $bp->groups->slug && $bp->action_variables[0] == 'group-settings' ) {
     640        if ( $bp->current_component == $bp->groups->slug && 'group-settings' == $bp->action_variables[0] ) {
    641641               
    642642                if ( !$bp->is_item_admin )
    … …  
    672672        global $bp, $group_obj;
    673673       
    674         if ( $bp->current_component == $bp->groups->slug && $bp->action_variables[0] == 'group-avatar' ) {
     674        if ( $bp->current_component == $bp->groups->slug && 'group-avatar' == $bp->action_variables[0] ) {
    675675               
    676676                if ( !$bp->is_item_admin )
    … …  
    717717        global $bp, $group_obj;
    718718
    719         if ( $bp->current_component == $bp->groups->slug && $bp->action_variables[0] == 'manage-members' ) {
     719        if ( $bp->current_component == $bp->groups->slug && 'manage-members' == $bp->action_variables[0] ) {
    720720               
    721721                if ( !$bp->is_item_admin )
    722722                        return false;
    723723               
    724                 if ( $bp->action_variables[1] == 'promote' && is_numeric( $bp->action_variables[2] ) ) {
     724                if ( 'promote' == $bp->action_variables[1] && is_numeric( $bp->action_variables[2] ) ) {
    725725                        $user_id = $bp->action_variables[2];
    726726                       
    … …  
    737737                }
    738738               
    739                 if ( $bp->action_variables[1] == 'demote' && is_numeric( $bp->action_variables[2] ) ) {
     739                if ( 'demote' == $bp->action_variables[1] && is_numeric( $bp->action_variables[2] ) ) {
    740740                        $user_id = $bp->action_variables[2];
    741741                       
    … …  
    752752                }
    753753               
    754                 if ( $bp->action_variables[1] == 'ban' && is_numeric( $bp->action_variables[2] ) ) {
     754                if ( 'ban' == $bp->action_variables[1] && is_numeric( $bp->action_variables[2] ) ) {
    755755                        $user_id = $bp->action_variables[2];
    756756                       
    … …  
    767767                }
    768768               
    769                 if ( $bp->action_variables[1] == 'unban' && is_numeric( $bp->action_variables[2] ) ) {
     769                if ( 'unban' == $bp->action_variables[1] && is_numeric( $bp->action_variables[2] ) ) {
    770770                        $user_id = $bp->action_variables[2];
    771771                       
    … …  
    793793        global $bp, $group_obj;
    794794       
    795         if ( $bp->current_component == $bp->groups->slug && $bp->action_variables[0] == 'membership-requests' ) {
    796                
    797                 if ( !$bp->is_item_admin || $group_obj->status == 'public' )
     795        if ( $bp->current_component == $bp->groups->slug && 'membership-requests' == $bp->action_variables[0] ) {
     796               
     797                if ( !$bp->is_item_admin || 'public' == $group_obj->status )
    798798                        return false;
    799799               
    … …  
    805805
    806806                if ( isset($request_action) && isset($membership_id) ) {
    807                         if ( $request_action == 'accept' && is_numeric($membership_id) ) {
     807                        if ( 'accept' == $request_action && is_numeric($membership_id) ) {
    808808
    809809                                // Accept the membership request
    … …  
    814814                                }
    815815
    816                         } else if ( $request_action == 'reject' && is_numeric($membership_id) ) {
     816                        } else if ( 'reject' == $request_action && is_numeric($membership_id) ) {
    817817
    818818                                // Reject the membership request
    … …  
    840840        global $bp, $group_obj;
    841841       
    842         if ( $bp->current_component == $bp->groups->slug && $bp->action_variables[0] == 'delete-group' ) {
     842        if ( $bp->current_component == $bp->groups->slug && 'delete-group' == $bp->action_variables[0] ) {
    843843               
    844844                if ( !$bp->is_item_admin )
    … …  
    878878                        <td></td>
    879879                        <td><?php _e( 'A member invites you to join a group', 'buddypress' ) ?></td>
    880                         <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_invite') || get_usermeta( $current_user->id, 'notification_groups_invite') == 'yes' ) { ?>checked="checked" <?php } ?>/></td>
    881                         <td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php if ( get_usermeta( $current_user->id, 'notification_groups_invite') == 'no' ) { ?>checked="checked" <?php } ?>/></td>
     880                        <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_invite') || 'yes' == get_usermeta( $current_user->id, 'notification_groups_invite') ) { ?>checked="checked" <?php } ?>/></td>
     881                        <td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_groups_invite') ) { ?>checked="checked" <?php } ?>/></td>
    882882                </tr>
    883883                <tr>
    884884                        <td></td>
    885885                        <td><?php _e( 'Group information is updated', 'buddypress' ) ?></td>
    886                         <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_group_updated') || get_usermeta( $current_user->id, 'notification_groups_group_updated') == 'yes' ) { ?>checked="checked" <?php } ?>/></td>
    887                         <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php if ( get_usermeta( $current_user->id, 'notification_groups_group_updated') == 'no' ) { ?>checked="checked" <?php } ?>/></td>
     886                        <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_group_updated') || 'yes' == get_usermeta( $current_user->id, 'notification_groups_group_updated') ) { ?>checked="checked" <?php } ?>/></td>
     887                        <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_groups_group_updated') ) { ?>checked="checked" <?php } ?>/></td>
    888888                </tr>
    889889                <?php if ( function_exists('bp_wire_install') ) { ?>
    … …  
    891891                        <td></td>
    892892                        <td><?php _e( 'A member posts on the wire of a group you belong to', 'buddypress' ) ?></td>
    893                         <td class="yes"><input type="radio" name="notifications[notification_groups_wire_post]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_wire_post') || get_usermeta( $current_user->id, 'notification_groups_wire_post') == 'yes' ) { ?>checked="checked" <?php } ?>/></td>
    894                         <td class="no"><input type="radio" name="notifications[notification_groups_wire_post]" value="no" <?php if ( get_usermeta( $current_user->id, 'notification_groups_wire_post') == 'no' ) { ?>checked="checked" <?php } ?>/></td>
     893                        <td class="yes"><input type="radio" name="notifications[notification_groups_wire_post]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_wire_post') || 'yes' == get_usermeta( $current_user->id, 'notification_groups_wire_post') ) { ?>checked="checked" <?php } ?>/></td>
     894                        <td class="no"><input type="radio" name="notifications[notification_groups_wire_post]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_groups_wire_post') ) { ?>checked="checked" <?php } ?>/></td>
    895895                </tr>
    896896                <?php } ?>
    … …  
    898898                        <td></td>
    899899                        <td><?php _e( 'You are promoted to a group administrator or moderator', 'buddypress' ) ?></td>
    900                         <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_admin_promotion') || get_usermeta( $current_user->id, 'notification_groups_admin_promotion') == 'yes' ) { ?>checked="checked" <?php } ?>/></td>
    901                         <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php if ( get_usermeta( $current_user->id, 'notification_groups_admin_promotion') == 'no' ) { ?>checked="checked" <?php } ?>/></td>
     900                        <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_admin_promotion') || 'yes' == get_usermeta( $current_user->id, 'notification_groups_admin_promotion') ) { ?>checked="checked" <?php } ?>/></td>
     901                        <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_groups_admin_promotion') ) { ?>checked="checked" <?php } ?>/></td>
    902902                </tr>
    903903                <tr>
    904904                        <td></td>
    905905                        <td><?php _e( 'A member requests to join a private group for which you are an admin', 'buddypress' ) ?></td>
    906                         <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_membership_request') || get_usermeta( $current_user->id, 'notification_groups_membership_request') == 'yes' ) { ?>checked="checked" <?php } ?>/></td>
    907                         <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php if ( get_usermeta( $current_user->id, 'notification_groups_membership_request') == 'no' ) { ?>checked="checked" <?php } ?>/></td>
     906                        <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_membership_request') || 'yes' == get_usermeta( $current_user->id, 'notification_groups_membership_request') ) { ?>checked="checked" <?php } ?>/></td>
     907                        <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_groups_membership_request') ) { ?>checked="checked" <?php } ?>/></td>
    908908                </tr>
    909909               
    … …  
    952952                extract($args);
    953953
    954                 if ( $group_obj->status == 'public' )
     954                if ( 'public' == $group_obj->status )
    955955                        bp_activity_record( $item_id, $component_name, $component_action, $is_private, $secondary_item_id, $user_id, $secondary_user_id );
    956956        }
    … …  
    13381338        global $bp, $create_group_step, $group_obj, $bbpress_live;
    13391339
    1340         if ( is_numeric( $step ) && ( $step == '1' || $step == '2' || $step == '3' || $step == '4' ) ) {
     1340        if ( is_numeric( $step ) && ( 1 == (int)$step || 2 == (int)$step || 3 == (int)$step || 4 == (int)$step ) ) {
    13411341               
    13421342                if ( !$group_obj )
    … …  
    14191419                                        $group_obj->photos_admin_only = 1;
    14201420                               
    1421                                 if ( $_POST['group-status'] == 'private' ) {
     1421                                if ( 'private' == $_POST['group-status'] ) {
    14221422                                        $group_obj->status = 'private';
    1423                                 } else if ( $_POST['group-status'] == 'hidden' ) {
     1423                                } else if ( 'hidden' == $_POST['group-status'] ) {
    14241424                                        $group_obj->status = 'hidden';
    14251425                                }
    … …  
    14801480        }
    14811481       
    1482         if ( substr( $slug, 0, 2 ) == 'wp' )
     1482        if ( 'wp' == substr( $slug, 0, 2 ) )
    14831483                $slug = substr( $slug, 2, strlen( $slug ) - 2 );
    14841484       
    … …  
    20402040        $metas = array_map('maybe_unserialize', $metas);
    20412041
    2042         if ( count($metas) == 1 )
     2042        if ( 1 == count($metas) )
    20432043                return $metas[0];
    20442044        else
  • trunk/bp-groups/bp-groups-admin.php

    r676 r1025  
    5858                               
    5959                                <?php
    60                                 if ( !isset($_REQUEST['order']) || $_REQUEST['order'] == 'ASC' ) {
     60                                if ( !isset($_REQUEST['order']) || 'ASC' == $_REQUEST['order'] ) {
    6161                                        $order = 'DESC';
    6262                                } else {
    … …  
    117117                                                <?php $counter = 0 ?>
    118118                                                <?php while ( bp_groups() ) : bp_the_group(); ?>
    119                                                         <tr<?php if ( $counter % 2 == 1 ) { ?> class="alternate"<?php }?>>
     119                                                        <tr<?php if ( 1 == $counter % 2 ) { ?> class="alternate"<?php }?>>
    120120                                                                <th class="check-column" scope="row">
    121121                                                                        <input id="group_<?php bp_group_id() ?>" type="checkbox" value="<?php bp_group_id() ?>" name="allgroups[<?php bp_group_id() ?>]" />
  • trunk/bp-groups/bp-groups-ajax.php

    r1021 r1025  
    1414                return false;
    1515       
    16         if ( $_POST['friend_action'] == 'invite' ) {
     16        if ( 'invite' == $_POST['friend_action'] ) {
    1717                if ( !groups_invite_user( $_POST['friend_id'], $_POST['group_id'] ) )
    1818                        return false;
    … …  
    2929                echo '</li>';
    3030               
    31         } else if ( $_POST['friend_action'] == 'uninvite' ) {
     31        } else if ( 'uninvite' == $_POST['friend_action'] ) {
    3232                if ( !groups_uninvite_user( $_POST['friend_id'], $_POST['group_id'] ) )
    3333                        return false;
    … …  
    8282                                                <span class="activity">
    8383                                                        <?php
    84                                                         if ( $_POST['filter'] == 'newest-groups') {
     84                                                        if ( 'newest-groups' == $_POST['filter'] ) {
    8585                                                                echo bp_core_get_last_activity( $group->date_created, __('created %s ago', 'buddypress') );
    86                                                         } else if ( $_POST['filter'] == 'recently-active-groups') {
     86                                                        } else if ( 'recently-active-groups' == $_POST['filter'] ) {
    8787                                                                echo bp_core_get_last_activity( groups_get_groupmeta( $group->id, 'last_activity' ), __('active %s ago', 'buddypress') );
    88                                                         } else if ( $_POST['filter'] == 'popular-groups') {
     88                                                        } else if ( 'popular-groups' == $_POST['filter'] ) {
    8989                                                                if ( $group->total_member_count == 1 )
    9090                                                                        echo $group->total_member_count . __(' member', 'buddypress');
    … …  
    256256                                                <?php $member_count = groups_get_groupmeta( $group->id, 'total_member_count' ) ?>
    257257                                                <?php echo ucwords($group->status) ?> <?php _e( 'Group', 'buddypress' ) ?> /
    258                                                 <?php if ( $member_count == 1 ) : ?>
     258                                                <?php if ( 1 == $member_count ) : ?>
    259259                                                        <?php _e( sprintf( '%d member', $member_count ), 'buddypress' ) ?>
    260260                                                <?php else : ?>
    … …  
    293293                return false;
    294294       
    295         if ( $group->status == 'hidden' )
     295        if ( 'hidden' == $group->status )
    296296                return false;
    297297       
    298298        if ( !groups_is_user_member( $bp->loggedin_user->id, $group->id ) ) {
    299299       
    300                 if ( $group->status == 'public' ) {
     300                if ( 'public' == $group->status ) {
    301301                        if ( !groups_join_group( $group->id ) ) {
    302302                                _e( 'Error joining group', 'buddypress' );
    … …  
    304304                                echo '<a id="group-' . $group->id . '" class="leave-group" rel="leave" title="' . __( 'Leave Group', 'buddypress' ) . '" href="' . bp_group_permalink( $group, false ) . '/leave-group">' . __( 'Leave Group', 'buddypress' ) . '</a>';
    305305                        }                       
    306                 } else if ( $group->status == 'private' ) {
     306                } else if ( 'private' == $group->status ) {
    307307                        if ( !groups_send_membership_request( $bp->loggedin_user->id, $group->id ) ) {
    308308                                _e( 'Error requesting membership', 'buddypress' );     
    … …  
    316316                        _e( 'Error leaving group', 'buddypress' );
    317317                } else {
    318                         if ( $group->status == 'public' ) {
     318                        if ( 'public' == $group->status ) {
    319319                                echo '<a id="group-' . $group->id . '" class="join-group" rel="join" title="' . __( 'Join Group', 'buddypress' ) . '" href="' . bp_group_permalink( $group, false ) . '/join">' . __( 'Join Group', 'buddypress' ) . '</a>';                           
    320                         } else if ( $group->status == 'private' ) {
     320                        } else if ( 'private' == $group->status ) {
    321321                                echo '<a id="group-' . $group->id . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'buddypress' ) . '" href="' . bp_group_permalink( $group, false ) . '/request-membership">' . __( 'Request Membership', 'buddypress' ) . '</a>';
    322322                        }
  • trunk/bp-groups/bp-groups-classes.php

    r1021 r1025  
    164164                }
    165165               
    166                 if ( $wpdb->query($sql) === false )
     166                if ( false == $wpdb->query($sql) )
    167167                        return false;
    168168               
  • trunk/bp-groups/bp-groups-cssjs.php

    r1021 r1025  
    2323        global $bp, $create_group_step;
    2424       
    25         if ( $create_group_step == '3' || ( $bp->current_component == $bp->groups->slug && $bp->action_variables[0] == 'group-avatar' ) ) {
     25        if ( 3 == (int)$create_group_step || ( $bp->current_component == $bp->groups->slug && $bp->action_variables[0] == 'group-avatar' ) ) {
    2626                wp_enqueue_script('jquery');
    2727                wp_enqueue_script('prototype');
  • trunk/bp-groups/bp-groups-notifications.php

    r1021 r1025  
    1717
    1818        foreach ( $group->user_dataset as $user ) {
    19                 if ( get_usermeta( $user->user_id, 'notification_groups_wire_post' ) == 'no' ) continue;
     19                if ( 'no' == get_usermeta( $user->user_id, 'notification_groups_wire_post' ) ) continue;
    2020               
    2121                $ud = get_userdata( $user->user_id );
    … …  
    5858
    5959        foreach ( $group->user_dataset as $user ) {
    60                 if ( get_usermeta( $user->user_id, 'notification_groups_group_updated' ) == 'no' ) continue;
     60                if ( 'no' == get_usermeta( $user->user_id, 'notification_groups_group_updated' ) ) continue;
    6161               
    6262                $ud = get_userdata( $user->user_id );
    … …  
    9090        bp_core_add_notification( $requesting_user_id, $admin_id, 'groups', 'new_membership_request', $group_id );
    9191
    92         if ( get_usermeta( $admin_id, 'notification_groups_membership_request' ) == 'no' )
     92        if ( 'no' == get_usermeta( $admin_id, 'notification_groups_membership_request' ) )
    9393                return false;
    9494               
    … …  
    135135                bp_core_add_notification( $group_id, $requesting_user_id, 'groups', 'membership_request_rejected' );
    136136       
    137         if ( get_usermeta( $requesting_user_id, 'notification_membership_request_completed' ) == 'no' )
     137        if ( 'no' == get_usermeta( $requesting_user_id, 'notification_membership_request_completed' ) )
    138138                return false;
    139139               
    … …  
    189189        bp_core_add_notification( $group_id, $user_id, 'groups', $type );
    190190
    191         if ( get_usermeta( $user_id, 'notification_groups_admin_promotion' ) == 'no' )
     191        if ( 'no' == get_usermeta( $user_id, 'notification_groups_admin_promotion' ) )
    192192                return false;
    193193
    … …  
    234234                bp_core_add_notification( $group_id, $invited_user_id, 'groups', 'group_invite' );
    235235
    236                 if ( get_usermeta( $invited_user_id, 'notification_groups_invite' ) == 'no' ) continue;
     236                if ( 'no' == get_usermeta( $invited_user_id, 'notification_groups_invite' ) ) continue;
    237237
    238238                $invited_ud = get_userdata($invited_user_id);
  • trunk/bp-groups/bp-groups-templatetags.php

    r1021 r1025  
    2828                $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $groups_per_page;
    2929               
    30                 if ( ( $bp->current_action == 'my-groups' && empty( $_REQUEST['group-filter-box'] ) ) || ( !$bp->current_action && !isset($_REQUEST['page']) && empty( $_REQUEST['group-filter-box'] ) ) ) {
     30                if ( ( 'my-groups' == $bp->current_action && empty( $_REQUEST['group-filter-box'] ) ) || ( !$bp->current_action && !isset($_REQUEST['page']) && empty( $_REQUEST['group-filter-box'] ) ) ) {
    3131
    3232                        $order = $bp->action_variables[0];
    3333                       
    34                         if ( $order == 'recently-joined' ) {
     34                        if ( 'recently-joined' == $order ) {
    3535                                $this->groups = groups_get_recently_joined_for_user( $bp->displayed_user->id, $this->pag_num, $this->pag_page );
    36                         } else if ( $order == 'most-popular' ) {
     36                        } else if ( 'most-popular' == $order ) {
    3737                                $this->groups = groups_get_most_popular_for_user( $bp->displayed_user->id, $this->pag_num, $this->pag_page );                           
    38                         } else if ( $order == 'admin-of' ) {
     38                        } else if ( 'admin-of' == $order ) {
    3939                                $this->groups = groups_get_user_is_admin_of( $bp->displayed_user->id, $this->pag_num, $this->pag_page );                               
    40                         } else if ( $order == 'mod-of' ) {
     40                        } else if ( 'mod-of' == $order ) {
    4141                                $this->groups = groups_get_user_is_mod_of( $bp->displayed_user->id, $this->pag_num, $this->pag_page );                         
    42                         } else if ( $order == 'alphabetically' ) {
     42                        } else if ( 'alphabetically' == $order ) {
    4343                                $this->groups = groups_get_alphabetically_for_user( $bp->displayed_user->id, $this->pag_num, $this->pag_page );
    4444                        } else {
    … …  
    5050                        $this->group_count = count($this->groups);
    5151               
    52                 } else if ( ( $bp->current_action == 'my-groups' && $_REQUEST['group-filter-box'] != '' ) || ( !$bp->current_action && !isset($_REQUEST['page']) && $_REQUEST['group-filter-box'] != '' ) ) {
     52                } else if ( ( 'my-groups' == $bp->current_action && $_REQUEST['group-filter-box'] != '' ) || ( !$bp->current_action && !isset($_REQUEST['page']) && $_REQUEST['group-filter-box'] != '' ) ) {
    5353
    5454                        $this->groups = groups_filter_user_groups( $_REQUEST['group-filter-box'], $this->pag_num, $this->pag_page );
    … …  
    5757                        $this->group_count = count($this->groups);
    5858               
    59                 } else if ( $bp->current_action == 'invites' ) {
     59                } else if ( 'invites' == $bp->current_action ) {
    6060               
    6161                        $this->groups = groups_get_invites_for_user();
    … …  
    6363                        $this->group_count = count($this->groups);
    6464               
    65                 } else if ( isset( $_REQUEST['page'] ) && $_REQUEST['page'] == 'groups_admin_settings' ) {
     65                } else if ( isset( $_REQUEST['page'] ) && 'groups_admin_settings' == $_REQUEST['page'] ) {
    6666                       
    6767                        $this->sort_by = $_REQUEST['sortby'];
    … …  
    157157                        $this->group = new BP_Groups_Group( $this->group->group_id, false );
    158158
    159                 if ( $this->current_group == 0 ) // loop has just started
     159                if ( 0 == $this->current_group ) // loop has just started
    160160                        do_action('loop_start');
    161161        }
    … …  
    188188        global $bp, $groups_template;
    189189       
    190         if ( $groups_template->group->status == 'public' ) {
     190        if ( 'public' == $groups_template->group->status ) {
    191191                return true;
    192192        } else {
    … …  
    229229        global $groups_template;
    230230       
    231         if ( $groups_template->group->status == 'public' ) {
     231        if ( 'public' == $groups_template->group->status ) {
    232232                $type = __( "Public Group", "buddypress" );
    233         } else if ( $groups_template->group->status == 'hidden' ) {     
     233        } else if ( 'hidden' == $groups_template->group->status ) {     
    234234                $type = __( "Hidden Group", "buddypress" );
    235         } else if ( $groups_template->group->status == 'private' ) {
     235        } else if ( 'private' == $groups_template->group->status ) {
    236236                $type = __( "Private Group", "buddypress" );
    237237        } else {
    … …  
    480480        global $groups_template, $bp;
    481481
    482         if ( $bp->current_action == 'my-groups' || !$bp->current_action ) {
     482        if ( 'my-groups' == $bp->current_action || !$bp->current_action ) {
    483483                $action = $bp->loggedin_user->domain . $bp->groups->slug . '/my-groups/search/';
    484484                $label = __('Filter Groups', 'buddypress');
    … …  
    595595        global $groups_template;
    596596       
    597         if ( $permission == 'admin' && $groups_template->group->photos_admin_only )
     597        if ( 'admin' == $permission && $groups_template->group->photos_admin_only )
    598598                echo ' checked="checked"';
    599599       
    600         if ( $permission == 'member' && !$groups_template->group->photos_admin_only )
     600        if ( 'member' == $permission && !$groups_template->group->photos_admin_only )
    601601                echo ' checked="checked"';
    602602}
    … …  
    718718?>
    719719        <?php if ( $bp->is_item_admin || $bp->is_item_mod ) { ?>
    720                 <li<?php if ( $current_tab == 'edit-details' || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $groups_template->group->slug ?>/admin/edit-details"><?php _e('Edit Details', 'buddypress') ?></a></li>
     720                <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $groups_template->group->slug ?>/admin/edit-details"><?php _e('Edit Details', 'buddypress') ?></a></li>
    721721        <?php } ?>
    722722
    723723        <?php if ( $bp->is_item_admin ) { ?>   
    724                 <li<?php if ( $current_tab == 'group-settings' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $groups_template->group->slug ?>/admin/group-settings"><?php _e('Group Settings', 'buddypress') ?></a></li>
     724                <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $groups_template->group->slug ?>/admin/group-settings"><?php _e('Group Settings', 'buddypress') ?></a></li>
    725725        <?php } ?>
    726726       
    727727        <?php if ( $bp->is_item_admin ) { ?>   
    728                 <li<?php if ( $current_tab == 'group-avatar' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $groups_template->group->slug ?>/admin/group-avatar"><?php _e('Group Avatar', 'buddypress') ?></a></li>
     728                <li<?php if ( 'group-avatar' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $groups_template->group->slug ?>/admin/group-avatar"><?php _e('Group Avatar', 'buddypress') ?></a></li>
    729729        <?php } ?>
    730730
    731731        <?php if ( $bp->is_item_admin ) { ?>                   
    732                 <li<?php if ( $current_tab == 'manage-members' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $groups_template->group->slug ?>/admin/manage-members"><?php _e('Manage Members', 'buddypress') ?></a></li>
     732                <li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $groups_template->group->slug ?>/admin/manage-members"><?php _e('Manage Members', 'buddypress') ?></a></li>
    733733        <?php } ?>
    734734       
    735735        <?php if ( $bp->is_item_admin && $groups_template->group->status == 'private' ) : ?>
    736         <li<?php if ( $current_tab == 'membership-requests' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $groups_template->group->slug ?>/admin/membership-requests"><?php _e('Membership Requests', 'buddypress') ?></a></li>
     736        <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $groups_template->group->slug ?>/admin/membership-requests"><?php _e('Membership Requests', 'buddypress') ?></a></li>
    737737        <?php endif; ?>
    738738
    739739        <?php if ( $bp->is_item_admin ) { ?>           
    740                 <li<?php if ( $current_tab == 'delete-group' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $groups_template->group->slug ?>/admin/delete-group"><?php _e('Delete Group', 'buddypress') ?></a></li>
     740                <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $groups_template->group->slug ?>/admin/delete-group"><?php _e('Delete Group', 'buddypress') ?></a></li>
    741741        <?php } ?>
    742742       
    … …  
    772772        global $bp, $create_group_step, $completed_to_step;
    773773?>
    774         <li<?php if ( $create_group_step == '1' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/create/step/1">1. <?php _e('Group Details', 'buddypress') ?></a></li>
    775         <li<?php if ( $create_group_step == '2' ) : ?> class="current"<?php endif; ?>><?php if ( $completed_to_step > 0 ) { ?><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/create/step/2">2. <?php _e('Group Settings', 'buddypress') ?></a><?php } else { ?><span>2. <?php _e('Group Settings', 'buddypress') ?></span><?php } ?></li>
    776         <li<?php if ( $create_group_step == '3' ) : ?> class="current"<?php endif; ?>><?php if ( $completed_to_step > 1 ) { ?><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/create/step/3">3. <?php _e('Group Avatar', 'buddypress') ?></a><?php } else { ?><span>3. <?php _e('Group Avatar', 'buddypress') ?></span><?php } ?></li>
    777         <li<?php if ( $create_group_step == '4' ) : ?> class="current"<?php endif; ?>><?php if ( $completed_to_step > 2 ) { ?><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/create/step/4">4. <?php _e('Invite Members', 'buddypress') ?></a><?php } else { ?><span>4. <?php _e('Invite Members', 'buddypress') ?></span><?php } ?></li>
     774        <li<?php if ( 1 == (int)$create_group_step ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/create/step/1">1. <?php _e('Group Details', 'buddypress') ?></a></li>
     775        <li<?php if ( 2 == (int)$create_group_step ) : ?> class="current"<?php endif; ?>><?php if ( $completed_to_step > 0 ) { ?><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/create/step/2">2. <?php _e('Group Settings', 'buddypress') ?></a><?php } else { ?><span>2. <?php _e('Group Settings', 'buddypress') ?></span><?php } ?></li>
     776        <li<?php if ( 3 == (int)$create_group_step ) : ?> class="current"<?php endif; ?>><?php if ( $completed_to_step > 1 ) { ?><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/create/step/3">3. <?php _e('Group Avatar', 'buddypress') ?></a><?php } else { ?><span>3. <?php _e('Group Avatar', 'buddypress') ?></span><?php } ?></li>
     777        <li<?php if ( 4 == (int)$create_group_step ) : ?> class="current"<?php endif; ?>><?php if ( $completed_to_step > 2 ) { ?><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/create/step/4">4. <?php _e('Invite Members', 'buddypress') ?></a><?php } else { ?><span>4. <?php _e('Invite Members', 'buddypress') ?></span><?php } ?></li>
    778778<?php
    779779        do_action( 'groups_creation_tabs' );
    … …  
    861861                       
    862862                                <div class="radio">
    863                                         <label><input type="radio" name="group-status" value="public"<?php if ( $group_obj->status == 'public' ) { ?> checked="checked"<?php } ?> /> <strong><?php _e('This is an open group', 'buddypress') ?></strong><br /><?php _e('This group will be free to join and will appear in group search results.', 'buddypress'); ?></label>
    864                                         <label><input type="radio" name="group-status" value="private"<?php if ( $group_obj->status == 'private' ) { ?> checked="checked"<?php } ?> /> <strong><?php _e('This is an private group', 'buddypress') ?></strong><br /><?php _e('This group will require an invite to join but will still appear in group search results.', 'buddypress'); ?></label>
    865                                         <label><input type="radio" name="group-status" value="hidden"<?php if ( $group_obj->status == 'hidden' ) { ?> checked="checked"<?php } ?> /> <strong><?php _e('This is a hidden group', 'buddypress') ?></strong><br /><?php _e('This group will require an invite to join and will only be visible to invited members. It will not appear in search results or on member profiles.', 'buddypress'); ?></label>
     863                                        <label><input type="radio" name="group-status" value="public"<?php if ( 'public' == $group_obj->status ) { ?> checked="checked"<?php } ?> /> <strong><?php _e('This is an open group', 'buddypress') ?></strong><br /><?php _e('This group will be free to join and will appear in group search results.', 'buddypress'); ?></label>
     864                                        <label><input type="radio" name="group-status" value="private"<?php if ( 'private' == $group_obj->status ) { ?> checked="checked"<?php } ?> /> <strong><?php _e('This is an private group', 'buddypress') ?></strong><br /><?php _e('This group will require an invite to join but will still appear in group search results.', 'buddypress'); ?></label>
     865                                        <label><input type="radio" name="group-status" value="hidden"<?php if ( 'hidden' == $group_obj->status ) { ?> checked="checked"<?php } ?> /> <strong><?php _e('This is a hidden group', 'buddypress') ?></strong><br /><?php _e('This group will require an invite to join and will only be visible to invited members. It will not appear in search results or on member profiles.', 'buddypress'); ?></label>
    866866                                </div>
    867867
    … …  
    968968        global $bp, $create_group_step, $completed_to_step;
    969969?>
    970         <li<?php if ( !isset($bp->action_variables[0]) || $bp->action_variables[0] == 'recently-active' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/my-groups/recently-active"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
    971         <li<?php if ( $bp->action_variables[0] == 'recently-joined' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/my-groups/recently-joined"><?php _e( 'Recently Joined', 'buddypress' ) ?></a></li>
    972         <li<?php if ( $bp->action_variables[0] == 'most-popular' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/my-groups/most-popular""><?php _e( 'Most Popular', 'buddypress' ) ?></a></li>
    973         <li<?php if ( $bp->action_variables[0] == 'admin-of' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/my-groups/admin-of""><?php _e( 'Administrator Of', 'buddypress' ) ?></a></li>
    974         <li<?php if ( $bp->action_variables[0] == 'mod-of' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/my-groups/mod-of""><?php _e( 'Moderator Of', 'buddypress' ) ?></a></li>
    975         <li<?php if ( $bp->action_variables[0] == 'alphabetically' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/my-groups/alphabetically""><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
     970        <li<?php if ( !isset($bp->action_variables[0]) || 'recently-active' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/my-groups/recently-active"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
     971        <li<?php if ( 'recently-joined' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/my-groups/recently-joined"><?php _e( 'Recently Joined', 'buddypress' ) ?></a></li>
     972        <li<?php if ( 'most-popular' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/my-groups/most-popular""><?php _e( 'Most Popular', 'buddypress' ) ?></a></li>
     973        <li<?php if ( 'admin-of' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/my-groups/admin-of""><?php _e( 'Administrator Of', 'buddypress' ) ?></a></li>
     974        <li<?php if ( 'mod-of' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/my-groups/mod-of""><?php _e( 'Moderator Of', 'buddypress' ) ?></a></li>
     975        <li<?php if ( 'alphabetically' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/my-groups/alphabetically""><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
    976976               
    977977<?php
    … …  
    11531153        global $groups_template;
    11541154       
    1155         if ( $groups_template->group->status == 'private' ) {
     1155        if ( 'private' == $groups_template->group->status ) {
    11561156                if ( !bp_group_has_requested_membership() )
    11571157                        if ( is_user_logged_in() )
    … …  
    11911191                                                <?php $member_count = groups_get_groupmeta( $group->id, 'total_member_count' ) ?>
    11921192                                                <?php echo ucwords($group->status) ?> <?php _e( 'Group', 'buddypress' ) ?> /
    1193                                                 <?php if ( $member_count == 1 ) : ?>
     1193                                                <?php if ( 1 == $member_count ) : ?>
    11941194                                                        <?php _e( sprintf( '%d member', $member_count ), 'buddypress' ) ?>
    11951195                                                <?php else : ?>
    … …  
    13361336                $this->member = $this->next_member();
    13371337
    1338                 if ( $this->current_member == 0 ) // loop has just started
     1338                if ( 0 == $this->current_member ) // loop has just started
    13391339                        do_action('loop_start');
    13401340        }
    … …  
    14111411        global $bp;
    14121412       
    1413         if ( $bp->current_action == 'group-finder' )
     1413        if ( 'group-finder' == $bp->current_action )
    14141414                echo apply_filters( 'bp_group_reject_invite_link', 'groupfinder-pag' );
    14151415        else
    … …  
    15211521                $this->request = $this->next_request();
    15221522
    1523                 if ( $this->current_request == 0 ) // loop has just started
     1523                if ( 0 == $this->current_request ) // loop has just started
    15241524                        do_action('loop_start');
    15251525        }
  • trunk/bp-groups/bp-groups-widgets.php

    r1021 r1025  
    5151                                                <span class="activity">
    5252                                                        <?php
    53                                                         if ( $group->total_member_count == 1 )
     53                                                        if ( 1 == $group->total_member_count )
    5454                                                                echo $group->total_member_count . __(' member', 'buddypress');
    5555                                                        else
  • trunk/bp-messages.php

    r1021 r1025  
    1111include_once( 'bp-messages/bp-messages-ajax.php' );
    1212include_once( 'bp-messages/bp-messages-cssjs.php' );
    13 include_once( 'bp-messages/bp-messages-admin.php' );
    1413include_once( 'bp-messages/bp-messages-templatetags.php' );
    1514include_once( 'bp-messages/bp-messages-notifications.php' );
    … …  
    3332       
    3433        $sql[] = "CREATE TABLE {$bp->messages->table_name_threads} (
    35                                 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     34                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    3635                                message_ids longtext NOT NULL,
    3736                                sender_ids longtext NOT NULL,
    3837                                first_post_date datetime NOT NULL,
    3938                                last_post_date datetime NOT NULL,
    40                                 last_message_id int(11) NOT NULL,
    41                                 last_sender_id int(11) NOT NULL,
     39                                last_message_id bigint(20) NOT NULL,
     40                                last_sender_id bigint(20) NOT NULL,
    4241                            KEY last_message_id (last_message_id),
    4342                            KEY last_sender_id (last_sender_id)
    … …  
    4544       
    4645        $sql[] = "CREATE TABLE {$bp->messages->table_name_recipients} (
    47                                 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    48                                 user_id int(11) NOT NULL,
    49                                 thread_id int(11) NOT NULL,
     46                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     47                                user_id bigint(20) NOT NULL,
     48                                thread_id bigint(20) NOT NULL,
    5049                                sender_only tinyint(1) NOT NULL DEFAULT '0',
    5150                                unread_count int(10) NOT NULL DEFAULT '0',
    … …  
    5958
    6059        $sql[] = "CREATE TABLE {$bp->messages->table_name_messages} (
    61                                 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    62                                 sender_id int(11) NOT NULL,
     60                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     61                                sender_id bigint(20) NOT NULL,
    6362                                subject varchar(200) NOT NULL,
    6463                                message longtext NOT NULL,
    … …  
    7271       
    7372        $sql[] = "CREATE TABLE {$bp->messages->table_name_notices} (
    74                                 id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     73                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    7574                                subject varchar(200) NOT NULL,
    7675                                message longtext NOT NULL,
    … …  
    123122        if ( is_site_admin() ) {
    124123                /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    125                 if ( ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->messages->table_name_messages}%'" ) == false ) || ( get_site_option('bp-messages-db-version') < BP_MESSAGES_DB_VERSION ) )
     124                if ( false == ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->messages->table_name_messages}%'" ) ) || ( get_site_option('bp-messages-db-version') < BP_MESSAGES_DB_VERSION ) )
    126125                        messages_install();
    127126        }
    … …  
    186185       
    187186        $recipients = false;
    188         if ( $_POST['send_to_usernames'] == '' ) {
    189                 if ( $_POST['send-to-input'] != '' ) {
     187        if ( empty( $_POST['send_to_usernames'] ) ) {
     188                if ( !empty( $_POST['send-to-input'] ) ) {
    190189                        // Replace commas with places
    191190                        $recipients = str_replace( ',', ' ', $_POST['send-to-input'] );
    … …  
    216215                $notice = new BP_Messages_Notice($notice_id);
    217216
    218                 if ( $bp->action_variables[0] == 'deactivate' ) {
     217                if ( 'deactivate' == $bp->action_variables[0] ) {
    219218                        if ( !$notice->deactivate() ) {
    220219                                bp_core_add_message( __('There was a problem deactivating that notice.', 'buddypress'), 'error' );     
    … …  
    222221                                bp_core_add_message( __('Notice deactivated.', 'buddypress') );
    223222                        }
    224                 } else if ( $bp->action_variables[0] == 'activate' ) {
     223                } else if ( 'activate' == $bp->action_variables[0] ) {
    225224                        if ( !$notice->activate() ) {
    226225                                bp_core_add_message( __('There was a problem activating that notice.', 'buddypress'), 'error' );
    … …  
    228227                                bp_core_add_message( __('Notice activated.', 'buddypress') );
    229228                        }
    230                 } else if ( $bp->action_variables[0] == 'delete' ) {
     229                } else if ( 'delete' == $bp->action_variables[0] ) {
    231230                        if ( !$notice->delete() ) {
    232231                                bp_core_add_message( __('There was a problem deleting that notice.', 'buddypress'), 'buddypress' );
    … …  
    255254                        <td></td>
    256255                        <td><?php _e( 'A member sends you a new message', 'buddypress' ) ?></td>
    257                         <td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_messages_new_message' ) || get_usermeta( $current_user->id, 'notification_messages_new_message' ) == 'yes' ) { ?>checked="checked" <?php } ?>/></td>
    258                         <td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php if ( get_usermeta( $current_user->id, 'notification_messages_new_message' ) == 'no' ) { ?>checked="checked" <?php } ?>/></td>
     256                        <td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_messages_new_message' ) || 'yes' == get_usermeta( $current_user->id, 'notification_messages_new_message' ) ) { ?>checked="checked" <?php } ?>/></td>
     257                        <td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_messages_new_message' ) ) { ?>checked="checked" <?php } ?>/></td>
    259258                </tr>
    260259                <tr>
    261260                        <td></td>
    262261                        <td><?php _e( 'A new site notice is posted', 'buddypress' ) ?></td>
    263                         <td class="yes"><input type="radio" name="notifications[notification_messages_new_notice]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_messages_new_notice' ) || get_usermeta( $current_user->id, 'notification_messages_new_notice' ) == 'yes' ) { ?>checked="checked" <?php } ?>/></td>
    264                         <td class="no"><input type="radio" name="notifications[notification_messages_new_notice]" value="no" <?php if ( get_usermeta( $current_user->id, 'notification_messages_new_notice' ) == 'no' ) { ?>checked="checked" <?php } ?>/></td>
     262                        <td class="yes"><input type="radio" name="notifications[notification_messages_new_notice]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_messages_new_notice' ) || 'yes' == get_usermeta( $current_user->id, 'notification_messages_new_notice' ) ) { ?>checked="checked" <?php } ?>/></td>
     263                        <td class="no"><input type="radio" name="notifications[notification_messages_new_notice]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_messages_new_notice' ) ) { ?>checked="checked" <?php } ?>/></td>
    265264                </tr>
    266265               
    … …  
    365364        global $bp;
    366365       
    367         if ( $action == 'new_message') {
     366        if ( 'new_message' == $action ) {
    368367                if ( (int)$total_items > 1 )
    369368                        return apply_filters( 'bp_messages_multiple_new_message_notification', '<a href="' . $bp->loggedin_user->domain . $bp->messages->slug . '/inbox" title="Inbox">' . sprintf( __('You have %d new messages'), (int)$total_items ) . '</a>', $total_items );               
    … …  
    413412               
    414413        // If there is only 1 recipient and it is the logged in user.
    415         } else if ( count( $recipients ) == 1 && $recipients[0] == $current_user->user_login ) {
     414        } else if ( 1 == count( $recipients ) && $recipients[0] == $current_user->user_login ) {
    416415                bp_core_add_message( __('You must send your message to one or more users not including yourself.', 'buddypress'), 'error' );
    417416                bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/compose' );   
    418417       
    419418        // If the subject or content boxes are empty.
    420         } else if ( $subject == '' || $content == '' ) {
     419        } else if ( empty( $subject ) || empty( $content ) ) {
    421420                if ( !$from_ajax ) {
    422421                        bp_core_add_message( __('Please make sure you fill in all the fields.', 'buddypress'), 'error' );
    … …  
    515514
    516515function messages_send_notice( $subject, $message, $from_template ) {
    517         if ( !is_site_admin() || $subject == '' || $message == '' ) {
     516        if ( !is_site_admin() || empty( $subject ) || empty( $message ) ) {
    518517                return false;
    519518        } else {
  • trunk/bp-messages/bp-messages-classes.php

    r1021 r1025  
    6262                                       
    6363                                        foreach ( $this->message_ids as $key => $message_id ) {
    64                                                 if ( $this->box == 'sentbox' ) {
     64                                                if ( 'sentbox' == $this->box ) {
    6565                                                        if ( !messages_is_user_sender( $bp->loggedin_user->id, $message_id ) ) {
    6666                                                                unset( $this->message_ids[$key] );
    … …  
    377377                        $sql = $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_threads} ( message_ids, sender_ids, first_post_date, last_post_date, last_message_id, last_sender_id ) VALUES ( %s, %s, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d), %d, %d )", $serialized_message_id, $serialized_sender_id, $this->date_sent, $this->date_sent, $message_id, $this->sender_id );
    378378                       
    379                         if ( $wpdb->query($sql) === false )
     379                        if ( false === $wpdb->query($sql) )
    380380                                return false;
    381381                       
  • trunk/bp-messages/bp-messages-notifications.php

    r884 r1025  
    1010
    1111        for ( $i = 0; $i < count($recipient_ids); $i++ ) {
    12                 if ( $message->sender_id == $recipient_ids[$i] || get_userdata( $recipient_ids[$i], 'notification-messages-new-message' ) == 'no' ) continue;
     12                if ( $message->sender_id == $recipient_ids[$i] || 'no' == get_userdata( $recipient_ids[$i], 'notification-messages-new-message' ) ) continue;
    1313
    1414                $ud = get_userdata($recipient_ids[$i]);
  • trunk/bp-messages/bp-messages-templatetags.php

    r1021 r1025  
    2222                $this->box = $box;
    2323               
    24                 if ( $this->box == 'notices' )
     24                if ( 'notices' == $this->box )
    2525                        $this->threads = BP_Messages_Notice::get_notices();
    2626                else
    … …  
    3333                        $this->thread_count = count($this->threads);
    3434               
    35                         if ( $this->box == 'notices' )
     35                        if ( 'notices' == $this->box )
    3636                                $this->total_thread_count = BP_Messages_Notice::get_total_notice_count();
    3737                        else
    … …  
    9090                $thread = $this->next_thread();
    9191
    92                 if ( $this->current_thread == 0 ) // loop has just started
     92                if ( 0 == $this->current_thread ) // loop has just started
    9393                        do_action('loop_start');
    9494        }
    … …  
    9898        global $bp, $messages_template;
    9999
    100         if ( $bp->current_action == 'notices' && !is_site_admin() ) {
     100        if ( 'notices' == $bp->current_action && !is_site_admin() ) {
    101101                wp_redirect( $bp->displayed_user->id );
    102102        } else {
    103                 if ( $bp->current_action == 'inbox' )
     103                if ( 'inbox' == $bp->current_action )
    104104                        bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, 'messages', 'new_message' );
    105105       
    … …  
    269269        global $messages_template, $bp;
    270270
    271         if ( $messages_template->thread->is_active == "1" ) {
     271        if ( 1 == (int)$messages_template->thread->is_active ) {
    272272                $link = $bp->loggedin_user->domain . $bp->messages->slug . '/notices/deactivate/' . $messages_template->thread->id;
    273273        } else {
    … …  
    280280        global $messages_template;
    281281       
    282         if ( $messages_template->thread->is_active == "1" ) {
     282        if ( 1 == (int)$messages_template->thread->is_active ) {
    283283                $text = __('Deactivate', 'buddypress');
    284284        } else {
  • trunk/bp-wire/bp-wire-templatetags.php

    r1024 r1025  
    2626                        // Seeing as we're viewing a users wire, lets remove any new wire
    2727                        // post notifications
    28                         if ( $bp->current_action == 'all-posts' )
     28                        if ( 'all-posts' == $bp->current_action )
    2929                                bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, 'xprofile', 'new_wire_post' );
    3030                       
    … …  
    9999                $this->wire_post = $this->next_wire_post();
    100100
    101                 if ( $this->current_wire_post == 0 ) // loop has just started
     101                if ( 0 == $this->current_wire_post ) // loop has just started
    102102                        do_action('loop_start');
    103103        }
    … …  
    262262                $uri = $bp->current_item;
    263263       
    264         if ( $bp->current_component == 'wire' || $bp->current_component == 'profile' ) {
     264        if ( $bp->current_component == $bp->wire->slug || $bp->current_component == $bp->profile->slug ) {
    265265                echo apply_filters( 'bp_wire_get_action', $bp->displayed_user->domain . $bp->wire->slug . '/post/' );
    266266        } else {
    … …  
    303303               
    304304        if ( ( $wire_posts_template->wire_post->user_id == $bp->loggedin_user->id ) || $bp->is_item_admin ) {
    305                 if ( $bp->current_component == 'wire' || $bp->current_component == 'profile' ) {
     305                if ( $bp->wire->slug == $bp->current_component || $bp->profile->slug == $bp->current_component ) {
    306306                        echo apply_filters( 'bp_wire_delete_link', '<a href="' . $bp->displayed_user->domain . $bp->wire->slug . '/delete/' . $wire_posts_template->wire_post->id . '">[' . __('Delete', 'buddypress') . ']</a>' );
    307307                } else {
    … …  
    319319                $uri = $bp->current_item;
    320320       
    321         if ( $bp->current_component == 'wire' || $bp->current_component == 'profile') {
     321        if ( $bp->current_component == $bp->wire->slug || $bp->current_component == $bp->profile->slug ) {
    322322                echo apply_filters( 'bp_wire_see_all_link', $bp->displayed_user->domain . $bp->wire->slug );
    323323        } else {
  • trunk/bp-xprofile.php

    r1021 r1025  
    5656       
    5757        $sql[] = "CREATE TABLE {$bp->profile->table_name_groups} (
    58                           id int(11) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
     58                          id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
    5959                          name varchar(150) NOT NULL,
    6060                          description mediumtext NOT NULL,
    … …  
    6464       
    6565        $sql[] = "CREATE TABLE {$bp->profile->table_name_fields} (
    66                           id int(11) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
    67                           group_id int(11) unsigned NOT NULL,
    68                           parent_id int(11) unsigned NOT NULL,
     66                          id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
     67                          group_id bigint(20) unsigned NOT NULL,
     68                          parent_id bigint(20) unsigned NOT NULL,
    6969                          type varchar(150) NOT NULL,
    7070                          name varchar(150) NOT NULL,
    … …  
    7272                          is_required tinyint(1) NOT NULL DEFAULT '0',
    7373                          is_default_option tinyint(1) NOT NULL DEFAULT '0',
    74                           field_order int(11) NOT NULL DEFAULT '0',
    75                           option_order int(11) NOT NULL DEFAULT '0',
     74                          field_order bigint(20) NOT NULL DEFAULT '0',
     75                          option_order bigint(20) NOT NULL DEFAULT '0',
    7676                          order_by varchar(15) NOT NULL,
    7777                          is_public int(2) NOT NULL DEFAULT '1',
    … …  
    8585       
    8686        $sql[] = "CREATE TABLE {$bp->profile->table_name_data} (
    87                           id int(11) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
    88                           field_id int(11) unsigned NOT NULL,
    89                           user_id int(11) unsigned NOT NULL,
     87                          id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
     88                          field_id bigint(20) unsigned NOT NULL,
     89                          user_id bigint(20) unsigned NOT NULL,
    9090                          value longtext NOT NULL,
    9191                          last_updated datetime NOT NULL,
    … …  
    118118
    119119        $sql[] = "CREATE TABLE {$bp->profile->table_name_wire} (
    120                            id int(11) NOT NULL AUTO_INCREMENT,
    121                            item_id int(11) NOT NULL,
    122                            user_id int(11) NOT NULL,
     120                           id bigint(20) NOT NULL AUTO_INCREMENT,
     121                           item_id bigint(20) NOT NULL,
     122                           user_id bigint(20) NOT NULL,
    123123                           content longtext NOT NULL,
    124124                           date_posted datetime NOT NULL,
    … …  
    187187
    188188        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    189         if ( ( $wpdb->get_var("SHOW TABLES LIKE '%{$bp->profile->table_name_groups}%'") == false ) || ( get_site_option('bp-xprofile-db-version') < BP_XPROFILE_DB_VERSION )  )
     189        if ( false == ( $wpdb->get_var("SHOW TABLES LIKE '%{$bp->profile->table_name_groups}%'") ) || ( get_site_option('bp-xprofile-db-version') < BP_XPROFILE_DB_VERSION )  )
    190190                xprofile_install();
    191191       
    192         if ( ( function_exists('bp_wire_install') && $wpdb->get_var("SHOW TABLES LIKE '%{$bp->profile->table_name_wire}%'") == false ) || ( get_site_option('bp-xprofile-db-version') < BP_XPROFILE_DB_VERSION )  )
     192        if ( ( function_exists('bp_wire_install') && false == $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->profile->table_name_wire}%'" ) ) || ( get_site_option('bp-xprofile-db-version') < BP_XPROFILE_DB_VERSION )  )
    193193                xprofile_wire_install();
    194194}
    … …  
    317317                        <td></td>
    318318                        <td><?php _e( 'A member posts on your wire', 'buddypress' ) ?></td>
    319                         <td class="yes"><input type="radio" name="notifications[notification_profile_wire_post]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_profile_wire_post' ) || get_usermeta( $current_user->id, 'notification_profile_wire_post' ) == 'yes' ) { ?>checked="checked" <?php } ?>/></td>
    320                         <td class="no"><input type="radio" name="notifications[notification_profile_wire_post]" value="no" <?php if ( get_usermeta( $current_user->id, 'notification_profile_wire_post' ) == 'no' ) { ?>checked="checked" <?php } ?>/></td>
     319                        <td class="yes"><input type="radio" name="notifications[notification_profile_wire_post]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_profile_wire_post' ) || 'yes' == get_usermeta( $current_user->id, 'notification_profile_wire_post' ) ) { ?>checked="checked" <?php } ?>/></td>
     320                        <td class="no"><input type="radio" name="notifications[notification_profile_wire_post]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_profile_wire_post' ) ) { ?>checked="checked" <?php } ?>/></td>
    321321                </tr>
    322322               
    … …  
    571571        global $bp;
    572572
    573         if ( $action == 'new_wire_post') {
     573        if ( 'new_wire_post' == $action ) {
    574574                if ( (int)$total_items > 1 ) {
    575575                        return apply_filters( 'bp_xprofile_multiple_new_wire_post_notification', '<a href="' . $bp->loggedin_user->domain . $bp->wire->slug . '" title="Wire">' . sprintf( __('You have %d new posts on your wire'), (int)$total_items ) . '</a>', $total_items );             
    … …  
    632632                                       
    633633                                        // If the user has submitted the form - validate and save the new value for this field
    634                                         if ( isset($_GET['mode']) && $_GET['mode'] == 'save' ) {
     634                                        if ( isset($_GET['mode']) && 'save' == $_GET['mode'] ) {
    635635                                               
    636636                                                // If the current field is a datebox, we need to append '_day' to the end of the field name
    637637                                                // otherwise the field name will not exist
    638                                                 $post_field_string = ( $group->fields[$j]->type == 'datebox' ) ? '_day' : null;
     638                                                $post_field_string = ( 'datebox' == $group->fields[$j]->type ) ? '_day' : null;
    639639                                               
    640640                                                // Explode the posted field IDs into an array so we know which fields have been submitted
    … …  
    753753                <?php
    754754                        if ( $message != '' ) {
    755                                 $type = ( $type == 'error' ) ? 'error' : 'updated';
     755                                $type = ( 'error' == $type ) ? 'error' : 'updated';
    756756                ?>
    757757                        <div id="message" class="<?php echo $type; ?> fade">
    … …  
    815815                return false;
    816816       
    817         if ( $field_type == "datebox" ) {
     817        if ( 'datebox' == $field_type ) {
    818818                $field_value = bp_format_time( $field_value, true );
    819819        } else {
  • trunk/bp-xprofile/bp-xprofile-admin.php

    r1021 r1025  
    1616        $groups = BP_XProfile_Group::get_all();
    1717
    18         if ( isset($_GET['mode']) && isset($_GET['group_id']) && $_GET['mode'] == "add_field" ) {
     18        if ( isset($_GET['mode']) && isset($_GET['group_id']) && 'add_field' == $_GET['mode'] ) {
    1919                xprofile_admin_manage_field($_GET['group_id']);
    20         } else if ( isset($_GET['mode']) && isset($_GET['group_id']) && isset($_GET['field_id']) && $_GET['mode'] == "edit_field" ) {
     20        } else if ( isset($_GET['mode']) && isset($_GET['group_id']) && isset($_GET['field_id']) && 'edit_field' == $_GET['mode'] ) {
    2121                xprofile_admin_manage_field($_GET['group_id'], $_GET['field_id']);
    22         } else if ( isset($_GET['mode']) && isset($_GET['field_id']) && $_GET['mode'] == "delete_field" ) {
     22        } else if ( isset($_GET['mode']) && isset($_GET['field_id']) && 'delete_field' == $_GET['mode'] ) {
    2323                xprofile_admin_delete_field($_GET['field_id'], 'field');
    24         } else if ( isset($_GET['mode']) && isset($_GET['option_id']) && $_GET['mode'] == "delete_option" ) {
     24        } else if ( isset($_GET['mode']) && isset($_GET['option_id']) && 'delete_option' == $_GET['mode'] ) {
    2525                xprofile_admin_delete_field($_GET['option_id'], 'option');
    26         } else if ( isset($_GET['mode']) && $_GET['mode'] == "add_group" ) {
     26        } else if ( isset($_GET['mode']) && 'add_group' == $_GET['mode'] ) {
    2727                xprofile_admin_manage_group();
    28         } else if ( isset($_GET['mode']) && isset($_GET['group_id']) && $_GET['mode'] == "delete_group" ) {
     28        } else if ( isset($_GET['mode']) && isset($_GET['group_id']) && 'delete_group' == $_GET['mode'] ) {
    2929                xprofile_admin_delete_group($_GET['group_id']);
    30         } else if ( isset($_GET['mode']) && isset($_GET['group_id']) && $_GET['mode'] == "edit_group" ) {
     30        } else if ( isset($_GET['mode']) && isset($_GET['group_id']) && 'edit_group' == $_GET['mode'] ) {
    3131                xprofile_admin_manage_group($_GET['group_id']);
    3232        } else {
    … …  
    9191                                                  <?php if ( $groups[$i]->fields ) { ?>
    9292                                                <?php for ( $j = 0; $j < count($groups[$i]->fields); $j++ ) { ?>
    93                                                                         <?php if ( $j % 2 == 0 ) { $class = ""; } else { $class = "alternate"; } ?>
     93                                                                        <?php if ( 0 == $j % 2 ) { $class = ""; } else { $class = "alternate"; } ?>
    9494                                                            <?php $field = new BP_XProfile_Field($groups[$i]->fields[$j]->id); ?>
    9595                                                            <?php if ( !$field->can_delete ) { $class .= ' core'; } ?>
    … …  
    244244        global $message, $type;
    245245       
    246         if ( $type == 'field' ) {
     246        if ( 'field' == $type ) {
    247247                $type = __('field', 'buddypress');
    248248        } else {
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r1021 r1025  
    5252                }
    5353               
    54                 if ( $wpdb->query($sql) === false )
     54                if ( !$wpdb->query($sql) )
    5555                        return false;
    5656               
    … …  
    6666                $sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_groups} WHERE id = %d", $this->id );
    6767
    68                 if ( $wpdb->query($sql) === false) {
     68                if ( !$wpdb->query($sql) ) {
    6969                        return false;
    7070                } else {
    … …  
    8585
    8686                // Get field ids for the current group.
    87                 $sql = $wpdb->prepare("SELECT id, type FROM {$bp->profile->table_name_fields} WHERE group_id = %d AND parent_id = 0 ORDER BY id", $this->id);
    88 
    89                 if(!$fields = $wpdb->get_results($sql))                 
    90                         return false;
    91 
     87                if ( !$fields = $wpdb->get_results( $wpdb->prepare("SELECT id, type FROM {$bp->profile->table_name_fields} WHERE group_id = %d AND parent_id = 0 ORDER BY id", $this->id ) ) )
     88                        return false;
     89               
    9290                return $fields;
    9391        }
    … …  
    9694                global $message;
    9795
    98                 if ( $this->id == null ) {
     96                if ( !$this->id ) {
    9997                        $title = __('Add Group', 'buddypress');
    10098                        $action = "admin.php?page=xprofile_settings&amp;mode=add_group";
    … …  
    111109                        <?php
    112110                                if ( $message != '' ) {
    113                                         $type = ( $type == 'error' ) ? 'error' : 'updated';
     111                                        $type = ( 'error' == $type ) ? 'error' : 'updated';
    114112                        ?>
    115113                                <div id="message" class="<?php echo $type; ?> fade">
    … …  
    233231                        return false;
    234232                       
    235                 $sql = $wpdb->prepare("DELETE FROM {$bp->profile->table_name_fields} WHERE id = %d OR parent_id = %d", $this->id, $this->id );
    236 
    237                 if ( $wpdb->query($sql) === false )
     233                if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_fields} WHERE id = %d OR parent_id = %d", $this->id, $this->id ) ) )
    238234                        return false;
    239235               
    … …  
    252248                        $sql = $wpdb->prepare("INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, is_public, order_by) VALUES (%d, 0, %s, %s, %s, %d, %d, %s)", $this->group_id, $this->type, $this->name, $this->desc, $this->is_required, $this->is_public, $this->order_by);
    253249                }
    254                 if ( $wpdb->query($sql) !== false ) {
     250               
     251                if ( $wpdb->query($sql) ) {
     252                       
    255253                        // Only do this if we are editing an existing field
    256254                        if ( $this->id != null ) {
    … …  
    264262                        // Check to see if this is a field with child options.
    265263                        // We need to add the options to the db, if it is.
    266                         if ( $this->type == 'radio' || $this->type == 'selectbox' || $this->type == 'checkbox' || $this->type == 'multiselectbox' ) {
     264                        if ( 'radio' == $this->type || 'selectbox' == $this->type || 'checkbox' == $this->type || 'multiselectbox' == $this->type ) {
    267265                                if ( $this->id ) {
    268266                                        $parent_id = $this->id;
    … …  
    305303                                        }
    306304                                } else {
    307                                         if ( $this->type == "radio" ) {
     305                                       
     306                                        if ( 'radio' == $this->type ) {
     307                                               
    308308                                                $options = $_POST['radio_option'];
    309309                                                $defaults = $_POST['isDefault_radio_option'];
    310                                         } else if ( $this->type == "selectbox" ) {
     310                                               
     311                                        } else if ( 'selectbox' == $this->type ) {
     312                                               
    311313                                                $options = $_POST['selectbox_option'];
    312314                                                $defaults = $_POST['isDefault_selectbox_option'];
    313                                         } else if ( $this->type == "multiselectbox" ) {
     315                                               
     316                                        } else if ( 'multiselectbox' == $this->type ) {
     317                                               
    314318                                                $options = $_POST['multiselectbox_option'];
    315319                                                $defaults = $_POST['isDefault_multiselectbox_option'];
    316                                         } else if ( $this->type == "checkbox" ) {
     320                                               
     321                                        } else if ( 'checkbox' == $this->type ) {
     322                                               
    317323                                                $options = $_POST['checkbox_option'];
    318324                                                $defaults = $_POST['isDefault_checkbox_option'];
     325                                               
    319326                                        }
    320327                                       
    … …  
    332339                                                        }
    333340
    334                                                         if ( $option_value != "" ) {
     341                                                        if ( !empty( $option_valu ) ) {
     342                                                               
    335343                                                                // don't insert an empty option.
    336                                                                 $sql = $wpdb->prepare("INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, option_order, is_default_option) VALUES (%d, %d, 'option', %s, '', 0, %d, %d)", $this->group_id, $parent_id, $option_value, $counter, $is_default);
    337 
    338                                                                 if ( $wpdb->query($sql) === false ) {
     344                                                                if ( !$wpdb->query( $wpdb->prepare("INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, option_order, is_default_option) VALUES (%d, %d, 'option', %s, '', 0, %d, %d)", $this->group_id, $parent_id, $option_value, $counter, $is_default ) ) )
    339345                                                                        return false;
    340 
    341                                                                         // @TODO
    342                                                                         // Need to go back and reverse what has been entered here.
    343                                                                 }
     346                                                               
     347                                                                return true;
    344348                                                        }
    345349                                               
    … …  
    580584                global $wpdb, $bp;
    581585               
    582                 //This is done here so we don't have problems with sql injection
    583                 if ( $this->order_by == 'asc' && !$for_editing ) {
     586                // This is done here so we don't have problems with sql injection
     587                if ( 'asc' == $this->order_by && !$for_editing ) {
    584588                        $sort_sql = 'ORDER BY name ASC';
    585                 } else if ( $this->order_by == 'desc' && !$for_editing ) {
     589                } else if ( 'desc' == $this->order_by && !$for_editing ) {
    586590                        $sort_sql = 'ORDER BY name DESC';
    587591                } else {
    … …  
    619623                        $default_name = '';
    620624                       
    621                         if ( $type == 'multiselectbox' || $type == 'checkbox' ) {
     625                        if ( 'multiselectbox' == $type || 'checkbox' == $type ) {
    622626                                $default_input = 'checkbox';
    623627                        } else {
    … …  
    627631                        <div id="<?php echo $type ?>" class="options-box" style="<?php if ( $this->type != $type ) { ?>display: none;<?php } ?> margin-left: 15px;">
    628632                                <h4><?php _e('Please enter options for this Field:', 'buddypress') ?></h4>
    629                                 <p>Order By:
     633                                <p><?php _e( 'Order By:', 'buddypress' ) ?>
    630634                                       
    631635                                        <select name="sort_order_<?php echo $type ?>" id="sort_order_<?php echo $type ?>" >
    632                                                 <option value="default" <?php if ( $this->order_by == 'default' ) {?> selected="selected"<?php } ?> ><?php _e( 'Order Entered', 'buddypress' ) ?></option>
    633                                                 <option value="asc" <?php if ( $this->order_by == 'asc' ) {?> selected="selected"<?php } ?>><?php _e( 'Name - Ascending', 'buddypress' ) ?></option>
    634                                                 <option value="desc" <?php if ( $this->order_by == 'desc' ) {?> selected="selected"<?php } ?>><?php _e( 'Name - Descending', 'buddypress' ) ?></option>
     636                                                <option value="default" <?php if ( 'default' == $this->order_by ) {?> selected="selected"<?php } ?> ><?php _e( 'Order Entered', 'buddypress' ) ?></option>
     637                                                <option value="asc" <?php if ( 'asc' == $this->order_by ) {?> selected="selected"<?php } ?>><?php _e( 'Name - Ascending', 'buddypress' ) ?></option>
     638                                                <option value="desc" <?php if ( 'desc' == $this->order_by ) {?> selected="selected"<?php } ?>><?php _e( 'Name - Descending', 'buddypress' ) ?></option>
    635639                                        </select>
    636640       
    … …  
    642646                                                $j = $i + 1;
    643647                                               
    644                                                 if ( $type == 'multiselectbox' || $type == 'checkbox' )
     648                                                if ( 'multiselectbox' == $type || 'checkbox' == $type )
    645649                                                        $default_name = '[' . $j . ']';
    646650                                        ?>
    647651                                                <p><?php _e('Option', 'buddypress') ?> <?php echo $j ?>:
    648652                                                   <input type="text" name="<?php echo $type ?>_option[<?php echo $j ?>]" id="<?php echo $type ?>_option<?php echo $j ?>" value="<?php echo $options[$i]->name ?>" />
    649                                                    <input type="<?php echo $default_input ?>" name="isDefault_<?php echo $type ?>_option<?php echo $default_name; ?>" <?php if ( $options[$i]->sort_order == 'CHECKED' ) {?> checked="checked"<?php } ?> " /> <?php _e( 'Default Value', 'buddypress' ) ?>
     653                                                   <input type="<?php echo $default_input ?>" name="isDefault_<?php echo $type ?>_option<?php echo $default_name; ?>" <?php if ( 'CHECKED' == $options[$i]->sort_order ) {?> checked="checked"<?php } ?> " /> <?php _e( 'Default Value', 'buddypress' ) ?>
    650654                                                <a href="admin.php?page=xprofile_settings&amp;mode=delete_option&amp;option_id=<?php echo $options[$i]->id ?>" class="ajax-option-delete" id="delete-<?php echo $options[$i]->id ?>">[x]</a></p>
    651655                                                </p>
    … …  
    655659                                <?php
    656660                                } else {
    657                                         if ( $type == 'multiselectbox' || $type == 'checkbox' )
     661                                        if ( 'multiselectbox' == $type || 'checkxbox' == $type )
    658662                                                $default_name = '[1]';
    659663                                ?>
    … …  
    672676               
    673677        function render_admin_form( $message = '' ) {
    674                 if ( $this->id == null ) {
     678                if ( !$this->id ) {
    675679                        $title = __('Add Field', 'buddypress');
    676680                        $action = "admin.php?page=xprofile_settings&amp;group_id=" . $this->group_id . "&amp;mode=add_field";
    … …  
    706710                                </div>
    707711                       
    708                                 <div id="titlediv">
     712                                <div id="titlediv" class="inside">
    709713                                        <h3><label for="description"><?php _e("Field Description", 'buddypress') ?></label></h3>
    710714                                        <div id="titlewrap">
    711                                                 <textarea name="description" id="description" rows="8" cols="60" style="border: none; width: 99%;"><?php echo $this->desc ?></textarea>
     715                                                <textarea name="description" id="description" rows="8" cols="60" style="border: 1px solid #ddd; width: 85%;"><?php echo $this->desc ?></textarea>
    712716                                        </div>
    713717                                </div>
    … …  
    910914               
    911915                // Validate Form
    912                 if ( empty( $_POST['title'] ) || empty( $_POST['required'] ) || empty( $_POST['fieldtype'] ) ) {
     916                if ( '' == $_POST['title'] || '' == $_POST['required'] || '' == $_POST['fieldtype'] ) {
    913917                        $message = __('Please make sure you fill out all required fields.', 'buddypress');
    914918                        return false;
    … …  
    10471051                global $wpdb, $bp;
    10481052               
    1049                 $sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $this->field_id, $this->user_id );
    1050 
    1051                 if ( $wpdb->query($sql) === false )
     1053                if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $this->field_id, $this->user_id ) ) )
    10521054                        return false;
    10531055               
    … …  
    11261128                global $wpdb, $userdata, $bp;
    11271129
    1128                 $sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d", $field_id );
    1129 
    1130                 if ( $wpdb->query($sql) === false )
     1130                if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d", $field_id ) ) )
    11311131                        return false;
    11321132               
  • trunk/bp-xprofile/bp-xprofile-filters.php

    r1021 r1025  
    2020                return false;
    2121
    22         if ( $field_type == 'datebox' ) {
     22        if ( 'datebox' == $field_type ) {
    2323                $field_value = bp_format_time( $field_value, true );
    2424        } else {
    … …  
    3131
    3232function xprofile_filter_link_profile_data( $field_value, $field_type, $field_id ) {
    33         if ( $field_type == 'datebox' )
     33        if ( 'datebox' == $field_type )
    3434                return $field_value;
    3535       
  • trunk/bp-xprofile/bp-xprofile-notifications.php

    r1021 r1025  
    2525                bp_core_add_notification( $poster_id, $user_id, 'xprofile', 'new_wire_post' );
    2626
    27                 if ( !get_usermeta( $bp->loggedin_user->id, 'notification_profile_wire_post' ) || get_usermeta( $bp->loggedin_user->id, 'notification_profile_wire_post' ) == 'yes' ) {
     27                if ( !get_usermeta( $bp->loggedin_user->id, 'notification_profile_wire_post' ) || 'yes' == get_usermeta( $bp->loggedin_user->id, 'notification_profile_wire_post' ) ) {
    2828                        $poster_name = bp_fetch_user_fullname( $poster_id, false );
    2929                        $wire_post = new BP_Wire_Post( $bp->profile->table_name_wire, $wire_post_id, true );
  • trunk/bp-xprofile/bp-xprofile-signup.php

    r1021 r1025  
    112112                        $field = new BP_XProfile_Field($field->id);
    113113                       
    114                         if ( $field->type == "datebox" ) {
     114                        if ( 'datebox' == $field->type ) {
    115115                                if ( $_POST['field_' . $field->id . '_day'] != "" && $_POST['field_' . $field->id . '_month'] != "" && $_POST['field_' . $field->id . '_year'] != "") {
    116116                                        $value = strtotime( $_POST['field_' . $field->id . '_day'] . " " .
    … …  
    160160        if ( isset($_FILES['file']) ) {
    161161
    162                 if ( $_FILES['file']['error'] !== 4 ) {
     162                if ( 4 !== $_FILES['file']['error'] ) {
    163163                        if ( !$checked_upload = bp_core_check_avatar_upload($_FILES) ) {
    164164                                $avatar_error = true;
  • trunk/bp-xprofile/bp-xprofile-templatetags.php

    r1021 r1025  
    6868                $group = $this->next_group();
    6969
    70                 if ( $this->current_group == 0 ) // loop has just started
     70                if ( 0 == $this->current_group ) // loop has just started
    7171                        do_action('loop_start');
    7272        }
Note: See TracChangeset for help on using the changeset viewer.