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

📄 admin_news_add.asp

📁 强大的后台文章编辑器的功能
💻 ASP
字号:
<%
if session("admin__user")="" then
  Response.Redirect "login.asp?id=8"
end if
%>
<!--#include file = admin_chk.asp -->
<!--#include file = admin_conn.asp -->
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
<base target="_self">
<STYLE type="text/css">
<!--
a:link       {text-decoration: none; font-family: AdobeSm; color: #000000 }
a:visited    {text-decoration: none; color: #000000 }
A:hover      {COLOR: green; FONT-FAMILY: "宋体,MingLiU"; TEXT-DECORATION: underline}
body         {font-size: 9pt; font-family: 宋体,MingLiU, Arial;color: #000000}
TD           {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000;table-layout:fixed;word-break:break-all}
p            {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
input        {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
body         {margin-top: 0; margin-bottom: 0;margin-left:0;margin-right:0; color: #000000}
select       {FONT-SIZE: 9PT;}
option       {FONT-SIZE: 9pt;}
textarea     {FONT-SIZE: 9pt;}
-->
</STYLE>
</head>

<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<%
titlecolor=trim(request("titlecolor"))
if request("id")<>"" then
  id=request("id")
  sql = "select * from news where id="&id
  Set rs = Server.CreateObject("ADODB.RecordSet")
  rs.Open sql,conn,1,1
  title=rs("title")
  tj=trim(rs("tj"))
  lmid=rs("lm2")
  html=rs("html")
  pic=trim(rs("pic"))
  content=rs("content")
  url=rs("url")
  titlecolor=rs("titlecolor")
  xgnews=rs("xgnews")
  ontop=rs("ontop")
  rs.close
  set rs=nothing
else
  lmid=trim(request("lmid"))
  html=trim(request("html"))
end if

if lmid="" then lmid=00

%>
<div align="center">
<table border="0" width="760" id="table1" cellspacing="0" cellpadding="0" background="images/010.jpg">
	<tr>
		<td>
		<div align="center">
			<table border="0" cellpadding="0" cellspacing="0" width="100%" id="table3">
				<tr>
					<td background="images/007.jpg">
					<img border="0" src="images/006.jpg" width="20" height="26"></td>
					<td background="images/007.jpg"> </td>
					<td background="images/007.jpg">
					<p align="right">
					<img border="0" src="images/008.jpg" width="57" height="26"></td>
				</tr>
			</table>
		</div>
		</td>
	</tr>
	<tr>
		<td  align=center>
		<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.title.value == "")
  {
    alert("请在 新闻信息标题 域中输入值。");
    theForm.title.focus();
    return (false);
  }

  if (theForm.title.value.length < 5)
  {
    alert("在 新闻信息标题 域中,请至少输入 5 个字符。");
    theForm.title.focus();
    return (false);
  }

  if (theForm.title.value.length > 100)
  {
    alert("在 新闻信息标题 域中,请最多输入 100 个字符。");
    theForm.title.focus();
    return (false);
  }

  if (theForm.lm.selectedIndex < 0)
  {
    alert("请选择“栏目分类”选项中的一项。");
    theForm.lm.focus();
    return (false);
  }

  if (theForm.lm.selectedIndex == 0)
  {
    alert("第一个“栏目分类”选项无效。 请选择其他选项中的一项。");
    theForm.lm.focus();
    return (false);
  }

  if (theForm.lm.selectedIndex < 0)
  {
    alert("请选择“栏目分类”选项中的一项。");
    theForm.lm.focus();
    return (false);
  }

  if (theForm.lm.selectedIndex == 0)
  {
    alert("第一个“栏目分类”选项无效。 请选择其他选项中的一项。");
    theForm.lm.focus();
    return (false);
  }

  if (theForm.zz.value == "")
  {
    alert("请在 栏目分类 域中输入值。");
    theForm.zz.focus();
    return (false);
  }
  return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="admin_news_add_save.asp<%if title<>"" then response.write "?edit=1&id="&request("id")%>" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">
			<table border="0" width="753" id="table2" cellpadding="5" style="border-collapse: collapse" bordercolor="#80ABF4">
				<tr>
					<td width="11%" align="center">新闻信息标题</td>
					<td width="54%">
					&nbsp;<!--webbot bot="Validation" s-display-name="新闻信息标题" b-value-required="TRUE" i-minimum-length="5" i-maximum-length="100" --><input type="text" name="title" size="59" maxlength="100" value='<%=title%>'></td>
					<td width="31%">
					<select size="1" name="titlecolor">
	            <option>默认颜色</option>
	            <OPTION <%if titlecolor="#000000" then response.write "selected"%> value="#000000" style="background-color:#000000"></OPTION>
                <OPTION <%if titlecolor="#FFFFFF" then response.write "selected"%> value="#FFFFFF" style="background-color:#FFFFFF"></OPTION>
                <OPTION <%if titlecolor="#008000" then response.write "selected"%> value="#008000" style="background-color:#008000"></OPTION>
                <OPTION <%if titlecolor="#800000" then response.write "selected"%> value="#800000" style="background-color:#800000"></OPTION>
                <OPTION <%if titlecolor="#808000" then response.write "selected"%> value="#808000" style="background-color:#808000"></OPTION>
                <OPTION <%if titlecolor="#000080" then response.write "selected"%> value="#000080" style="background-color:#000080"></OPTION>
                <OPTION <%if titlecolor="#800080" then response.write "selected"%> value="#800080" style="background-color:#800080"></OPTION>
                <OPTION <%if titlecolor="#808080" then response.write "selected"%> value="#808080" style="background-color:#808080"></OPTION>
                <OPTION <%if titlecolor="#FFFF00" then response.write "selected"%> value="#FFFF00" style="background-color:#FFFF00"></OPTION>
                <OPTION <%if titlecolor="#00FF00" then response.write "selected"%> value="#00FF00" style="background-color:#00FF00"></OPTION>
                <OPTION <%if titlecolor="#00FFFF" then response.write "selected"%> value="#00FFFF" style="background-color:#00FFFF"></OPTION>
                <OPTION <%if titlecolor="#FF00FF" then response.write "selected"%> value="#FF00FF" style="background-color:#FF00FF"></OPTION>
                <OPTION <%if titlecolor="#FF0000" then response.write "selected"%> value="#FF0000" style="background-color:#FF0000"></OPTION>
                <OPTION <%if titlecolor="#0000FF" then response.write "selected"%> value="#0000FF" style="background-color:#0000FF"></OPTION>
                <OPTION <%if titlecolor="#008080" then response.write "selected"%> value="#008080" style="background-color:#008080"></OPTION>
					</select>
					</td>
				</tr>
				<tr>
					<td width="11%" align="center">跳转URL</td>
					<td width="54%">&nbsp;<input type="text" name="URL" size="59" value='<%=url%>'></td>
					<td width="31%">填写网址,当点击标题,就自动打开此URL。不显示新闻内容</td>
				</tr>
				<tr>
					<td width="11%" align="center">栏目选择</td>
					<td width="54%">&nbsp;<%
if session("dj")="1" then
%>
<!--webbot bot="Validation" s-display-name="栏目分类" b-value-required="TRUE" b-disallow-first-item="TRUE" --><select size="1" name="lm">
					<option>请选择</option>
					  <%					  
					  sql = "select * from lm where lm<>'' order by id asc"
					  Set rs = Server.CreateObject("ADODB.RecordSet")
					  rs.Open sql,conn,1,1
					  while not rs.eof
					       response.write "<optgroup label='"&rs("lm")&"'>"
							sql2 = "select * from lm where lmid='"&rs("id")&"' order by id asc"
							Set rs2 = Server.CreateObject("ADODB.RecordSet")
							rs2.Open sql2,conn,1,1
							while not rs2.eof
							%>
							   <option value='<%=rs("id")%>|<%=rs2("id")%>' <% if int(lmid)=rs2("id") then response.write " selected" %>>├(编号:<%=rs2("id")%>)<%=rs2("lm2")%></option>
							<%
							rs2.movenext
							wend
					  rs.movenext
					  wend 
					  rs.close
					  set rs=nothing
					 
					%>
					
					</select>
<%else%>
<!--webbot bot="Validation" s-display-name="栏目分类" b-value-required="TRUE" b-disallow-first-item="TRUE" --><select size="1" name="lm">
					<option>请选择</option>
					  <%
					  sql3 = "select * from admin where user='"&session("admin__user")&"' order by id desc"
					  Set rs3 = Server.CreateObject("ADODB.RecordSet")
					  rs3.Open sql3,conn,1,1
					   lmid=rs3("lmid")
					   nr=split(lmid,",")
					   For i=0 to ubound(nr)
					        aaa=nr(i)
					        if aaa="" then aaa=0
							sql2 = "select * from lm where id="&aaa
							Set rs2 = Server.CreateObject("ADODB.RecordSet")
							rs2.Open sql2,conn,1,1
							while not rs2.eof
							%>
							   <option value='<%=rs2("lmid")%>|<%=rs2("id")%>' <% if int(lmid)=rs2("id") then response.write " selected" %>>├(编号:<%=rs2("id")%>)<%=rs2("lm2")%></option>
							<%
							rs2.movenext
							wend
						next
					  rs2.close
					  set rs2=nothing
					 
					%>
					
					</select>
<%end if%></td>
					<td width="31%">来源:<!--webbot bot="Validation" s-display-name="栏目分类" b-value-required="TRUE" b-disallow-first-item="TRUE" --><input type="text" name="zz" size="14" maxlength="40" value="<%=session("admin__user")%>"><textarea name="content" style="display:none" cols="1" rows="1"><%if content<>"" then response.write content%></textarea></td>
				</tr>
				<tr>
					<td colspan="3">
					<IFRAME ID="eWebEditor1" SRC="edit/ewebeditor.asp?id=content&style=news" FRAMEBORDER="0" SCROLLING="no" WIDTH="100%" HEIGHT="399" marginwidth="1" marginheight="1" name="wfasdg"></IFRAME></td>
				</tr>
				<tr>
					<td width="65%" colspan="2">
					&nbsp;<input type="checkbox" <% if pic<>"" then Response.Write " checked "%> name="tuwen" value="1" id=tu><label for=tu>图文</label>
					 <input type="checkbox" <%if tj="推荐" then response.write " checked "%> name="tj"  value="推荐" id=tj><label for=tj>推荐新闻</label> <input type="checkbox" name="ontop" <%if ontop=5 then response.write " checked "%> value="5" id=ontop><label for=ontop>固顶</label></td>
					<td width="31%"> </td>
				</tr>
				<tr>
					<td width="11%">
					<p align="center">相关新闻</td>
					<td width="54%">
					<input type="text" name="xgnews" size="20" value="<%=xgnews%>"> 
					(填写关键字)</td>
					<td width="31%"> </td>
				</tr>
			</table>
			<p align="center"><input type="submit" value=" 保 存 " name="B1">   <input type="reset" value=" 重 置 " name="B2"></p>
		</form>
		<p> </td>
	</tr>
</table>

</div>

</body>

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

⌨️ 快捷键说明

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