Changeset 5729 for trunk/bp-activity/bp-activity-functions.php
- Timestamp:
- 02/11/2012 09:32:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-functions.php
r5705 r5729 80 80 81 81 if ( $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ) ) { 82 foreach( (array) $usernames as $username ) {82 foreach( (array) $usernames as $username ) { 83 83 if ( bp_is_username_compatibility_mode() ) 84 84 $user_id = username_exists( $username ); … … 105 105 default : 106 106 if ( !in_array( $activity_id, $new_mentions ) ) { 107 $new_mentions[] = (int) $activity_id;107 $new_mentions[] = (int) $activity_id; 108 108 } 109 109 break; … … 149 149 $at_mention_title = sprintf( __( '@%s Mentions', 'buddypress' ), bp_get_loggedin_user_username() ); 150 150 151 if ( (int) $total_items > 1 ) {151 if ( (int) $total_items > 1 ) { 152 152 $text = sprintf( __( 'You have %1$d new activity mentions', 'buddypress' ), (int) $total_items ); 153 153 $filter = 'bp_activity_multiple_at_mentions_notification'; … … 161 161 162 162 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 ); 164 164 } else { 165 165 $return = apply_filters( $filter, array( 166 166 'text' => $text, 167 167 '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 ); 169 169 } 170 170 … … 289 289 // Update the total number of users who have favorited this activity 290 290 $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; 292 292 293 293 // Update user meta … … 349 349 350 350 // 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 ) ) { 352 352 353 353 // Update users favorites … … 527 527 528 528 if ( !empty( $metas ) ) { 529 $metas = array_map( 'maybe_unserialize', (array) $metas );529 $metas = array_map( 'maybe_unserialize', (array) $metas ); 530 530 531 531 foreach( $metas as $mkey => $mvalue ) { … … 540 540 541 541 // Maybe, just maybe... unserialize 542 $metas = array_map( 'maybe_unserialize', (array) $metas );542 $metas = array_map( 'maybe_unserialize', (array) $metas ); 543 543 544 544 // Return first item in array if only 1, else return all metas found … … 819 819 820 820 // 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 ) { 822 822 if ( !$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' ) ) { 823 823 $activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden, false, false, $spam ); … … 1034 1034 // Check to see if the parent activity is hidden, and if so, hide this comment publically. 1035 1035 $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; 1037 1037 1038 1038 // Insert the activity comment … … 1155 1155 $latest_update = bp_get_user_meta( $user_id, 'bp_latest_update', true ); 1156 1156 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 ) ) { 1158 1158 bp_delete_user_meta( $user_id, 'bp_latest_update' ); 1159 1159 } … … 1310 1310 // Recursively delete all children of this comment. 1311 1311 if ( $children = BP_Activity_Activity::get_child_comments( $comment_id ) ) { 1312 foreach( (array) $children as $child ) {1312 foreach( (array) $children as $child ) { 1313 1313 bp_activity_delete_children( $activity_id, $child->id ); 1314 1314 } … … 1408 1408 } 1409 1409 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; 1412 1412 $new_width = $new_height * $ratio; 1413 1413
Note: See TracChangeset
for help on using the changeset viewer.