1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Query to create a forum

Discussion in 'XenForo Development Discussions' started by Lu Jia, May 28, 2011.

  1. Lu Jia

    Lu Jia Active Member

    PHP:
    $db->query("INSERT INTO `xf_node` (`title`, `description`, `node_name`, `node_type_id`,    `parent_node_id`, `display_order`, `display_in_list`, `lft`, `rgt`, `depth`, `style_id`, `effective_style_id`) VALUES (...);");
    What sould I put in the column 'lft' and 'rgt'?
     
  2. ragtek

    ragtek Guest

    You shouldn't use a query for this!

    Everytime you want to create a new "xenforo element"(user,post,page,forum,thread,etc...) you should use the datawriter for this.
     
  3. Lu Jia

    Lu Jia Active Member

    Oh :D
    Can you post me an example of Datawriter to create a new forum element?
    Thank a lot
     
  4. SheepCow

    SheepCow Well-Known Member

    Have a look in the ControllerAdmin directory for the way XenForo does it, but basically, you create a DataWriter, set the values and save :)
     

Share This Page