官方首页 | 无图版 | BBS首页
PJBlog3 2.8.5.157 新版发布 下载|升级(2008.8.26) 大话PJ3 | PJ3评测反馈 | PJ3发展建议 PJ纪念版T-shirt设计大赛投票结束大奖揭晓! PJ3内测团队主创人员身份,性格,特点吐血大曝光
PJBlog技术支持论坛使用问题总索引 PJ-Blog 3 斑竹日志 【独家】我使用过的三种空间,与客服的精彩故事 Z-Blog,Wordpress,Bo-Blog转换到PJBlog
 26 123
发新话题
打印

[插件发布] 附件管理插件 V2.0 ForPJBlog2

本主题由 嵘心天涯 于 2007-5-1 19:34 设置高亮

附件管理插件 V2.0 ForPJBlog2

本插件已出新版本: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

由于本人水平有限,不足之处,请多多包涵
附件: 您所在的用户组无法下载或查看附件
本帖最近评分记录
  • 嵘心天涯 PJ币 +40 非常不错,感谢分享 2007-5-1 19:33
Welcome To Shotan's Blog

TOP

晕忽忽。我照上述方法试了。居然乱码啦

TOP

我的博客
http://tt456.cn

TOP

乱码?不会吧,我运行是正常的,而且为了避免错误,我在本机测试了好几遍啊
兄弟,你能截个图来看看吗?
Welcome To Shotan's Blog

TOP

不错

TOP

·● 迈克伍:MichaelWu.CN

TOP

哈哈哈哈!对我没什么用,帮你顶了!
即使心再碎也不流泪……
http://www.l-sky.cn

TOP

8cuo,支持一下

TOP

看起来乱乱的,好象没什么用吧

TOP

很不错,很不错,竟然现在才看到。。

TOP

 26 123
发新话题