Changeset 2073
- Timestamp:
- 05/09/2009 08:56:25 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
bb-admin/includes/functions.bb-admin.php (modified) (2 diffs)
-
bb-admin/includes/functions.bb-upgrade.php (modified) (1 diff)
-
bb-includes/functions.bb-posts.php (modified) (5 diffs)
-
bb-includes/functions.bb-topics.php (modified) (5 diffs)
-
bb-includes/functions.bb-users.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-admin/includes/functions.bb-admin.php
r2069 r2073 646 646 647 647 $return = $bbdb->query( $bbdb->prepare( "DELETE FROM $bbdb->forums WHERE forum_id = %d", $forum_id ) ); 648 649 wp_cache_flush( 'bb_post' ); 648 650 649 651 if ( $topic_ids ) … … 794 796 $topic_ids = $bbdb->get_col( $bbdb->prepare( "SELECT topic_id FROM $bbdb->topics WHERE forum_id = %d", $from_forum_id ) ); 795 797 $return = $bbdb->update( $bbdb->topics, array( 'forum_id' => $to_forum_id ), array( 'forum_id' => $from_forum_id ) ); 798 799 wp_cache_flush( 'bb_post' ); 800 796 801 if ( $topic_ids ) 797 802 foreach ( $topic_ids as $topic_id ) { -
trunk/bb-admin/includes/functions.bb-upgrade.php
r2011 r2073 48 48 49 49 bb_update_db_version(); 50 wp_cache_flush(); 50 51 51 52 $bb_upgrade['messages'] = array_filter($bb_upgrade['messages']); -
trunk/bb-includes/functions.bb-posts.php
r2062 r2073 268 268 if ( $update ) { 269 269 $bbdb->update( $bbdb->posts, compact( $fields ), compact( 'post_id' ) ); 270 wp_cache_delete( $post_id, 'bb_post' ); 270 271 } else { 271 272 $bbdb->insert( $bbdb->posts, compact( $fields ) ); … … 299 300 wp_cache_delete( $forum_id, 'bb_forum' ); 300 301 wp_cache_flush( 'bb_forums' ); 302 wp_cache_flush( 'bb_query' ); 301 303 302 304 if ( $update ) // fire actions after cache is flushed … … 332 334 $posts = get_thread( $topic_id, array( 'per_page' => '-1' ) ); 333 335 if ( $posts ) { 334 foreach ( $posts as $i => $post ) 336 foreach ( $posts as $i => $post ) { 335 337 $bbdb->query( $bbdb->prepare( "UPDATE $bbdb->posts SET post_position = %d WHERE post_id = %d", $i + 1, $post->post_id ) ); 338 wp_cache_delete( (int) $post->post_id, 'bb_post' ); 339 } 336 340 wp_cache_delete( $topic_id, 'bb_thread' ); 341 wp_cache_flush( 'bb_query' ); 337 342 return true; 338 343 } else { … … 385 390 wp_cache_delete( $topic_id, 'bb_thread' ); 386 391 wp_cache_flush( 'bb_forums' ); 392 wp_cache_flush( 'bb_query' ); 387 393 do_action( 'bb_delete_post', $post_id, $new_status, $old_status ); 388 394 return $post_id; … … 397 403 $post_status = (int) $post_status; 398 404 $bbdb->update( $bbdb->posts, compact( 'post_status' ), compact( 'post_id' ) ); 405 wp_cache_delete( $post_id, 'bb_post' ); 399 406 } 400 407 -
trunk/bb-includes/functions.bb-topics.php
r2040 r2073 212 212 if ( in_array( 'topic_slug', $fields ) ) 213 213 wp_cache_delete( $topic->topic_slug, 'bb_topic_slug' ); 214 wp_cache_flush( 'bb_query' ); 214 215 do_action( 'bb_update_topic', $topic_id ); 215 216 } else { … … 219 220 wp_cache_delete( $forum_id, 'bb_forum' ); 220 221 wp_cache_flush( 'bb_forums' ); 222 wp_cache_flush( 'bb_query' ); 221 223 do_action( 'bb_new_topic', $topic_id ); 222 224 } … … 307 309 wp_cache_delete( $topic->topic_slug, 'bb_topic_slug' ); 308 310 wp_cache_delete( $topic_id, 'bb_thread' ); 311 wp_cache_delete( $topic->forum_id, 'bb_forum' ); 312 wp_cache_flush( 'bb_forums' ); 313 wp_cache_flush( 'bb_query' ); 309 314 return $topic_id; 310 315 } else { … … 329 334 "UPDATE $bbdb->forums SET topics = topics - 1, posts = posts - %d WHERE forum_id = %d", $topic->topic_posts, $topic->forum_id 330 335 ) ); 336 wp_cache_flush( 'bb_post' ); 331 337 wp_cache_delete( $topic_id, 'bb_topic' ); 332 338 wp_cache_delete( $forum_id, 'bb_forum' ); 333 339 wp_cache_flush( 'bb_forums' ); 340 wp_cache_flush( 'bb_query' ); 334 341 return $forum_id; 335 342 } … … 344 351 ) ); 345 352 $old_poster = bb_get_user( $old_post->poster_id ); 353 wp_cache_delete( $topic_id, 'bb_topic' ); 346 354 return $bbdb->update( $bbdb->topics, array( 'topic_time' => $old_post->post_time, 'topic_last_poster' => $old_post->poster_id, 'topic_last_poster_name' => $old_poster->login_name, 'topic_last_post_id' => $old_post->post_id ), compact( 'topic_id' ) ); 347 } 355 } 348 356 349 357 function bb_close_topic( $topic_id ) { -
trunk/bb-includes/functions.bb-users.php
r2057 r2073 45 45 $bbdb->update( $bbdb->topics, array( 'topic_last_poster' => $new_user->ID, 'topic_last_poster_name' => $new_user->user_login ), array( 'topic_last_poster' => $user->ID ) ); 46 46 bb_update_topics_replied( $new_user->ID ); 47 wp_cache_flush( 'bb_post' ); 48 wp_cache_flush( 'bb_thread' ); 49 wp_cache_flush( 'bb_topic_tag' ); 50 wp_cache_flush( 'bb_topic' ); 47 51 } 48 52
Note: See TracChangeset
for help on using the changeset viewer.