Support Forum
It's hard for me to test but I think I have this right! The following change will alter the listing based on the last post in a topic instead of the first as you suggest and which I agree is better...
You will need to edit two files:
(1) wp-content/sp-resources/forum-plugins/prune-db/admin/sp-prune-db-admin-prune.php
Quite near the top you will find this code:
$sql = "SELECT * FROM ".SFTOPICS. " WHERE topic_date <= '".$date."'".$forum_id. " ORDER BY topic_date, forum_id ASC";
Change it for the following code:
$sql = "SELECT * FROM ".SFTOPICS." JOIN ".SFPOSTS." ON ".SFTOPICS.".post_id = ".SFPOSTS.".post_id WHERE ".SFPOSTS.".post_date <= '".$date."'".$forum_id. " ORDER BY ".SFPOSTS.".post_date, ".SFTOPICS.".forum_id ASC";
which should then display a corrected topic listing. It would be wise to actually just test this against known data to ensure it is correct but I believe it to be so.
(2) wp-content/sp-resources/forum-plugins/prune-db/library/sp-prune-db-components.php
At line 69 you will find this block of code:
if ($first) { $forum_ids = ' AND (forum_id='.sp_esc_int($_POST['group'.$x.'forum'.$y]); $first = false; } else { $forum_ids .= ' OR forum_id='.sp_esc_int($_POST['group'.$x.'forum'.$y]); }
change it to:
if ($first) { $forum_ids = ' AND ('.SFTOPICS.'.forum_id='.sp_esc_int($_POST['group'.$x.'forum'.$y]); $first = false; } else { $forum_ids .= ' OR '.SFTOPICS.'.forum_id='.sp_esc_int($_POST['group'.$x.'forum'.$y]); }
As stated - this does nothing for the batching into smaller chunks. I would suggest no more than, say, 100 topics at a time but this value will differ for everyone.
YELLOW
SWORDFISH
|
Yellow Swordfish said
What? 10620? Oh my. I need to think about that one! We might need to devise a SQL script for something like that. Let me ponder for a while.
heh... what can I say.. people like to chat LOL
After a few threads got that long we started locking them down and starting new ones but there's half a dozen like that
1 Guest(s)