vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Delete Threads and posts (https://vborg.vbsupport.ru/showthread.php?t=158304)

AudioFX 09-20-2007 05:41 PM

Delete Threads and posts
 
Hi There
I was wondering if anyone knew the sql statement to delete a thread, all posts assigned to the thread, and to remove the post count from members who posted in the thread. I need to completely remove the thread as if it never existed. I'm not sure of the tables I need to adjust, and was hoping to get some advice before I use trial and error ;)
Thank you for any suggestions

Paul M 09-20-2007 05:43 PM

Just delete it using the normal vbulletin delete thread function.

AudioFX 09-27-2007 11:56 AM

Thanks for the reply Paul. Can you give me the function name and arguments?

Lynne 09-27-2007 02:14 PM

I believe he's talking about going into the thread you want to delete and clicking on the Thread Tools bar above the first post and then selecting Delete Thread. You may then click Physically Remove and the then the thread and all the posts will be deleted forever.

Dismounted 09-28-2007 05:21 AM

You would use the datamanager. Simply call the Thread Datamanager, call "set_existing". And finally, call "delete".

AudioFX 09-28-2007 05:29 AM

You see i'm using a 3rd party hack, downloadsII to be exact. When a new file is uploaded, a new thread is automatically created in a specific forum. If the user then decides to delete the file from their account, then I need to need to delete the thread that was automatically created. This would be achieved using an SQL statement or even better, a delete thread function as Tom M suggestion. Essentially I need to "physically delete the thread".

Dismounted, how would I use the datamanger to delete the thread? I do not understand what you mean by "calling the Thread Datamanager".

Dismounted 09-28-2007 06:13 AM

PHP Code:

$thread fetch_threadinfo($threadid);

$threadman =& datamanager_init('Thread'$vbulletinERRTYPE_SILENT'threadpost');
$threadman->set_existing($thread);
$threadman->delete(falsetrueNULLfalse);
unset(
$threadman); 


AudioFX 09-28-2007 06:30 AM

Awesome, thanks a lot Dismounted! I'm gonna try this out this evening. :)


All times are GMT. The time now is 09:14 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.02650 seconds
  • Memory Usage 1,722KB
  • 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
  • (8)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