Announcement

Collapse
No announcement yet.

How do I add a new thread via an external script?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Colin F
    replied
    Have you looked at the documentation for the DataManagers: http://www.vbulletin.com/docs/html/data_managers ?

    In the code above you'd probably want to do a pre-save first to check for errors.

    For further help please ask on www.vbulletin.org though, as we can't support custom code.

    Leave a comment:


  • DarkReaper
    started a topic How do I add a new thread via an external script?

    How do I add a new thread via an external script?

    I'm attempting to update my external news posting script so that it works with vB 3.6.1 and am having some issues. Previously I simply manually performed all of the necessary SQL, and now I'm trying to use vB_DataManager_Thread_FirstPost(). However, my own script uses some of the same functions as vB does (iif, for example) so it runs into errors. Does anyone know how I can get this to work right?

    PHP Code:
        $cwd getcwd();
        
    chdir('/home/seriousc/www/forums');
        require_once(
    './global.php');
        require_once(
    './includes/class_dm.php');
        require_once(
    './includes/class_dm_threadpost.php');

        
    $threaddm = new vB_DataManager_Thread_FirstPost($vbulletinERRTYPE_STANDARD);

        
    $threaddm->do_set('forumid'$newsforumid);
        
    $threaddm->do_set('postuserid'$userid);
        
    $threaddm->do_set('userid'$userid);
        
    $threaddm->do_set('username'$postusername);
        
    $threaddm->do_set('pagetext'$body);
        
    $threaddm->do_set('title'$title);
        
    $threaddm->do_set('allowsmilie'$allowsmilie);
        
    $threaddm->do_set('visible'$visible);
        
    $threadid $threaddm->save();

        
    chdir($cwd);

        return 
    $threadid

Related Topics

Collapse

Working...
X