SRS附件管理 V4.0 beta1 For PJ3
作者:夜空寂灭 日期:2008-11-09
插件名称: SRS附件管理 V4.0 beta1 For PJ3
原 作 者: 夜空[DarkSky@SRS]
发布时间: 2008-11-08
版 本 号: 4.0
适用版本: pj3 (pj2应该也没问题的)
修改源码: 是
MD5 验证: C40F28EAA97AA3596BA9522C181FC8C4
下载地址:
点击下载此文件
附上修改后的文件,如果之前没修改过源程序可以直接替换
SRS_Attachment_EditFile_For PJBlog3 v2.8.5.157.rar
插件演示:
插件简介:
在上一个版本(3.0)还只是在原来的基础上修改,这次因为修复以前发现的问题及想增加的一些功能,所以全部代码重写了,所以名字也改为自己的
关于上传文件自定义命名的说明:
1、$d|字符数$:根据“字符数”生成指定长度的“数字字符串”。例如:$d|6$
字符范围是:"1234567890"
2、$s|字符数$:根据“字符数”生成指定长度的“字母字符串”。例如:$s|5$
字符范围是:"abcdefghijklmnopqrstuvwxyz"
3、$a|字符数$:根据“字符数”生成指定长度的“数字和字母的混合字符串”。例如:$a|8$
字符范围是:"abcdefghijklmnopqrstuvwxyz1234567890"
4、$date$:生成当前日期时间。
5、$fname$:上传文件原文件名。
自定义命名就是通过把这些标签自由组合为上传文件命名。
v4.0更新内容:
1、在PJ3下应用(静态也没问题);
2、修复rss读取错误;
3、完成上传文件自定义命名功能;
4、增加文字水印的设置选项;
5、增加水印随机位置;
6、增加实时更新下载次数功能;
想不起来了……你们安装了自己看吧……
安装方法:
1.header.asp
找到
- Dim BlogTitle
- response.cookies("SRS_Attachment_Down")= "SRS_Attachment"
- Session("SRS_Attachment_Down")="SRS_Attachment"
- Dim BlogTitle
2.feed.asp
添加代码(红色部分):
- <!--#include file="common/ubbcode.asp" -->
- <!--#include file="common/ModSet.asp" -->
- <!--#include file="plugins.asp" -->
找到
- .Pattern = "<a (.*?)href=""(?!(http|https|ftp|mms|rstp)://)(.*?)"""
- Str = .Replace(Str, "<a $1href=""" & SiteURL & "$3""")
- 'SRS附件管理 4.0 增加 By Kan 2008-11-06
- .Pattern = "onclick=""setTimeout\(function\(\)\{getSRSAttach(.*?)"""
- Str = .Replace(Str, "")
- .Pattern = "<label id=""SRSAttachCount(.*?)</label>"
- Str = .Replace(Str, "")
- .Pattern = "<script type=""text/javascript"">getSRSAttach(.*?)</script>"
- Str = .Replace(Str, "")
找到
- Conn.Close
- Set Conn = Nothing
- </channel>
- </rss>
- <%
- Conn.Close
- Set Conn = Nothing
- %>
3.ConContent.asp
在文件顶部添加导入文件(红色部分)
- <!--#include file="common/ModSet.asp" -->
- <!--#include file="plugins.asp" -->
4.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=SRSAttachDownload(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=SRSAttachDownload(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=SRSAttachDownload(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=SRSAttachDownload(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
- '=====================兼容以前的附件==================================
以上语句主要是对你博客中原来的附件地址的识别,以前添加的附件是没有防盗链的。注意上面的attachments是你博客附件文件所在的文件夹名称,如果你的博客附件的文件夹是其他的名称,做相应的替换即可
5.common/common.js
找到
- function addUploadItem(type,path,memberDown)
修改为:
- function addUploadItem(type,path,memberDown,autoico,IsShowInfo,IsUpdateNow)
然后,把这个函数最后部分
- default :
- if (EditType=="UBBEditor"){
- if (memberDown==1)
- {parent.document.forms[0].Message.value+='[mDown='+path+']点击下载此文件[/mDown]\n'}
- else
- {parent.document.forms[0].Message.value+='[down='+path+']点击下载此文件[/down]\n'}
- }
- else{oEditor.InsertHtml('<a href="'+path+'"><img border="0" src="../../images/download.gif" alt="" style="margin:0px 2px -4px 0px"/>点击下载此文件</a>')}
- break;
- default :
- if (EditType=="UBBEditor"){
- if (memberDown==1){
- parent.document.forms[0].Message.value+='[mDown='+path+']点击下载此文件[/mDown]\n'
- }else{
- parent.document.forms[0].Message.value+='[down='+path+']点击下载此文件[/down]\n'
- }
- }else{
- //'========= Kan 2008-11-04 插件:附近管理 增加对FCK的支持 Start =========
- var srs_att = path.split("=");
- var srs_att_no = srs_att.length;
- var srs_att_ico = "download.gif";
- var srs_att_icotype = "|jpg|gif|bmp|png|zip|rar|swf|mdb|doc|xls|pdf|mbk|mp3|wmv|wma|";
- if (autoico==1){
- if ( srs_att_icotype.indexOf("|"+type+"|") > -1 ){
- srs_att_ico= type+".gif"
- }else{
- srs_att_ico="unknow.gif"
- }
- srs_att_ico="file/"+srs_att_ico
- }
- var srs_att_InsertHtml = '<a href="'+path+'" target="_blank" title="点击下载此文件" '
- if (IsUpdateNow==1){
- srs_att_InsertHtml=srs_att_InsertHtml+'onclick="setTimeout(function(){getSRSAttach('+ srs_att[srs_att_no-1] + ')},3000);" '
- }
- srs_att_InsertHtml=srs_att_InsertHtml+'><img border="0" src="../../images/'+srs_att_ico+'" alt="点击下载" style="margin:0px 2px -4px 0px"/>点击下载此文件</a>'
- if (IsShowInfo==1){
- srs_att_InsertHtml=srs_att_InsertHtml+' <label id="SRSAttachCount'+srs_att[srs_att_no-1]+'">[附件信息Loading...]</label><script type="text/javascript">getSRSAttach('+srs_att[srs_att_no-1]+')</script>'
- }
- oEditor.InsertHtml(srs_att_InsertHtml)
- }
- //'========= Kan 2008-03-24 插件:附近管理 增加对FCK的支持 End =========
- break;
好了,代码的修改到这里就完成了。
提醒一下,修改前先做好备份啊!
哦,还有,在压缩包中的SRSA_update.asp文件时数据库升级文件,用于由附件管理3.0升级到4.0的,如果以前没应用过附件管理插件,这个文件可以删除。
文章来自: 本站原创
Tags: SRS 附件 管理 插件 PJBLOG
相关日志:
错误提示:
Microsoft VBScript runtime ���� '800a01f4'
Variable is undefined: 'SRSAttachDownload'
/blog/common/ubbcode.asp���� 222
引用来自 simjet再问一下 静态要怎么弄这个插件 不支持静态啊
静态也是一样,缺少了一些函数,只要在静态的模版页面加上就可以了,好像是static.htm
添加的js函数可以在plugins.asp里找到
引用来自 路人OB3708型我只想要下载次数统计和文件大小 能不能帮个忙?
www.simjet.net
可能缺少一些js函数吧,可以自行检查一下WAP访问页面是否有导入plugins.asp文件
我只想要下载次数统计和文件大小 能不能帮个忙?
www.simjet.net
引用来自 倾城之恋要修改的地方漏了一个……现在补上了,在第五步common/common.js处
页面用力 o>﹏<o 加载中...
上一篇
下一篇


回复



可能是哪里出问题了?
如果要修改,则需修改地方太多,而且现在已经推出了官方版本的附近管理,可以试试