xoops 附件问题

article 与 news 是两个不同的模组
不过,article克隆了一个名字叫news的其实是article的模组,版本为news0.99.
...........
本站下载区的news 1.54是中文汉化版,你可以访问这里下载使用:
http://xoops.org.cn/modules/wfdownloa ... glefile.php?cid=5&lid=594
这个是国外比较流行的新闻模组,在发表文章页面你会看见附件上传选项.
.......
article的附件上传方法:
发表文章选择 FCK编辑器,在编辑器中,选择添加链接,选择本地上传,然后选择本地电脑你想上传的文件,
不过,要命名,相对于 News1.54来说,相对要麻烦一些.

自动按日期分文件夹,随机命名(PHP)。

请修改editor/editor/filemanager/connectors/php文件夹下的:config.php文件
找到如下的内容:
// Path to user files relative to the document root.
$Config['UserFilesPath'] =
修改为:
// Path to user files relative to the document root.
$Config['UserFilesPath'] = '/uploadfiles/'.date("Ym")."/" ;
这样上传的文件就按照日期存放了。
其次:重命名
请修改该文件夹下的io.php文件
找到:
// Do a cleanup of the file name to avoid possible problems
function SanitizeFileName( $sNewFileName )
==》
function SanitizeFileName( $sNewFileName )
{
。。。。。。
//random file
$sExtension = substr( $sNewFileName, ( strrpos($sNewFileName, '.') + 1 ) ) ;
$sNewFileName = my_setfilename().'.'.$sExtension;
return $sNewFileName ;
}

function my_setfilename(){
$gettime = explode(' ',microtime());
$string = 'abcdefghijklmnopgrstuvwxyz0123456789';
$rand = '';
for ($x=0;$x<12;$x++)
 $rand .= substr($string,mt_rand(0,strlen($string)-1),1);
return date("ymdHis").substr($gettime[0],2,6).$rand;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值