2016-06-09 23 views
1

我有vbulletin 4论坛和我安装了vbadvanced CMPS。如何使用自定义模板上postbit的vbulletin变量

现在我想自定义新闻模块和我需要的是从postbit模板中使用的变量并调用它adv_portal_newsbits模板......我该怎么办呢?

有控制NEWS模块和adv_portal_newsbits模板的news.php文件...我做了一些搜索,看起来我需要在news.php文件里注册来自postbit模板的变量......或者我可能会在“米错了?

如果这是真的,我该如何注册我需要的变量? (我需要帖子标题,来自第一篇文章和文字的图片)

回答

0

Postbit模板包含一个线程的所有信息,在你的情况下,它听起来像你应该得到的threadbit信息。你需要做的是看看forumdisplay.php,看看它是如何获得threadbit的。 然后在你的news.php,你想要做这样的事情:

require_once(DIR . '/includes/functions_forumdisplay.php'); 
$threads = $db->query_read_slave (sql query, depends on what you need); 
$threadbits; 
while ($thread = $db->fetch_array($threads)) { 
    // this method is from the functions_forumdisplay.php 
    $threadbits .= process_thread_array($thread); 
} 
$templater = vB_Template::create('adv_portal_newsbits'); 
$templater->register('threadbits', $threadbits); 
print_output($templater->render()); 

现在,在您adv_portal_newsbits模板,你可以拨打{动:生threadbits}。请注意,threadbits是一个包含所有适合您查询的线程的数组,但您可以使用{vb:each}

相关问题