vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Delete Thread From Code (https://vborg.vbsupport.ru/showthread.php?t=118499)

LeaderGL 06-13-2006 07:07 PM

Delete Thread From Code
 
Hi, do you know how can i delete a thread from an external script? (also using vB API).

[OFF TOPIC] Do you, also, know how modify a post? [/OFF TOPIC]

regards,
LeaderGL

tgreer 06-13-2006 07:19 PM

I believe you'd use DataManagers for this. Perhaps someone who has posted about datamanagers in the private Coders Discussion would be willing to step over here and provide some insight?

LeaderGL 06-13-2006 07:26 PM

do you have some code example on how to delete thread?

tgreer 06-13-2006 07:40 PM

Not that I've written and tested, no. However, the editpost.php file contains this code:

PHP Code:

                $threadman =& datamanager_init('Thread'$vbulletinERRTYPE_STANDARD'threadpost');
                
$threadman->set_existing($threadinfo);
                
$threadman->delete($foruminfo['countposts'], $removaltype, array('userid' => $vbulletin->userinfo['userid'], 'username' => $vbulletin->userinfo['username'], 'reason' => $vbulletin->GPC['reason'], 'keepattachments' => $vbulletin->GPC['keepattachments']));
                unset(
$threadman); 


LeaderGL 06-13-2006 07:43 PM

ok, and how i create $threadinfo and $foruminfo ?

i've threadid to delete...

tgreer 06-13-2006 07:50 PM

Yep, that's the question! I don't have a good answer... I'm exploring this at the same time as you. I'd start by carefully looking at the code in editpost.php. Start at line #982.

Maybe threadid is all you need?

Looking at "class_dm_threadpost.php", there is a "delete" function for threads. You can see the signature for that function on line 1182 of that file. It looks like you can just set the $threadid variable for the thread you want to delete.


All times are GMT. The time now is 11:36 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.02107 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
  • (6)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