vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Delete all but 1st post (https://vborg.vbsupport.ru/showthread.php?t=212596)

Stagehandspace 05-01-2009 04:09 AM

Delete all but 1st post
 
Title says it all really but anyway...

I wish to do a clean up of my forum as I have lots of pointless "thank you" spam posts
so my question is how can I delete all posts in the forums except for the first one

ie: the thread starter

Im guessing an sql quiry would do do the trick but I have no knowledge of sql coding...

any help is appreciated...:)

nando99 05-01-2009 04:09 PM

why not copy the thread some where and delete everything and then just post it again...

or you can use the inline moderation to delete all posts except the one u want...

Reeve of shinra 05-01-2009 06:34 PM

Could be annoying if you had to that with a few hundred threads.

Lynne 05-01-2009 07:12 PM

Looks like you could go through each post in the post table, grab the threadid, then go to the thread table and see if your postid is the same as the firstpostid in the thread table and if not, delete it. You'd have to run the counters afterwards because that will be off unless you update that when you delete the post.


All times are GMT. The time now is 02:21 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.01049 seconds
  • Memory Usage 1,706KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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