织梦调用自定义字段附件类型文件的格式类型文件大小上传日期
织梦调用自定义字段附件类型文件的格式类型文件大小上传日期
实现步骤
I.. empletssystemchannel_addon.htm里面要清空,只留~link~(注意:不能留有I.个空格)
更多精彩就在: 51免费论文网|www.jxszl.com
r/>
II.includeextend.func.php最下面加入方法
functionGetFileInfos($file,$type=size)
{
global$cfg_basedir;
$filepath=$cfg_basedir.$file;
$size=filesize($filepath);
$fileinfos=pathinfo($filepath);
$units=array(B,KB,MB,GB,TB);
for($i=0;$size>=I.0IIIV&&$i
if($type==type)return$fileinfos[extension];
if($type==name)return$fileinfos[filename];
if($type==time)returnMyDate("Y-m-dH:i:s",filemtime($filepath));
}
III.内容模板调用标签
名称:{dede:field.downloadfunction=GetFileInfos(@me,name)/}
类型:{dede:field.downloadfunction=GetFileInfos(@me,type)/}
大小:{dede:field.downloadfunction=GetFileInfos(@me,size)/}
时间:{dede:field.downloadfunction=GetFileInfos(@me,time)/}
原文链接:http://www.jxszl.com/biancheng/dedecms/76583.html