附件管理整合版(防盗链)


打开:Action.asp
上插入
<!--#include file="control/f_control.asp" -->


在 set checkcdb=nothing 下面添加
ElseIf request("action") = "Antidown" or request("action") = "Antimdown" then
dim down, showdownstr, id
response.expires=-1
response.expiresabsolute=now()-1
response.cachecontrol="no-cache"
id = request("id")
id = split(id,"&")(0)
Set down = conn.execute("select FilesPath,FilesCounts from blog_Files where id="&id)
response.clear()
If request("action") = "Antimdown" and memName = empty Then
showdownstr = getFileIcons(getFileInfo(down(0))(9))&" 该文件只允许会员下载! <a href=""login.asp"" accesskey=""L"">登录</a> | <a href=""register.asp"">注册</a>"
Else
showdownstr = getFileIcons(getFileInfo(down(0))(9))&" <a href="""&request("downurl")&""" target=""_blank"">"&trim(checkstr(request("main")))&" </a>[该附件大小 <font color=red>"&getFileInfo(down(0))(0)&"</font> ; 更新于 <font color=red>"&Datetostr(getFileInfo(down(0))(10),"Y-m-d")&"</font> ; 已被下载 <font color=red>"&down(1)&"</font> 次]"
End If
response.write showdownstr


打开:common/ubbcode.asp 找到
re.Pattern = "\[down=(.[^\]]*)\](.[^\[]*)\[\/down]"
在上面插入
            dim rndnum11, rndnum22, rndnum33, rndnum44
            re.Pattern = "\[down=(download\.asp\?id=)(.[^\[]*)\](.[^\[]*)\[\/down]"
            Set strMatchs = re.Execute(strContent)
            For Each strMatch in strMatchs
                tmpStr1 = checkURL(strMatch.SubMatches(0))
                tmpStr2 = strMatch.SubMatches(1)
                tmpStr3 = strMatch.SubMatches(2)
                rndnum11 = randomStr(10)
                strContent = Replace(strContent, strMatch.Value, "<span id=""down_"&rndnum11&"""></span><script language=""javascript"" type=""text/javascript"">check('Action.asp?action=Antidown&id="&tmpStr2&"&downurl="&server.URLEncode(tmpStr1&tmpStr2)&"&main="&server.URLEncode(tmpStr3)&"','down_"&rndnum11&"','down_"&rndnum11&"');</script>", 1, -1, 0)
            Next

            re.Pattern = "\[down\](download\.asp\?id=)(.[^\[]*)\[\/down\]"
            Set strMatchs = re.Execute(strContent)
            For Each strMatch in strMatchs
                tmpStr1 = checkURL(strMatch.SubMatches(0))
                tmpStr2 = strMatch.SubMatches(1)
                rndnum22 = randomStr(10)
                strContent = Replace(strContent, strMatch.Value, "<span id=""down_"&rndnum22&"""></span><script language=""javascript"" type=""text/javascript"">check('Action.asp?action=Antidown&id="&tmpStr2&"&downurl="&server.URLEncode(tmpStr1&tmpStr2)&"&main="&server.URLEncode("点击下载此文件")&"','down_"&rndnum22&"','down_"&rndnum22&"');</script>", 1, -1, 0)
            Next

            re.Pattern = "\[mDown=(download\.asp\?id=)(.[^\[]*)\](.[^\[]*)\[\/mDown]"
            Set strMatchs = re.Execute(strContent)
            For Each strMatch in strMatchs
                tmpStr1 = checkURL(strMatch.SubMatches(0))
                tmpStr2 = strMatch.SubMatches(1)
                tmpStr3 = strMatch.SubMatches(2)
                rndnum33 = randomStr(10)
                strContent = Replace(strContent, strMatch.Value, "<span id=""mdown_"&rndnum33&"""></span><script language=""javascript"" type=""text/javascript"">check('Action.asp?action=Antimdown&id="&tmpStr2&"&downurl="&server.URLEncode(tmpStr1&tmpStr2)&"&main="&server.URLEncode(tmpStr3)&"','mdown_"&rndnum33&"','mdown_"&rndnum33&"');</script>", 1, -1, 0)
            Next

            re.Pattern = "\[mDown\](download\.asp\?id=)(.[^\[]*)\[\/mDown]"
            Set strMatchs = re.Execute(strContent)
            For Each strMatch in strMatchs
                tmpStr1 = checkURL(strMatch.SubMatches(0))
                tmpStr2 = strMatch.SubMatches(1)
                rndnum44 = randomStr(10)
                strContent = Replace(strContent, strMatch.Value, "<span id=""mdown_"&rndnum44&"""></span><script language=""javascript"" type=""text/javascript"">check('Action.asp?action=Antimdown&id="&tmpStr2&"&downurl="&server.URLEncode(tmpStr1&tmpStr2)&"&main="&server.URLEncode("点击下载此文件")&"','mdown_"&rndnum44&"','mdown_"&rndnum44&"');</script>", 1, -1, 0)
            Next


共 3 页: [1] [2] [3] [全文阅读]



评论: 7 | 引用: 0 | 查看次数: 5149
simjet
回复回复simjet [2009-04-01 00:48:49 | del | 取消审核]
请教两个问题

第一个  

后台管理 附件信息 这边,怎么让每页显示100个?

第二个

修改后文章没有引用的附件不会自动选中

不知道是我的问题还是代码的问题
sean0
回复回复sean0 [2009-03-09 20:50:38 | del | 取消审核]
我安装你的方法修改了,是静态页面
但是老是加载状态
这是怎么回事??
4564545
回复回复4564545 [2009-03-01 23:42:04 | del | 取消审核]
The Microsoft Jet database engine cannot find the input table or query 'blog_Files'. Make sure it exists and that its name is spelled correctly.

/blog/control/c_SQLFile.asp, line 77


情留メ蚊子 于 2009-03-02 05:53 PM 回复
请升级数据库
skywalker
回复回复skywalker [2009-01-15 21:36:02 | del | 取消审核]
第一件事情:你的留言板不好用了,留言提交后找不到地址
第二件事情:我非常喜欢你的这个选项卡,相关日志(支持全静态别名)的东西,你可以发给我修改方法或者代码吗?
InsHy
回复回复InsHy [2009-01-09 10:39:55 | del | 取消审核]
蚊子兄 能不能把你的站的留言本发我一份 我的好像不能支持别名静态模式下的内页侧栏。
我的邮箱是 7223033@qq.com  

还有你的留言本现在不能留言了 不知道为什么 所以就发这了 请见谅
EL10P
回复回复EL10P [2009-01-09 01:09:12 | del | 取消审核]
放假喽。..........
海天无影
回复回复海天无影 [2009-01-04 11:04:46 | del | 取消审核]
请问这个什么原理啊。。。目标另存为和迅雷就不能下载。。。但还是在你的网站啊。。。防盗链不是应该其他网站才不能下载的吗~

情留メ蚊子 于 2009-01-04 12:01 AM 回复
用迅雷可以下载。。另保存不能,用IE默认的下载可以

发表评论
昵 称:
密 码:    游客发言不需要密码.
邮 箱:    支持Gravatar头像
网 址:
验证码:    点击输入框
内 容:
您一共可以输入1000个字
选 项:
不想保留信息请删除cookie
发表评论后您发表的内容自动复制到了剪贴板
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 关闭