⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cat_config.asp

📁 blog 程序 DIV BLOG 0.6 Readme [ http://www.IamTing.com ] DIV BLOG 0.6版更新说明 =====================
💻 ASP
字号:
<!--#include file="../conn.asp" -->
<!--#include file="admin_lib.asp" -->
<%
'==============================
if not instr(1,Request.ServerVariables("http_Referer"),Request.ServerVariables ("SERVER_NAME"),1)=8 then
message "DLOG错误:提交的数据来自网站外部"
response.end
end if

'checkadmin
    Username=Session("username"&dlog_session)
    Password=Session("password"&dlog_session)
    if username="" or password="" then
            Username=replace(request.Cookies(dlog_cookies_name)("Username"),"'","")
            Password=replace(request.Cookies(dlog_cookies_name)("Password"),"'","")
    end if
    sql= "SELECT isad FROM User_MDB where username = '" & Username & "' and password='" & Password & "'"
    set rs_inc=conn.Execute(sql)
            if not (rs_inc.BOF or rs_inc.eof) then
                ulogin="true" 
            Session("username"&dlog_session) = Username
            Session("password"&dlog_session) = Password
            Session("isad"&dlog_session)=rs_inc("isad")

                isad=Session("isad"&dlog_session)       
            end if
            rs_inc.Close()
        set rs_inc=nothing
  if isad<>-1 then
    Redirect "index.asp","不是真正管理员哦"
  end if
'==============================
%>
<%
cat_id=request("cat_id")
if cat_id="" then cat_id=0

if request("set_cat_config")="true" then
m_id=cint(request("m_id"))
ccolor1=request("ccolor1")
ccolor2=request("ccolor2")
my_page_size=replace(request("my_page_size"),"'","''")
log_view_type=request("log_view_type")
log_cut_line=request("log_cut_line")

sql="select log_cat_id from log_config where log_cat_id="&cat_id
set tempc=conn.EXECUTE(sql)

if tempc.eof or tempc.bof then
   sql="INSERT INTO log_config(log_cat_id,ccolor1,ccolor2,m_id,my_page_size,log_view_type,log_cut_line)VALUES("&Cat_ID&",'"&ccolor1&"','"&ccolor2&"',"&m_id&","&my_page_size&","&log_view_type&","&log_cut_line&")"
   conn.EXECUTE(sql)


else

sql="UPDATE log_config SET ccolor1='"&ccolor1&"',ccolor2='"&ccolor2&"',m_id="&m_id&",my_page_size="&my_page_size&",log_view_type="&log_view_type&",log_cut_line="&log_cut_line&" WHERE log_cat_id="&cat_id&""
set tempc=conn.Execute(sql)
end if

redirect "cat_config_manage.asp","操作成功"

end if

if request("cat_action")="del_config" then
   if cat_id=0 then
      message "主体样式不能删除"
      response.end
   end if
   sql="delete from log_config where log_cat_id="&cat_id
   conn.EXECUTE(sql)
   redirect "cat_config_manage.asp","该分类样式以被删除"

end if


if request("cat_action")="edit_config" then

sql = "SELECT * FROM log_config WHERE log_cat_id="&cat_id&""
set tempc=conn.execute(sql)
if tempc.eof or tempc.bof then 
  sql = "SELECT * FROM log_config WHERE log_cat_id=0"
  set tempc=conn.Execute(sql)
end if
color1=tempc("ccolor1")
color2=tempc("ccolor2")
log_cut_line=tempc("log_cut_line")
mypagesize=tempc("my_page_size")
m_id=tempc("m_id")
tempc.close
set tempc=nothing
%>
<html>
<head>
<title>LOG MANAGE</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../styles.css">
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">


<script language="javascript">
function foreColor(n)
{
  var arr = showModalDialog("selcolor.html", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0");
  if(arr==null)return;
  if(n==null)return;
  //if(n==1){form1.font_color.value=arr;}
  //if(n==2){form1.a_link.value=arr;}
  if(n==3){form1.ccolor1.value=arr;}
  if(n==4){form1.ccolor2.value=arr;}
  //if(n==5){form1.a_over.value=arr;}
  //if(n==6){form1.a_visited.value=arr;}
  changcolor()
}
function changcolor(){
//document.body.style.color=form1.font_color.value;
c1.style.backgroundColor=form1.ccolor1.value;
c2.style.backgroundColor=form1.ccolor2.value;
}

</script>
<table width="728" border="0" cellspacing="0" cellpadding="0" height="100%">
  <form name="form1" method="POST" action="cat_config.asp"><tr>
    <td> 
<%if not (isad=-1 and Ulogin="true") then
	        message "对不起,你没有操作权限"
			response.end
end if%>
<table width="95%" border="0" align="center" cellpadding="2" cellspacing="2" bgcolor="#f8f8f8">
          <tr> 
            <td><strong>设置日志样式</strong></td>
          </tr>
          <tr> 
            <td bgcolor="#FFFFFF"><strong>选择模版</strong>: 
              <select name="m_id">
                <%
			sql="SELECT m_id,m_title from moban order by m_id desc"
			set tmpl=conn.EXECUTE(sql)
			while not tmpl.eof
		%>
                <option value="<%=tmpl("m_id")%>"
				<%if tmpl("m_id")=m_id then%>
		selected
		<%end if%>
		> ├ <%=tmpl("m_title")%></option>
                <%
		tmpl.movenext
	     wend
			
			%>
              </select> </td>
          </tr>
          <tr> 
            <td><strong>首页日志列表显示模式:</strong><br> <input name="log_view_type" type="radio" value="1" checked>
              截断显示 | 截断 
              <select name="log_cut_line" id="log_cut_line">
                <option value="2">2行</option>
                <option value="3">3行</option>
                <option value="4" selected>4行</option>
                <option value="5">5行</option>
                <option value="6">6行</option>
                <option value="7">7行</option>
                <option value="8">8行</option>
                <option value="9">9行</option>
              </select><br> 
<script>
document.form1.log_cut_line.options.value="<%=log_cut_line%>"	//读取截断显示的行数 by Poorfish
</script>
			  <input type="radio" name="log_view_type" value="0">
              显示完整日志内容<br> <input type="radio" name="log_view_type" value="-1">
              只显示日志标题</td>
          </tr>
          <tr> 
            <td bgcolor="#FFFFFF"> <br> </td>
          </tr>
          <tr> 
            <td align="right" valign="top"><table width="100%" border="0" cellspacing="1" cellpadding="4" bgcolor="<%=color1%>" id="c1">
                <tr> 
                  <td height="50" ><strong>日志显示循环色1:</strong> <input type="text" name="ccolor1" value="<%=color1%>" class="bk" onblur="changcolor()"> 
                    <img src="../images/chc.gif" width="16" height="16" style="cursor:hand" onclick=foreColor(3)></td>
                </tr>
                <tr> 
                  <td bgcolor="<%=color2%>" height="50" id="c2">日志显示循环色2: 
                    <input type="text" name="ccolor2" value="<%=color2%>" class="bk" onblur="changcolor()"> 
                    <img src="../images/chc.gif" width="16" height="16" style="cursor:hand" onclick=foreColor(4)> 
                  </td>
                </tr>
                <tr> 
                  <td height="50"><strong>每页显示日志篇数:</strong> <input type="text" name="my_page_size" size="2" maxlength="2" value="<%=mypagesize%>" class="bk"> 
                  </td>
                </tr>
              </table></td>
          </tr>
          <tr> 
            <td align="right" valign="top" bgcolor="#FFFFFF"> <input type="hidden" name="set_cat_config" value="true"> 
              <input type="hidden" name="cat_id" value="<%=cat_id%>"> 
              <input type="submit" name="Submit" value="修改样式&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"></td>
          </tr>
        </table>
      
      </td>
  </tr></form>
</table>
</body>
</html>
<%
tmpl.close
set tmpl=nothing
end if


conn.close
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -