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

📄 editmbcode.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
'==============================
%>
<%
if request("savemb")<>"" then
m_id=request("m_id")
m_title=Trim(replace(request("m_title"),"'","''"))
m_html=RTrim(replace(request("m_html"),"'","''"))
preview_img=Trim(replace(request("preview_img"),"'","''"))
if preview_img="" then preview_img="-"
end_time=now()
saveaction=request("saveaction")

select case saveaction
    case "save_cover"
	        SQL = "UPDATE moban set m_title='"&m_title&"',preview_img='"&preview_img&"',end_time='"&end_time&"',m_html='"&m_html&"' where m_ID="&m_ID
            conn.EXECUTE SQL
			url="editmbcode.asp?m_id="&m_id
			redirect url,"存盘成功"
	case "save_as"
	        SQL = "INSERT INTO moban(m_title,m_html,preview_img,end_time)VALUES('"&m_title&"','"&m_html&"','"&preview_img&"','"&end_time&"')"
			conn.EXECUTE SQL
			SQL= "select top 1 m_id from moban order by m_id desc"
			set tempc=conn.EXECUTE(SQL)
			url="editmbcode.asp?m_id="&tempc("m_id")
			tempc.close
			set tempc=nothing
			redirect url,"存盘成功"
	case "save_del"
	        if m_id=1 then
			   message "错误,该模版不能删除!!"
			   response.End
			end if
	        SQL = "delete from moban where m_ID="&m_id
			conn.EXECUTE SQL
	        redirect "mb_manage.asp","该模版已删除"
   end select
end if
%>
<html>
<head>
<title>edit_mb_code</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../styles.css"></head>

<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" style="OVERFLOW: auto"> 
<table width="728" border="0" cellpadding="4" cellspacing="0" bgcolor="#cccccc">
  <tr>
    <td><b>模版编辑:</b> </td>
  </tr>
</table>
<%
m_id=cint(request("m_id"))
sql="SELECT m_id,preview_img,m_title,m_html from moban WHERE m_id="&m_id&""
set tempc=conn.EXECUTE(sql)
if tempc.eof or tempc.bof then
   message "该模版不存在"
   response.End
 end if
%>
<table width="728" border="0" cellpadding="0" cellspacing="2">
  <form name="form1" method="post" action="editmbcode.asp"><tr> 
    <td width="32%">名称: 
      <input name="m_title" type="text" value="<%=tempc("m_title")%>" maxlength="20" class="bk"></td>
      <td width="68%" align="right">缩略图地址: 
        <input name="preview_img" type="text" value="<%=tempc("preview_img")%>" size="40" class="bk">
      <input name="m_id" type="hidden" id="m_id" value="<%=tempc("m_id")%>">
      </td>
  </tr>
  <tr> 
    <td colspan="2"><textarea name="m_html" cols="100%" rows="24" style="PADDING: 5px;OVERFLOW-left: auto;width:100%;border:#cccccc 1px inner"><%=tempc("m_html")%></textarea></td>
  </tr>
  <tr> 
    <td colspan="2">
	    <input type="hidden" name="saveaction" value="false" id="saveas">
        <input name="savemb" type="hidden" id="savemb" value="save_cover">
        <input type="submit" name="Submit" value="保存"  onmousedown="form1.saveaction.value='save_cover';">
        <input type="submit" name="Submit2" value="另存为" onmousedown="form1.saveaction.value='save_as';">
		<%if tempc("m_id")=1 then%>
		[ 该模版为初始模版,不可删除]
		<%else%>
		<input type="submit" name="Submit3" value="删除本模版"  onmousedown="form1.saveaction.value='save_del';">
        <%end if%>
      </td>
  </tr></form>
</table>

<%

%>

</body>
</html>
<%
tempc.close
set tempc=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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