admin_skin.asp
上传用户:comthink
上传日期:2021-05-06
资源大小:1280k
文件大小:5k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <!--#include file="conn.asp"-->
  2. <!-- #include file="inc/const.asp" -->
  3. <title><%=txl_info(0)%>--管理页面</title>
  4. <!-- #include file="inc/admin_css.asp" -->
  5. <meta NAME=GENERATOR Content="Microsoft FrontPage 3.0" CHARSET=GB2312>
  6. <BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#DDEEFF">
  7. <%
  8. if not supermaster or session("flag")="" then
  9. Errmsg=Errmsg+"<br>"+"<li>本页面为管理员专用,请<a href=admin_index.asp target=_top>登陆</a>后进入。<br><li>您没有管理本页面的权限。"
  10. call txl_error()
  11. else
  12. dim body
  13. select case request("action")
  14. case "news"
  15. call step1()
  16. case "step2"
  17. call saveskin()
  18. case "del"
  19. call delskin()
  20. case "active"
  21. call active()
  22. case else
  23. call skininfo()
  24. end select
  25. conn.close
  26. set conn=nothing
  27. end if
  28. sub delskin()
  29. set rs=conn.execute("select skinname from config where active=1 and id="&request("nskinid"))
  30. if rs.eof and rs.bof then
  31. conn.execute("delete from config where id="&request("nskinid"))
  32. response.write "删除成功。"
  33. else
  34. response.write "错误提示:当前使用的论坛模板不能删除,请先设置该模板为不是当前模板状态。"
  35. end if
  36. rs.close
  37. set rs=nothing
  38. end sub
  39. sub skininfo
  40. %>
  41. <form method=post action="admin_skin.asp?action=active">
  42. <table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center>
  43. <tr> 
  44. <td height="23" colspan="2" ><b>同学录模板选择管理</b>:<BR>可点击相应模板进行统一查看和管理,可以设置某个模板为当前使用。由于相关的设置项目非常多,为了不至混淆,建议对当前使用的模板修改点击相应管理菜单进行修改,点击模板名称进行修改模板名。
  45. </td>
  46. </tr>
  47. </table>
  48. <table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder">
  49. <tr> 
  50. <th width="83%" height=22>模板名称</th><th width="17%">当前是否使用</th>
  51. </tr>
  52. <%
  53. set rs=conn.execute("select id,active,skinname from config order by id desc")
  54. do while not rs.eof
  55. %>
  56. <tr> 
  57. <td height=25 class=txlrow>&nbsp;<a href="admin_skin.asp?action=edit&skinid=<%=rs("id")%>"><%=rs(2)%></a>( <a href="admin_color.asp?skinid=<%=rs("id")%>"><U>界面CSS设置</U></a> | <a href="admin_pic.asp?skinid=<%=rs("id")%>"><U>模板图片设置</U></a> | <a href="admin_skin.asp?action=del&nskinid=<%=rs("id")%>" onclick="{if(confirm('删除后不可恢复,确定删除吗?')){return true;}return false;}"><U>删除</U></font> )</td>
  58. <td class=txlrow>&nbsp;<input type=radio name=skinid value="<%=rs(0)%>" <%if rs(1)=1 then%>checked<%end if%>></td>
  59. </tr>
  60. <%
  61. rs.movenext
  62. loop
  63. rs.close
  64. set rs=nothing
  65. %>
  66. <tr> 
  67. <td width="80%" height=22 align=right class=txlrow>&nbsp;当前同学录默认使用模板只能选择一个&nbsp;</td>
  68. <td width="50%" class=txlrow><input type=submit value="提 交" name=submit></td>
  69. </tr>
  70. </table>
  71. </form>
  72. <%
  73. end sub
  74. sub step1()
  75. %>
  76. <form method="POST" action=?action=step2>
  77. <table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder">
  78. <tr> 
  79. <th height="25" colspan="2" >添加新模板</th>
  80. </tr>
  81. <tr> 
  82. <td width="40%" class="txlrow">添加新模板说明</td>
  83. <td width="60%" class="txlrow">1、先添加模板名称;<br>2、然后进入模板CSS修改页面,修改相应当CSS定义;<br>3、最后到模板图片设置项,修改当前模板下的图片。</td>
  84. </tr>
  85. <tr> 
  86. <td width="40%" class="txlrow"><B>模板名称</B></td>
  87. <td width="60%" class="txlrow"> <input type="text" name="SkinName" size="35"></td>
  88. </tr>
  89. <tr> 
  90. <td width="40%" class="txlrow">&nbsp;</td>
  91. <td width="60%" class="txlrow"> <input type="submit" name="Submit" value="下一步"></td>
  92. </tr>
  93. </table>
  94. </form>
  95. <%
  96. end sub
  97. sub saveskin()
  98. dim ars
  99. dim skinname
  100. skinName=request("skinname")
  101. set Ars=conn.execute("select * from config where active=1")
  102. set rs = server.CreateObject ("adodb.recordset")
  103. sql="select * from config"
  104. rs.open sql,conn,1,3
  105. rs.addnew
  106. rs("txl_info")=ars("txl_info")
  107. rs("txl_set")=ars("txl_set")
  108. rs("txl_user")=ars("txl_user")
  109. rs("txl_copyright")=ars("txl_copyright")
  110. rs("txl_ads")=ars("txl_ads")
  111. rs("txl_body")=ars("txl_body")
  112. rs("skinname")=skinname
  113. rs("Cookiepath")=ars("Cookiepath")
  114. rs("badwords")=ars("badwords")
  115. rs("lastuser")=ars("lastuser")
  116. rs("birthuser")=ars("birthuser")
  117. rs("stopwhy")=ars("stopwhy")
  118. rs("UserNum")=ars("UserNum")
  119. rs("GbookNum")=ars("GbookNum")
  120. rs("BbsNum")=ars("BbsNum")
  121. rs("PhotoNum")=ars("PhotoNum")
  122. rs("txl_ubb")=ars("txl_ubb")
  123. rs("txl_skinpic")=ars("txl_skinpic")
  124. rs("txl_userface")=ars("txl_userface")
  125. rs("txl_postface")=ars("txl_postface")
  126. rs("txl_emot")=ars("txl_emot")
  127. rs("active")=0
  128. rs.update
  129. Response.Redirect "admin_color.asp?skinid="&rs("id")
  130. rs.close
  131. set rs=nothing
  132. end sub
  133. sub active()
  134. set rs=conn.execute("select * from config where active=1")
  135. conn.execute("update config set active=0 where id="&rs("id"))
  136. conn.execute("update config set active=1 where id="&request("skinid"))
  137. response.write "更新成功,<a href=admin_skin.asp>返回</a>。"
  138. rs.close
  139. set rs=nothing
  140. end sub
  141. %>