vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   API Question: Inserting a new thread from outside Vbulletin (https://vborg.vbsupport.ru/showthread.php?t=168321)

MattFord 01-20-2008 07:48 PM

API Question: Inserting a new thread from outside Vbulletin
 
I seem to recall that there is a way to insert a new thread and get the ID back. I've been googling the docs to no avail. Can anybody recall such a tutorial?

Marco van Herwaarden 01-21-2008 06:36 AM

I am pretty sure there is a thread in the articles forum about this.

Dismounted 01-21-2008 10:12 AM

There was also a thread posted on this topic a few days ago.

djdevin 08-07-2008 04:08 AM

Great, link us.

RLShare 08-07-2008 04:34 AM

PHP Code:

$threaddm =& datamanager_init('Thread_FirstPost'$vbulletinERRTYPE_ARRAY'threadpost');

                

                
$foruminfo fetch_foruminfo(forumid);
                
$threaddm->set_info('forum'foruminfo);
                
$threaddm->set('forumid'$foruminfo['forumid']);
                
$threaddm->set('userid'userid);
                
$threaddm->set('title'title);
                
$threaddm->set('pagetext'message);
                
$threaddm->set('allowsmilie'0);
                
$threaddm->set('visible'1);
                
$threaddm->set('dateline'TIMENOW);


                if(
$threaddm->errors){
                        Do 
something about the error
                                
}
                        }
                else{
                        
$threadid=$threaddm->save();



djdevin 08-08-2008 06:58 PM

Worked - awesome. Thank you.


All times are GMT. The time now is 04:25 PM.

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.01432 seconds
  • Memory Usage 1,723KB
  • 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