[wp-forums] topic count off for sub forum

mrmist listswptesters at mist.org.uk
Sun Aug 1 15:33:57 UTC 2010


In message
<AANLkTins6S-xTtdhv3o3dipnEZcdvIg_7I-NymnYPuZ8 at mail.gmail.com>, mrmist
<listswpforums at mist.org.uk> writes
>I've checked this on my local test install, and it appears to be caused
>when a single-post topic that has been marked as spam through bozoing
>is deleted.  The topic count then goes down by one, even though the count
>didn't include said topic to begin with.
>


I don't follow the bbpress code much, but if I had to guess I'd point to
this as the culprit in bb_delete_post

if ( 0 == $old_status ) {
                        bb_update_topicmeta( $topic_id, 'deleted_posts',
$topic->deleted_posts + 1 );
                        $bbdb->query( $bbdb->prepare( "UPDATE
$bbdb->forums SET posts = posts - 1 WHERE forum_id = %d",
$topic->forum_id ) );
                } else if ( 0 == $new_status ) {
                        bb_update_topicmeta( $topic_id, 'deleted_posts',
$topic->deleted_posts - 1 );
                        $bbdb->query( $bbdb->prepare( "UPDATE
$bbdb->forums SET posts = posts + 1 WHERE forum_id = %d",
$topic->forum_id ) );
                }

Since there's nothing there to handle status 2, for spam.


-- 
mrmist


More information about the wp-forums mailing list