📄 myfile.asp
字号:
<input type=hidden name="F_AnnounceID" value="<%= rs("F_AnnounceID") %>">
<%end if%>
<a href="dispbbs.asp?Boardid=<%=rs("F_BoardID")%>&ID=<%=F_Rootid%>&replyID=<%=F_bbsid%>&skin=1" target="_blank" title="浏览相关帖子">[<font color=<%=Forum_body(8)%>>查看相关讨论</font>]</a>
</td>
</tr>
<%end if%>
<tr>
<td width="15%" height="26" class=tablebody2 align=right>文件的说明:</td>
<td width="85%" height="26" class=tablebody1 align=left>
<textarea name="F_Readme" rows=6 cols=80% wrap=VIRTUAL><%response.write Server.htmlencode(body)%></textarea>
<input type=hidden name="saveid" value="<%= rs("F_ID") %>"> (不得超过125个汉字或250个字符)
</td>
</tr>
<%if myurl=true then %>
<tr>
<td valign=middle align=right class=tablebody2 >文件允许删除:</td>
<td valign=middle class=tablebody1>
<input type=radio name=Fflag value=0 <%if rs("F_Flag")=0 then %> checked<%end if%>>是
<input type=radio name=Fflag value=2 <%if rs("F_Flag")=2 then %> checked<%end if%>>否
</td>
</tr>
<%else%>
<tr>
<td valign=middle align=right class=tablebody2 >文件允许删除:</td>
<td valign=middle class=tablebody1>
<input type=radio name=Fflag value=1 <%if rs("F_Flag")=1 then %> checked<%end if%>>是
<input type=radio name=Fflag value=2 <%if rs("F_Flag")=2 then %> checked<%end if%>>否
</td>
</tr>
<%end if%>
<tr>
<td width="100%" height="26" colspan="2" class=tablebody1>
说明:<li>若允许文件可删除,则当含有该文件的帖子被删除后,文件有可能亦被删除;
<li>文件说明不得超过125个汉字或250个字符.
</td>
</tr>
<tr>
<th width="100%" height="26" colspan="2">
<input type=Submit value="保存" name=Submit>
</th>
</tr>
</form>
</table>
<%
end if
rs.close
set rs=nothing
end sub
'保存修改
sub filesave()
if GroupSetting(48)=0 then
errmsg=errmsg+"<br>"+"<li>您没有论坛文件管理的权限,请与管理员联系。"
founderr=true
exit sub
end if
dim saveid,F_Readme,Fflag,fileurl
dim F_BoardID,F_AnnounceID
F_BoardID=checkStr(trim(request.form("F_BoardID")))
F_AnnounceID=checkStr(trim(request.form("F_AnnounceID")))
F_Readme=checkStr(trim(request.form("F_Readme")))
saveid=trim(request.form("saveid"))
Fflag=trim(request.form("Fflag"))
if not isnumeric(Fflag) or not isnumeric(F_BoardID) then
errmsg=errmsg+"<br>"+"<li>执行的数据不存在,或不合符要求。"
founderr=true
exit sub
end if
if not isnumeric(saveid) or isnull(saveid) then
errmsg=errmsg+"<br>"+"<li>执行的数据不存在。"
founderr=true
exit sub
end if
if F_Readme="" or isnull(F_Readme) then
errmsg=errmsg+"<br>"+"<li>说明内容不能为空。"
founderr=true
exit sub
end if
if strLength(F_Readme)>250 then
ErrMsg=ErrMsg+"<Br>"+"<li>说明内容不得大于" & 250 & "bytes"
FoundErr=true
exit sub
end if
fileurl=checkStr(trim(request.form("fileurl")))
if fileurl<>"" then
if instr(fileurl,"/")=0 or instr(fileurl,"://")=0 or instr(fileurl,".")=0 then
ErrMsg=ErrMsg+"<Br>"+"<li>请填写完整的文件链接地址!"
FoundErr=true
exit sub
end if
conn.execute("update [DV_Upfile] set F_Filename='"&fileurl&"',F_Readme='"&F_Readme&"' ,F_Flag="&Fflag&" where F_ID="&saveid)
else
conn.execute("update [DV_Upfile] set F_BoardID="&F_BoardID&",F_AnnounceID='"&F_AnnounceID&"',F_Readme='"&F_Readme&"' ,F_Flag="&Fflag&" where F_ID="&saveid)
end if
sucmsg=sucmsg+"<br>"+"<li><b>编辑成功。<a href=myfile.asp >[返回管理页面]</a>"
call dvbbs_suc()
end sub
'新增文件
sub addnew()
%>
<table cellpadding=3 cellspacing=1 align=center class=tableborder1>
<form action="?action=fsnew" method=post >
<tr>
<th width="100%" height="26" colspan="2" align=left>新增我个人文件</th>
</tr>
<tr>
<td width="15%" height="26" class=tablebody2 align=right>新增的文件:</td>
<td width="85%" height="26" class=tablebody1 align=left>
<input type=text name="fileurl" size="80%" value="http://"> (请填写完成的文件链接地址)
</td>
</tr>
<tr>
<td width="15%" height="26" class=tablebody2 align=right>文件的说明:</td>
<td width="85%" height="26" class=tablebody1 align=left>
<textarea name="F_Readme" rows=6 cols=80% wrap=VIRTUAL value=""></textarea> (不得超过125个汉字或250个字符)
</td>
</tr>
<tr>
<td valign=middle align=right class=tablebody2 >文件的类型:</td>
<td valign=middle class=tablebody1>
<select name="filetype" size=1>
<option value="">文件类型</option>
<%
dim iupload
iupload="文件集|图片集|FLASH集|音乐集|电影集"
iupload=split(iupload,"|")
for i=0 to ubound(iupload)
response.write "<option value="&i&">"&iupload(i)&"</option>"
next
%>
</select>
</td>
</tr>
<td valign=middle align=right class=tablebody2 >文件允许删除:</td>
<td valign=middle class=tablebody1>
<input type=radio name=Fflag value=1 checked >是
<input type=radio name=Fflag value=2 >否
</td>
</tr>
<tr>
<td width="100%" height="26" colspan="2" class=tablebody1>
说明:<li>若允许文件可删除,当清理时会自动清除;
<li>文件说明不得超过125个汉字或250个字符;
<li>请用HTTP://或FTP://或HTTPS://开头的完整链接地址.
</td>
</tr>
<tr>
<th width="100%" height="26" colspan="2">
<input type=Submit value="保存" name=Submit> <INPUT TYPE="reset" value="清除">
</th>
</tr>
</form>
</table>
<%
end sub
'保存新增文件
sub savenew()
if GroupSetting(48)=0 then
errmsg=errmsg+"<br>"+"<li>您没有论坛文件管理的权限,请与管理员联系。"
founderr=true
exit sub
end if
dim F_Readme,fileurl,filetype,fileExt,fileExt_a,filename
dim F_Type,F_Flag
F_Readme=checkStr(trim(request.form("F_Readme")))
fileurl=checkStr(trim(request.form("fileurl")))
filetype=trim(request.form("filetype"))
F_Flag=trim(request.form("Fflag"))
if fileurl="" or isnull(fileurl) then
errmsg=errmsg+"<br>"+"<li>文件链接不能为空。"
founderr=true
exit sub
else
if strLength(fileurl)>250 then
ErrMsg=ErrMsg+"<Br>"+"<li>文件链接不得大于" & 250 & "bytes"
FoundErr=true
exit sub
end if
end if
if F_Readme="" or isnull(F_Readme) then
errmsg=errmsg+"<br>"+"<li>说明内容不能为空。"
founderr=true
exit sub
end if
if strLength(F_Readme)>250 then
ErrMsg=ErrMsg+"<Br>"+"<li>说明内容不得大于" & 250 & "bytes"
FoundErr=true
exit sub
end if
if not isnumeric(F_Flag) then
errmsg=errmsg+"<br>"+"<li>执行的数据不存在。"
founderr=true
exit sub
end if
if instr(fileurl,"/")=0 or instr(fileurl,"://")=0 or instr(fileurl,".")=0 then
ErrMsg=ErrMsg+"<Br>"+"<li>请填写完整的文件链接地址!"
FoundErr=true
exit sub
else
filename=split(fileurl,"/")
fileExt=lcase(filename(ubound(filename)))
end if
fileExt_a=split(fileExt,".")
fileExt=lcase(fileExt_a(ubound(fileExt_a)))
if fileEXT="asp" and fileEXT="asa" and fileEXT="aspx" then
ErrMsg=ErrMsg+"<Br>"+"<li>文件格式不支持,请重新填写!"
FoundErr=true
exit sub
end if
if lcase(fileExt)="gif" or lcase(fileExt)="jpg" or lcase(fileExt)="jpeg" or lcase(fileExt)="bmp" or lcase(fileExt)="png" then
F_Type=1
elseif lcase(fileExt)="swf" or lcase(fileExt)="swi" then
F_Type=2
elseif lcase(fileExt)="mid" or lcase(fileExt)="wav" or lcase(fileExt)="mp3" or lcase(fileExt)="rmi" or lcase(fileExt)="cda" then
F_Type=3
elseif lcase(fileExt)="avi" or lcase(fileExt)="wov" or lcase(fileExt)="asf" or lcase(fileExt)="mpg" or lcase(fileExt)="mpeg" or lcase(fileExt)="ra" or lcase(fileExt)="ram" then
F_Type=4
else
F_Type=0
end if
BoardID=0
conn.execute("insert into dv_upfile (F_BoardID,F_UserID,F_Username,F_Filename,F_FileType,F_Type,F_Readme,F_Flag ) values ("&BoardID&","&UserID&",'"&membername&"','"&replace(fileurl,"|","")&"','"&replace(fileExt,".","")&"',"&F_Type&",'"&F_Readme&"',"&F_Flag&" )")
sucmsg=sucmsg+"<br>"+"<li><b>编辑成功。<a href=myfile.asp >[返回管理页面]</a>"
call dvbbs_suc()
end sub
'删除文件
sub fdel()
dim delid
if GroupSetting(48)=0 then
errmsg=errmsg+"<br>"+"<li>您没有论坛文件管理的权限,请与管理员联系。"
founderr=true
exit sub
end if
delid=replace(request("delid"),"'","")
if delid="" or isnull(delid) then
Errmsg=Errmsg+"<li>"+"请选择相关参数。"
founderr=true
exit sub
else
if master or superboardmaster or boardmaster then
conn.execute("delete from DV_Upfile where F_ID in ("&delid&")")
else
conn.execute("delete from DV_Upfile where F_Flag=1 and F_ID in ("&delid&")")
end if
sucmsg=sucmsg+"<br>"+"<li><b>您已经删除选定的文件记录。"
call dvbbs_suc()
end if
end sub
'删除所有文件
sub alldel()
if GroupSetting(48)=0 then
errmsg=errmsg+"<br>"+"<li>您没有论坛文件管理的权限,请与管理员联系。"
founderr=true
exit sub
end if
dim delid
delid=replace(request("delid"),"'","")
if delid="" or isnull(delid) then
Errmsg=Errmsg+"<li>"+"请选择相关参数。"
founderr=true
exit sub
end if
'conn.execute("delete from DV_Upfile where F_Flag=1 and F_UserID="&userid)
sucmsg=sucmsg+"<br>"+"<li><b>您已经删除了所有文件记录。"
call dvbbs_suc()
end sub
function filenum(types)
dim stype
if isnumeric(types) then
select case types
case 0
stype="F_Type=0 and"
case 1
stype="F_Type=1 and"
case 2
stype="F_Type=2 and"
case 3
stype="F_Type=3 and"
case 4
stype="F_Type=4 and"
case else
stype=""
end select
else
stype=""
end if
rs=conn.execute("Select Count(F_ID) From DV_Upfile Where "&stype&" F_UserID="&userid&"")
filenum=rs(0)
set rs=nothing
if isnull(filenum) then filenum=0
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -