k4is3r
07-27-2003, 11:58 PM
Hi all,
some forums in my board are too big and containing many threads that i have to delete.
The problem is this: i want to delete all the posts and the threads but i would like that this not affect the "article counter" of my board.
The counter uses the FireFly hack posted on vb.org here https://vborg.vbsupport.ru/showthread.php?s=&threadid=33811 and the piece of code for count the thread in a certain forum is this:$getpostids=$DB_site->query("
SELECT post.postid,post.userid AS postuserid FROM post
WHERE post.threadid='$threadid' AND post.visible=1
ORDER BY dateline $postorder LIMIT ".($limitlower-1).",$perpage
");
if ($limitupper>$totalposts) {
$limitupper=$totalposts;
if ($limitlower>$totalposts) {
$limitlower=$totalposts-$perpage;
}
}
if ($limitlower<=0) {
$limitlower=1;
}
$postids="post.postid IN (0";
$hackuserids="(0";
while ($post=$DB_site->fetch_array($getpostids)) {
$postids.=",".$post['postid'];
$hackuserids.=",".$post['postuserid'];
}
$postids.=")";
$hackuserids.=")";
$hacks=array();
$hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM thread WHERE forumid IN (13,14,15,16,20,21,23,24,25,26,27,49,59,46,77,78,7 9,80,81,72,74) AND postuserid IN $hackuserids GROUP BY postuserid");
while ($hackcount=$DB_site->fetch_array($hackcounts)) {
if (!isset($hackcount[totalhacks]))
$hackcount[totalhacks]=0;
$hacks["$hackcount[postuserid]"]=$hackcount[totalhacks];
}
$hacks[0]=0;
Now my question is: what are the queries to delete all posts and the threads and not reduce the counter?
thank you very much in appreciate :smoke:
some forums in my board are too big and containing many threads that i have to delete.
The problem is this: i want to delete all the posts and the threads but i would like that this not affect the "article counter" of my board.
The counter uses the FireFly hack posted on vb.org here https://vborg.vbsupport.ru/showthread.php?s=&threadid=33811 and the piece of code for count the thread in a certain forum is this:$getpostids=$DB_site->query("
SELECT post.postid,post.userid AS postuserid FROM post
WHERE post.threadid='$threadid' AND post.visible=1
ORDER BY dateline $postorder LIMIT ".($limitlower-1).",$perpage
");
if ($limitupper>$totalposts) {
$limitupper=$totalposts;
if ($limitlower>$totalposts) {
$limitlower=$totalposts-$perpage;
}
}
if ($limitlower<=0) {
$limitlower=1;
}
$postids="post.postid IN (0";
$hackuserids="(0";
while ($post=$DB_site->fetch_array($getpostids)) {
$postids.=",".$post['postid'];
$hackuserids.=",".$post['postuserid'];
}
$postids.=")";
$hackuserids.=")";
$hacks=array();
$hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM thread WHERE forumid IN (13,14,15,16,20,21,23,24,25,26,27,49,59,46,77,78,7 9,80,81,72,74) AND postuserid IN $hackuserids GROUP BY postuserid");
while ($hackcount=$DB_site->fetch_array($hackcounts)) {
if (!isset($hackcount[totalhacks]))
$hackcount[totalhacks]=0;
$hacks["$hackcount[postuserid]"]=$hackcount[totalhacks];
}
$hacks[0]=0;
Now my question is: what are the queries to delete all posts and the threads and not reduce the counter?
thank you very much in appreciate :smoke: