Skip to:
Content

BuddyPress.org

Changeset 3145


Ignore:
Timestamp:
07/22/2010 11:09:28 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Fixes #2523 props cnorris23

Location:
branches/1.2
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-activity.php

    r3144 r3145  
    276276                <td></td>
    277277                <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( $bp->loggedin_user->id, $bp->loggedin_user->userdata->user_nicename, $bp->loggedin_user->userdata->user_login ) ) ?></td>
    278                 <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php if ( !get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) || 'yes' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) ) { ?>checked="checked" <?php } ?>/></td>
    279                 <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php if ( 'no' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) ) { ?>checked="checked" <?php } ?>/></td>
     278                <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php if ( !get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_mention', true ) || 'yes' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_mention', true ) ) { ?>checked="checked" <?php } ?>/></td>
     279                <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php if ( 'no' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_mention', true ) ) { ?>checked="checked" <?php } ?>/></td>
    280280            </tr>
    281281            <tr>
    282282                <td></td>
    283283                <td><?php printf( __( "A member replies to an update or comment you've posted", 'buddypress' ), $current_user->user_login ) ?></td>
    284                 <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" value="yes" <?php if ( !get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) || 'yes' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) ) { ?>checked="checked" <?php } ?>/></td>
    285                 <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php if ( 'no' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) ) { ?>checked="checked" <?php } ?>/></td>
     284                <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" value="yes" <?php if ( !get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply', true ) || 'yes' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply', true ) ) { ?>checked="checked" <?php } ?>/></td>
     285                <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php if ( 'no' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply', true ) ) { ?>checked="checked" <?php } ?>/></td>
    286286            </tr>
    287287
     
    711711
    712712    /* Add this update to the "latest update" usermeta so it can be fetched anywhere. */
    713     update_usermeta( $bp->loggedin_user->id, 'bp_latest_update', array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) );
     713    update_user_meta( $bp->loggedin_user->id, 'bp_latest_update', array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) );
    714714
    715715    /* Require the notifications code so email notifications can be set on the 'bp_activity_posted_update' action. */
     
    838838        $user_id = $args['user_id'];
    839839
    840     $latest_update = get_usermeta( $user_id, 'bp_latest_update' );
     840    $latest_update = get_user_meta( $user_id, 'bp_latest_update', true );
    841841    if ( !empty( $latest_update ) ) {
    842842        if ( in_array( (int)$latest_update['id'], (array)$activity_ids_deleted ) )
    843             delete_usermeta( $user_id, 'bp_latest_update' );
     843            delete_user_meta( $user_id, 'bp_latest_update' );
    844844    }
    845845
     
    992992
    993993function bp_activity_get_user_favorites( $user_id ) {
    994     $my_favs = maybe_unserialize( get_usermeta( $user_id, 'bp_favorite_activities' ) );
     994    $my_favs = maybe_unserialize( get_user_meta( $user_id, 'bp_favorite_activities', true ) );
    995995    $existing_favs = bp_activity_get_specific( array( 'activity_ids' => $my_favs ) );
    996996
     
    999999
    10001000    $new_favs = array_unique( (array)$new_favs );
    1001     update_usermeta( $user_id, 'bp_favorite_activities', $new_favs );
     1001    update_user_meta( $user_id, 'bp_favorite_activities', $new_favs );
    10021002
    10031003    return apply_filters( 'bp_activity_get_user_favorites', $new_favs );
     
    10111011
    10121012    /* Update the user's personal favorites */
    1013     $my_favs = maybe_unserialize( get_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities' ) );
     1013    $my_favs = maybe_unserialize( get_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities', true ) );
    10141014    $my_favs[] = $activity_id;
    10151015
     
    10221022        $fav_count = 1;
    10231023
    1024     update_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities', $my_favs );
     1024    update_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities', $my_favs );
    10251025    bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count );
    10261026
     
    10371037
    10381038    /* Remove the fav from the user's favs */
    1039     $my_favs = maybe_unserialize( get_usermeta( $user_id, 'bp_favorite_activities' ) );
     1039    $my_favs = maybe_unserialize( get_user_meta( $user_id, 'bp_favorite_activities', true ) );
    10401040    $my_favs = array_flip( (array) $my_favs );
    10411041    unset( $my_favs[$activity_id] );
     
    10501050    }
    10511051
    1052     update_usermeta( $user_id, 'bp_favorite_activities', $my_favs );
     1052    update_user_meta( $user_id, 'bp_favorite_activities', $my_favs );
    10531053
    10541054    do_action( 'bp_activity_remove_user_favorite', $activity_id, $user_id );
     
    11721172
    11731173    // Remove any usermeta
    1174     delete_usermeta( $user_id, 'bp_latest_update' );
    1175     delete_usermeta( $user_id, 'bp_favorite_activities' );
     1174    delete_user_meta( $user_id, 'bp_latest_update' );
     1175    delete_user_meta( $user_id, 'bp_favorite_activities' );
    11761176
    11771177    do_action( 'bp_activity_remove_data', $user_id );
  • branches/1.2/bp-activity/bp-activity-classes.php

    r3115 r3145  
    532532        global $bp;
    533533
    534         if ( !$favorite_activity_entries = get_usermeta( $user_id, 'bp_favorite_activities' ) )
     534        if ( !$favorite_activity_entries = get_user_meta( $user_id, 'bp_favorite_activities', true ) )
    535535            return 0;
    536536
  • branches/1.2/bp-activity/bp-activity-filters.php

    r3076 r3145  
    115115
    116116        /* Increase the number of new @ mentions for the user */
    117         $new_mention_count = (int)get_usermeta( $user_id, 'bp_new_mention_count' );
    118         update_usermeta( $user_id, 'bp_new_mention_count', $new_mention_count + 1 );
     117        $new_mention_count = (int)get_user_meta( $user_id, 'bp_new_mention_count', true );
     118        update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count + 1 );
    119119
    120120        $content = str_replace( "@$username", "<a href='" . bp_core_get_user_domain( bp_core_get_userid( $username ) ) . "' rel='nofollow'>@$username</a>", $content );
  • branches/1.2/bp-activity/bp-activity-notifications.php

    r2869 r3145  
    1717
    1818        // Now email the user with the contents of the message (if they have enabled email notifications)
    19         if ( 'no' != get_usermeta( $receiver_user_id, 'notification_activity_new_mention' ) ) {
     19        if ( 'no' != get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) {
    2020            $poster_name = bp_core_get_user_displayname( $poster_user_id );
    2121
     
    2929            $ud = bp_core_get_core_userdata( $receiver_user_id );
    3030            $to = $ud->user_email;
    31             $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name );
     31            $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name );
    3232
    3333$message = sprintf( __(
     
    6161    $original_activity = new BP_Activity_Activity( $activity_id );
    6262
    63     if ( $original_activity->user_id != $commenter_id && 'no' != get_usermeta( $original_activity->user_id, 'notification_activity_new_reply' ) ) {
     63    if ( $original_activity->user_id != $commenter_id && 'no' != get_user_meta( $original_activity->user_id, 'notification_activity_new_reply', true ) ) {
    6464        $poster_name = bp_core_get_user_displayname( $commenter_id );
    6565        $thread_link = bp_activity_get_permalink( $activity_id );
     
    7272        $ud = bp_core_get_core_userdata( $original_activity->user_id );
    7373        $to = $ud->user_email;
    74         $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( '%s replied to one of your updates', 'buddypress' ), $poster_name );
     74        $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( '%s replied to one of your updates', 'buddypress' ), $poster_name );
    7575
    7676$message = sprintf( __(
     
    103103    $parent_comment = new BP_Activity_Activity( $parent_id );
    104104
    105     if ( $parent_comment->user_id != $commenter_id && $original_activity->user_id != $parent_comment->user_id && 'no' != get_usermeta( $parent_comment->user_id, 'notification_activity_new_reply' ) ) {
     105    if ( $parent_comment->user_id != $commenter_id && $original_activity->user_id != $parent_comment->user_id && 'no' != get_user_meta( $parent_comment->user_id, 'notification_activity_new_reply', true ) ) {
    106106        $poster_name = bp_core_get_user_displayname( $commenter_id );
    107107        $thread_link = bp_activity_get_permalink( $activity_id );
     
    111111        $ud = bp_core_get_core_userdata( $parent_comment->user_id );
    112112        $to = $ud->user_email;
    113         $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( '%s replied to one of your comments', 'buddypress' ), $poster_name );
     113        $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( '%s replied to one of your comments', 'buddypress' ), $poster_name );
    114114
    115115        $poster_name = stripslashes( $poster_name );
  • branches/1.2/bp-activity/bp-activity-templatetags.php

    r3143 r3145  
    2626
    2727        /* Get an array of the logged in user's favorite activities */
    28         $this->my_favs = maybe_unserialize( get_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities' ) );
     28        $this->my_favs = maybe_unserialize( get_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities', true ) );
    2929
    3030        if ( !empty( $include ) ) {
     
    730730            $user_id = $bp->displayed_user->id;
    731731
    732         if ( !$update = get_usermeta( $user_id, 'bp_latest_update' ) )
     732        if ( !$update = get_user_meta( $user_id, 'bp_latest_update', true ) )
    733733            return false;
    734734
     
    832832}
    833833    function bp_get_total_mention_count_for_user( $user_id = false ) {
    834         return apply_filters( 'bp_get_total_mention_count_for_user', get_usermeta( $user_id, 'bp_new_mention_count' ) );
     834        return apply_filters( 'bp_get_total_mention_count_for_user', get_user_meta( $user_id, 'bp_new_mention_count', true ) );
    835835    }
    836836
  • branches/1.2/bp-core.php

    r3143 r3145  
    557557 * @global $current_user WordPress global variable containing current logged in user information
    558558 * @param user_id The ID of the user.
    559  * @uses get_usermeta() WordPress function to get the usermeta for a user.
     559 * @uses get_user_meta() WordPress function to get the usermeta for a user.
    560560 */
    561561function bp_core_get_user_domain( $user_id, $user_nicename = false, $user_login = false ) {
     
    14751475 * @package BuddyPress Core
    14761476 * @global $userdata WordPress user data for the current logged in user.
    1477  * @uses update_usermeta() WordPress function to update user metadata in the usermeta table.
     1477 * @uses update_user_meta() WordPress function to update user metadata in the usermeta table.
    14781478 */
    14791479function bp_core_record_activity() {
     
    14831483        return false;
    14841484
    1485     $activity = get_usermeta( $bp->loggedin_user->id, 'last_activity' );
     1485    $activity = get_user_meta( $bp->loggedin_user->id, 'last_activity', true );
    14861486
    14871487    if ( !is_numeric( $activity ) )
     
    14921492
    14931493    if ( '' == $activity || strtotime( $current_time ) >= strtotime( '+5 minutes', $activity ) )
    1494         update_usermeta( $bp->loggedin_user->id, 'last_activity', $current_time );
     1494        update_user_meta( $bp->loggedin_user->id, 'last_activity', $current_time );
    14951495}
    14961496add_action( 'wp_head', 'bp_core_record_activity' );
     
    19291929 * @package BuddyPress Core
    19301930 * @param $user_id The user id for the user to delete usermeta for
    1931  * @uses delete_usermeta() deletes a row from the wp_usermeta table based on meta_key
     1931 * @uses delete_user_meta() deletes a row from the wp_usermeta table based on meta_key
    19321932 */
    19331933function bp_core_remove_data( $user_id ) {
    19341934    /* Remove usermeta */
    1935     delete_usermeta( $user_id, 'last_activity' );
     1935    delete_user_meta( $user_id, 'last_activity' );
    19361936
    19371937    /* Flush the cache to remove the user from all cached objects */
  • branches/1.2/bp-core/bp-core-classes.php

    r3143 r3145  
    5151     * @uses bp_core_get_userlink() Returns a HTML formatted link for a user with the user's full name as the link text
    5252     * @uses bp_core_get_user_email() Returns the email address for the user based on user ID
    53      * @uses get_usermeta() WordPress function returns the value of passed usermeta name from usermeta table
     53     * @uses get_user_meta() WordPress function returns the value of passed usermeta name from usermeta table
    5454     * @uses bp_core_fetch_avatar() Returns HTML formatted avatar for a user
    5555     * @uses bp_profile_last_updated_date() Returns the last updated date for a user.
     
    8080        $this->avatar_mini = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'width' => 30, 'height' => 30 ) );
    8181
    82         $this->last_active = bp_core_get_last_activity( get_usermeta( $this->id, 'last_activity' ), __( 'active %s ago', 'buddypress' ) );
     82        $this->last_active = bp_core_get_last_activity( get_user_meta( $this->id, 'last_activity', true ), __( 'active %s ago', 'buddypress' ) );
    8383    }
    8484
  • branches/1.2/bp-core/bp-core-settings.php

    r3143 r3145  
    115115        if ( $_POST['notifications'] ) {
    116116            foreach ( (array)$_POST['notifications'] as $key => $value ) {
    117                 update_usermeta( (int)$current_user->id, $key, $value );
     117                update_user_meta( (int)$current_user->id, $key, $value );
    118118            }
    119119        }
  • branches/1.2/bp-core/bp-core-signup.php

    r3144 r3145  
    425425        if ( !bp_core_is_multisite() ) {
    426426            $activation_key = wp_hash( $user_id );
    427             update_usermeta( $user_id, 'activation_key', $activation_key );
     427            update_user_meta( $user_id, 'activation_key', $activation_key );
    428428            bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key );
    429429        }
     
    488488
    489489        /* Remove the activation key meta */
    490         delete_usermeta( $user_id, 'activation_key' );
     490        delete_user_meta( $user_id, 'activation_key' );
    491491    }
    492492
     
    495495
    496496    /* Add a last active entry */
    497     update_usermeta( $user_id, 'last_activity', bp_core_current_time() );
     497    update_user_meta( $user_id, 'last_activity', bp_core_current_time() );
    498498
    499499    /* Set the password on multisite installs */
     
    538538
    539539    /* Add a last active entry */
    540     update_usermeta( $user_id, 'last_activity', bp_core_current_time() );
     540    update_user_meta( $user_id, 'last_activity', bp_core_current_time() );
    541541
    542542    /* Add the user's fullname to Xprofile */
    543543    if ( function_exists( 'xprofile_set_field_data' ) ) {
    544         $firstname = get_usermeta( $user_id, 'first_name' );
    545         $lastname = ' ' . get_usermeta( $user_id, 'last_name' );
     544        $firstname = get_user_meta( $user_id, 'first_name', true );
     545        $lastname = ' ' . get_user_meta( $user_id, 'last_name', true );
    546546        $name = $firstname . $lastname;
    547547
    548548        if ( empty( $name ) || ' ' == $name )
    549             $name = get_usermeta( $user_id, 'nickname' );
     549            $name = get_user_meta( $user_id, 'nickname', true );
    550550
    551551        xprofile_set_field_data( 1, $user_id, $name );
  • branches/1.2/bp-core/bp-core-templatetags.php

    r3143 r3145  
    13451345        $user_id = $bp->displayed_user->id;
    13461346
    1347     $last_activity = bp_core_get_last_activity( get_usermeta( $user_id, 'last_activity' ), __('active %s ago', 'buddypress') );
     1347    $last_activity = bp_core_get_last_activity( get_user_meta( $user_id, 'last_activity', true ), __('active %s ago', 'buddypress') );
    13481348
    13491349    if ( $echo )
  • branches/1.2/bp-forums.php

    r3118 r3145  
    528528    global $bp, $wp_roles, $bb_table_prefix;
    529529
    530     $bb_cap = get_usermeta( $bp->loggedin_user->id, $bb_table_prefix . 'capabilities' );
     530    $bb_cap = get_user_meta( $bp->loggedin_user->id, $bb_table_prefix . 'capabilities', true );
    531531
    532532    if ( empty( $bb_cap ) )
  • branches/1.2/bp-forums/bp-forums-bbpress.php

    r2209 r3145  
    104104        $site_admins = get_site_option( 'site_admins', array('admin') );
    105105        foreach ( (array)$site_admins as $site_admin )
    106             update_usermeta( bp_core_get_userid( $site_admin ), $bb_table_prefix . 'capabilities', array( 'keymaster' => true ) );
     106            update_user_meta( bp_core_get_userid( $site_admin ), $bb_table_prefix . 'capabilities', array( 'keymaster' => true ) );
    107107
    108108        // Create the first forum.
     
    131131        extract( $args, EXTR_SKIP );
    132132
    133         return update_usermeta( $id, $meta_key, $meta_value );
     133        return update_user_meta( $id, $meta_key, $meta_value );
    134134    }
    135135}
  • branches/1.2/bp-friends.php

    r3142 r3145  
    156156                <td></td>
    157157                <td><?php _e( 'A member sends you a friendship request', 'buddypress' ) ?></td>
    158                 <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>
    159                 <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>
     158                <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_friends_friendship_request', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_friends_friendship_request', true ) ) { ?>checked="checked" <?php } ?>/></td>
     159                <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" value="no" <?php if ( get_user_meta( $current_user->id, 'notification_friends_friendship_request', true ) == 'no' ) { ?>checked="checked" <?php } ?>/></td>
    160160            </tr>
    161161            <tr>
    162162                <td></td>
    163163                <td><?php _e( 'A member accepts your friendship request', 'buddypress' ) ?></td>
    164                 <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>
    165                 <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>
     164                <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_friends_friendship_accepted', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_friends_friendship_accepted', true ) ) { ?>checked="checked" <?php } ?>/></td>
     165                <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_friends_friendship_accepted', true ) ) { ?>checked="checked" <?php } ?>/></td>
    166166            </tr>
    167167
     
    488488
    489489    if ( !$count = wp_cache_get( 'bp_total_friend_count_' . $user_id, 'bp' ) ) {
    490         $count = get_usermeta( $user_id, 'total_friend_count' );
     490        $count = get_user_meta( $user_id, 'total_friend_count', true );
    491491        if ( empty( $count ) ) $count = 0;
    492492        wp_cache_set( 'bp_total_friend_count_' . $user_id, $count, 'bp' );
     
    591591function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) {
    592592    if ( 'add' == $status ) {
    593         update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count' ) + 1 );
    594         update_usermeta( $friend_user_id, 'total_friend_count', (int)get_usermeta( $friend_user_id, 'total_friend_count' ) + 1 );
     593        update_user_meta( $initiator_user_id, 'total_friend_count', (int)get_user_meta( $initiator_user_id, 'total_friend_count', true ) + 1 );
     594        update_user_meta( $friend_user_id, 'total_friend_count', (int)get_user_meta( $friend_user_id, 'total_friend_count', true ) + 1 );
    595595    } else {
    596         update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count' ) - 1 );
    597         update_usermeta( $friend_user_id, 'total_friend_count', (int)get_usermeta( $friend_user_id, 'total_friend_count' ) - 1 );
     596        update_user_meta( $initiator_user_id, 'total_friend_count', (int)get_user_meta( $initiator_user_id, 'total_friend_count', true ) - 1 );
     597        update_user_meta( $friend_user_id, 'total_friend_count', (int)get_user_meta( $friend_user_id, 'total_friend_count', true ) - 1 );
    598598    }
    599599}
     
    603603
    604604    /* Remove usermeta */
    605     delete_usermeta( $user_id, 'total_friend_count' );
     605    delete_user_meta( $user_id, 'total_friend_count' );
    606606
    607607    /* Remove friendship requests FROM user */
  • branches/1.2/bp-friends/bp-friends-classes.php

    r3142 r3145  
    128128
    129129        // Do not update meta if user has never had friends
    130         if ( !$count && !get_usermeta( $user_id, 'total_friend_count' ) )
     130        if ( !$count && !get_user_meta( $user_id, 'total_friend_count', true ) )
    131131            return 0;
    132132
    133         update_usermeta( $user_id, 'total_friend_count', (int)$count );
     133        update_user_meta( $user_id, 'total_friend_count', (int)$count );
    134134        return (int)$count;
    135135    }
  • branches/1.2/bp-friends/bp-friends-notifications.php

    r2719 r3145  
    66    $initiator_name = bp_core_get_user_displayname( $initiator_id );
    77
    8     if ( 'no' == get_usermeta( (int)$friend_id, 'notification_friends_friendship_request' ) )
     8    if ( 'no' == get_user_meta( (int)$friend_id, 'notification_friends_friendship_request', true ) )
    99        return false;
    1010
     
    1919    // Set up and send the message
    2020    $to = $ud->user_email;
    21     $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name );
     21    $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name );
    2222
    2323    $message = sprintf( __(
     
    4848    $friend_name = bp_core_get_user_displayname( $friend_id );
    4949
    50     if ( 'no' == get_usermeta( (int)$initiator_id, 'notification_friends_friendship_accepted' ) )
     50    if ( 'no' == get_user_meta( (int)$initiator_id, 'notification_friends_friendship_accepted', true ) )
    5151        return false;
    5252
     
    5858    // Set up and send the message
    5959    $to = $ud->user_email;
    60     $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name );
     60    $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name );
    6161
    6262    $message = sprintf( __(
  • branches/1.2/bp-groups.php

    r3143 r3145  
    975975                <td></td>
    976976                <td><?php _e( 'A member invites you to join a group', 'buddypress' ) ?></td>
    977                 <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>
    978                 <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>
     977                <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_invite', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_invite', true ) ) { ?>checked="checked" <?php } ?>/></td>
     978                <td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_invite', true ) ) { ?>checked="checked" <?php } ?>/></td>
    979979            </tr>
    980980            <tr>
    981981                <td></td>
    982982                <td><?php _e( 'Group information is updated', 'buddypress' ) ?></td>
    983                 <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>
    984                 <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>
     983                <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_group_updated', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_group_updated', true ) ) { ?>checked="checked" <?php } ?>/></td>
     984                <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_group_updated', true ) ) { ?>checked="checked" <?php } ?>/></td>
    985985            </tr>
    986986            <tr>
    987987                <td></td>
    988988                <td><?php _e( 'You are promoted to a group administrator or moderator', 'buddypress' ) ?></td>
    989                 <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>
    990                 <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>
     989                <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_admin_promotion', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_admin_promotion', true ) ) { ?>checked="checked" <?php } ?>/></td>
     990                <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_admin_promotion', true ) ) { ?>checked="checked" <?php } ?>/></td>
    991991            </tr>
    992992            <tr>
    993993                <td></td>
    994994                <td><?php _e( 'A member requests to join a private group for which you are an admin', 'buddypress' ) ?></td>
    995                 <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>
    996                 <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>
     995                <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_membership_request', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_membership_request', true ) ) { ?>checked="checked" <?php } ?>/></td>
     996                <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_membership_request', true ) ) { ?>checked="checked" <?php } ?>/></td>
    997997            </tr>
    998998
     
    16881688
    16891689    /* Modify user's group memberhip count */
    1690     update_usermeta( $user_id, 'total_group_count', (int) get_usermeta( $user_id, 'total_group_count') - 1 );
     1690    update_user_meta( $user_id, 'total_group_count', (int) get_user_meta( $user_id, 'total_group_count', true ) - 1 );
    16911691
    16921692    /* If the user joined this group less than five minutes ago, remove the joined_group activity so
     
    23382338        return false;
    23392339
    2340     update_usermeta( $user_id, 'total_group_count', (int)$total_count - 1 );
     2340    update_user_meta( $user_id, 'total_group_count', (int)$total_count - 1 );
    23412341}
    23422342
  • branches/1.2/bp-groups/bp-groups-classes.php

    r3143 r3145  
    749749        groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) - 1 ) );
    750750
    751         $group_count = get_usermeta( $this->user_id, 'total_group_count' );
     751        $group_count = get_user_meta( $this->user_id, 'total_group_count', true );
    752752        if ( !empty( $group_count ) )
    753             update_usermeta( $this->user_id, 'total_group_count', (int)$group_count - 1 );
     753            update_user_meta( $this->user_id, 'total_group_count', (int)$group_count - 1 );
    754754
    755755        return $this->save();
     
    763763
    764764        groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) + 1 ) );
    765         update_usermeta( $this->user_id, 'total_group_count', (int)get_usermeta( $this->user_id, 'total_group_count' ) + 1 );
     765        update_user_meta( $this->user_id, 'total_group_count', (int)get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
    766766
    767767        return $this->save();
  • branches/1.2/bp-groups/bp-groups-notifications.php

    r2719 r3145  
    55
    66    $group = new BP_Groups_Group( $group_id );
    7     $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . __( 'Group Details Updated', 'buddypress' );
     7    $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . __( 'Group Details Updated', 'buddypress' );
    88
    99    $user_ids = BP_Groups_Member::get_group_member_ids( $group->id );
    1010    foreach ( (array)$user_ids as $user_id ) {
    11         if ( 'no' == get_usermeta( $user_id, 'notification_groups_group_updated' ) ) continue;
     11        if ( 'no' == get_user_meta( $user_id, 'notification_groups_group_updated', true ) ) continue;
    1212
    1313        $ud = bp_core_get_core_userdata( $user_id );
     
    4545    bp_core_add_notification( $requesting_user_id, $admin_id, 'groups', 'new_membership_request', $group_id );
    4646
    47     if ( 'no' == get_usermeta( $admin_id, 'notification_groups_membership_request' ) )
     47    if ( 'no' == get_user_meta( $admin_id, 'notification_groups_membership_request', true ) )
    4848        return false;
    4949
     
    6060    // Set up and send the message
    6161    $to = $ud->user_email;
    62     $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), $group->name );
     62    $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), $group->name );
    6363
    6464$message = sprintf( __(
     
    9494        bp_core_add_notification( $group_id, $requesting_user_id, 'groups', 'membership_request_rejected' );
    9595
    96     if ( 'no' == get_usermeta( $requesting_user_id, 'notification_membership_request_completed' ) )
     96    if ( 'no' == get_user_meta( $requesting_user_id, 'notification_membership_request_completed', true ) )
    9797        return false;
    9898
     
    108108
    109109    if ( $accepted ) {
    110         $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name );
     110        $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name );
    111111        $message = sprintf( __(
    112112'Your membership request for the group "%s" has been accepted.
     
    118118
    119119    } else {
    120         $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), $group->name );
     120        $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), $group->name );
    121121        $message = sprintf( __(
    122122'Your membership request for the group "%s" has been rejected.
     
    152152    bp_core_add_notification( $group_id, $user_id, 'groups', $type );
    153153
    154     if ( 'no' == get_usermeta( $user_id, 'notification_groups_admin_promotion' ) )
     154    if ( 'no' == get_user_meta( $user_id, 'notification_groups_admin_promotion', true ) )
    155155        return false;
    156156
     
    164164    $to = $ud->user_email;
    165165
    166     $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), $group->name );
     166    $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), $group->name );
    167167
    168168    $message = sprintf( __(
     
    200200        bp_core_add_notification( $group->id, $invited_user_id, 'groups', 'group_invite' );
    201201
    202         if ( 'no' == get_usermeta( $invited_user_id, 'notification_groups_invite' ) )
     202        if ( 'no' == get_user_meta( $invited_user_id, 'notification_groups_invite', true ) )
    203203            return false;
    204204
     
    212212        $to = $invited_ud->user_email;
    213213
    214         $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name );
     214        $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name );
    215215
    216216        $message = sprintf( __(
     
    259259
    260260        // Now email the user with the contents of the message (if they have enabled email notifications)
    261         if ( 'no' != get_usermeta( $user_id, 'notification_activity_new_mention' ) ) {
     261        if ( 'no' != get_user_meta( $user_id, 'notification_activity_new_mention', true ) ) {
    262262            $poster_name = bp_core_get_user_displayname( $poster_user_id );
    263263
     
    271271            $ud = bp_core_get_core_userdata( $receiver_user_id );
    272272            $to = $ud->user_email;
    273             $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( '%s mentioned you in the group "%s"', 'buddypress' ), $poster_name, $group->name );
     273            $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( '%s mentioned you in the group "%s"', 'buddypress' ), $poster_name, $group->name );
    274274
    275275$message = sprintf( __(
  • branches/1.2/bp-messages.php

    r3142 r3145  
    250250                <td></td>
    251251                <td><?php _e( 'A member sends you a new message', 'buddypress' ) ?></td>
    252                 <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>
    253                 <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>
     252                <td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_messages_new_message', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_messages_new_message', true ) ) { ?>checked="checked" <?php } ?>/></td>
     253                <td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_messages_new_message', true ) ) { ?>checked="checked" <?php } ?>/></td>
    254254            </tr>
    255255            <tr>
    256256                <td></td>
    257257                <td><?php _e( 'A new site notice is posted', 'buddypress' ) ?></td>
    258                 <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>
    259                 <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>
     258                <td class="yes"><input type="radio" name="notifications[notification_messages_new_notice]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_messages_new_notice', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_messages_new_notice', true ) ) { ?>checked="checked" <?php } ?>/></td>
     259                <td class="no"><input type="radio" name="notifications[notification_messages_new_notice]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_messages_new_notice', true ) ) { ?>checked="checked" <?php } ?>/></td>
    260260            </tr>
    261261
  • branches/1.2/bp-messages/bp-messages-classes.php

    r3142 r3145  
    402402        $wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_notices} SET is_active = 0 WHERE id != %d", $id ) );
    403403
    404         update_usermeta( $bp->loggedin_user->id, 'last_activity', date( 'Y-m-d H:i:s' ) );
     404        update_user_meta( $bp->loggedin_user->id, 'last_activity', date( 'Y-m-d H:i:s' ) );
    405405
    406406        do_action( 'messages_notice_after_save', $this );
  • branches/1.2/bp-messages/bp-messages-notifications.php

    r2871 r3145  
    88
    99    foreach( $recipients as $recipient ) {
    10         if ( $sender_id == $recipient->user_id || 'no' == get_usermeta( $recipient->user_id, 'notification_messages_new_message' ) ) continue;
     10        if ( $sender_id == $recipient->user_id || 'no' == get_user_meta( $recipient->user_id, 'notification_messages_new_message', true ) ) continue;
    1111
    1212        $ud = get_userdata( $recipient->user_id );
     
    2020        // Set up and send the message
    2121        $email_to = $ud->user_email;
    22         $email_subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), $sender_name );
     22        $email_subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), $sender_name );
    2323
    2424        $email_content = sprintf( __(
  • branches/1.2/bp-messages/bp-messages-templatetags.php

    r3134 r3145  
    273273        global $messages_template;
    274274
    275         return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( strtotime( $messages_template->thread->last_message_date ) ) );
     275        return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( get_date_from_gmt( $messages_template->thread->last_message_date, 'U' ) ) );
    276276    }
    277277
     
    457457        return false;
    458458
    459     $closed_notices = get_usermeta( $userdata->ID, 'closed_notices' );
     459    $closed_notices = get_user_meta( $userdata->ID, 'closed_notices', true );
    460460
    461461    if ( !$closed_notices )
  • branches/1.2/bp-themes/bp-default/_inc/ajax.php

    r3143 r3145  
    443443        echo "-1<div id='message' class='error'><p>" . __('There was a problem closing the notice.', 'buddypress') . '</p></div>';
    444444    } else {
    445         $notice_ids = get_usermeta( $userdata->ID, 'closed_notices' );
     445        $notice_ids = get_user_meta( $userdata->ID, 'closed_notices', true );
    446446
    447447        $notice_ids[] = (int) $_POST['notice_id'];
    448448
    449         update_usermeta( $userdata->ID, 'closed_notices', $notice_ids );
     449        update_user_meta( $userdata->ID, 'closed_notices', $notice_ids );
    450450    }
    451451}
  • branches/1.2/bp-xprofile.php

    r3143 r3145  
    909909    }
    910910
    911     update_usermeta( $user_id, 'nickname', $fullname );
    912     update_usermeta( $user_id, 'first_name', $firstname );
    913     update_usermeta( $user_id, 'last_name', $lastname );
     911    update_user_meta( $user_id, 'nickname', $fullname );
     912    update_user_meta( $user_id, 'first_name', $firstname );
     913    update_user_meta( $user_id, 'last_name', $lastname );
    914914
    915915    $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) );
     
    963963 * @package BuddyPress XProfile
    964964 * @param $user_id The ID of the deleted user
    965  * @uses get_usermeta() Get a user meta value based on meta key from wp_usermeta
    966  * @uses delete_usermeta() Delete user meta value based on meta key from wp_usermeta
     965 * @uses get_user_meta() Get a user meta value based on meta key from wp_usermeta
     966 * @uses delete_user_meta() Delete user meta value based on meta key from wp_usermeta
    967967 * @uses delete_data_for_user() Removes all profile data from the xprofile tables for the user
    968968 */
     
    971971
    972972    // delete any avatar files.
    973     @unlink( get_usermeta( $user_id, 'bp_core_avatar_v1_path' ) );
    974     @unlink( get_usermeta( $user_id, 'bp_core_avatar_v2_path' ) );
     973    @unlink( get_user_meta( $user_id, 'bp_core_avatar_v1_path', true ) );
     974    @unlink( get_user_meta( $user_id, 'bp_core_avatar_v2_path', true ) );
    975975
    976976    // unset the usermeta for avatars from the usermeta table.
    977     delete_usermeta( $user_id, 'bp_core_avatar_v1' );
    978     delete_usermeta( $user_id, 'bp_core_avatar_v1_path' );
    979     delete_usermeta( $user_id, 'bp_core_avatar_v2' );
    980     delete_usermeta( $user_id, 'bp_core_avatar_v2_path' );
     977    delete_user_meta( $user_id, 'bp_core_avatar_v1' );
     978    delete_user_meta( $user_id, 'bp_core_avatar_v1_path' );
     979    delete_user_meta( $user_id, 'bp_core_avatar_v2' );
     980    delete_user_meta( $user_id, 'bp_core_avatar_v2_path' );
    981981}
    982982add_action( 'wpmu_delete_user', 'xprofile_remove_data' );
  • branches/1.2/bp-xprofile/bp-xprofile-templatetags.php

    r3143 r3145  
    647647        global $bp;
    648648
    649         $last_updated = get_usermeta( $bp->displayed_user->id, 'profile_last_updated' );
     649        $last_updated = get_user_meta( $bp->displayed_user->id, 'profile_last_updated', true );
    650650
    651651        if ( $last_updated )
Note: See TracChangeset for help on using the changeset viewer.