Discuz X2.5 diy 模块模板官方没有自带调用最后回复人的功能,网络上有很多朋友提问怎么实现这个功能,但是回答的人却少见。本人通过分析 Discuz 代码解决此问题,特发布博客分享。
打开
source\class\block\forum\block_thread.php
,查找'blockclass_thread_field_lastpost' => '最后回复时间',
在其下方添加代码
'blockclass_thread_field_lastposter' => '最后回复人',
打开
source\language\lang_blockclass.php
,查找'lastpost' => array('name' => lang('blockclass', 'blockclass_thread_field_lastpost'), 'formtype' => 'date', 'datatype' => 'date'),
在其下方添加代码
'lastposter' => array('name' => lang('blockclass', 'blockclass_thread_field_lastposter'), 'formtype' => 'text', 'datatype' => 'string'),
打开
source\language\lang_blockclass.php
,查找'lastpost' => $data['lastpost'],
在其下方添加代码
'lastposter' => $data['lastposter'],
调用标签
{lastposter}
登录后台,工具->更新缓存->全部勾选->确定