本帖最后由 老衲悟空 于 2013-11-26 00:25 编辑
Discuz X2.5 diy模块模板官方没有自带调用最后回复人的功能,网络上有很多朋友提问怎么实现这个功能,但是回答的人却少见或者很少能真正实现的,今天特意研究了下,下面把方法分享给大家。
一、打开source\class\block\forum\block_thread.php
1.查找
- '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'),
复制代码 2.查找
- 'lastpost' => $data['lastpost'],
复制代码 在其下方添加代码
- 'lastposter' => $data['lastposter'],
复制代码 二、打开source\language\lang_blockclass.php
查找
- 'blockclass_thread_field_lastpost' => '最后回复时间',
复制代码 在其下方添加代码
- 'blockclass_thread_field_lastposter' => '最后回复人',
复制代码 三、登录后台,工具->更新缓存->全部勾选->确定
四、diy->高级模式->编辑(对应模块)->模块模板->调用标签{lastposter}即可。
演示站点:http://www.ywmm8.com
|