📄 matrix3_eplist.asp
字号:
<!-- #include file="const.asp" -->
<!-- #include file="ep_config.asp" -->
<%
call opendb()
checkadmin()
call closedb()
dim objFSO,objFolder,objFile,ep_folder,dfile,action1
dim wordstr,imgstr,ep_str,i,color,j,x
dim uploadsize,uploadtype,uploadfolder
uploadsize=200 'K
uploadtype="jpg,gif,bmp,jpeg"
ep_folder="expression"
%>
<html>
<head>
<title><%=sitename%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function alertwin(url)
{
if(confirm("确定删除文件?"))
{
location.href = url;
}
}
function clickall0(obj){
for (var i=0; i<obj.elements.length; i++)
{
var e=obj.elements[i];
if (e.name=="id")
{
e.checked=obj.clickall.checked;
}
}
}
function submitsave(obj){
obj.action1.value="save";
obj.Submit2.disabled=true;
obj.submit();
}
function submitdel(obj){
if(confirm("确定要执行删除?"))
{
obj.action1.value="delete2";
obj.Submit3.disabled=true;
obj.submit();
}
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="10" align="center" valign="top"> <!-- #include file="topbar.asp" --> </td>
</tr>
<tr>
<td align="center" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="12" bgcolor="#ECE9D9"> </td>
<td width="1" bgcolor="#E8BC3C"></td>
<td width="10"> </td>
<td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="100%" height="26"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="61%"><span class="v8"><img src="images/btn_face.gif" width="10" height="7">
<a href="index.asp"><%=sitename%></a> <FONT face=Webdings color="#660000">8</FONT>
<a href="matrix3_admin.asp">BBS管理</a> <FONT face=Webdings color="#660000">8</FONT>
自定义表情管理</span></td>
<td width="39%" align="right" nowrap><font color="#FF0000">注意:上传图片时,请尽量不要使用中文文件名</font>
</td>
</tr>
</table></td>
</tr>
<tr>
<td height="1" bgcolor="#ECE9D9"></td>
</tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td height="12" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="150" height="16" bgcolor="#990000"> <span class="v8b"> <img src="images/fang-1.gif" align="absmiddle">
</span><span class="v7"><font color="#FFFFFF">自定义表情管理</font></span></td>
<td height="16" nowrap bgcolor="#CCCCCC" class="v8b"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<form enctype="multipart/form-data" action="matrix3_ep_upload.asp" method="post">
<tr>
<td width="13%" align="center" nowrap> </td>
<td width="87%" align="right" nowrap> 添加自定义表情:
<input name="file1" type="file" id="file1" size="25" maxlength="150">
快捷键:
<input name="wordstr" type="text" id="wordstr" size="4" maxlength="20">
<input type="submit" name="Submit" value="添加">
</td>
</tr>
</form>
</table></td>
</tr>
</table>
<%
dfile=trim(request.QueryString("file"))
action1=trim(request("action1"))
set objFSO=Server.CreateObject("Scripting.FileSystemObject")
if action1="delete" and dfile<>"" then
FileDelete(dfile)
elseif action1="delete2" then
for each x in request.Form("id")
FileDelete(x)
next
response.write("<script>alert('删除完成');location.href='matrix3_eplist.asp';</script>")
response.End()
elseif action1="save" then
call ep_generate()
set objFSO=nothing
response.write("<script>alert('成功保存');location.href='matrix3_eplist.asp';</script>")
response.End()
end if
if not objFSO.FolderExists(Server.MapPath(ep_folder)) then
objFSO.CreateFolder(Server.MapPath(ep_folder))
end if
set objFolder=objFSO.GetFolder(Server.MapPath(ep_folder))
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
<form name="form1" method="post" action="matrix3_eplist.asp">
<tr valign="middle" bgcolor="#F0F0F0">
<td width="5%" height="30" align="center" nowrap>选择</td>
<td width="15%" height="30" align="center" nowrap>图片</td>
<td width="15%" height="30" align="center" nowrap>快捷键</td>
<td width="10%" align="center" nowrap bgcolor="#F0F0F0">删除</td>
<td width="10%" height="30" align="center" nowrap bgcolor="#F0F0F0"> </td>
<td width="5%" height="30" align="center" nowrap>选择</td>
<td width="15%" height="30" align="center" nowrap>图片</td>
<td width="15%" align="center" nowrap>快捷键</td>
<td width="10%" align="center" nowrap>删除</td>
</tr>
<%
i=0
j=1
For Each objFile in objFolder.Files
imgstr=objFile.Name
if (j mod 2)=0 then
color="#F5F5F5"
else
color="#FFFFFF"
end if
if imgstr<>"Thumbs.db" then
if instr(epstr_all,imgstr)>0 then
wordstr=left(epstr_all,instr(epstr_all,imgstr)-2)
if instr(wordstr,";")>0 then wordstr=mid(wordstr,instrRev(wordstr,";")+1)
else
wordstr=""
end if
call outone()
i=i+1
end if
Next
set objFSO=nothing
set objFolder =nothing
if (i mod 2)=1 then
response.write("<td width='5%' height=24 align=center nowrap bgcolor='"&color&"'> </td>")
response.write("<td width='15%' height=24 align=center nowrap bgcolor='"&color&"'> </td>")
response.write("<td width='15%' height=24 align=center nowrap bgcolor='"&color&"'> </td>")
response.write("<td width='10%' height=24 align=center nowrap bgcolor='"&color&"'> </td>")
response.write("</tr>")
end if
sub outone()
if (i mod 2)=0 then
response.write("<tr valign=middle>")
response.write("<td width='5%' height=24 align=center nowrap bgcolor='"&color&"'><input name=""id"" type=""checkbox"" id=""id"" value="""&imgstr&"""></td>")
response.write("<td width='15%' height=24 align=center nowrap bgcolor='"&color&"'><img src='"&ep_folder&"/"&imgstr&"' align=absmiddle><input name=""imgstr"" type=""hidden"" id=""imgstr"" value="""&imgstr&"""></td>")
response.write("<td width='15%' height=24 align=center nowrap bgcolor='"&color&"'><input name=""wordstr"" type=""text"" id=""wordstr"" value="""&wordstr&""" size=4 maxlength=20 style='height:18px'></td>")
response.write("<td width='10%' height=24 align=center nowrap bgcolor='"&color&"'><a href=""javascript:alertwin('?action1=delete&file="&imgstr&"')"" title='删除该自定义表情,不可恢复'>删除</a></td>")
response.write("<td width='10%' height=24 align=center nowrap bgcolor='#FFFFFF'>"&j&"</td>")
else
response.write("<td width='5%' height=24 align=center nowrap bgcolor='"&color&"'><input name=""id"" type=""checkbox"" id=""id"" value="""&imgstr&"""></td>")
response.write("<td width='15%' height=24 align=center nowrap bgcolor='"&color&"'><img src='"&ep_folder&"/"&imgstr&"' align=absmiddle><input name=""imgstr"" type=""hidden"" id=""imgstr"" value="""&imgstr&"""></td>")
response.write("<td width='15%' height=24 align=center nowrap bgcolor='"&color&"'><input name=""wordstr"" type=""text"" id=""wordstr"" value="""&wordstr&""" size=4 maxlength=20 style='height:18px'></td>")
response.write("<td width='10%' height=24 align=center nowrap bgcolor='"&color&"'><a href=""javascript:alertwin('?action1=delete&file="&imgstr&"')"" title='删除该自定义表情,不可恢复'>删除</a></td>")
response.write("</tr>")
j=j+1
end if
end sub
%>
</table>
<table width="100%" height="40" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#CCCCCC">
<td width="9%" align="center" nowrap><input name="clickall" type="checkbox" id="clickall" value="1" onClick="clickall0(this.form);">
全选</td>
<td width="76%" align="center"><input name="action1" type="hidden" id="action1" value="">
<input type="button" name="Submit2" value=" 保 存 " onClick="submitsave(this.form);"></td>
<td width="15%" align="center"><input type="button" name="Submit3" value="删除所选" onClick="submitdel(this.form);"></td>
</tr></form>
</table>
</td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="2" bgcolor="#ECE9D9"></td>
</tr>
</table></td>
</tr>
</table>
</td>
<td width="10"> </td>
<td width="1" bgcolor="#E8BC3C"></td>
<td width="100" bgcolor="#ECE9D9" valign="top"> <!-- #include file="matrix3_right.asp" --></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="10" align="center" valign="bottom">
<!-- #include file="bottombar.asp" -->
</td>
</tr>
</table>
</body>
</html>
<%
sub ep_generate()
ep_str=""
i=0
dim filestr
for i=1 to request.Form("imgstr").count
imgstr=trim(request.Form("imgstr")(i))
wordstr=trim(request.Form("wordstr")(i))
if imgstr<>"" and wordstr<>"" then
wordstr=replace(wordstr,";",";")
if ep_str="" then
if instr(ep_str,";"&wordstr&";")=0 then ep_str=wordstr&";"&imgstr
else
if instr(ep_str,";"&wordstr&";")=0 then ep_str=ep_str&";"&wordstr&";"&imgstr
end if
end if
Next
filestr="<"&"%"&vbcrlf
filestr=filestr&"dim epstr_all"&vbcrlf&"epstr_all="""&ep_str&""""&vbcrlf
filestr=filestr&"function use_ep(epstr)"&vbcrlf
filestr=filestr&" use_ep="""""&vbcrlf
filestr=filestr&" if isnull(epstr) or epstr="""" then exit function"&vbcrlf
filestr=filestr&" dim ep_i,ep_n,ep,ep_str,ep_folder"&vbcrlf
filestr=filestr&" ep_folder="""&ep_folder&""""&vbcrlf
filestr=filestr&" ep_str="""&ep_str&""""&vbcrlf
filestr=filestr&" ep=split(ep_str,"";"")"&vbcrlf
filestr=filestr&" ep_n=(int)(ubound(ep)/2)"&vbcrlf
filestr=filestr&" ep_i=0"&vbcrlf
filestr=filestr&" do while ep_i<=ep_n"&vbcrlf
filestr=filestr&" epstr=replace(epstr,ep(2*ep_i),""<img border=0 src=""""""&ep_folder&""/""&ep(2*ep_i+1)&"""""" align=""""absmiddle"""">"")"&vbcrlf
filestr=filestr&" ep_i=ep_i+1"&vbcrlf
filestr=filestr&" loop"&vbcrlf
filestr=filestr&" use_ep=epstr"&vbcrlf
filestr=filestr&"end function"&vbcrlf
filestr=filestr&"%"&">"
set objFile=objFSO.CreateTextFile(server.mappath("ep_config.asp"),True)
objFile.write(filestr)
objFile.close
set objFile=nothing
end sub
function FileDelete(filename)
If objFSO.FileExists(Server.MapPath(ep_folder&"/"&filename)) Then
objFSO.DeleteFile(Server.MapPath(ep_folder&"/"&filename))
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -