⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 download.asp

📁 程序介绍: 1、内嵌式投票系统
💻 ASP
字号:
<%
''''''''''''''''''''''''''''''''''''''''''''
'
'  TXSite / 通用网站系统
'
'  版本    :v1.8.20
'
'  制作人  :milp(milp@21cn.com)
'
'  版权所有:源码之家(http://www.21tx.com)
'
'  主页地址:http://www.21tx.com
'            http://www.bestnets.net
'            http://www.soucn.com
'
'  技术支持:http://www.21tx.com/bbs
'
''''''''''''''''''''''''''''''''''''''''''''
'程序创建时间   12:53 2001-8-7
'程序完成时间   15:55 2001-8-7
'最后修改时间   23:58 2001-9-10
'注意:用户不得修改和删除下载,共有两处判断
if session("adminflag")="" then Response.Redirect "default.asp"

'const defaultdown="http://www.bestnets.net/download/6/"    '默认的用户下载目录
const defaultdown="/6/" 
dim action,downarr,id,name,r,m,s,mtype,stype,addate,isUse,keywords,author,authorurl,url,content,score,size,click,surround,copyright
action=request("action")

const thisprog="download.asp"
dim sqlfenye,txtitle
txtitle=request("searchtxt")
if session("adminflag")<3 then
if txtitle<>"" then
  sqlfenye="select * from main where showflag=1 and name like '%"&trim(txtitle)&"%' order by id desc"
else
  sqlfenye="select * from main where showflag=1 order by id desc"
end if
else
if txtitle<>"" then
  sqlfenye="select * from main where showflag=1 and addname='"&session("name")&"' and name like '%"&trim(txtitle)&"%' order by id desc"
else
  sqlfenye="select * from main where showflag=1 and addname='"&session("name")&"' order by id desc"
end if
end if
Sub deleteid(id)
 if session("adminflag")>2 then
  rSub.open "select * from main where id="&id,conn,1,1
  if rSub("addname")<>session("name") then
   rSub.close
   PrintMsg("你没有权限删除其他人添加的下载!")
  end if
 end if
 conn.execute "delete from main where id="&cstr(id)
End sub
Sub isUseid(id)
 if session("adminflag")>2 then
  rSub.open "select * from main where id="&id,conn,1,1
  if rSub("addname")<>session("name") then
   rSub.close
   PrintMsg("你没有权限修改其他人添加的下载!")
  end if
 end if
  conn.execute "update main set isUse=True where id="&cstr(id)
End sub
Sub notisUseid(id)
 if session("adminflag")>2 then
  rSub.open "select * from main where id="&id,conn,1,1
  if rSub("addname")<>session("name") then
   rSub.close
   PrintMsg("你没有权限修改其他人添加的下载!")
  end if
 end if
  conn.execute "update main set isUse=False where id="&cstr(id)
End Sub
%>
<!--#include file="base.asp"-->
<!--#include file="char.asp"-->
<!--#include file="subs.asp"-->
<%
if action="" then action="add"
if action="fenye" then
  Call fenye
elseif action="mod" then
  Call moddownload
elseif action="saveadd" then
  Call savedownload
elseif action="savemod" then
  Call savedownload
else
  Call adddownload
end if
%>
<!--#include file="end.asp"-->

<%Sub moddownload
rSub.open "select main.*,type.rtype,type.mtype,type.stype from main,type where type.s=main.s and main.id="&request("id"),conn,1,1
if rSub.bof and rSub.eof then Call PringMsg("操作错误!")
id=rSub("id")
name=rSub("name")
s=rSub("s")
m=rSub("m")
r=rSub("r")
mtype=rSub("mtype")
stype=rSub("stype")
addate=rSub("addate")
keywords=rSub("keywords")
author=rSub("author")
authorurl=rSub("authorurl")
isUse=rSub("isUse")
content=rSub("content")
surround=rSub("surround")
size=rSub("size")
score=rSub("score")
click=rSub("click")
copyright=rSub("copyright")
rSub.close

if instr(content,"|")>0 then
 dim xx
 downarr=split(content,"|")
 for xx = 0 to ubound(downarr)-1
   url=url&downarr(xx)+chr(13)
 next
 content=downarr(ubound(downarr))
end if

Call adddownload
End Sub%>

<%Sub adddownload%>
<p align=center><font color=red><b><%=request("msg")%></b></font></p>
<form name="txForm" method="post" action="<%=thisprog%>?action=save<%=action%>&id=<%=id%>">
  <table width="90%" border="0" cellspacing="4" cellpadding="0" align="center">
    <tr>
      <td width=100%><b>下载名称:</b>
        <input type="text" name="name" size="30" maxlength="100" value="<%=name%>"><font color=red>**</font>(最多100字符)
        <br>
        <b>软件大小:</b>
        <input type="text" name="size" size="10" maxlength="10" value="<%=size%>">
<%if size="" then response.write "<select name=KM><option value=K>K</option><option value=M>M</option></select>"%>
       <b>评价:</b>
<select name="score">
<%
if score="" then
  score=4
  rname="初始点击值"
else
  rname="已被点击"
end if
for xx=1 to 5
if xx=score then
   selo="selected"
else
   selo=""
end if
  response.write "<option "&selo&" value="&xx&">"&xx&"星</option>"
next
%>
</select><font color=red>**</font>
<%if session("adminflag")<3 then%>
        <br>
        <b>添加时间:</b>
        <input type="text" name="addate" size="10" maxlength="20" value="<%=addate%>">(不填则为系统时间)
        <b><%=rname%>:</b>
        <input type="text" name="click" size="3" maxlength="10" value="<%=click%>">(不填则置为1)
<%end if%> 
        <br>
        <b>下载栏目:</b>
<%Call fenlei%><br>
        <b>运行环境:</b>
<select name="surround">
<option <%if surround="ASP环境" then response.write "selected"%> value="ASP环境">ASP环境</option>
<option <%if surround="PHP环境" then response.write "selected"%> value="PHP环境">PHP环境</option>
<option <%if surround="CGI环境" then response.write "selected"%> value="CGI环境">CGI环境</option>
<option <%if surround="Windows环境" then response.write "selected"%> value="Windows环境">Windows环境</option>
<option <%if surround="Unix/Linux环境" then response.write "selected"%> value="Unix/Linux环境">Unix/Linux环境</option>
<option value="未知环境">未知环境</option>
</select>
版权形式:
<select name="copyright">
<option <%if copyright="共享软件" then response.write "selected"%> value="共享软件">共享软件</option>
<option <%if copyright="付费软件" then response.write "selected"%> value="付费软件">付费软件</option>
<option <%if copyright="商业软件" then response.write "selected"%> value="商业软件">商业软件</option>
<option value="未知形式">未知形式</option>
</select>
<%if name="" and session("adminflag")<4 then%>
是否有效:<input type="checkbox" name="isUse" checked>
<%elseif session("adminflag")<4 then%>
是否有效:<input type="checkbox" name="isUse" value="<%=isUse%>" <%if isUse then response.write "checked"%>>
<%end if%>        <br>
        <b>原 作 者:</b>
        <input type="text" name="author" size=10 maxlength="50" value="<%=author%>">(最多50字符)
        <b>作者链接:</b>
        <input type="text" name="authorurl" size=12 maxlength="100" value="<%=authorurl%>">(最多100字符)
        <br>
        <b>关 键 字:</b>
        <input type="text" name="keywords" size="10" maxlength="50" value="<%=keywords%>">(最多50字符,参照下面的关键字索引,添加了关键字才有相关内容)
        <br>
        <b>下载链接:</b>
<%
  dim fname
  fname = now()
  fname = replace(fname,"-","")
  fname = replace(fname," ","") 
  fname = replace(fname,":","")
  fname = replace(fname,"PM","")
  fname = replace(fname,"AM","")
  fname = replace(fname,"上午","")
  fname = replace(fname,"下午","")
  fname = int(fname) + int(10*Rnd + 1)
'  if url="" then url=defaultdown&fname&".zip"
%>
        <textarea cols="60" name="url" rows="4"><%=url%></textarea><font color=red>**</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<strong>支持无限下载链接</strong>,每行一个链接,空行自动忽略!)
        <br>
<%if content<>"" then
content=replace(content,"<BR>",chr(13),1,-1,1)
content=replace(content,"</p><p>",chr(13),1,-1,1)
'content=replace(content,"&nbsp;"," ",1,-1,1)
end if
%>
        <b>下载简介:</b>
        <textarea cols="60" name="content" rows="8" title=可以使用Ctrl+Enter快速提交><%=content%></textarea><font color=red>**</font>
        <p>
        <input type="submit" value="提交">
        <input type="reset" value="重置"> <font color=red>[可以使用Ctrl+Enter快速提交]</font></p>
   </td>
   </tr>
  </table>
</form>
<p><%Call showkeywords%></p>
<%End Sub

Sub savedownload
name=trim(request.form("name"))
keywords=trim(request.form("keywords"))
isUse=trim(request.form("isUse"))
author=trim(request.form("author"))
authorurl=trim(request.form("authorurl"))
url=trim(request.form("url"))
s=trim(request.form("s"))
click=trim(request.form("click"))
score=trim(request.form("score"))
size=trim(request.form("size"))
copyright=trim(request.form("copyright"))
surround=trim(request.form("surround"))

addate=trim(request.form("addate"))
if addate="" then addate=now()

'if action="saveadd" then
  content=ubbcode(request.form("content"))
'else
'  content=request.form("content")
'end if

if name="" then 
OutMsg=OutMsg+"<br>"+"<li>错误提示:请输入下载名称!"
founderr=true
end if
if s="" then 
OutMsg=OutMsg+"<br>"+"<li>错误提示:请选择下载栏目!"
founderr=true
end if
if not isDate(addate) then 
OutMsg=OutMsg+"<br>"+"<li>错误提示:你输入的时间非法!"
founderr=true
end if
if url="" then 
OutMsg=OutMsg+"<br>"+"<li>错误提示:请输入最少一个下载链接!"
founderr=true
end if
if content="" then 
OutMsg=OutMsg+"<br>"+"<li>错误提示:请输入下载简介!"
founderr=true
end if
if instr(url,"|")>0 or instr(content,"|")>0 then
OutMsg=OutMsg+"<br>"+"<li>错误提示:下载链接或下载简介中包含非常字符 '|' "
founderr=true
end if
if instr(url,"/")<1 then
OutMsg=OutMsg+"<br>"+"<li>错误提示:请输入合法的链接!"
founderr=true
end if
if founderr=true then Call PrintMsg(OutMsg)

if instr(url,chr(10))>0 then
 dim xx
 downarr=split(url,chr(10))
 url=""
 for xx = 0 to ubound(downarr)
'   if instr(url,"/")<1 or instr(url,":")<1 then PrintMsg("请输入合法的链接!")
   if instr(downarr(xx),"/")>0 then url=url&trim(downarr(xx))&"|"
 next
 url=url&"|"
 url=replace(url,"||","")
end if

dim rst
set rst=server.createobject("adodb.recordset")
rst.open "select * from type where s="&s,conn,1,1

if action="saveadd" then
  rSub.open "select * from main where id is null",conn,1,3
  rSub.AddNew
  rSub("showflag")=1
  rSub("addname")=session("name")
  size=size&trim(request.form("KM"))
elseif action="savemod" then
  rSub.open "select * from main where id="&request("id"),conn,1,3
  if rSub("addname")<>session("name") then
   rSub.close
   PrintMsg("你没有权限修改其他人添加的下载!")
  end if
end if

rSub("content")=url+"|"+content

rSub("name")=name
rSub("s")=s
rSub("addate")=addate
rSub("score")=score
if copyright<>"未知形式" then rSub("copyright")=copyright
if keywords<>"" then
 rSub("keywords")=keywords
else
 rSub("keywords")=NULL
end if
if author<>"" then rSub("author")=author
if authorurl<>"" then rSub("authorurl")=authorurl
if surround<>"未知环境" then rSub("surround")=surround
if size<>"" then rSub("size")=size
if click<>"" then
  rSub("click")=click
else
  rSub("click")=1
end if
if isUse="" then
  rSub("isUse")=False
else
  rSub("isUse")=True
end if
if session("adminflag")>3 and action="saveadd" then rSub("isUse")=False
rSub("r")=rst("r")
rSub("m")=rst("m")
rSub.update
id=rSub("id")
rSub.close
rst.close
set rst=nothing
if session("adminflag")=4 then foruser="请等待副站长或站长审核"
if session("adminflag")>2 and action="saveadd" then PrintMsg("添加成功 "&foruser&" <a href=../show.asp?id="&id&" target=_blank>预览</a> <a href="&thisprog&"?action=add>继续添加</a>")
if action="savemod" then response.redirect thisprog&"?action=mod&id="&request("id")
response.redirect thisprog
End Sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -