远程存图按日期目录存放_风讯Cms教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

本文讨论区:http://bbs.foosun.net/dispbbs.asp?boardID=22&ID=7958&page=1

方法:
1、修改图片新闻文件:admin/Info/NewsPic.asp

A、查找: If ISavePic = "1" then
INewsAddObj("Content") = ReplaceRemoteUrl(Save_Content,"/" & UpFiles & "/" & BeyondPicDir,RsNewsConfigObj("DoMain"),DummyPath_Riker)
Else
INewsAddObj("Content") = Save_Content '新闻内容 尚未判定
End If
B、以及文字新闻文件:admin/Info/NewsWords.asp
If ISavePic = "1" then
INewsAddObj("Content") = ReplaceRemoteUrl(Save_Content,"/" & UpFiles & "/"&BeyondPicDir,RsNewsConfigObj("DoMain"),DummyPath_Riker)
else
INewsAddObj("Content") = Save_Content
End If

替换成:
If ISavePic = "1" then
INewsAddObj("Content") = ReplaceRemoteUrl(Save_Content,"/" & UpFiles & "/"&BeyondPicDir & "/" & year(now) & "-" & month(now) & "-" & day(now),RsNewsConfigObj("DoMain"),DummyPath_Riker)
else
INewsAddObj("Content") = Save_Content
End If
2、修改网站根目录下Inc/Function.asp (非admin/inc/function.asp文件)
A、查找Function ReplaceRemoteUrl(NewsContent,SaveFilePath,FunDoMain,DummyPath)
在此函数里添加:(比如在 Set re = Nothing 下面加)
AutoCreateFolder(Server.MapPath(SaveFilePath))

B、添加函数:
'================================================
'按月份自动明名上传文件夹,需要FSO组件支持。
' 自动创建指定的多级文件夹
' strPath为绝对路径
' 引用请保留版权
' by im286_Anjer
' 2005-4-3
' http://www.ggmo.net
'调用方法:AutoCreateFolder("C:\a\b\c")
'================================================
Function AutoCreateFolder(strPath) ' As Boolean
On Error Resume Next

Dim astrPath, ulngPath, i, strTmpPath
Dim objFSO

If InStr(strPath, "\") <=0 Or InStr(strPath, ":") <= 0 Then
AutoCreateFolder = False
Exit Function
End If
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(strPath) Then
AutoCreateFolder = True
Exit Function
End If
astrPath = Split(strPath, "\")
ulngPath = UBound(astrPath)
strTmpPath = ""
For i = 0 To ulngPath
strTmpPath = strTmpPath & astrPath(i) & "\"9 7 3 1 2 4 8 :

查看更多 风讯cms教程  风讯cms模板

来源:模板无忧//所属分类:风讯Cms教程/更新时间:2006-06-16
相关风讯Cms教程