2012-03-16, 06:40 AM
I am working over making a plugin, in which the plugin deletes specific user's posts and threads.
Everything goes smooth, but it causes a bug. On the index forum listing page and the sub-forum listing (if any sub-forums are there) it does not update the threads and post's accurate count and also keeps on showing last post by usernamehere whereas there is no posts only.
For example, if FORUM A has 3 threads and after my query is ran, 1 thread is deleted so there are 2 left, but on index page, that count won't be updated, it would still show as if there are 3 threads.
See this screenshot:
http://img688.imageshack.us/img688/8238/...7809c5.png
It shows there are 3 threads, whereas when entering the forum, there is not a single thread or post there:
http://i.imgur.com/0aa32.png
I checked the db table mybb_forums which only shows the remaining last post by that test4 guy. So the thing is, how to rebuild that mybb_forums table so that the statistics are updated.
Just like we use rebuild_settings() after activating or deactivating plugin, is there any $db->query for it?
And btw, I tried using optimize query, but no effect.
Also ran recount and rebuild manually to check whether its a problem which could be solved by it, but nope, no effect.
Any solution?
Thank you.
Everything goes smooth, but it causes a bug. On the index forum listing page and the sub-forum listing (if any sub-forums are there) it does not update the threads and post's accurate count and also keeps on showing last post by usernamehere whereas there is no posts only.
For example, if FORUM A has 3 threads and after my query is ran, 1 thread is deleted so there are 2 left, but on index page, that count won't be updated, it would still show as if there are 3 threads.
See this screenshot:
http://img688.imageshack.us/img688/8238/...7809c5.png
It shows there are 3 threads, whereas when entering the forum, there is not a single thread or post there:
http://i.imgur.com/0aa32.png
I checked the db table mybb_forums which only shows the remaining last post by that test4 guy. So the thing is, how to rebuild that mybb_forums table so that the statistics are updated.
Just like we use rebuild_settings() after activating or deactivating plugin, is there any $db->query for it?
And btw, I tried using optimize query, but no effect.
Also ran recount and rebuild manually to check whether its a problem which could be solved by it, but nope, no effect.
Any solution?
Thank you.