我有公告4论坛,我安装了vbadvanced。
现在,我想定制新闻模块,我需要的是使用来自postbit模板的变量,并在 template...how上调用它,我可以这样做吗?
有news.php文件控制新闻模块和adv_portal_newsbits模板.我做了一些搜索,在我看来,我需要在news.php file...or中注册后置模板中的变量,也许我错了?
如果这是真的,我如何注册我需要的变量?(我需要文章标题,第一篇文章中的图片和文字)
发布于 2016-06-14 22:31:08
Postbit模板有一个线程的所有信息,在您的例子中,听起来您应该获得线程位信息。您需要做的是查看一下forumdisplay.php,看看它是如何获得线程位的。然后在你的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模板中,只需调用{vb:原始线程位}即可。注意,线程位是一个数组,包含适合您的查询的所有线程,但是可以使用{vb:each}
https://stackoverflow.com/questions/37733180
复制相似问题