LPH
Well-known member
I'm close to rendering the thread list outside XenForo but know the params are not complete. I'd like to be able to set the node_id, number of threads to show, and see replies, etc.
The attached image shows what is rendered.
The struggle is figuring out the $params. Is there an "easy" way to figure these out?
If it isn't just the params, do you see something else needed?
PHP:
$dependencies = new XenForo_Dependencies_Public();
$dependencies->preLoadData();
/* Get the visitor param */
$visitor = XenForo_Visitor::getInstance();
$styleId = $visitor['style_id'];
if ( $styleId > 0 ) {
XenForo_Template_Public::setStyleId( $styleId );
} else {
XenForo_Template_Public::setStyleId( 1 );
}
$languageId = $visitor['language_id'];
if ( $languageId > 0 ) {
XenForo_Template_Abstract::setLanguageId( $languageId );
} else {
XenForo_Template_Abstract::setLanguageId( 1 );
}
$params = array(
'visitor' => $visitor,
'node_id' =>'5',
//'threads' => '',
'totalThreads' => '5'
);
$template = $dependencies->createTemplateObject( 'thread_list', $params );
echo $template->render();
The attached image shows what is rendered.
The struggle is figuring out the $params. Is there an "easy" way to figure these out?
If it isn't just the params, do you see something else needed?