Skip to:
Content

bbPress.org

Changeset 2073


Ignore:
Timestamp:
05/09/2009 08:56:25 AM (17 years ago)
Author:
sambauers
Message:

Extra cache flushing.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-admin/includes/functions.bb-admin.php

    r2069 r2073  
    646646
    647647    $return = $bbdb->query( $bbdb->prepare( "DELETE FROM $bbdb->forums WHERE forum_id = %d", $forum_id ) );
     648
     649    wp_cache_flush( 'bb_post' );
    648650
    649651    if ( $topic_ids )
     
    794796    $topic_ids = $bbdb->get_col( $bbdb->prepare( "SELECT topic_id FROM $bbdb->topics WHERE forum_id = %d", $from_forum_id ) );
    795797    $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
    796801    if ( $topic_ids )
    797802        foreach ( $topic_ids as $topic_id ) {
  • trunk/bb-admin/includes/functions.bb-upgrade.php

    r2011 r2073  
    4848
    4949    bb_update_db_version();
     50    wp_cache_flush();
    5051
    5152    $bb_upgrade['messages'] = array_filter($bb_upgrade['messages']);
  • trunk/bb-includes/functions.bb-posts.php

    r2062 r2073  
    268268    if ( $update ) {
    269269        $bbdb->update( $bbdb->posts, compact( $fields ), compact( 'post_id' ) );
     270        wp_cache_delete( $post_id, 'bb_post' );
    270271    } else {
    271272        $bbdb->insert( $bbdb->posts, compact( $fields ) );
     
    299300    wp_cache_delete( $forum_id, 'bb_forum' );
    300301    wp_cache_flush( 'bb_forums' );
     302    wp_cache_flush( 'bb_query' );
    301303
    302304    if ( $update ) // fire actions after cache is flushed
     
    332334    $posts = get_thread( $topic_id, array( 'per_page' => '-1' ) );
    333335    if ( $posts ) {
    334         foreach ( $posts as $i => $post )
     336        foreach ( $posts as $i => $post ) {
    335337            $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        }
    336340        wp_cache_delete( $topic_id, 'bb_thread' );
     341        wp_cache_flush( 'bb_query' );
    337342        return true;
    338343    } else {
     
    385390        wp_cache_delete( $topic_id, 'bb_thread' );
    386391        wp_cache_flush( 'bb_forums' );
     392        wp_cache_flush( 'bb_query' );
    387393        do_action( 'bb_delete_post', $post_id, $new_status, $old_status );
    388394        return $post_id;
     
    397403    $post_status = (int) $post_status;
    398404    $bbdb->update( $bbdb->posts, compact( 'post_status' ), compact( 'post_id' ) );
     405    wp_cache_delete( $post_id, 'bb_post' );
    399406}
    400407
  • trunk/bb-includes/functions.bb-topics.php

    r2040 r2073  
    212212        if ( in_array( 'topic_slug', $fields ) )
    213213            wp_cache_delete( $topic->topic_slug, 'bb_topic_slug' );
     214        wp_cache_flush( 'bb_query' );
    214215        do_action( 'bb_update_topic', $topic_id );
    215216    } else {
     
    219220        wp_cache_delete( $forum_id, 'bb_forum' );
    220221        wp_cache_flush( 'bb_forums' );
     222        wp_cache_flush( 'bb_query' );
    221223        do_action( 'bb_new_topic', $topic_id );
    222224    }
     
    307309        wp_cache_delete( $topic->topic_slug, 'bb_topic_slug' );
    308310        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' );
    309314        return $topic_id;
    310315    } else {
     
    329334            "UPDATE $bbdb->forums SET topics = topics - 1, posts = posts - %d WHERE forum_id = %d", $topic->topic_posts, $topic->forum_id
    330335        ) );
     336        wp_cache_flush( 'bb_post' );
    331337        wp_cache_delete( $topic_id, 'bb_topic' );
    332338        wp_cache_delete( $forum_id, 'bb_forum' );
    333339        wp_cache_flush( 'bb_forums' );
     340        wp_cache_flush( 'bb_query' );
    334341        return $forum_id;
    335342    }
     
    344351    ) );
    345352    $old_poster = bb_get_user( $old_post->poster_id );
     353    wp_cache_delete( $topic_id, 'bb_topic' );
    346354    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}
    348356
    349357function bb_close_topic( $topic_id ) {
  • trunk/bb-includes/functions.bb-users.php

    r2057 r2073  
    4545        $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 ) );
    4646        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' );
    4751    }
    4852
Note: See TracChangeset for help on using the changeset viewer.