📄 userfacemanage.asp
字号:
<!--#include file=../../INC/txlconst.asp-->
<!--#include file=../../INC/txlfun.asp-->
<%
Dim const_txl_HomeUrl
const_txl_HomeUrl = "../../"
%>
<!--#include file=../checkadmin.asp-->
<%
opendatabase
txl_SiteHead const_txlname&"- 管理员"
dim newnum
newnum=Request.Form("NEWNUM")
if newnum="" or (not isnumeric(newnum)) then newnum=0
dim sel
dim facecount,rs,faceurl,i
set rs=conn.execute ("select faceurl from config where id=1")
faceurl=rs(0)
rs.close
set rs=nothing
faceurl=Split(faceurl,"|")
facecount=Ubound(faceurl)
if request("Submit")="保存设置" then
call saveconst()
elseif request("Submit")="恢复默认设置" then
call savedefault()
else
call consted()
end if
closedatabase
SiteBottom
sub consted()
%>
<form method="POST" action=userfacemanage.asp name="bbspic" >
<table width="95%" border="0" cellspacing="1" cellpadding="3" align=center>
<tr>
<td height="23" colspan="4" ><B>说明</B>:<br>①、以下图片均保存于论坛<%=const_FaceUploadurl%>目录中,如要更换也请将图片放于该目录<br>②、右边复选框为删除选项,如果选择后点保存设置,则删除相应图片<BR>③、如仅仅修改文件名,可在修改相应选项后直接点击保存设置而不用选择右边复选框
</td>
</tr>
</table>
<table width="95%" border="0" cellspacing="1" cellpadding="3" align=center >
<tr>
<th height="23" colspan="4" align=left bgcolor="#7E99E7">注册头像管理设置 (目前共有<%=facecount%>个注册头像图片在文件夹:<%=const_FaceUploadurl%>)</th>
</tr>
<tr>
<td width="16%" align=left bgcolor="#DEE5FA" >批量增加数目:</td>
<td colspan="3" align=left bgcolor="#DEE5FA">
<input name="NEWNUM" type="text" value="<%=newnum%>">
<input type="submit" name="Submit" value="增加">
<font color="red">(增加后把相应的文件上传到该目录下。) </font></td>
</tr>
<%if Request.Form("Submit")="增加" then
dim newfile
newnum=Int(Request.Form("NEWNUM"))
for i=1 to newnum
%>
<tr>
<td width="16%" Highlight>注册头像ID:
<input type=hidden name="face_id<%=i%>" size="10" value="<%=i%>"><%=i%></td>
<td Highlight colspan="2">新增加的文件:
<input name="userface<%=facecount+i%>" type="text" id="userface<%=facecount+i%>" value="<%=facecount+i%>.gif">
</td>
<td width="17%" Highlight> <input name="delid<%=facecount+i%>" type="checkbox" id="delid<%=facecount+i%>" value="<%=facecount+i%>"></td>
</tr>
<%next%>
<% end if%>
<tr>
<th width="16%" >文件</th>
<th width="47%" >文件名</th>
<th width="20%" > 图片
<th width="17%" > 删除 </th>
</tr>
<% for i=0 to facecount-1 %>
<tr bgcolor="#DEE5FA">
<td width="16%" >文件名: <input type=hidden name="face_id<%=i%>" size="10" value="<%=i%>"></td>
<td width="47%" > <input name="userface<%=i+1%>" type="text" id="userface<%=i+1%>" value="<%=faceurl(i)%>"></td>
<td width="20%" > <img src=<%=const_txl_homeurl%>img/<%=faceurl(i)%>>
<td width="17%" > <input name="delid<%=i+1%>" type="checkbox" id="delid<%=i+1%>" value="<%=i+1%>">
</td>
</tr>
<% next %>
<tr>
<td colspan="4" > <B>注意</B>:右边复选框为删除选项,如果选择后点保存设置,则删除相应图片<BR>
如仅仅修改文件名,可在修改相应选项后直接点击保存设置而不用选择右边复选框 </td>
</tr>
<tr>
<td colspan="4" > <div align="center"> 删除选项:删除所选的实际文件(<font color=red>需要FSO支持功能</font>):是
<input type=radio name=setfso value=1 >
否
<input type=radio name=setfso value=0 >
请选择要删除的文件,
<input type="checkbox" name=chkall value=on onclick="CheckAll(this.form)">
全选 <BR>
<input type="submit" name="Submit" value="保存设置">
<input type="submit" name="Submit" value="恢复默认设置">
</div></td>
</tr>
</table>
<BR><BR>
</form>
<script language="JavaScript">
<!--
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked;
}
}
//-->
</script>
<%
end sub
sub saveconst()
dim f_userface,formname,d_elid,faceid,i
dim filepaths,objFSO,upface
for i=1 to facecount+newnum
faceid="face_id"&i
d_elid="delid"&i
formname="userface"&i
if cint(request.Form(d_elid))=0 then
f_userface=f_userface&request.Form(formname)&"|"
else
upface=const_txl_homeurl&const_FaceUploadurl&request.Form(formname)
if request("setfso")=1 then
filepaths=Server.MapPath(""&upface&"")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
if objFSO.fileExists(filepaths) then
objFSO.DeleteFile(filepaths)
response.write "删除"&filepaths&"<br>"
else
response.write "未找到"&filepaths&"<br>"
end if
end if
end if
next
dim sql,upconfig
upconfig=" faceurl='"&f_userface& "' "
sql = "update config set "&upconfig&" "
conn.execute(sql)
response.write "<br>设置成功。<a href="&Request.ServerVariables("HTTP_REFERER")&" >点击返回</a>"
end sub
sub savedefault()
dim userface,PostFace,emot,sql
for i=1 to 60
userface=userface&i&".bmp|"
next
sql = "update config set faceurl='"&userface&"' where id=1"
conn.execute(sql)
response.write "<br>设置成功。<a href="&Request.ServerVariables("HTTP_REFERER")&" >点击返回</a>"
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -