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

PHP Update Nodes

Discussion in 'XenForo Development Discussions' started by ScottLott, Feb 24, 2014.

  1. ScottLott

    ScottLott Member

    Hey guys,
    I'm trying to setup a PHP file that can update XenForo page nodes.

    I found the database location of the node page templates (xf_template) but I can't just modify the mySQL table, it doesn't update the page.

    It looks like another file is created in the "template_parsed" column of the database that holds a saved version of the template XenForo actually uses to render the page nodes.

    This second column stuff isn't something I can make on the fly, so I'm wondering what can be done to modify Page Nodes from a PHP file?
  2. ScottLott

    ScottLott Member

    Alright, I've gotten this far:

            $startTime = microtime(true);
            $fileDir =  "../../../community";
            require($fileDir . '/library/XenForo/Autoloader.php');
            XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');
            XenForo_Application::initialize($fileDir . '/library', $fileDir, true, array('resetOutputBuffering' => false));
            XenForo_Application::set('page_start_time', $startTime);
            $deps = new XenForo_Dependencies_Public();
            $writer = XenForo_DataWriter::create('XenForo_DataWriter_Template');
    But it's not working and there are no error messages. (The templateID and template are passed into this section of the code from $_POST).

    Once again, I'm trying to make changes to XenForo templates using a PHP file outside of XenForo.

Share This Page