本插件已出新版本:http://bbs.pjhelp.cn/thread-19636-1-1.html
感谢各位网友对第一个版本的支持,现发布2.0版本,这次更新,增加了很多功能,现放出来与大家一起分享一下,有兴趣的网友可以试用一下
插件的主要功能:
1.全面兼容UBB和FCK编辑器
2.实现上传的附件防盗链功能(后台可以关闭此功能)
3.实现上传的图片添加水印的功能,后台有水印功能的相关设置
4.自带后台管理,可以对上传的附件信息进行修改
5.后台可以添加附件信息,可以实现对文件路径的隐藏功能
6.当用户下载附件时,可记录附件的下载次数以及显示附件的大小信息
7.整合wbc的附件清理功能,可在线删除上传的附件
8.可自行选择附件防盗链方式
……
由于大家现在的博客上修改添加过很多的功能,所以为了方便网友,这次我没有做升级文件,以防带来不必要的麻烦,我尽量将修改方法做的简单些。
如果没有安装过以前版本的请看这里:
1.header.asp
找到
复制内容到剪贴板
代码:
Dim BlogTitle修改为
复制内容到剪贴板
代码:
response.Cookies("shotan")= "pjblog"
Dim BlogTitle注意:设置cookie时候,可以将这个值blog改为其他的值,或者你可以用一个随机函数给他们赋值,不过一定要和download.asp中的第一行中的一起修改,保证两值相同
2.common/ubbcode.asp
找到
复制内容到剪贴板
代码:
'-----------特殊标签----------------
re.Pattern = "\[down=(.[^\]]*)\](.[^\[]*)\[\/down]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
strContent=replace(strContent,strMatch.Value,"<img src=""images/download.gif"" alt=""下载文件"" style=""margin:0px 2px -4px 0px""/> <a href="""&tmpStr1&""" target=""_blank"">"&tmpStr2&"</a>",1,-1,0)
Next
re.Pattern = "\[down\](.[^\[]*)\[\/down]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
strContent=replace(strContent,strMatch.Value,"<img src=""images/download.gif"" alt=""下载文件"" style=""margin:0px 2px -4px 0px""/> <a href="""&tmpStr1&""" target=""_blank"">下载此文件</a>",1,-1,0)
Next
re.Pattern = "\[mDown=(.[^\]]*)\](.[^\[]*)\[\/mDown]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
if len(memName)>0 then
strContent=replace(strContent,strMatch.Value,"<img src=""images/download.gif"" alt=""下载文件"" style=""margin:0px 2px -4px 0px""/> <a href="""&tmpStr1&""" target=""_blank"">"&tmpStr2&"</a>",1,-1,0)
else
strContent=replace(strContent,strMatch.Value,"<img src=""images/download.gif"" alt=""只允许会员下载"" style=""margin:0px 2px -4px 0px""/> 该文件只允许会员下载! <a href=""login.asp"">登录</a> | <a href=""register.asp"">注册</a>",1,-1,0)
end if
Next
re.Pattern = "\[mDown\](.[^\[]*)\[\/mDown]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
if len(memName)>0 then
strContent=replace(strContent,strMatch.Value,"<img src=""images/download.gif"" alt=""下载文件"" style=""margin:0px 2px -4px 0px""/> <a href="""&tmpStr1&""" target=""_blank"">下载此文件</a>",1,-1,0)
else
strContent=replace(strContent,strMatch.Value,"<img src=""images/download.gif"" alt=""只允许会员下载"" style=""margin:0px 2px -4px 0px""/> 该文件只允许会员下载! <a href=""login.asp"">登录</a> | <a href=""register.asp"">注册</a>",1,-1,0)
end if
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)
tmpStr3=strMatch.SubMatches(2)
strContent=Shotan_Download(strContent,strMatch.Value,tmpStr1,tmpStr2,tmpStr3)
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)
strContent=Shotan_Download(strContent,strMatch.Value,tmpStr1,tmpStr2,"")
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)
if len(memName)>0 then
strContent=Shotan_Download(strContent,strMatch.Value,tmpStr1,tmpStr2,tmpStr3)
else
strContent=replace(strContent,strMatch.Value,"<img src=""images/download.gif"" alt=""只允许会员下载"" style=""margin:0px 2px -4px 0px""/> 该文件只允许会员下载! <a href=""login.asp"">登录</a> | <a href=""register.asp"">注册</a>",1,-1,0)
end if
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))
if len(memName)>0 then
strContent=Shotan_Download(strContent,strMatch.Value,tmpStr1,tmpStr2,"")
else
strContent=replace(strContent,strMatch.Value,"<img src=""images/download.gif"" alt=""只允许会员下载"" style=""margin:0px 2px -4px 0px""/> 该文件只允许会员下载! <a href=""login.asp"">登录</a> | <a href=""register.asp"">注册</a>",1,-1,0)
end if
Next说明:如果你的博客中ubbcode.asp文件从来没有修改过,那可以将下载压缩包中的ubbcode.asp文件上传到网站空间中common文件夹下覆盖原来的ubbcode.asp文件,操作之前做好备份哦,以防万一
2.将下载压缩包中的download.asp文件上传到网站的根目录下
3.将下载压缩包中的attachment.asp文件覆盖原来的attachment.asp
注意:进行此操作前先做好文件备份,以便造成不必要的麻烦
4.将下载压缩包中的Attachment文件夹上传到自己博客的Plugins文件夹下,然后进博客后台将插件安装一下
OK,搞定了,呵呵
演示地址:
http://www.shotan.com/article.asp?id=102
由于本人水平有限,不足之处,请多多包涵
