Changeset 1025
- Timestamp:
- 02/06/2009 10:44:01 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r1021 r1025 34 34 35 35 $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, 40 40 component_name varchar(75) NOT NULL, 41 41 component_action varchar(75) NOT NULL, … … 50 50 51 51 $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, 55 55 content longtext NOT NULL, 56 56 primary_link varchar(150) NOT NULL, … … 68 68 69 69 $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, 72 72 content longtext NOT NULL, 73 73 primary_link varchar(150) NOT NULL, … … 95 95 96 96 $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), 101 101 content longtext NOT NULL, 102 102 primary_link varchar(150) NOT NULL, … … 154 154 } 155 155 156 if ( is_site_admin() && $current_blog->blog_id == 1) {156 if ( is_site_admin() && 1 == $current_blog->blog_id ) { 157 157 /* Check to see if the site wide activity table is set up. */ 158 158 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 320 320 321 321 for ( $i = 0; $i < count($activity_array); $i++ ) { 322 if ( $activity_array[$i]['content'] == '') continue;322 if ( empty( $activity_array[$i]['content'] ) ) continue; 323 323 324 324 // Cache that sucka... -
trunk/bp-activity/bp-activity-templatetags.php
r1021 r1025 26 26 $user_id = $bp->displayed_user->id; 27 27 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 ) ) { 29 29 $this->activities = BP_Activity_Activity::get_activity_for_user( $user_id, $limit ); 30 30 } else { … … 99 99 global $bp, $activities_template, $bp_activity_user_id, $bp_activity_limit; 100 100 101 if ( $bp->current_action == 'my-friends')101 if ( 'my-friends' == $bp->current_action ) 102 102 $filter_content = false; 103 103 else … … 165 165 // The "You" and "Your" conversion is only done in english, if a translation file is present 166 166 // then do not translate as it causes problems in other languages. 167 if ( get_locale() == '') {167 if ( '' == get_locale() ) { 168 168 /* Switch 'their/your' depending on whether the user is logged in or not and viewing their profile */ 169 169 if ( $filter_words ) { … … 206 206 global $bp; 207 207 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 ) 209 209 echo apply_filters( 'bp_activities_member_rss_link', $bp->displayed_user->domain . $bp->activity->slug . '/feed' ); 210 210 else -
trunk/bp-activity/bp-activity-widgets.php
r1021 r1025 24 24 25 25 <?php 26 if ( $options['max_items'] == '') {26 if ( empty( $options['max_items'] ) ) { 27 27 $options['max_items'] = 20; 28 28 } -
trunk/bp-blogs.php
r1021 r1025 32 32 33 33 $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, 37 37 KEY user_id (user_id), 38 38 KEY blog_id (blog_id) … … 40 40 41 41 $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, 46 46 date_created datetime NOT NULL, 47 47 KEY user_id (user_id), … … 51 51 52 52 $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, 58 58 date_created datetime NOT NULL, 59 59 KEY user_id (user_id), … … 64 64 65 65 $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, 68 68 meta_key varchar(255) DEFAULT NULL, 69 69 meta_value longtext DEFAULT NULL, … … 110 110 if ( is_site_admin() ) { 111 111 /* 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 ) ) 113 113 bp_blogs_install(); 114 114 } … … 173 173 174 174 /* Set up the component options navigation for Blog */ 175 if ( $bp->current_component == 'blogs') {175 if ( 'blogs' == $bp->current_component ) { 176 176 if ( bp_is_home() ) { 177 177 if ( function_exists('xprofile_setup_nav') ) { … … 409 409 410 410 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 ) { 412 412 413 413 /** … … 515 515 * to remove the record of the post. 516 516 */ 517 if ( !$comment->comment_approved || $comment->comment_approved == 'spam')517 if ( !$comment->comment_approved || 'spam' == $comment->comment_approved ) 518 518 BP_Blogs_Comment::delete( $comment_id, $blog_id ); 519 519 } … … 766 766 $metas = array_map('maybe_unserialize', $metas); 767 767 768 if ( count($metas) == 1)768 if ( 1 == count($metas) ) 769 769 return $metas[0]; 770 770 else -
trunk/bp-blogs/bp-blogs-templatetags.php
r1021 r1025 80 80 $blog = $this->next_blog(); 81 81 82 if ( $this->current_blog == 0) // loop has just started82 if ( 0 == $this->current_blog ) // loop has just started 83 83 do_action('loop_start'); 84 84 } … … 199 199 $post = $this->next_post(); 200 200 201 if ( $this->current_post == 0) // loop has just started201 if ( 0 == $this->current_post ) // loop has just started 202 202 do_action('loop_start'); 203 203 } … … 384 384 ); 385 385 386 if ( $post->post_type == 'page')386 if ( 'page' == $post->post_type ) 387 387 return get_page_link($post->ID, $leavename); 388 else if ($post->post_type == 'attachment')388 else if ( 'attachment' == $post->post_type ) 389 389 return get_attachment_link($post->ID); 390 390 … … 396 396 397 397 $category = ''; 398 if ( strpos($permalink, '%category%') !== false) {398 if ( false !== strpos($permalink, '%category%') ) { 399 399 $cats = get_the_category($post->ID); 400 400 if ( $cats ) … … 413 413 414 414 $author = ''; 415 if ( strpos($permalink, '%author%') !== false) {415 if ( false !== strpos($permalink, '%author%') ) { 416 416 $authordata = get_userdata($post->post_author); 417 417 $author = $authordata->user_nicename; … … 547 547 $comment = $this->next_comment(); 548 548 549 if ( $this->current_comment == 0) // loop has just started549 if ( 0 == $this->current_comment ) // loop has just started 550 550 do_action('loop_start'); 551 551 } … … 616 616 $date_format = get_option('date_format'); 617 617 618 if ( $echo == true)618 if ( $echo ) 619 619 echo apply_filters( 'bp_comment_date', mysql2date( $date_format, $comments_template->comment->comment_date ) ); 620 620 else … … 651 651 $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user" 652 652 653 if ( $active_signup == 'none' || $active_signup == 'user')653 if ( 'none' == $active_signup || 'user' == $active_signup ) 654 654 return false; 655 655 … … 701 701 702 702 // Blog name 703 if( constant( "VHOST" ) == 'no')703 if( 'no' == constant( "VHOST" ) ) 704 704 echo '<label for="blogname">' . __('Blog Name:', 'buddypress') . '</label>'; 705 705 else … … 710 710 <?php } 711 711 712 if( constant( "VHOST" ) == 'no') {712 if( 'no' == constant( "VHOST" ) ) { 713 713 echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span><input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /><br />'; 714 714 } else { … … 717 717 if ( !is_user_logged_in() ) { 718 718 print '(<strong>' . __( 'Your address will be ' , 'buddypress'); 719 if( constant( "VHOST" ) == 'no') {719 if( 'no' == constant( "VHOST" ) ) { 720 720 print $current_site->domain . $current_site->path . __( 'blogname' , 'buddypress'); 721 721 } else { … … 739 739 <div style="clear:both;"></div> 740 740 <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 } ?> /> 742 742 <strong><?php _e( 'Yes' , 'buddypress'); ?></strong> 743 743 </label> 744 744 <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 } ?> /> 746 746 <strong><?php _e( 'No' , 'buddypress'); ?></strong> 747 747 </label> … … 818 818 ?> 819 819 <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> 823 823 </ul> 824 824 <?php -
trunk/bp-blogs/directories/bp-blogs-directory-blogs.php
r1021 r1025 3 3 global $bp, $current_blog; 4 4 5 if ( $bp->current_component == $bp->blogs->slug && $bp->current_action == '') {5 if ( $bp->current_component == $bp->blogs->slug && empty( $bp->current_action ) ) { 6 6 add_action( 'bp_template_content', 'bp_blogs_directory_blogs_content' ); 7 7 add_action( 'bp_template_sidebar', 'bp_blogs_directory_blogs_sidebar' ); -
trunk/bp-core.php
r1021 r1025 193 193 194 194 $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), 199 199 component_name varchar(75) NOT NULL, 200 200 component_action varchar(75) NOT NULL, 201 201 date_notified datetime NOT NULL, 202 is_new tinyint(1) NOT NULL,203 202 KEY item_id (item_id), 204 203 KEY secondary_item_id (secondary_item_id), 205 204 KEY user_id (user_id), 206 KEY is_new (is_new),207 205 KEY component_name (component_name), 208 206 KEY component_action (component_action) … … 240 238 if ( is_site_admin() ) { 241 239 /* 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 ) ) 243 241 bp_core_install(); 244 242 } … … 308 306 bp_core_add_subnav_item( 'profile', 'public', __('Public', 'buddypress'), $profile_link, 'xprofile_screen_display_profile' ); 309 307 310 if ( $bp->current_component == 'profile') {308 if ( 'profile' == $bp->current_component ) { 311 309 if ( bp_is_home() ) { 312 310 $bp->bp_options_title = __('My Profile', 'buddypress'); … … 833 831 */ 834 832 function bp_is_serialized( $data ) { 835 if ( trim($data) == "") {833 if ( '' == trim($data) ) { 836 834 return false; 837 835 } … … 881 879 function bp_core_render_notice() { 882 880 if ( $_SESSION['message'] ) { 883 $type = ( $_SESSION['message_type'] == 'success') ? 'updated' : 'error';881 $type = ( 'success' == $_SESSION['message_type'] ) ? 'updated' : 'error'; 884 882 ?> 885 883 <div id="message" class="<?php echo $type; ?>"> … … 925 923 /* $newer_date will equal false if we want to know the time elapsed between a date and the current time */ 926 924 /* $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; 928 926 929 927 /* Difference in seconds */ … … 947 945 948 946 /* 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]; 950 948 951 949 /* Step two: the second chunk */ … … 958 956 if ( ( $count2 = floor( ( $since - ( $seconds * $count ) ) / $seconds2 ) ) != 0 ) { 959 957 /* 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]; 961 959 } 962 960 } -
trunk/bp-core/bp-core-activation.php
r837 r1025 91 91 92 92 // Send email with activation link. 93 if ( constant( "VHOST" ) == 'no') {93 if ( 'no' == constant( "VHOST" ) ) { 94 94 $activate_url = bp_activation_page( false ) . "?key=$key"; 95 95 } else { … … 100 100 $admin_email = get_site_option( "admin_email" ); 101 101 102 if ( $admin_email == '')102 if ( empty( $admin_email ) ) 103 103 $admin_email = 'support@' . $_SERVER['SERVER_NAME']; 104 104 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" ) ); 106 106 $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 107 107 $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}")); … … 121 121 $admin_email = get_site_option( "admin_email" ); 122 122 123 if ( $admin_email == '')123 if ( empty( $admin_email ) ) 124 124 $admin_email = 'support@' . $_SERVER['SERVER_NAME']; 125 125 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" ) ); 127 127 $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 128 128 $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 14 14 15 15 if ( function_exists( 'xprofile_install' ) ) { 16 if ( $key == 'bp-xprofile-base-group-name') {16 if ( 'bp-xprofile-base-group-name' == $key ) { 17 17 $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') ) ) ); 18 18 } 19 19 20 if ( $key == 'bp-xprofile-fullname-field-name') {20 if ( 'bp-xprofile-fullname-field-name' == $key ) { 21 21 $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') ) ) ); 22 22 } -
trunk/bp-core/bp-core-adminbar.php
r1021 r1025 61 61 $counter = 0; 62 62 foreach( $bp->bp_nav as $nav_item ) { 63 $alt = ( $counter % 2 == 0) ? ' class="alt"' : '';63 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; 64 64 65 65 echo '<li' . $alt . '>'; … … 70 70 $sub_counter = 0; 71 71 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"' : ''; 73 73 echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '">' . $subnav_item['name'] . '</a></li>'; 74 74 $sub_counter++; … … 82 82 } 83 83 84 $alt = ( $counter % 2 == 0) ? ' class="alt"' : '';84 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; 85 85 86 86 if ( function_exists('wp_logout_url') ) { … … 141 141 $role = get_blog_role_for_user( $bp->loggedin_user->id, $blog->userblog_id ); 142 142 143 $alt = ( $counter % 2 == 0) ? ' class="alt"' : '';143 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; 144 144 echo '<li' . $alt . '>'; 145 145 echo '<a href="' . $blog->siteurl . '">' . $blog->blogname . ' (' . $role . ')</a>'; 146 if ( !('Subscriber' == $role)) { // then they have something to display on the flyout menu146 if ( !( 'Subscriber' == $role ) ) { // then they have something to display on the flyout menu 147 147 echo '<ul>'; 148 148 echo '<li class="alt"><a href="' . $blog->siteurl . '/wp-admin/">' . __('Dashboard', 'buddypress') . '</a></li>'; … … 150 150 echo '<li class="alt"><a href="' . $blog->siteurl . '/wp-admin/edit.php">' . __('Manage Posts', 'buddypress') . '</a></li>'; 151 151 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 ) { 153 153 echo '<li><a href="' . $blog->siteurl . '/wp-admin/themes.php">' . __('Switch Theme', 'buddypress') . '</a></li>'; 154 154 } … … 160 160 } 161 161 162 $alt = ( $counter % 2 == 0) ? ' class="alt"' : '';162 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; 163 163 164 164 echo '<li' . $alt . '>'; … … 191 191 <?php $counter = 0; ?> 192 192 <?php for ( $i = 0; $i < count($notifications); $i++ ) { ?> 193 <?php $alt = ( $counter % 2 == 0) ? ' class="alt"' : ''; ?>193 <?php $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?> 194 194 <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li> 195 195 <?php $counter++; ?> -
trunk/bp-core/bp-core-ajax.php
r1021 r1025 33 33 <span class="activity"> 34 34 <?php 35 if ( $_POST['filter'] == 'newest-members') {35 if ( 'newest-members' == $_POST['filter'] ) { 36 36 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'] ) { 38 38 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' ) ) 41 41 echo get_usermeta( $user->user_id, 'total_friend_count' ) . __(' friend', 'buddypress'); 42 42 else -
trunk/bp-core/bp-core-avatars.php
r1021 r1025 48 48 if ( empty( $grav_option ) ) { 49 49 $default_grav = 'wavatar'; 50 } else if ( $grav_option == 'mystery') {50 } else if ( 'mystery' == $grav_option ) { 51 51 $default_grav = site_url( MUPLUGINDIR . '/bp-core/images/mystery-man.jpg'); 52 52 } else { … … 66 66 function bp_core_get_avatar_filter( $avatar, $id_or_email, $size, $default ) { 67 67 $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 ) 71 71 $ver = 1; 72 72 … … 111 111 } 112 112 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'] ) { 114 114 115 115 // Confirm that the nonce is valid … … 147 147 bp_core_render_avatar_cropper($original, $canvas, $action); 148 148 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'] ) { 150 150 // Crop, save, store 151 151 … … 167 167 echo '<span class="crop-img">' . bp_core_get_avatar( get_current_user_id(), 1 ) . '</span>'; 168 168 169 if ( CORE_AVATAR_V2_W !== false && CORE_AVATAR_V2_H !== false) {169 if ( CORE_AVATAR_V2_W && CORE_AVATAR_V2_H ) { 170 170 echo '<span class="crop-img">' . bp_core_get_avatar( get_current_user_id(), 2 ) . '</span>'; 171 171 } 172 172 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'] ) { 174 174 // Delete an avatar 175 175 -
trunk/bp-core/bp-core-catchuri.php
r1021 r1025 44 44 45 45 /* 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] ) ) 47 47 array_pop( $bp_uri ); 48 48 49 49 /* Take empties off the start of complete URI */ 50 if ( $bp_uri[0] == "")50 if ( empty( $bp_uri[0] ) ) 51 51 array_shift( $bp_uri ); 52 52 … … 67 67 68 68 /* Take empties off the end of path */ 69 if ( $paths[count($paths) - 1] == "")69 if ( empty( $paths[count($paths) - 1] ) ) 70 70 array_pop( $paths ); 71 71 72 72 /* Take empties off the start of path */ 73 if ( $paths[0] == "")73 if ( empty( $paths[0] ) ) 74 74 array_shift( $paths ); 75 75 … … 112 112 $is_root_component = in_array( $bp_uri[0], $root_components ); 113 113 114 if ( VHOST == 'no'&& !$is_root_component ) {114 if ( 'no' == VHOST && !$is_root_component ) { 115 115 $component_index++; 116 116 $action_index++; … … 131 131 132 132 /* 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 ) 134 134 array_shift($action_variables); 135 135 -
trunk/bp-core/bp-core-classes.php
r1021 r1025 86 86 87 87 if ( $this->total_friends ) { 88 if ( $this->total_friends == 1)88 if ( 1 == $this->total_friends ) 89 89 $this->total_friends .= ' ' . __( 'friend', 'buddypress' ); 90 90 else … … 97 97 if ( function_exists('bp_blogs_install') ) { 98 98 if ( $this->total_blogs ) { 99 if ( $this->total_blogs == 1)99 if ( 1 == $this->total_blogs ) 100 100 $this->total_blogs .= ' ' . __( 'blog', 'buddypress' ); 101 101 else … … 110 110 111 111 if ( $this->total_groups ) { 112 if ( $this->total_groups == 1)112 if ( 1 == $this->total_groups ) 113 113 $this->total_groups .= ' ' . __( 'group', 'buddypress' ); 114 114 else … … 239 239 var $component_action; 240 240 var $date_notified; 241 var $is_new;242 241 243 242 function bp_core_notification( $id = false ) { … … 258 257 $this->component_action = $notification->component_action; 259 258 $this->date_notified = $notification->date_notified; 260 $this->is_new = $notification->is_new;261 259 } 262 260 } … … 267 265 if ( $this->id ) { 268 266 // 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 ); 270 268 } else { 271 269 // 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 ); 273 271 } 274 272 … … 291 289 global $wpdb, $bp; 292 290 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 ) ); 294 292 } 295 293 -
trunk/bp-core/bp-core-cssjs.php
r806 r1025 44 44 wp_enqueue_style( 'bp-admin-bar', site_url( MUPLUGINDIR . '/bp-core/css/admin-bar.css' ) ); 45 45 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' ) ) 47 47 wp_enqueue_style( 'bp-admin-bar-rtl', site_url( MUPLUGINDIR . '/bp-core/css/admin-bar-rtl.css' ) ); 48 48 } 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' ); 49 54 50 55 wp_print_styles(); … … 75 80 */ 76 81 function bp_core_add_admin_js() { 77 if ( strpos( $_GET['page'], 'bp-core' ) !== false) {82 if ( false !== strpos( $_GET['page'], 'bp-core' ) ) { 78 83 wp_enqueue_script( 'bp-account-admin-js', site_url( MUPLUGINDIR . '/bp-core/js/account-admin.js' ) ); 79 84 } 80 85 81 if ( strpos( $_GET['page'], 'bp-core/admin-mods' ) !== false) {86 if ( false !== strpos( $_GET['page'], 'bp-core/admin-mods' ) ) { 82 87 wp_enqueue_script('password-strength-meter'); 83 88 } … … 139 144 } 140 145 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 ) { ?> 142 147 function v2Cropper() { 143 148 v1Crop = new Cropper.ImgWithPreview( -
trunk/bp-core/bp-core-notifications.php
r1021 r1025 13 13 $notification->component_action = $component_action; 14 14 $notification->date_notified = $date_notified; 15 $notification->is_new = 1;16 15 17 16 if ( $secondary_item_id ) … … 59 58 continue; 60 59 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; 63 62 64 63 if ( function_exists( $component_name . '_format_notifications' ) ) { -
trunk/bp-core/bp-core-signup.php
r966 r1025 33 33 34 34 // Blog name 35 if ( constant( "VHOST" ) == 'no')35 if ( 'no' == constant( "VHOST" ) ) 36 36 echo '<label for="blogname">' . __('Blog Name:', 'buddypress') . '</label>'; 37 37 else … … 42 42 <?php } 43 43 44 if ( constant( "VHOST" ) == 'no') {44 if ( 'no' == constant( "VHOST" ) ) { 45 45 echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span><input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /><br />'; 46 46 } else { 47 47 echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /><span class="suffix_address">.' . $current_site->domain . $current_site->path . '</span><br />'; 48 48 } 49 49 50 if ( !is_user_logged_in() ) { 50 51 echo '<p class="help-text">'; 51 52 print '(<strong>' . __( 'Your address will be ', 'buddypress' ); 52 if( constant( "VHOST" ) == 'no') {53 if( 'no' == constant( "VHOST" ) ) { 53 54 print $current_site->domain . $current_site->path . __( 'blogname', 'buddypress' ); 54 55 } else { … … 72 73 <?php _e( 'I would like my blog to appear in search engines like Google and Technorati, and in public listings around this site.', 'buddypress' ); ?> 73 74 <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 } ?> /> 75 76 <?php _e( 'Yes', 'buddypress' ); ?> 76 77 </label> 77 78 <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 } ?> /> 79 80 <?php _e( 'No', 'buddypress' ); ?> 80 81 </label> … … 218 219 <?php bp_core_signup_show_user_form($user_name, $user_email, $errors); ?> 219 220 220 <?php if( $active_signup == 'blog') { ?>221 <?php if( 'blog' == $active_signup ) { ?> 221 222 <input id="signupblog" type="hidden" name="signup_for" value="blog" /> 222 <?php } elseif( $active_signup == 'user') { ?>223 <?php } elseif( 'user' == $active_signup ) { ?> 223 224 <input id="signupblog" type="hidden" name="signup_for" value="user" /> 224 225 <?php } else { ?> -
trunk/bp-forums.php
r1021 r1025 19 19 global $bp, $bbpress_live; 20 20 21 if ( get_usermeta( $bp->loggedin_user->id, 'bb_capabilities' ) == '')21 if ( '' == get_usermeta( $bp->loggedin_user->id, 'bb_capabilities' ) ) 22 22 bp_forums_make_user_active_member( $bp->loggedin_user->id ); 23 23 -
trunk/bp-friends.php
r1021 r1025 12 12 include_once( 'bp-friends/bp-friends-cssjs.php' ); 13 13 include_once( 'bp-friends/bp-friends-templatetags.php' ); 14 include_once( 'bp-friends/bp-friends-widgets.php' );15 14 include_once( 'bp-friends/bp-friends-notifications.php' ); 16 15 include_once( 'bp-friends/bp-friends-filters.php' ); … … 30 29 31 30 $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, 35 34 is_confirmed bool DEFAULT 0, 36 35 is_limited bool DEFAULT 0, … … 72 71 if ( is_site_admin() ) { 73 72 /* 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 ) ) 75 74 friends_install(); 76 75 } … … 125 124 global $bp; 126 125 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]) ) { 128 127 129 128 if ( friends_accept_friendship( $bp->action_variables[1] ) ) { … … 134 133 bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action ); 135 134 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]) ) { 137 136 138 137 if ( friends_reject_friendship( $bp->action_variables[1] ) ) { … … 166 165 <td></td> 167 166 <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> 169 168 <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> 170 169 </tr> … … 172 171 <td></td> 173 172 <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> 176 175 </tr> 177 176 … … 468 467 global $bp; 469 468 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 ) ) 471 470 return true; 472 471 … … 573 572 574 573 function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) { 575 if ( $status == 'add') {574 if ( 'add' == $status ) { 576 575 update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count' ) + 1 ); 577 576 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 13 13 global $bp; 14 14 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'] ) ) { 16 16 if ( !friends_remove_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) { 17 17 echo __("Friendship could not be canceled.", 'buddypress'); … … 19 19 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>'; 20 20 } 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'] ) ) { 22 22 if ( !friends_add_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) { 23 23 echo __("Friendship could not be requested.", 'buddypress'); 24 24 } else { 25 25 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>';27 26 } 28 27 } else { 29 echo __( 'Request Pending', 'buddypress');28 echo __( 'Request Pending', 'buddypress' ); 30 29 } 31 30 -
trunk/bp-friends/bp-friends-classes.php
r1021 r1025 174 174 175 175 if ( $result ) { 176 if ( (int)$result[0]->is_confirmed == 0) {176 if ( 0 == (int)$result[0]->is_confirmed ) { 177 177 return 'pending'; 178 178 } else { -
trunk/bp-friends/bp-friends-notifications.php
r884 r1025 6 6 $initiator_name = bp_fetch_user_fullname( $initiator_id, false ); 7 7 8 if ( get_usermeta( (int)$friend_id, 'notification_friends_friendship_request' ) == 'no')8 if ( 'no' == get_usermeta( (int)$friend_id, 'notification_friends_friendship_request' ) ) 9 9 return false; 10 10 … … 45 45 $friend_name = bp_fetch_user_fullname( $friend_id, false ); 46 46 47 if ( get_usermeta( (int)$initiator_id, 'notification_friends_friendship_accepted' ) == 'no')47 if ( 'no' == get_usermeta( (int)$initiator_id, 'notification_friends_friendship_accepted' ) ) 48 48 return false; 49 49 -
trunk/bp-friends/bp-friends-templatetags.php
r1021 r1025 20 20 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : 10; 21 21 22 if ( $bp->current_action == 'my-friends' && $_POST['friend-search-box'] != '') {22 if ( 'my-friends' == $bp->current_action && !empty( $_POST['friend-search-box'] ) ) { 23 23 24 24 // Search results … … 27 27 $this->friendships = $this->friendships['friends']; 28 28 29 } else if ( $bp->current_action == 'requests') {29 } else if ( 'requests' == $bp->current_action ) { 30 30 31 31 // Friendship Requests … … 37 37 $order = $bp->action_variables[0]; 38 38 39 if ( $order == 'newest') {39 if ( 'newest' == $order ) { 40 40 $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 ) { 42 42 $this->friendships = friends_get_alphabetically( $bp->displayed_user->id, $this->pag_num, $this->pag_page ); 43 43 } else { … … 102 102 $this->friendship = $this->next_friendship(); 103 103 104 if ( $bp->current_action == 'requests') {104 if ( 'requests' == $bp->current_action ) { 105 105 $this->friendship = new BP_Friends_Friendship( $this->friendship ); 106 106 } else { … … 109 109 } 110 110 111 if ( $this->current_friendship == 0) // loop has just started111 if ( 0 == $this->current_friendship ) // loop has just started 112 112 do_action('loop_start'); 113 113 } … … 315 315 316 316 echo '<div class="friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">'; 317 if ( $friend_status == 'pending') {317 if ( 'pending' == $friend_status ) { 318 318 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 ) { 320 320 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>'; 321 321 } else { … … 333 333 global $bp, $create_group_step, $completed_to_step; 334 334 ?> 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> 338 338 <?php 339 339 do_action( 'friends_header_tabs' ); -
trunk/bp-groups.php
r1021 r1025 31 31 32 32 $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, 35 35 name varchar(100) NOT NULL, 36 36 slug varchar(100) NOT NULL, … … 52 52 53 53 $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, 58 58 is_admin tinyint(1) NOT NULL DEFAULT '0', 59 59 is_mod tinyint(1) NOT NULL DEFAULT '0', … … 73 73 74 74 $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, 77 77 meta_key varchar(255) DEFAULT NULL, 78 78 meta_value longtext DEFAULT NULL, … … 94 94 95 95 $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, 99 99 content longtext NOT NULL, 100 100 date_posted datetime NOT NULL, … … 150 150 if ( is_site_admin() ) { 151 151 /* 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 ) ) 153 153 groups_install(); 154 154 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 ) ) 156 156 groups_wire_install(); 157 157 } … … 199 199 200 200 /* 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; 202 202 } 203 203 … … 242 242 243 243 // 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 ) { 245 245 if ( groups_is_user_member( $bp->loggedin_user->id, $group_obj->id ) && is_user_logged_in() ) 246 246 $has_access = true; … … 366 366 367 367 // 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 ) { 369 369 $create_group_step++; 370 370 $completed_to_step++; … … 373 373 374 374 // We're done. 375 if ( $create_group_step == 4)375 if ( 4 == (int)$create_group_step ) 376 376 bp_core_redirect( bp_group_permalink( $group_obj, false ) ); 377 377 … … 455 455 456 456 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 ) ) { 458 458 459 459 if ( !groups_new_wire_post( $group_obj->id, $_POST['wire-post-textarea'] ) ) { … … 469 469 } 470 470 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 ) ) { 472 472 $wire_message_id = $bp->action_variables[1]; 473 473 … … 484 484 } 485 485 486 } else if ( ( !$wire_action || $bp->action_variables[1] == 'latest') ) {486 } else if ( ( !$wire_action || 'latest' == $bp->action_variables[1] ) ) { 487 487 bp_core_load_template( 'groups/wire' ); 488 488 } else { … … 518 518 519 519 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] ) { 521 521 // Send the invites. 522 522 groups_send_invites($group_obj); … … 538 538 539 539 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] ) { 541 541 542 542 // Check if the user is the group admin first. … … 555 555 } 556 556 557 } else if ( isset($bp->action_variables) && $bp->action_variables[0] == 'no') {557 } else if ( isset($bp->action_variables) && 'no' == $bp->action_variables[0] ) { 558 558 559 559 bp_core_redirect( bp_group_permalink( $group_obj, false) ); … … 576 576 return false; 577 577 578 if ( $group_obj->status == 'private') {578 if ( 'private' == $group_obj->status ) { 579 579 // If the user has submitted a request, send it. 580 580 if ( isset( $_POST['group-request-send']) ) { … … 608 608 global $bp, $group_obj; 609 609 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] ) { 611 611 612 612 if ( $bp->is_item_admin || $bp->is_item_mod ) { … … 638 638 global $bp, $group_obj; 639 639 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] ) { 641 641 642 642 if ( !$bp->is_item_admin ) … … 672 672 global $bp, $group_obj; 673 673 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] ) { 675 675 676 676 if ( !$bp->is_item_admin ) … … 717 717 global $bp, $group_obj; 718 718 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] ) { 720 720 721 721 if ( !$bp->is_item_admin ) 722 722 return false; 723 723 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] ) ) { 725 725 $user_id = $bp->action_variables[2]; 726 726 … … 737 737 } 738 738 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] ) ) { 740 740 $user_id = $bp->action_variables[2]; 741 741 … … 752 752 } 753 753 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] ) ) { 755 755 $user_id = $bp->action_variables[2]; 756 756 … … 767 767 } 768 768 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] ) ) { 770 770 $user_id = $bp->action_variables[2]; 771 771 … … 793 793 global $bp, $group_obj; 794 794 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 ) 798 798 return false; 799 799 … … 805 805 806 806 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) ) { 808 808 809 809 // Accept the membership request … … 814 814 } 815 815 816 } else if ( $request_action == 'reject'&& is_numeric($membership_id) ) {816 } else if ( 'reject' == $request_action && is_numeric($membership_id) ) { 817 817 818 818 // Reject the membership request … … 840 840 global $bp, $group_obj; 841 841 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] ) { 843 843 844 844 if ( !$bp->is_item_admin ) … … 878 878 <td></td> 879 879 <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> 882 882 </tr> 883 883 <tr> 884 884 <td></td> 885 885 <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> 888 888 </tr> 889 889 <?php if ( function_exists('bp_wire_install') ) { ?> … … 891 891 <td></td> 892 892 <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> 895 895 </tr> 896 896 <?php } ?> … … 898 898 <td></td> 899 899 <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> 902 902 </tr> 903 903 <tr> 904 904 <td></td> 905 905 <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> 908 908 </tr> 909 909 … … 952 952 extract($args); 953 953 954 if ( $group_obj->status == 'public')954 if ( 'public' == $group_obj->status ) 955 955 bp_activity_record( $item_id, $component_name, $component_action, $is_private, $secondary_item_id, $user_id, $secondary_user_id ); 956 956 } … … 1338 1338 global $bp, $create_group_step, $group_obj, $bbpress_live; 1339 1339 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 ) ) { 1341 1341 1342 1342 if ( !$group_obj ) … … 1419 1419 $group_obj->photos_admin_only = 1; 1420 1420 1421 if ( $_POST['group-status'] == 'private') {1421 if ( 'private' == $_POST['group-status'] ) { 1422 1422 $group_obj->status = 'private'; 1423 } else if ( $_POST['group-status'] == 'hidden') {1423 } else if ( 'hidden' == $_POST['group-status'] ) { 1424 1424 $group_obj->status = 'hidden'; 1425 1425 } … … 1480 1480 } 1481 1481 1482 if ( substr( $slug, 0, 2 ) == 'wp')1482 if ( 'wp' == substr( $slug, 0, 2 ) ) 1483 1483 $slug = substr( $slug, 2, strlen( $slug ) - 2 ); 1484 1484 … … 2040 2040 $metas = array_map('maybe_unserialize', $metas); 2041 2041 2042 if ( count($metas) == 1)2042 if ( 1 == count($metas) ) 2043 2043 return $metas[0]; 2044 2044 else -
trunk/bp-groups/bp-groups-admin.php
r676 r1025 58 58 59 59 <?php 60 if ( !isset($_REQUEST['order']) || $_REQUEST['order'] == 'ASC') {60 if ( !isset($_REQUEST['order']) || 'ASC' == $_REQUEST['order'] ) { 61 61 $order = 'DESC'; 62 62 } else { … … 117 117 <?php $counter = 0 ?> 118 118 <?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 }?>> 120 120 <th class="check-column" scope="row"> 121 121 <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 14 14 return false; 15 15 16 if ( $_POST['friend_action'] == 'invite') {16 if ( 'invite' == $_POST['friend_action'] ) { 17 17 if ( !groups_invite_user( $_POST['friend_id'], $_POST['group_id'] ) ) 18 18 return false; … … 29 29 echo '</li>'; 30 30 31 } else if ( $_POST['friend_action'] == 'uninvite') {31 } else if ( 'uninvite' == $_POST['friend_action'] ) { 32 32 if ( !groups_uninvite_user( $_POST['friend_id'], $_POST['group_id'] ) ) 33 33 return false; … … 82 82 <span class="activity"> 83 83 <?php 84 if ( $_POST['filter'] == 'newest-groups') {84 if ( 'newest-groups' == $_POST['filter'] ) { 85 85 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'] ) { 87 87 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'] ) { 89 89 if ( $group->total_member_count == 1 ) 90 90 echo $group->total_member_count . __(' member', 'buddypress'); … … 256 256 <?php $member_count = groups_get_groupmeta( $group->id, 'total_member_count' ) ?> 257 257 <?php echo ucwords($group->status) ?> <?php _e( 'Group', 'buddypress' ) ?> / 258 <?php if ( $member_count == 1) : ?>258 <?php if ( 1 == $member_count ) : ?> 259 259 <?php _e( sprintf( '%d member', $member_count ), 'buddypress' ) ?> 260 260 <?php else : ?> … … 293 293 return false; 294 294 295 if ( $group->status == 'hidden')295 if ( 'hidden' == $group->status ) 296 296 return false; 297 297 298 298 if ( !groups_is_user_member( $bp->loggedin_user->id, $group->id ) ) { 299 299 300 if ( $group->status == 'public') {300 if ( 'public' == $group->status ) { 301 301 if ( !groups_join_group( $group->id ) ) { 302 302 _e( 'Error joining group', 'buddypress' ); … … 304 304 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>'; 305 305 } 306 } else if ( $group->status == 'private') {306 } else if ( 'private' == $group->status ) { 307 307 if ( !groups_send_membership_request( $bp->loggedin_user->id, $group->id ) ) { 308 308 _e( 'Error requesting membership', 'buddypress' ); … … 316 316 _e( 'Error leaving group', 'buddypress' ); 317 317 } else { 318 if ( $group->status == 'public') {318 if ( 'public' == $group->status ) { 319 319 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 ) { 321 321 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>'; 322 322 } -
trunk/bp-groups/bp-groups-classes.php
r1021 r1025 164 164 } 165 165 166 if ( $wpdb->query($sql) === false)166 if ( false == $wpdb->query($sql) ) 167 167 return false; 168 168 -
trunk/bp-groups/bp-groups-cssjs.php
r1021 r1025 23 23 global $bp, $create_group_step; 24 24 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' ) ) { 26 26 wp_enqueue_script('jquery'); 27 27 wp_enqueue_script('prototype'); -
trunk/bp-groups/bp-groups-notifications.php
r1021 r1025 17 17 18 18 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; 20 20 21 21 $ud = get_userdata( $user->user_id ); … … 58 58 59 59 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; 61 61 62 62 $ud = get_userdata( $user->user_id ); … … 90 90 bp_core_add_notification( $requesting_user_id, $admin_id, 'groups', 'new_membership_request', $group_id ); 91 91 92 if ( get_usermeta( $admin_id, 'notification_groups_membership_request' ) == 'no')92 if ( 'no' == get_usermeta( $admin_id, 'notification_groups_membership_request' ) ) 93 93 return false; 94 94 … … 135 135 bp_core_add_notification( $group_id, $requesting_user_id, 'groups', 'membership_request_rejected' ); 136 136 137 if ( get_usermeta( $requesting_user_id, 'notification_membership_request_completed' ) == 'no')137 if ( 'no' == get_usermeta( $requesting_user_id, 'notification_membership_request_completed' ) ) 138 138 return false; 139 139 … … 189 189 bp_core_add_notification( $group_id, $user_id, 'groups', $type ); 190 190 191 if ( get_usermeta( $user_id, 'notification_groups_admin_promotion' ) == 'no')191 if ( 'no' == get_usermeta( $user_id, 'notification_groups_admin_promotion' ) ) 192 192 return false; 193 193 … … 234 234 bp_core_add_notification( $group_id, $invited_user_id, 'groups', 'group_invite' ); 235 235 236 if ( get_usermeta( $invited_user_id, 'notification_groups_invite' ) == 'no') continue;236 if ( 'no' == get_usermeta( $invited_user_id, 'notification_groups_invite' ) ) continue; 237 237 238 238 $invited_ud = get_userdata($invited_user_id); -
trunk/bp-groups/bp-groups-templatetags.php
r1021 r1025 28 28 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $groups_per_page; 29 29 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'] ) ) ) { 31 31 32 32 $order = $bp->action_variables[0]; 33 33 34 if ( $order == 'recently-joined') {34 if ( 'recently-joined' == $order ) { 35 35 $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 ) { 37 37 $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 ) { 39 39 $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 ) { 41 41 $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 ) { 43 43 $this->groups = groups_get_alphabetically_for_user( $bp->displayed_user->id, $this->pag_num, $this->pag_page ); 44 44 } else { … … 50 50 $this->group_count = count($this->groups); 51 51 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'] != '' ) ) { 53 53 54 54 $this->groups = groups_filter_user_groups( $_REQUEST['group-filter-box'], $this->pag_num, $this->pag_page ); … … 57 57 $this->group_count = count($this->groups); 58 58 59 } else if ( $bp->current_action == 'invites') {59 } else if ( 'invites' == $bp->current_action ) { 60 60 61 61 $this->groups = groups_get_invites_for_user(); … … 63 63 $this->group_count = count($this->groups); 64 64 65 } else if ( isset( $_REQUEST['page'] ) && $_REQUEST['page'] == 'groups_admin_settings') {65 } else if ( isset( $_REQUEST['page'] ) && 'groups_admin_settings' == $_REQUEST['page'] ) { 66 66 67 67 $this->sort_by = $_REQUEST['sortby']; … … 157 157 $this->group = new BP_Groups_Group( $this->group->group_id, false ); 158 158 159 if ( $this->current_group == 0) // loop has just started159 if ( 0 == $this->current_group ) // loop has just started 160 160 do_action('loop_start'); 161 161 } … … 188 188 global $bp, $groups_template; 189 189 190 if ( $groups_template->group->status == 'public') {190 if ( 'public' == $groups_template->group->status ) { 191 191 return true; 192 192 } else { … … 229 229 global $groups_template; 230 230 231 if ( $groups_template->group->status == 'public') {231 if ( 'public' == $groups_template->group->status ) { 232 232 $type = __( "Public Group", "buddypress" ); 233 } else if ( $groups_template->group->status == 'hidden') {233 } else if ( 'hidden' == $groups_template->group->status ) { 234 234 $type = __( "Hidden Group", "buddypress" ); 235 } else if ( $groups_template->group->status == 'private') {235 } else if ( 'private' == $groups_template->group->status ) { 236 236 $type = __( "Private Group", "buddypress" ); 237 237 } else { … … 480 480 global $groups_template, $bp; 481 481 482 if ( $bp->current_action == 'my-groups'|| !$bp->current_action ) {482 if ( 'my-groups' == $bp->current_action || !$bp->current_action ) { 483 483 $action = $bp->loggedin_user->domain . $bp->groups->slug . '/my-groups/search/'; 484 484 $label = __('Filter Groups', 'buddypress'); … … 595 595 global $groups_template; 596 596 597 if ( $permission == 'admin'&& $groups_template->group->photos_admin_only )597 if ( 'admin' == $permission && $groups_template->group->photos_admin_only ) 598 598 echo ' checked="checked"'; 599 599 600 if ( $permission == 'member'&& !$groups_template->group->photos_admin_only )600 if ( 'member' == $permission && !$groups_template->group->photos_admin_only ) 601 601 echo ' checked="checked"'; 602 602 } … … 718 718 ?> 719 719 <?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> 721 721 <?php } ?> 722 722 723 723 <?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> 725 725 <?php } ?> 726 726 727 727 <?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> 729 729 <?php } ?> 730 730 731 731 <?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> 733 733 <?php } ?> 734 734 735 735 <?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> 737 737 <?php endif; ?> 738 738 739 739 <?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> 741 741 <?php } ?> 742 742 … … 772 772 global $bp, $create_group_step, $completed_to_step; 773 773 ?> 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> 778 778 <?php 779 779 do_action( 'groups_creation_tabs' ); … … 861 861 862 862 <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> 866 866 </div> 867 867 … … 968 968 global $bp, $create_group_step, $completed_to_step; 969 969 ?> 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> 976 976 977 977 <?php … … 1153 1153 global $groups_template; 1154 1154 1155 if ( $groups_template->group->status == 'private') {1155 if ( 'private' == $groups_template->group->status ) { 1156 1156 if ( !bp_group_has_requested_membership() ) 1157 1157 if ( is_user_logged_in() ) … … 1191 1191 <?php $member_count = groups_get_groupmeta( $group->id, 'total_member_count' ) ?> 1192 1192 <?php echo ucwords($group->status) ?> <?php _e( 'Group', 'buddypress' ) ?> / 1193 <?php if ( $member_count == 1) : ?>1193 <?php if ( 1 == $member_count ) : ?> 1194 1194 <?php _e( sprintf( '%d member', $member_count ), 'buddypress' ) ?> 1195 1195 <?php else : ?> … … 1336 1336 $this->member = $this->next_member(); 1337 1337 1338 if ( $this->current_member == 0) // loop has just started1338 if ( 0 == $this->current_member ) // loop has just started 1339 1339 do_action('loop_start'); 1340 1340 } … … 1411 1411 global $bp; 1412 1412 1413 if ( $bp->current_action == 'group-finder')1413 if ( 'group-finder' == $bp->current_action ) 1414 1414 echo apply_filters( 'bp_group_reject_invite_link', 'groupfinder-pag' ); 1415 1415 else … … 1521 1521 $this->request = $this->next_request(); 1522 1522 1523 if ( $this->current_request == 0) // loop has just started1523 if ( 0 == $this->current_request ) // loop has just started 1524 1524 do_action('loop_start'); 1525 1525 } -
trunk/bp-groups/bp-groups-widgets.php
r1021 r1025 51 51 <span class="activity"> 52 52 <?php 53 if ( $group->total_member_count == 1)53 if ( 1 == $group->total_member_count ) 54 54 echo $group->total_member_count . __(' member', 'buddypress'); 55 55 else -
trunk/bp-messages.php
r1021 r1025 11 11 include_once( 'bp-messages/bp-messages-ajax.php' ); 12 12 include_once( 'bp-messages/bp-messages-cssjs.php' ); 13 include_once( 'bp-messages/bp-messages-admin.php' );14 13 include_once( 'bp-messages/bp-messages-templatetags.php' ); 15 14 include_once( 'bp-messages/bp-messages-notifications.php' ); … … 33 32 34 33 $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, 36 35 message_ids longtext NOT NULL, 37 36 sender_ids longtext NOT NULL, 38 37 first_post_date datetime NOT NULL, 39 38 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, 42 41 KEY last_message_id (last_message_id), 43 42 KEY last_sender_id (last_sender_id) … … 45 44 46 45 $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, 50 49 sender_only tinyint(1) NOT NULL DEFAULT '0', 51 50 unread_count int(10) NOT NULL DEFAULT '0', … … 59 58 60 59 $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, 63 62 subject varchar(200) NOT NULL, 64 63 message longtext NOT NULL, … … 72 71 73 72 $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, 75 74 subject varchar(200) NOT NULL, 76 75 message longtext NOT NULL, … … 123 122 if ( is_site_admin() ) { 124 123 /* 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 ) ) 126 125 messages_install(); 127 126 } … … 186 185 187 186 $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'] ) ) { 190 189 // Replace commas with places 191 190 $recipients = str_replace( ',', ' ', $_POST['send-to-input'] ); … … 216 215 $notice = new BP_Messages_Notice($notice_id); 217 216 218 if ( $bp->action_variables[0] == 'deactivate') {217 if ( 'deactivate' == $bp->action_variables[0] ) { 219 218 if ( !$notice->deactivate() ) { 220 219 bp_core_add_message( __('There was a problem deactivating that notice.', 'buddypress'), 'error' ); … … 222 221 bp_core_add_message( __('Notice deactivated.', 'buddypress') ); 223 222 } 224 } else if ( $bp->action_variables[0] == 'activate') {223 } else if ( 'activate' == $bp->action_variables[0] ) { 225 224 if ( !$notice->activate() ) { 226 225 bp_core_add_message( __('There was a problem activating that notice.', 'buddypress'), 'error' ); … … 228 227 bp_core_add_message( __('Notice activated.', 'buddypress') ); 229 228 } 230 } else if ( $bp->action_variables[0] == 'delete') {229 } else if ( 'delete' == $bp->action_variables[0] ) { 231 230 if ( !$notice->delete() ) { 232 231 bp_core_add_message( __('There was a problem deleting that notice.', 'buddypress'), 'buddypress' ); … … 255 254 <td></td> 256 255 <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> 259 258 </tr> 260 259 <tr> 261 260 <td></td> 262 261 <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> 265 264 </tr> 266 265 … … 365 364 global $bp; 366 365 367 if ( $action == 'new_message') {366 if ( 'new_message' == $action ) { 368 367 if ( (int)$total_items > 1 ) 369 368 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 ); … … 413 412 414 413 // 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 ) { 416 415 bp_core_add_message( __('You must send your message to one or more users not including yourself.', 'buddypress'), 'error' ); 417 416 bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/compose' ); 418 417 419 418 // If the subject or content boxes are empty. 420 } else if ( $subject == '' || $content == '') {419 } else if ( empty( $subject ) || empty( $content ) ) { 421 420 if ( !$from_ajax ) { 422 421 bp_core_add_message( __('Please make sure you fill in all the fields.', 'buddypress'), 'error' ); … … 515 514 516 515 function messages_send_notice( $subject, $message, $from_template ) { 517 if ( !is_site_admin() || $subject == '' || $message == '') {516 if ( !is_site_admin() || empty( $subject ) || empty( $message ) ) { 518 517 return false; 519 518 } else { -
trunk/bp-messages/bp-messages-classes.php
r1021 r1025 62 62 63 63 foreach ( $this->message_ids as $key => $message_id ) { 64 if ( $this->box == 'sentbox') {64 if ( 'sentbox' == $this->box ) { 65 65 if ( !messages_is_user_sender( $bp->loggedin_user->id, $message_id ) ) { 66 66 unset( $this->message_ids[$key] ); … … 377 377 $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 ); 378 378 379 if ( $wpdb->query($sql) === false)379 if ( false === $wpdb->query($sql) ) 380 380 return false; 381 381 -
trunk/bp-messages/bp-messages-notifications.php
r884 r1025 10 10 11 11 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; 13 13 14 14 $ud = get_userdata($recipient_ids[$i]); -
trunk/bp-messages/bp-messages-templatetags.php
r1021 r1025 22 22 $this->box = $box; 23 23 24 if ( $this->box == 'notices')24 if ( 'notices' == $this->box ) 25 25 $this->threads = BP_Messages_Notice::get_notices(); 26 26 else … … 33 33 $this->thread_count = count($this->threads); 34 34 35 if ( $this->box == 'notices')35 if ( 'notices' == $this->box ) 36 36 $this->total_thread_count = BP_Messages_Notice::get_total_notice_count(); 37 37 else … … 90 90 $thread = $this->next_thread(); 91 91 92 if ( $this->current_thread == 0) // loop has just started92 if ( 0 == $this->current_thread ) // loop has just started 93 93 do_action('loop_start'); 94 94 } … … 98 98 global $bp, $messages_template; 99 99 100 if ( $bp->current_action == 'notices'&& !is_site_admin() ) {100 if ( 'notices' == $bp->current_action && !is_site_admin() ) { 101 101 wp_redirect( $bp->displayed_user->id ); 102 102 } else { 103 if ( $bp->current_action == 'inbox')103 if ( 'inbox' == $bp->current_action ) 104 104 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, 'messages', 'new_message' ); 105 105 … … 269 269 global $messages_template, $bp; 270 270 271 if ( $messages_template->thread->is_active == "1") {271 if ( 1 == (int)$messages_template->thread->is_active ) { 272 272 $link = $bp->loggedin_user->domain . $bp->messages->slug . '/notices/deactivate/' . $messages_template->thread->id; 273 273 } else { … … 280 280 global $messages_template; 281 281 282 if ( $messages_template->thread->is_active == "1") {282 if ( 1 == (int)$messages_template->thread->is_active ) { 283 283 $text = __('Deactivate', 'buddypress'); 284 284 } else { -
trunk/bp-wire/bp-wire-templatetags.php
r1024 r1025 26 26 // Seeing as we're viewing a users wire, lets remove any new wire 27 27 // post notifications 28 if ( $bp->current_action == 'all-posts')28 if ( 'all-posts' == $bp->current_action ) 29 29 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, 'xprofile', 'new_wire_post' ); 30 30 … … 99 99 $this->wire_post = $this->next_wire_post(); 100 100 101 if ( $this->current_wire_post == 0) // loop has just started101 if ( 0 == $this->current_wire_post ) // loop has just started 102 102 do_action('loop_start'); 103 103 } … … 262 262 $uri = $bp->current_item; 263 263 264 if ( $bp->current_component == 'wire' || $bp->current_component == 'profile') {264 if ( $bp->current_component == $bp->wire->slug || $bp->current_component == $bp->profile->slug ) { 265 265 echo apply_filters( 'bp_wire_get_action', $bp->displayed_user->domain . $bp->wire->slug . '/post/' ); 266 266 } else { … … 303 303 304 304 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 ) { 306 306 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>' ); 307 307 } else { … … 319 319 $uri = $bp->current_item; 320 320 321 if ( $bp->current_component == 'wire' || $bp->current_component == 'profile') {321 if ( $bp->current_component == $bp->wire->slug || $bp->current_component == $bp->profile->slug ) { 322 322 echo apply_filters( 'bp_wire_see_all_link', $bp->displayed_user->domain . $bp->wire->slug ); 323 323 } else { -
trunk/bp-xprofile.php
r1021 r1025 56 56 57 57 $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, 59 59 name varchar(150) NOT NULL, 60 60 description mediumtext NOT NULL, … … 64 64 65 65 $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, 69 69 type varchar(150) NOT NULL, 70 70 name varchar(150) NOT NULL, … … 72 72 is_required tinyint(1) NOT NULL DEFAULT '0', 73 73 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', 76 76 order_by varchar(15) NOT NULL, 77 77 is_public int(2) NOT NULL DEFAULT '1', … … 85 85 86 86 $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, 90 90 value longtext NOT NULL, 91 91 last_updated datetime NOT NULL, … … 118 118 119 119 $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, 123 123 content longtext NOT NULL, 124 124 date_posted datetime NOT NULL, … … 187 187 188 188 /* 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 ) ) 190 190 xprofile_install(); 191 191 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 ) ) 193 193 xprofile_wire_install(); 194 194 } … … 317 317 <td></td> 318 318 <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> 321 321 </tr> 322 322 … … 571 571 global $bp; 572 572 573 if ( $action == 'new_wire_post') {573 if ( 'new_wire_post' == $action ) { 574 574 if ( (int)$total_items > 1 ) { 575 575 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 ); … … 632 632 633 633 // 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'] ) { 635 635 636 636 // If the current field is a datebox, we need to append '_day' to the end of the field name 637 637 // 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; 639 639 640 640 // Explode the posted field IDs into an array so we know which fields have been submitted … … 753 753 <?php 754 754 if ( $message != '' ) { 755 $type = ( $type == 'error') ? 'error' : 'updated';755 $type = ( 'error' == $type ) ? 'error' : 'updated'; 756 756 ?> 757 757 <div id="message" class="<?php echo $type; ?> fade"> … … 815 815 return false; 816 816 817 if ( $field_type == "datebox") {817 if ( 'datebox' == $field_type ) { 818 818 $field_value = bp_format_time( $field_value, true ); 819 819 } else { -
trunk/bp-xprofile/bp-xprofile-admin.php
r1021 r1025 16 16 $groups = BP_XProfile_Group::get_all(); 17 17 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'] ) { 19 19 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'] ) { 21 21 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'] ) { 23 23 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'] ) { 25 25 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'] ) { 27 27 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'] ) { 29 29 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'] ) { 31 31 xprofile_admin_manage_group($_GET['group_id']); 32 32 } else { … … 91 91 <?php if ( $groups[$i]->fields ) { ?> 92 92 <?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"; } ?> 94 94 <?php $field = new BP_XProfile_Field($groups[$i]->fields[$j]->id); ?> 95 95 <?php if ( !$field->can_delete ) { $class .= ' core'; } ?> … … 244 244 global $message, $type; 245 245 246 if ( $type == 'field') {246 if ( 'field' == $type ) { 247 247 $type = __('field', 'buddypress'); 248 248 } else { -
trunk/bp-xprofile/bp-xprofile-classes.php
r1021 r1025 52 52 } 53 53 54 if ( $wpdb->query($sql) === false)54 if ( !$wpdb->query($sql) ) 55 55 return false; 56 56 … … 66 66 $sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_groups} WHERE id = %d", $this->id ); 67 67 68 if ( $wpdb->query($sql) === false) {68 if ( !$wpdb->query($sql) ) { 69 69 return false; 70 70 } else { … … 85 85 86 86 // 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 92 90 return $fields; 93 91 } … … 96 94 global $message; 97 95 98 if ( $this->id == null) {96 if ( !$this->id ) { 99 97 $title = __('Add Group', 'buddypress'); 100 98 $action = "admin.php?page=xprofile_settings&mode=add_group"; … … 111 109 <?php 112 110 if ( $message != '' ) { 113 $type = ( $type == 'error') ? 'error' : 'updated';111 $type = ( 'error' == $type ) ? 'error' : 'updated'; 114 112 ?> 115 113 <div id="message" class="<?php echo $type; ?> fade"> … … 233 231 return false; 234 232 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 ) ) ) 238 234 return false; 239 235 … … 252 248 $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); 253 249 } 254 if ( $wpdb->query($sql) !== false ) { 250 251 if ( $wpdb->query($sql) ) { 252 255 253 // Only do this if we are editing an existing field 256 254 if ( $this->id != null ) { … … 264 262 // Check to see if this is a field with child options. 265 263 // 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 ) { 267 265 if ( $this->id ) { 268 266 $parent_id = $this->id; … … 305 303 } 306 304 } else { 307 if ( $this->type == "radio" ) { 305 306 if ( 'radio' == $this->type ) { 307 308 308 $options = $_POST['radio_option']; 309 309 $defaults = $_POST['isDefault_radio_option']; 310 } else if ( $this->type == "selectbox" ) { 310 311 } else if ( 'selectbox' == $this->type ) { 312 311 313 $options = $_POST['selectbox_option']; 312 314 $defaults = $_POST['isDefault_selectbox_option']; 313 } else if ( $this->type == "multiselectbox" ) { 315 316 } else if ( 'multiselectbox' == $this->type ) { 317 314 318 $options = $_POST['multiselectbox_option']; 315 319 $defaults = $_POST['isDefault_multiselectbox_option']; 316 } else if ( $this->type == "checkbox" ) { 320 321 } else if ( 'checkbox' == $this->type ) { 322 317 323 $options = $_POST['checkbox_option']; 318 324 $defaults = $_POST['isDefault_checkbox_option']; 325 319 326 } 320 327 … … 332 339 } 333 340 334 if ( $option_value != "" ) { 341 if ( !empty( $option_valu ) ) { 342 335 343 // 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 ) ) ) 339 345 return false; 340 341 // @TODO 342 // Need to go back and reverse what has been entered here. 343 } 346 347 return true; 344 348 } 345 349 … … 580 584 global $wpdb, $bp; 581 585 582 // This is done here so we don't have problems with sql injection583 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 ) { 584 588 $sort_sql = 'ORDER BY name ASC'; 585 } else if ( $this->order_by == 'desc'&& !$for_editing ) {589 } else if ( 'desc' == $this->order_by && !$for_editing ) { 586 590 $sort_sql = 'ORDER BY name DESC'; 587 591 } else { … … 619 623 $default_name = ''; 620 624 621 if ( $type == 'multiselectbox' || $type == 'checkbox') {625 if ( 'multiselectbox' == $type || 'checkbox' == $type ) { 622 626 $default_input = 'checkbox'; 623 627 } else { … … 627 631 <div id="<?php echo $type ?>" class="options-box" style="<?php if ( $this->type != $type ) { ?>display: none;<?php } ?> margin-left: 15px;"> 628 632 <h4><?php _e('Please enter options for this Field:', 'buddypress') ?></h4> 629 <p> Order By:633 <p><?php _e( 'Order By:', 'buddypress' ) ?> 630 634 631 635 <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> 635 639 </select> 636 640 … … 642 646 $j = $i + 1; 643 647 644 if ( $type == 'multiselectbox' || $type == 'checkbox')648 if ( 'multiselectbox' == $type || 'checkbox' == $type ) 645 649 $default_name = '[' . $j . ']'; 646 650 ?> 647 651 <p><?php _e('Option', 'buddypress') ?> <?php echo $j ?>: 648 652 <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' ) ?> 650 654 <a href="admin.php?page=xprofile_settings&mode=delete_option&option_id=<?php echo $options[$i]->id ?>" class="ajax-option-delete" id="delete-<?php echo $options[$i]->id ?>">[x]</a></p> 651 655 </p> … … 655 659 <?php 656 660 } else { 657 if ( $type == 'multiselectbox' || $type == 'checkbox')661 if ( 'multiselectbox' == $type || 'checkxbox' == $type ) 658 662 $default_name = '[1]'; 659 663 ?> … … 672 676 673 677 function render_admin_form( $message = '' ) { 674 if ( $this->id == null) {678 if ( !$this->id ) { 675 679 $title = __('Add Field', 'buddypress'); 676 680 $action = "admin.php?page=xprofile_settings&group_id=" . $this->group_id . "&mode=add_field"; … … 706 710 </div> 707 711 708 <div id="titlediv" >712 <div id="titlediv" class="inside"> 709 713 <h3><label for="description"><?php _e("Field Description", 'buddypress') ?></label></h3> 710 714 <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> 712 716 </div> 713 717 </div> … … 910 914 911 915 // Validate Form 912 if ( empty( $_POST['title'] ) || empty( $_POST['required'] ) || empty( $_POST['fieldtype'] )) {916 if ( '' == $_POST['title'] || '' == $_POST['required'] || '' == $_POST['fieldtype'] ) { 913 917 $message = __('Please make sure you fill out all required fields.', 'buddypress'); 914 918 return false; … … 1047 1051 global $wpdb, $bp; 1048 1052 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 ) ) ) 1052 1054 return false; 1053 1055 … … 1126 1128 global $wpdb, $userdata, $bp; 1127 1129 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 ) ) ) 1131 1131 return false; 1132 1132 -
trunk/bp-xprofile/bp-xprofile-filters.php
r1021 r1025 20 20 return false; 21 21 22 if ( $field_type == 'datebox') {22 if ( 'datebox' == $field_type ) { 23 23 $field_value = bp_format_time( $field_value, true ); 24 24 } else { … … 31 31 32 32 function xprofile_filter_link_profile_data( $field_value, $field_type, $field_id ) { 33 if ( $field_type == 'datebox')33 if ( 'datebox' == $field_type ) 34 34 return $field_value; 35 35 -
trunk/bp-xprofile/bp-xprofile-notifications.php
r1021 r1025 25 25 bp_core_add_notification( $poster_id, $user_id, 'xprofile', 'new_wire_post' ); 26 26 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' ) ) { 28 28 $poster_name = bp_fetch_user_fullname( $poster_id, false ); 29 29 $wire_post = new BP_Wire_Post( $bp->profile->table_name_wire, $wire_post_id, true ); -
trunk/bp-xprofile/bp-xprofile-signup.php
r1021 r1025 112 112 $field = new BP_XProfile_Field($field->id); 113 113 114 if ( $field->type == "datebox") {114 if ( 'datebox' == $field->type ) { 115 115 if ( $_POST['field_' . $field->id . '_day'] != "" && $_POST['field_' . $field->id . '_month'] != "" && $_POST['field_' . $field->id . '_year'] != "") { 116 116 $value = strtotime( $_POST['field_' . $field->id . '_day'] . " " . … … 160 160 if ( isset($_FILES['file']) ) { 161 161 162 if ( $_FILES['file']['error'] !== 4) {162 if ( 4 !== $_FILES['file']['error'] ) { 163 163 if ( !$checked_upload = bp_core_check_avatar_upload($_FILES) ) { 164 164 $avatar_error = true; -
trunk/bp-xprofile/bp-xprofile-templatetags.php
r1021 r1025 68 68 $group = $this->next_group(); 69 69 70 if ( $this->current_group == 0) // loop has just started70 if ( 0 == $this->current_group ) // loop has just started 71 71 do_action('loop_start'); 72 72 }
Note: See TracChangeset
for help on using the changeset viewer.