Skip to:
Content

BuddyPress.org

Changeset 1025 for trunk/bp-friends.php


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

Syntax cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-friends.php

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