以前看过一些方法,但好像都没有效果: (刚试过,以下方法可行)
帖子里的最后由xx于xx编辑这种备注性的提示信息显示在帖子顶部占用很大位置(特别是手机版访问时),非常别扭。
可以把它移到帖子正文底部。
1.打开/source/class/model/model_forum_post.php,找到约459行:
$this->param[‘message’] = lang(‘forum/misc’, $this->param[‘htmlon’] ? ‘post_edithtml’ : (!$this->forum[‘allowbbcode’] || $this->param[‘bbcodeoff’] ? ‘post_editnobbcode’ : ‘post_edit’), array(‘editor’ => $editor, ‘edittime’ => $edittime)) . $this->param[‘message’];
复制代码
把最后的. $this->param[‘message’]移到前面,即
$this->param[‘message’] = $this->param[‘message’]. lang(‘forum/misc’, $this->param[‘htmlon’] ? ‘post_edithtml’ : (!$this->forum[‘allowbbcode’] || $this->param[‘bbcodeoff’] ? ‘post_editnobbcode’ : ‘post_edit’), array(‘editor’ => $editor, ‘edittime’ => $edittime));
2.打开/source/language/forum/lang_misc.php,找到第32—37行:
'post_edit' => "本帖最后由 {editor} 于 {edittime} 编辑\n\n", 'post_edit_regexp' => '/^\[i=s\] 本帖最后由 .*? 于 .*? 编辑 \[\/i\]\n\n/s', 'post_edithtml' => '本帖最后由 {editor} 于 {edittime} 编辑<br /><br />', 'post_edithtml_regexp' => '/^\[i=s\] 本帖最后由 .*? 于 .*? 编辑 \[\/i\]<br \/><br \/>/s', 'post_editnobbcode' => '[ 本帖最后由 {editor} 于 {edittime} 编辑 ]\n\n', 'post_editnobbcode_regexp' => '/^\[ 本帖最后由 .*? 于 .*? 编辑 \]\n\n/s',
去掉其中的^,即
'post_edit' => "本帖最后由 {editor} 于 {edittime} 编辑\n\n", 'post_edit_regexp' => '/\[i=s\] 本帖最后由 .*? 于 .*? 编辑 \[\/i\]\n\n/s', 'post_edithtml' => '本帖最后由 {editor} 于 {edittime} 编辑<br /><br />', 'post_edithtml_regexp' => '/\[i=s\] 本帖最后由 .*? 于 .*? 编辑 \[\/i\]<br \/><br \/>/s', 'post_editnobbcode' => '[ 本帖最后由 {editor} 于 {edittime} 编辑 ]\n\n', 'post_editnobbcode_regexp' => '/\[ 本帖最后由 .*? 于 .*? 编辑 \]\n\n/s',
post, 最后, 编辑, 本帖, this |
|
|
|
|
|
|
|
楼主 |
发表于 2019-8-2 17:11:32
|
显示全部楼层
|
刚试过,上面的方法是可行的,只是以前已经发布的帖子不会变更。 |
|
|
|
|
|
|
|
发表于 2026-5-9 20:26:44
|
显示全部楼层
感谢楼主的分享!这个问题的确很烦人,尤其是用手机浏览帖子的时候,那个编辑提示显示在顶部很占地方,看起来也很不协调。
这个修改很实用,照顾到了不同终端用户的阅读体验。支持一下!
顺便想问一句,这样修改之后,在手机版和电脑版的显示效果都会有改善吗?还有就是修改后会不会对论坛的其他功能有影响? |
|
|
|
|
|
|
|
|