【帝国CMS插件】时间格式改成几分钟,几小时,几天前等插件

 更新时间:2015年12月30日 16:42  点击:2043

版本支持:帝国cms6.6上测试通过,其他版本未测。


插件支持:列表模板,标签模板,内容模板,评论JS的调用模板,以及新出的内容页评论ajax分页显示插件的调用。

插件安装使用说明:

把userfun.txt里面的内容复制到 /e/class/userfun.php 文件里(放在<?php和?>之间就可以了。


调用说明:

1、在标签模板、列表模板中的调用:

代码:

'.user_time($r[newstime],0).'

2、在内容页中调用

代码:

<?=user_time($navinfor[newstime],0)?>

3、在评论JS调用模板调用方法:

在评论JS调用模板把

[!----pltime--]

换成:

<?=user_time($r[saytime],1)?>

然后打开e\pl\more\index.php ,找到:

require("../../class/connect.php");

下一行加入以下代码:

require("../../class/userfun.php");

然后保存


4、在官方的内容页评论AJAX分页显示插件中调用:

打开e\extend\infocomment\template\index.php

把:

<?=$r[saytime]?>

替换成:

<?=user_time($r[saytime],1)?>

然后打开e\extend\infocomment\index.php  查找:

require("../../class/connect.php");

在下一行加入以下代代码:

require("../../class/userfun.php");

点击下载


[!--infotagslink--]

相关文章