附件防盗链-管理插件 V3.0

插件的主要功能:
1.全面兼容UBB和FCK编辑器
2.实现上传的附件防盗链功能(后台可以关闭此功能)
3.实现上传的图片添加水印的功能,后台有水印功能的相关设置
4.自带后台管理,可以对上传的附件信息进行修改
5.后台可以添加附件信息,可以实现对文件路径的隐藏功能
6.当用户下载附件时,可记录附件的下载次数以及显示附件的大小信息
7.整合wbc的附件清理功能,可在线删除上传的附件
8.可自行选择附件防盗链方式
……
附件管理插件 V3.0 For PJBlog2
1.修正了2.0中的BUG
2.增强了防盗链的性能
3.增加了文字防盗链方式,文字内容后台可以设置
4.新版本插件增加了对影音文件的防盗链
5.新增了附件类型的自动识别功能


安装方法共3步
第一步:用”Dreamweaver网页编辑器“打开 header.asp
找到
程序代码 程序代码
Dim BlogTitle


改成
程序代码 程序代码
response.cookies("shotan")= "ilankpj"
Session("shotan")="ilankpj"
Dim BlogTitle


注意:设置cookie时候,可以将这个值 ilankpj 改为其他的值,或者你可以用一个随机函数给他们赋值,不过一定要和download.asp中的 if Request.cookies("shotan")= "ilankpj" 一起修改,保证两值相同。

第二步:用”Dreamweaver网页编辑器“打开 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


如果你的博客中用以前的方法添加的附件较多,你可以在上面的语句修改完之后,接着再加入
程序代码 程序代码

'=====================兼容以前的附件==================================
                re.Pattern = "\[down=attachments\/(.[^\]]*)\](.[^\[]*)\[\/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=""attachments/"&tmpStr1&""" target=""_blank"">"&tmpStr2&"</a>",1,-1,0)
                Next                
                
                re.Pattern = "\[down\]attachments\/(.[^\[]*)\[\/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=""attachments/"&tmpStr1&""" target=""_blank"">下载此文件</a>",1,-1,0)
                Next

                re.Pattern = "\[mDown=attachments\/(.[^\]]*)\](.[^\[]*)\[\/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=""attachments/"&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\]attachments\/(.[^\[]*)\[\/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=""attachments/"&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
'=====================兼容以前的附件==================================


第三步:上传
1.将下载压缩包中的download.asp文件上传到网站的根目录下
2.将下载压缩包中的attachment.asp文件上传到网站的根目录下,覆盖原来的attachment.asp
3.将下载压缩包中的Attachment文件夹上传到自己博客的Plugins/文件夹下,然后进博客后台将插件安装一下

说明:如果不会修改或者从没有修改过博客源码,可以直接把 header.asp 与  common/ubbcode.asp 上传到博客目录覆盖。

注意:进行此操作前先做好文件备份,以便造成不必要的麻烦

下载:附件防盗链-管理插件 下载文件 下载此文件


[本日志由 ilank 于 2008-01-20 10:31 PM 编辑]
文章来自:
引用通告: 查看所有引用 | 我要引用此文章
Tags: pjblog 插件 防盗
相关文章:

评论: 14 | 引用: 0 | 查看次数: 50754
yangzhirong [2008-01-04 04:13 PM]
我想知道Pjblog升级到2.7后附件管理该怎样修改,我以前用的是2.6的。升级后没有用附件管理,听说不支持2.7,但是以前的附件都下载不了了,谢谢!
---回复----------------------------------------------------------------------
请不要使用此插件,本站空间下载有限制,也不使用此插件,回答完毕
yangzhirong [2008-01-03 06:07 PM]
这个支持2.7的不?
AHUI [2007-12-11 12:26 AM]
你的验证码有问题,根本就引用不了文章,换成以前的就可以

-------------------------------------------------------------------
回复:因为我限制了验证码的位数,低于4位,就不能通过验证,但验证码最高也才3位,
所以你是不可能验证通过的,因为我不想有垃圾引用,所以就这样设置了
piaohh [2007-11-12 07:45 PM]
使用过程中开启防盗链的时候  自己登陆后怎么上传的图片都不显示出来呢!!还有本站下载也不可以  难道防盗链吧自己都防住了!!!

--//回复-------------------
建议你不要使用,此插件存在小问题,版本不兼容
68449040 [2007-10-02 09:13 AM]
那是服务器的什么问题呢...?

我在新的服务器上弄的确实是有问题.


但是.在我的旧的上面弄就是好使的.!
68449040 [2007-10-01 07:11 PM]
3.实现上传的图片添加水印的功能,后台有水印功能的相关设置
上传的时候,那个“选择水印类型”不能点的呢。。?
而且图片上传上去以后也并没有水印啊?

回复:你服务器问题
68449040 [2007-10-01 06:59 PM]
删除了header其中的一段代码,才可以了。。
68449040 [2007-10-01 06:30 PM]
为什么用了你的插件,上传到空间上以后,网站却打不开了呢。。


弄了好多次都是一样。!!
yangzhirong [2007-09-13 12:20 AM]
[quote=yangzhirong]你好,我把博客设成动态日志了,可是当打开某一篇日志时页面的布局就乱了,底边的内容跑到侧边去了,侧边的内容到中间了,这是为什么啊?谢谢!

站长回复:安装了不该安的插件或;在侧边工具栏新建了不该建的模块;最后一个原因,就是模版问题,一般不是这个问题。[/quote]


我已经找到问题了,谢谢!
yangzhirong [2007-09-12 03:45 PM]
你好,我把博客设成动态日志了,可是当打开某一篇日志时页面的布局就乱了,底边的内容跑到侧边去了,侧边的内容到中间了,这是为什么啊?谢谢!

站长回复:安装了不该安的插件或;在侧边工具栏新建了不该建的模块;最后一个原因,就是模版问题,一般不是这个问题。
发表评论
昵 称:
密 码: 游客发言不需要密码.
验证码: 验证码
内 容:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 关闭 | [img]标签 关闭