XF 2.1 Read database data for a bb code

stan1226

Member
For my site I am building a link between Joomla and Xenforo. So far everything is turning out great and Joomla successfully creates Xenforo threads for new Joomla articles.

But right now I am a bit stuck, because I want the new threads to show the text of the article in the first post. I add the following BB codes for the content as the message of the xenforo post:
Code:
[article]117[/article]

Am I thankful for any input.

Update: I just wrote this function in an extension:
Code:
$content = $renderer->renderSubTree($tagChildren, $options);
        if(isset($content)) {
            $db = XenForo_Application::get('db');
            $query_results = $db->fetchOne("SELECT `fulltext` FROM `zcwab_content` WHERE `id` = 975");
            return $query_results;
        } else {
            return 'No article found';
        }

But I get the following error: Fatal error: Class 'stan1226\JoomlaBBCodes\BbCode\XenForo_Application' not found. How can I include the needed part?

2nd Update: Ok I got it actually working with $db = \XF::db();
Topic can be closed now
 
Last edited:
Top Bottom