vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Mysql queries to delete some records![help specially for FireFly] (https://vborg.vbsupport.ru/showthread.php?t=55669)

k4is3r 07-27-2003 11:58 PM

Mysql queries to delete some records![help specially for FireFly]
 
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/showthrea...threadid=33811 and the piece of code for count the thread in a certain forum is this:
PHP Code:

$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,79,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:

Xenon 07-28-2003 09:54 AM

not possible as the counter is calculated dynamically regarding the db.

all you can do is a very bad workaround to move all hackthreads to a special forum and then include that forum to the counter, but delete all posts in this threads...


All times are GMT. The time now is 08:40 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01169 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete