DataWriter Forum

Lu Jia

Active member
Hi,
I got some problem with datawriter :( how is it possible to use it to create a new forum from a php script?
 
Ups.
Sorry, i've completly forgotten on you :(

That's the helper i'm using for this (with minimal infos)
PHP:
    public static function createForum($forumName, $parentId = 0){
        $dw = XenForo_DataWriter::create('XenForo_DataWriter_Forum');
        $dw->set('title', $forumName);
        $dw->set('node_type_id', 'Forum');
        $dw->set('parent_node_id', $parentId);
        $dw->save();

        return $dw->getMergedData();
    }
 
Top Bottom