admin_userskin.asp
来自「是个不错的文件代码,希望大家好好用,」· ASP 代码 · 共 706 行 · 第 1/2 页
ASP
706 行
<!--#include file="inc/inc_sys.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>oBlog--用 户 模 板 管 理</title>
<link rel="stylesheet" href="images/style.css" type="text/css" />
<script src="images/menu.js" type="text/javascript"></script>
</head>
<body>
<SCRIPT language=javascript>
function unselectall()
{
if(document.form2.chkAll.checked){
document.form2.chkAll.checked = document.form2.chkAll.checked&0;
}
}
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>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<%
dim action,ispass,rstClass,sClasses
Action=trim(request("Action"))
Set rstClass=Server.CreateObject("Adodb.RecordSet")
rstClass.Open "Select * From oblog_skinclass Where iType=0",conn,1,3
Do While Not rstClass.Eof
sClasses= sClasses & "<option value=" & rstClass("classid") & " >" & rstClass("classname") & "(" & rstClass("icount") & ")</option>" & vbcrlf
rstClass.MoveNext
Loop
rstClass.MoveFirst
%>
<div id="main_body">
<ul class="main_top">
<li class="main_top_left left">用 户 模 板 管 理</li>
<li class="main_top_right right"> </li>
</ul>
<div class="main_content_rightbg">
<div class="main_content_leftbg">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" Class="border">
<tr class="tdbg">
<td width="100" height="30"><strong>操作链接:</strong></td>
<td width="687" height="30">
<a href="admin_userskin.asp?action=skinclass">模板分类维护</a> | <a href="admin_userskin.asp?action=showskin&ispass=1">已通过审核的模板</a> | <a href="admin_userskin.asp?action=showskin&ispass=0">未通过审核的模板</a></td>
</tr>
<form name="form1" action="admin_userskin.asp?action=showskin&ispass=1" method="post">
<tr class="tdbg">
<td width="100" height="30"><strong>按分类过滤:</strong></td>
<td width="687" height="30">
<select size=1 name="classid">
<option value="0">------尚未分类------</option>
<%=sClasses%>
</select>
<input type="submit" value=" 查 看 "></td>
</tr>
</form>
</table>
</div>
</div>
<ul class="main_end">
<li class="main_end_left left"></li>
<li class="main_end_right right"></li>
</ul>
</div>
<%
select case Action
case "saveconfig"
call saveconfig()
case "showskin"
call showskin()
case "modiskin"
call modiskin()
case "savedefault"
call savedefault()
case "delconfig"
call delconfig()
case "addskin"
call addskin()
case "saveaddskin"
call saveaddskin()
case "passskin"
call passskin
case "unpassskin"
call unpassskin
case "move"
call SaveMove()
Case "skinclass"
Call ShowClasses
Case "saveclass"
Call SaveClass
Case "delclass"
Call DelClass
end select
sub showskin()
dim rs,psql,sql,classid
ispass=clng(request("ispass"))
classid=Request("classid")
If classid<>"" Then Classid=Int(classid)
if ispass=1 then
G_P_FileName="admin_userskin.asp?action=showskin&ispass=1"
psql=" where ispass=1 "
else
G_P_FileName="admin_userskin.asp?action=showskin&ispass=0"
psql=" where ispass=0 "
end if
If classid<>"" Then
If classid=0 Then
psql=" where ispass=1 And (classid=0 Or classid='') "
Else
psql=" where ispass=1 And classid=" & classid
End If
End If
if request("page")<>"" then
G_P_This=cint(request("page"))
else
G_P_This=1
end if
set rs=Server.CreateObject("Adodb.RecordSet")
sql="select id,userskinname,skinauthor,skinauthorurl,isdefault,ispass,skinpic,classid from oblog_userskin "&psql&" order by id desc "
'Response.Write Sql
'Response.End
rs.Open sql,Conn,1,1
if rs.eof and rs.bof then
showContent(rs)
G_P_Guide=G_P_Guide & " (共有0个模板)</h1>"
response.write "<div align='right'>"&G_P_Guide&"</div>"
else
G_P_AllRecords=rs.recordcount
G_P_Guide=G_P_Guide & " (共有" & G_P_AllRecords & "个模板)</h1>"
if G_P_This<1 then
G_P_This=1
end if
if (G_P_This-1)*G_P_PerMax>G_P_AllRecords then
if (G_P_AllRecords mod G_P_PerMax)=0 then
G_P_This= G_P_AllRecords \ G_P_PerMax
else
G_P_This= G_P_AllRecords \ G_P_PerMax + 1
end if
end if
if G_P_This=1 then
Call showContent(rs)
response.write oblog.showpage(true,true,"个模板")
else
if (G_P_This-1)*G_P_PerMax<G_P_AllRecords then
rs.move (G_P_This-1)*G_P_PerMax
dim bookmark
bookmark=rs.bookmark
else
G_P_This=1
end if
Call showContent(rs)
response.write oblog.showpage(true,true,"个模板")
end if
end if
end sub
sub showContent(rs)
dim i
i=0
%>
<div id="main_body">
<ul class="main_top">
<li class="main_top_left left"><%if ispass=1 then response.Write "通过审核的模板" else response.write "未通过审核的模板"%></li>
<li class="main_top_right right"> </li>
</ul>
<div class="main_content_rightbg">
<div class="main_content_leftbg">
<form name="form2" method="post" action="admin_userskin.asp" onSubmit="return confirm('确定要执行选定的操作吗?');">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" Class="border">
<tr class="topbg">
<td align="center"><strong>选中</strong></td>
<td align="center"><strong>模板分类</strong></td>
<td align="center"><strong>模板名称</strong></td>
<td><strong>操作</strong></td>
</tr>
<%
do while not rs.eof
dim userskinname
userskinname=rs("userskinname")
%>
<tr class="topbg">
<td width="30" valign="top">
<div align="center"><input name="checkbox" type="checkbox" onClick="unselectall()" id= "checkbox" class="tdbg" value='<%=rs("id")%>'></div>
<div align="center"><%= rs("id") %></div></td>
<td width="120"><div align="center">
<%
Dim ClassId1
ClassId1=Ob_IIF(rs("classid"),0)
If ClassId1>0 Then
rstClass.Filter="classid=" & ClassId1
If Not rstClass.Eof Then
Response.Write rstClass("classname")
Else
Response.Write "--"
End If
Else
Response.Write "--"
End If
%></div></td>
<td width="140"><div align="center">
<a href="../showskin.asp?id=<%=rs("id")%>" target="_blank"><img style="width:120px;height:77px;border:1px #888 solid;" src="../<%=rs("skinpic")%>" /><br />
<%if rs("isdefault")=1 then
response.Write "<font style=""color:#f00;font-weight:600;"">默认模板:"&userskinname&"</red>"
else
response.Write userskinname
end if
%></a>
</div></td>
<td><div>
<strong>模板作者:</strong><%if rs("skinauthorurl")="" or isnull(rs("skinauthorurl")) then
response.Write rs("skinauthor")
else
response.Write "<a href="""&oblog.filt_html(rs("skinauthorurl"))&""" target='_blank'>"&rs("skinauthor")&"</a>"
end if%>
</div>
<div><%if rs("ispass")=1 then response.Write("<span style=""color:#317531;font-weight:600;"">已审核</span>") else response.Write("<span style=""color:#F30;font-weight:600;"">未审核</span>")%> <%if ispass=0 then%>
<a href="admin_userskin.asp?action=passskin&id=<%=rs("id")%>">通过审核</a>
<%else%>
<a href="admin_userskin.asp?action=unpassskin&id=<%=rs("id")%>">取消审核</a>
<%end if%></div>
<div><a href="../admin_edit.asp?action=modiskin&skintype=user&t=0&editm=1&skinorder=0&id=<%=rs("id")%>" target="_blank">修改主模板</a> <a href="../admin_edit.asp?action=modiskin&skintype=user&t=0&editm=1&skinorder=1&id=<%=rs("id")%>" target="_blank">修改副模板</a> <a href="admin_userskin.asp?action=modiskin&id=<%=rs("id")%>">修改模板(文本方式)</a></div>
<div><a href="admin_userskin.asp?action=delconfig&id=<%=rs("id")%>" style="color:#f00;font-weight:600;" onclick=return(confirm("确定要删除这个模板吗?"))>删除模板</a></div>
</td>
</tr>
<%
i=i+1
if i>=G_P_PerMax then exit do
rs.movenext
loop
%>
<tr>
<td height="40" colspan="4" align="center" class="tdbg"><div align="center">
<input name="chkAll" type="checkbox" id="chkAll" onclick=checkAll(this.form) value="checkbox" />
全选
<input type="radio" value="savedefault" name="action" checked>默认模板
<%if ispass=0 then%>
<input type="radio" value="passskin" name="action" >通过审核
<%else%>
<input type="radio" value="unpassskin" name="action">取消审核
<%end if%>
<input type="radio" value="delconfig" name="action" >删除
<input type="radio" value="move" name="action" >移动到:
<select name="classid">
<%=sClasses%>
</select>
<input type="submit" name="Submit" value="保存设置">
</div></td>
</tr>
</table>
</form>
</div>
</div>
<ul class="main_end">
<li class="main_end_left left"></li>
<li class="main_end_right right"></li>
</ul>
</div>
<%
set rs=nothing
end sub
sub savedefault()
dim isdefaultID
isdefaultID=trim(request("checkbox"))
if instr(isdefaultID,",")>0 then
Response.Write("<script language=javascript>alert('用户默认模板只可以选择一个!');history.back();</script>")
Response.End()
elseif isdefaultID="" then
Response.Write("<script language=javascript>alert('请指定要设定为默认的模板!');history.back();</script>")
Response.End()
exit sub
end if
oblog.execute("update oblog_userskin set isdefault=0")
oblog.execute("update oblog_userskin set isdefault=1 where id="&isdefaultID)
Response.Write"<script language=JavaScript>"
Response.Write"alert(""修改成功!"");"
Response.Write"window.history.go(-1);"
Response.Write"</script>"
end sub
sub passskin()
dim id
id=trim(request("checkbox"))
if instr(id,",")>0 then
id=replace(id," ","")
oblog.execute("update oblog_userskin set ispass=1 where id in ("&id&")")
elseif id="" then
id=clng(request("id"))
oblog.execute("update oblog_userskin set ispass=1 where id="&id)
else
oblog.execute("update oblog_userskin set ispass=1 where id="&id)
end if
ReCountSkins
oblog.showok "通过审核成功",""
end sub
sub unpassskin()
dim id
id=trim(request("checkbox"))
if instr(id,",")>0 then
id=replace(id," ","")
oblog.execute("update oblog_userskin set ispass=0 where id in ("&id&")")
elseif id="" then
id=clng(request("id"))
oblog.execute("update oblog_userskin set ispass=0 where id="&id)
else
oblog.execute("update oblog_userskin set ispass=0 where id="&id)
end if
ReCountSkins
oblog.showok "取消审核成功",""
end sub
sub saveconfig()
dim rs,sql
if trim(request("userskinname"))="" then oblog.sys_err("模板名不能为空"):response.End()
if trim(request("skinmain"))="" then oblog.sys_err("主模板不能为空"):response.End()
if trim(request("skinshowlog"))="" then oblog.sys_err("副模板不能为空"):response.End()
set rs=server.CreateObject("adodb.recordset")
sql="select * from oblog_userskin where id="&clng(request.QueryString("id"))
if not IsObject(conn) then link_database
rs.open sql,conn,1,3
rs("userskinname")=trim(request("userskinname"))
rs("skinauthor")=trim(request("skinauthor"))
rs("skinmain")=request("skinmain")
rs("skinshowlog")=request("skinshowlog")
rs("skinpic")=trim(request("skinpic"))
rs("classid")=trim(request("classid"))
rs("skinauthorurl")=trim(request("skinauthorurl"))
rs.update
rs.close
set rs=nothing
ReCountSkins
oblog.showok "保存成功",""
end sub
sub delconfig()
dim id
id=trim(request("checkbox"))
if instr(id,",")>0 then
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?