Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/11/2012 09:32:04 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Breathing room for cast variables.

File:
1 edited

Legend:

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

    r5705 r5729  
    8080
    8181    if ( $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ) ) {
    82         foreach( (array)$usernames as $username ) {
     82        foreach( (array) $usernames as $username ) {
    8383            if ( bp_is_username_compatibility_mode() )
    8484                $user_id = username_exists( $username );
     
    105105                default :
    106106                    if ( !in_array( $activity_id, $new_mentions ) ) {
    107                         $new_mentions[] = (int)$activity_id;
     107                        $new_mentions[] = (int) $activity_id;
    108108                    }
    109109                    break;
     
    149149            $at_mention_title = sprintf( __( '@%s Mentions', 'buddypress' ), bp_get_loggedin_user_username() );
    150150
    151             if ( (int)$total_items > 1 ) {
     151            if ( (int) $total_items > 1 ) {
    152152                $text = sprintf( __( 'You have %1$d new activity mentions', 'buddypress' ), (int) $total_items );
    153153                $filter = 'bp_activity_multiple_at_mentions_notification';
     
    161161
    162162    if ( 'string' == $format ) {
    163         $return = apply_filters( $filter, '<a href="' . $at_mention_link . '" title="' . $at_mention_title . '">' . $text . '</a>', $at_mention_link, (int)$total_items, $activity_id, $poster_user_id );
     163        $return = apply_filters( $filter, '<a href="' . $at_mention_link . '" title="' . $at_mention_title . '">' . $text . '</a>', $at_mention_link, (int) $total_items, $activity_id, $poster_user_id );
    164164    } else {
    165165        $return = apply_filters( $filter, array(
    166166            'text' => $text,
    167167            'link' => $at_mention_link
    168         ), $at_mention_link, (int)$total_items, $activity_id, $poster_user_id );
     168        ), $at_mention_link, (int) $total_items, $activity_id, $poster_user_id );
    169169    }
    170170
     
    289289    // Update the total number of users who have favorited this activity
    290290    $fav_count = bp_activity_get_meta( $activity_id, 'favorite_count' );
    291     $fav_count = !empty( $fav_count ) ? (int)$fav_count + 1 : 1;
     291    $fav_count = !empty( $fav_count ) ? (int) $fav_count + 1 : 1;
    292292
    293293    // Update user meta
     
    349349
    350350        // Deduct from total favorites
    351         if ( bp_activity_update_meta( $activity_id, 'favorite_count', (int)$fav_count - 1 ) ) {
     351        if ( bp_activity_update_meta( $activity_id, 'favorite_count', (int) $fav_count - 1 ) ) {
    352352
    353353            // Update users favorites
     
    527527               
    528528        if ( !empty( $metas ) ) {
    529             $metas = array_map( 'maybe_unserialize', (array)$metas );
     529            $metas = array_map( 'maybe_unserialize', (array) $metas );
    530530           
    531531            foreach( $metas as $mkey => $mvalue ) {
     
    540540
    541541    // Maybe, just maybe... unserialize
    542     $metas = array_map( 'maybe_unserialize', (array)$metas );
     542    $metas = array_map( 'maybe_unserialize', (array) $metas );
    543543
    544544    // Return first item in array if only 1, else return all metas found
     
    819819
    820820    // Attempt to return a cached copy of the first page of sitewide activity.
    821     if ( 1 == (int)$page && empty( $max ) && empty( $search_terms ) && empty( $filter ) && empty( $exclude ) && empty( $in ) && 'DESC' == $sort && empty( $exclude ) && 'ham_only' == $spam ) {
     821    if ( 1 == (int) $page && empty( $max ) && empty( $search_terms ) && empty( $filter ) && empty( $exclude ) && empty( $in ) && 'DESC' == $sort && empty( $exclude ) && 'ham_only' == $spam ) {
    822822        if ( !$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' ) ) {
    823823            $activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden, false, false, $spam );
     
    10341034    // Check to see if the parent activity is hidden, and if so, hide this comment publically.
    10351035    $activity = new BP_Activity_Activity( $activity_id );
    1036     $is_hidden = ( (int)$activity->hide_sitewide ) ? 1 : 0;
     1036    $is_hidden = ( (int) $activity->hide_sitewide ) ? 1 : 0;
    10371037
    10381038    // Insert the activity comment
     
    11551155    $latest_update = bp_get_user_meta( $user_id, 'bp_latest_update', true );
    11561156    if ( !empty( $latest_update ) ) {
    1157         if ( in_array( (int)$latest_update['id'], (array)$activity_ids_deleted ) ) {
     1157        if ( in_array( (int) $latest_update['id'], (array) $activity_ids_deleted ) ) {
    11581158            bp_delete_user_meta( $user_id, 'bp_latest_update' );
    11591159        }
     
    13101310        // Recursively delete all children of this comment.
    13111311        if ( $children = BP_Activity_Activity::get_child_comments( $comment_id ) ) {
    1312             foreach( (array)$children as $child ) {
     1312            foreach( (array) $children as $child ) {
    13131313                bp_activity_delete_children( $activity_id, $child->id );
    13141314            }
     
    14081408            }
    14091409
    1410             $ratio      = (int)$width / (int)$height;
    1411             $new_height = (int)$height >= 100 ? 100 : $height;
     1410            $ratio      = (int) $width / (int) $height;
     1411            $new_height = (int) $height >= 100 ? 100 : $height;
    14121412            $new_width  = $new_height * $ratio;
    14131413
Note: See TracChangeset for help on using the changeset viewer.