Changeset 6189
- Timestamp:
- 12/27/2016 11:57:33 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/tools.php
r6188 r6189 2229 2229 $changed = $total = 0; 2230 2230 $key = $bbp_db->prefix . '_bbp_favorites'; 2231 $favorites = $bbp_db->get_ col( "SELECT * FROM {$bbp_db->usermeta} WHERE meta_key = '{$key}'" );2231 $favorites = $bbp_db->get_results( "SELECT * FROM {$bbp_db->usermeta} WHERE meta_key = '{$key}'" ); 2232 2232 2233 2233 // Bail if no closed topics found … … 2237 2237 2238 2238 // Loop through each user's favorites 2239 foreach ( $favorites as $meta _id => $meta) {2239 foreach ( $favorites as $meta ) { 2240 2240 2241 2241 // Get post IDs … … 2248 2248 2249 2249 // Skip if already exists 2250 if ( $bbp_db->get_var( $bbp_db->prepare( "SELECT COUNT(*) FROM {$bbp_db->postmeta} WHERE post_id = %d AND meta_key = %s AND meta_value = %d" ), $post_id, '_bbp_favorite', $meta->user_id) ) {2250 if ( $bbp_db->get_var( $bbp_db->prepare( "SELECT COUNT(*) FROM {$bbp_db->postmeta} WHERE post_id = %d AND meta_key = %s AND meta_value = %d", $post_id, '_bbp_favorite', $meta->user_id ) ) ) { 2251 2251 continue; 2252 2252 } … … 2264 2264 // Delete user meta if everything was copied successfully 2265 2265 if ( $changed === $to_change ) { 2266 delete_metadata_by_mid( 'user', $meta_id );2266 //delete_metadata_by_mid( 'user', $meta->umeta_id ); 2267 2267 } 2268 2268 } … … 2292 2292 $changed = $total = 0; 2293 2293 $key = $bbp_db->prefix . '_bbp_subscriptions'; 2294 $subscriptions = $bbp_db->get_ col( "SELECT * FROM {$bbp_db->usermeta} WHERE meta_key = '{$key}'" );2294 $subscriptions = $bbp_db->get_results( "SELECT * FROM {$bbp_db->usermeta} WHERE meta_key = '{$key}'" ); 2295 2295 2296 2296 // Bail if no closed topics found … … 2300 2300 2301 2301 // Loop through each user's favorites 2302 foreach ( $subscriptions as $meta _id => $meta) {2302 foreach ( $subscriptions as $meta ) { 2303 2303 2304 2304 // Get post IDs … … 2311 2311 2312 2312 // Skip if already exists 2313 if ( $bbp_db->get_var( $bbp_db->prepare( "SELECT COUNT(*) FROM {$bbp_db->postmeta} WHERE post_id = %d AND meta_key = %s AND meta_value = %d" ), $post_id, '_bbp_subscription', $meta->user_id) ) {2313 if ( $bbp_db->get_var( $bbp_db->prepare( "SELECT COUNT(*) FROM {$bbp_db->postmeta} WHERE post_id = %d AND meta_key = %s AND meta_value = %d", $post_id, '_bbp_subscription', $meta->user_id ) ) ) { 2314 2314 continue; 2315 2315 } … … 2327 2327 // Delete user meta if everything was copied successfully 2328 2328 if ( $changed === $to_change ) { 2329 delete_metadata_by_mid( 'user', $meta_id );2329 //delete_metadata_by_mid( 'user', $meta->umeta_id ); 2330 2330 } 2331 2331 }
Note: See TracChangeset
for help on using the changeset viewer.