附件管理 v4.0 (不断更新)
作者:情留メ蚊子 日期:2008-11-19
附件管理 v4.0 For PJBlog3(只适合PJ3) 由本人 从 附件管理 v3.0 修改而来,版权归原作者所有。
主要功能:
1、通过FSO截取文件大小,类型,更新时间。
2、支持静态,静态下可以显示下载次数。(Ajax)
3、支持是否显示附件大小、更新时间、下载次数。
还有原版的功能。
静态防盗链还在修改中。。。。
1、打开control/f_control.asp 查找
Set ServerFolder = FSO.GetFolder(Server.MapPath(pathName))
改成
Set ServerFolder = FSO.GetFolder(Server.MapPath("/"&pathName))
查找:FileInfo(8) 那8改成10
查找:FileInfo(8) = "" 'File.ShortName 部分服务器不支持
在下面插入
查找:Function getFileIcons(Str) 到 下一个 End Function
全部替换成:
打开attachment.asp
查找:
在上面插入
查找:
替换成:
[分页符]
2、打开:common/ubbcode.asp查找:
替换成:
[分页符]
3、打开:Template/static.htm 、header.asp 找到 </head>上插入(PJ最新版PJblog3 3.0.6.170不用改)
4、下载附件放到相应位置
说明:附件内的Action.asp 和 common/ajax.js 是PJ最新版PJblog3 3.0.6.170的文件,最新版出的时候可以用此文件覆盖。
主要功能:
1、通过FSO截取文件大小,类型,更新时间。
2、支持静态,静态下可以显示下载次数。(Ajax)
3、支持是否显示附件大小、更新时间、下载次数。
还有原版的功能。
静态防盗链还在修改中。。。。
1、打开control/f_control.asp 查找
Set ServerFolder = FSO.GetFolder(Server.MapPath(pathName))
改成
Set ServerFolder = FSO.GetFolder(Server.MapPath("/"&pathName))
查找:FileInfo(8) 那8改成10
查找:FileInfo(8) = "" 'File.ShortName 部分服务器不支持
在下面插入
复制内容到剪贴板
程序代码
程序代码 FileInfo(9) = FSO.getExtensionName(Server.MapPath(FileName)) '获取文件类型
FileInfo(10) = File.DateLastModified'获取文件更新时间
FileInfo(10) = File.DateLastModified'获取文件更新时间
查找:Function getFileIcons(Str) 到 下一个 End Function
全部替换成:
复制内容到剪贴板
程序代码
程序代码Function getFileIcons(Str)
Dim FileIcon
If FileExist("/images/file/"&Str&".gif") Then FileIcon = Str Else FileIcon = "unknow"
getFileIcons = "<img border=""0"" src="""&SiteURL&"images/file/"&FileIcon&".gif"" style=""margin:4px 3px -3px 0px""/>"
End Function
Dim FileIcon
If FileExist("/images/file/"&Str&".gif") Then FileIcon = Str Else FileIcon = "unknow"
getFileIcons = "<img border=""0"" src="""&SiteURL&"images/file/"&FileIcon&".gif"" style=""margin:4px 3px -3px 0px""/>"
End Function
打开attachment.asp
查找:
复制内容到剪贴板
程序代码
程序代码F_File.SaveAs Server.MapPath("attachments/"&D_Name&"/"&F_Name)
在上面插入
复制内容到剪贴板
程序代码
程序代码 Dim Rs,DownloadID,S_FilePath
Set Rs=Conn.Execute("Select top 1 id From blog_attachment order by id desc")
If not (rs.eof and rs.bof) Then DownloadID = Rs(0)+1 Else DownloadID = "1"
Rs.Close
Set Rs=nothing
S_FilePath = "attachments/"&D_Name&"/"&F_Name
Conn.execute("insert into blog_attachment(path) values('"&S_FilePath&"')")
Set Rs=Conn.Execute("Select top 1 id From blog_attachment order by id desc")
If not (rs.eof and rs.bof) Then DownloadID = Rs(0)+1 Else DownloadID = "1"
Rs.Close
Set Rs=nothing
S_FilePath = "attachments/"&D_Name&"/"&F_Name
Conn.execute("insert into blog_attachment(path) values('"&S_FilePath&"')")
查找:
复制内容到剪贴板
程序代码
程序代码<script>addUploadItem('"&F_Type&"','attachments/"&D_Name&"/"&F_Name&"',"&Request.QueryString("MSave")&")</script>
替换成:
复制内容到剪贴板
程序代码
程序代码<script>addUploadItem('"&F_Type&"','download.asp?id="&DownloadID&"',"&Request.QueryString("MSave")&")</script>
[分页符]
2、打开:common/ubbcode.asp查找:
复制内容到剪贴板
程序代码
程序代码'-----------特殊标签---------------- 到 'CC Video 支持 之间全部替换
替换成:
复制内容到剪贴板
程序代码
程序代码 re.Pattern = "\[down=(download\.asp\?id=)([0-9]*)\](.[^\[]*)\[\/down]"
Set strMatchs = re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1 = checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
tmpStr3=strMatch.SubMatches(2)
dim rndnum1:rndnum1=randomStr(10)
strContent = Replace(strContent, strMatch.Value, "<span id=""down_"&rndnum1&"""></span><script language=""javascript"" type=""text/javascript"">check('Action.asp?action=down&id="&tmpStr2&"&downurl="&server.URLEncode(tmpStr1&tmpStr2)&"&main="&server.URLEncode(tmpStr3)&"','down_"&rndnum1&"','down_"&rndnum1&"');</script>", 1, -1, 0)
Next
re.Pattern = "\[down\](download\.asp\?id=)([0-9]*)\[\/down\]"
Set strMatchs = re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1 = checkURL(strMatch.SubMatches(0))
tmpStr2 = strMatch.SubMatches(1)
dim rndnum2:rndnum2=randomStr(10)
strContent = Replace(strContent, strMatch.Value, "<span id=""down_"&rndnum2&"""></span><script language=""javascript"" type=""text/javascript"">check('Action.asp?action=down&id="&tmpStr2&"&downurl="&server.URLEncode(tmpStr1&tmpStr2)&"&main="&server.URLEncode("点击下载此文件")&"','down_"&rndnum2&"','down_"&rndnum2&"');</script>", 1, -1, 0)
Next
re.Pattern = "\[mDown=(download\.asp\?id=)([0-9]*)\](.[^\[]*)\[\/mDown]"
Set strMatchs = re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1 = checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
tmpStr3=strMatch.SubMatches(2)
dim rndnum3:rndnum3=randomStr(10)
strContent = Replace(strContent, strMatch.Value, "<span id=""mdown_"&rndnum3&"""></span><script language=""javascript"" type=""text/javascript"">check('Action.asp?action=mdown&id="&tmpStr2&"&downurl="&server.URLEncode(tmpStr1&tmpStr2)&"&main="&server.URLEncode(tmpStr3)&"','mdown_"&rndnum3&"','mdown_"&rndnum3&"');</script>", 1, -1, 0)
Next
re.Pattern = "\[mDown\](download\.asp\?id=)([0-9]*)\[\/mDown]"
Set strMatchs = re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1 = checkURL(strMatch.SubMatches(0))
tmpStr2 = strMatch.SubMatches(1)
dim rndnum4:rndnum4=randomStr(10)
strContent = Replace(strContent, strMatch.Value, "<span id=""mdown_"&rndnum4&"""></span><script language=""javascript"" type=""text/javascript"">check('Action.asp?action=mdown&id="&tmpStr2&"&downurl="&server.URLEncode(tmpStr1&tmpStr2)&"&main="&server.URLEncode("点击下载此文件")&"','mdown_"&rndnum4&"','mdown_"&rndnum4&"');</script>", 1, -1, 0)
Next
Set strMatchs = re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1 = checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
tmpStr3=strMatch.SubMatches(2)
dim rndnum1:rndnum1=randomStr(10)
strContent = Replace(strContent, strMatch.Value, "<span id=""down_"&rndnum1&"""></span><script language=""javascript"" type=""text/javascript"">check('Action.asp?action=down&id="&tmpStr2&"&downurl="&server.URLEncode(tmpStr1&tmpStr2)&"&main="&server.URLEncode(tmpStr3)&"','down_"&rndnum1&"','down_"&rndnum1&"');</script>", 1, -1, 0)
Next
re.Pattern = "\[down\](download\.asp\?id=)([0-9]*)\[\/down\]"
Set strMatchs = re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1 = checkURL(strMatch.SubMatches(0))
tmpStr2 = strMatch.SubMatches(1)
dim rndnum2:rndnum2=randomStr(10)
strContent = Replace(strContent, strMatch.Value, "<span id=""down_"&rndnum2&"""></span><script language=""javascript"" type=""text/javascript"">check('Action.asp?action=down&id="&tmpStr2&"&downurl="&server.URLEncode(tmpStr1&tmpStr2)&"&main="&server.URLEncode("点击下载此文件")&"','down_"&rndnum2&"','down_"&rndnum2&"');</script>", 1, -1, 0)
Next
re.Pattern = "\[mDown=(download\.asp\?id=)([0-9]*)\](.[^\[]*)\[\/mDown]"
Set strMatchs = re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1 = checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
tmpStr3=strMatch.SubMatches(2)
dim rndnum3:rndnum3=randomStr(10)
strContent = Replace(strContent, strMatch.Value, "<span id=""mdown_"&rndnum3&"""></span><script language=""javascript"" type=""text/javascript"">check('Action.asp?action=mdown&id="&tmpStr2&"&downurl="&server.URLEncode(tmpStr1&tmpStr2)&"&main="&server.URLEncode(tmpStr3)&"','mdown_"&rndnum3&"','mdown_"&rndnum3&"');</script>", 1, -1, 0)
Next
re.Pattern = "\[mDown\](download\.asp\?id=)([0-9]*)\[\/mDown]"
Set strMatchs = re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1 = checkURL(strMatch.SubMatches(0))
tmpStr2 = strMatch.SubMatches(1)
dim rndnum4:rndnum4=randomStr(10)
strContent = Replace(strContent, strMatch.Value, "<span id=""mdown_"&rndnum4&"""></span><script language=""javascript"" type=""text/javascript"">check('Action.asp?action=mdown&id="&tmpStr2&"&downurl="&server.URLEncode(tmpStr1&tmpStr2)&"&main="&server.URLEncode("点击下载此文件")&"','mdown_"&rndnum4&"','mdown_"&rndnum4&"');</script>", 1, -1, 0)
Next
[分页符]
3、打开:Template/static.htm 、header.asp 找到 </head>上插入(PJ最新版PJblog3 3.0.6.170不用改)
复制内容到剪贴板
程序代码
程序代码<script type="text/javascript" src="common/ajax.js"></script>
4、下载附件放到相应位置
说明:附件内的Action.asp 和 common/ajax.js 是PJ最新版PJblog3 3.0.6.170的文件,最新版出的时候可以用此文件覆盖。
评论: 10 | 引用: 0 | 查看次数: 5457
回复
| 取消审核]出错了.....呜呜.....上传附件后点下载——附件不存在....登陆后台发现——数据库备份列表都不显示了.....怎么办????
什么时候 静态防盗链 修改完成啊 期待中ing~~~
修改后,会员下载就显示错误了!
然后,我按照你论坛里发的修复会员下载,但是,不知道怎么修改!~~!
然后,我按照你论坛里发的修复会员下载,但是,不知道怎么修改!~~!

看不到的是:[down=id]点击下载此文件[/down这一项内容 
下载下来的用了之后会出现乱码,
按博主所说一步一步自已操作能安装,并能管理.但就是日志中看不到 链接.直接就是空白,希望帮忙解决一下
,谢谢 
按博主所说一步一步自已操作能安装,并能管理.但就是日志中看不到 链接.直接就是空白,希望帮忙解决一下
,谢谢 
情留メ蚊子 于 2008-11-23 01:57 AM 回复
不会吧 直接联系QQ 540644769
抱歉又來打擾您了,之前的問題是我修改過程中漏了一個步驟!現在是可以顯示了。
但在下載插件時出現無法找到網頁呢!
試問這問題是出在哪裡呢?
麻煩您了,謝謝!
但在下載插件時出現無法找到網頁呢!
試問這問題是出在哪裡呢?
麻煩您了,謝謝!
给我做个连接,谢谢,www.poorich.com
刚才又试了一下,不管是访客、会员、管理员模式下点击进入文章,确实都无法显示文章里提供下载的附件。
唯以管理员身份进入后台做附件管理时才能看见。
以上状况提供给博主参考,希望能有解决办法!
唯以管理员身份进入后台做附件管理时才能看见。
以上状况提供给博主参考,希望能有解决办法!
根本无法安装,能具体演示下吗
情留メ蚊子 于 2008-11-19 11:58 PM 回复
提示什么?
发表评论
上一篇
下一篇

文章来自:
Tags:
相关日志: