admin_news.asp
来自「安全性好,适用于制作论坛和进行资源下载的个人和大型网站使用!」· ASP 代码 · 共 909 行 · 第 1/3 页
ASP
909 行
end if
if content="" then
Response.Write("<script language=javascript>alert('你必须填写新闻的内容!');history.back(1);</script>")
response.End
end if
rs("cat_id")=catid
rs("news_title")=title
rs("news_author")=newsauthor
rs("news_ahome")=newsahome
rs("news_keyword")=keyword
rs("news_content")=content
if cint(isimg)=1 then
rs("isimg")=cint(isimg)
rs("images")=newpic
rs("imgyes")=cint(sImgYes)
else
rs("isimg")=0
rs("images")=newpic
rs("imgyes")=0
end if
rs("isbest")=cint(newsisbest)
rs("istop")=cint(newistop)
rs("tjuser")=tjuser
rs.update
rs.close
set rs=nothing
response.redirect "admin_news.asp?action=cat"
end if
if request.Form("action")="delnews" then
if request.Form("id")="" then
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
response.End
else
if not isInteger(request.form("id")) then
Response.Write("<script language=javascript>alert('非法的新闻id参数。');history.back(1);</script>")
response.End
end if
end if
Conn.Execute "DELETE * FROM [news] WHERE news_id="&clng(request.form("id"))
conn.execute("update allcount set newscount = newscount - 1")
response.redirect "admin_news.asp?action=cat"
end if
if request.QueryString("action")="newnew" then
%>
<script>
<!--
function showimg(){
if (document.addnews.hx66.checked == true) {
img.style.display = "";
advance.innerText="取消图片新闻"
}else{
img.style.display = "none";
advance.innerText="设为图片新闻"
}
}
//-->
</script>
<table width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
<form name="addnews" method="post" action="">
<tr>
<td class=Hxcmsss>新增新闻</td>
</tr>
<tr>
<td class=Hxcmsds>新闻分类:
<select name="cat_id">
<%
sql="select * from newcat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
response.write "<optgroup label='"&rs1("cat_name")&"'>"
sql="select * from newcat where sid="&rs1("cat_id")
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
%>
<option value="<%=rs2("cat_id")%>">├ <%=rs2("cat_name")%></option>
<%
rs2.movenext
loop
rs1.movenext
loop
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing%>
</select></td>
</tr>
<tr>
<td class=Hxcmsds>新闻标题:
<input type="text" name="news_title" size="50" class="textarea"> <select name="news_color" id="news_color">
<option value="" selected>标题醒目</option>
<option value="red">红色醒目</option>
<option value="green">绿色醒目</option>
<option value="blue">蓝色醒目</option>
<option value="#FF00FF">粉红醒目</option>
</select>
</td>
</tr>
<tr>
<td class=Hxcmsds>新闻作者:
<input name="news_author" type="text" id="writer" size="20" style="width:150px"> <button onClick="writer.value='佚名'" class=button>佚名</button> <button onClick="writer.value='网络'" class=button>网络</button> <button onClick="writer.value='<%=webceo%>'" class=button><%=webceo%></button>
</td>
</tr>
<tr>
<td class=Hxcmsds>新闻来源:
<input name="news_ahome" type="text" id="writer1" size="20" style="width:150px"> <button onClick="writer1.value='网络转摘'" class=button>网络转摘</button> <button onClick="writer1.value='本站原创'" class=button>本站原创</button> <button onClick="writer1.value='<%=webname%>'" class=button><%=webname%></button>
</td>
</tr>
<tr>
<td class=Hxcmsds>新闻添加:
<input name="tjuser" type="text" id="tjuser" size="20" style="width:150px" value="<%=Session("hxStudioAdminName")%>">
</td>
</tr>
<tr>
<td class=Hxcmsds>新闻关键字
<input type="text" name="news_keyword" size="20" style="width:150px"> 多个用 | 隔开。</td>
</tr>
<tr>
<td class=Hxcmsds><span id=advance>设为图片新闻</span><input type="checkbox" name="hx66" value=1 onClick=showimg()> (勾选上为图片新闻)</td>
</tr>
<tr>
<td>
<table width="100%" border="1" align="seft" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" id="img" style="display: none">
<tr class=Hxcmsds>
<td width="20%" align="right">首页幻灯和缩略图片地址:</td>
<td width="40%"><input type="text" name="images" size="40" value=""></td>
<td width="40%">如为空,缩略图则显无图片、幻灯不显示。此图片地址<=50字符</td>
</tr>
<tr class=Hxcmsds>
<td align="right">图片显在内容:</td>
<td align="left"><input type="checkbox" name="hx6666" value="1"></td>
<td width="20%">此图片是否在内容里显示,勾选上为是。</td>
</tr>
<tr class=Hxcmsds>
<td align="right">首页幻灯和缩略图片上传:</td>
<td align="left" height="25" colspan=2><iframe frameborder=0 width=290 height=25 scrolling=no src="upload.asp?action=xwpic"></iframe></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class=Hxcmsds><textarea cols="85" name="news_content" rows="20" class="textarea" style="display:none"></textarea>
<IFRAME ID="eWebEditor1" SRC="eWebEditor/eWebEditor.asp?id=news_content&style=hxcms" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="320"></IFRAME></td>
</tr>
<tr>
<td bgcolor="#E8E8E8" height="30" align="center">
<input type="checkbox" name="istop" value="1">
置顶
<input type="submit" name="Submit" value="确定新增" class="button">
<input type="reset" name="Reset" value="清空重写" class="button">
[<a href="admin_news.asp">返回</a>] </td>
</tr>
<input type="hidden" name="action" value="newnew">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%end if
if request.QueryString("action")="editnew" then
if request.querystring("news_id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
response.end
else
if not isinteger(request.querystring("news_id")) then
Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
response.end
end if
end if
if request.querystring("cat_id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
response.end
else
if not isinteger(request.querystring("cat_id")) then
Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
response.end
end if
end if
sql="select * from news where news_id="&cint(request.querystring("news_id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<script>
<!--
function showimg(){
if (document.addnews.hx66.checked == true) {
img.style.display = "";
advance.innerText="取消图片新闻"
}else{
img.style.display = "none";
advance.innerText="设为图片新闻"
}
}
//-->
</script>
<table width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
<form name="addnews" method="post" action="">
<tr>
<td class=Hxcmsss>修改新闻</td>
</tr>
<tr>
<td class=Hxcmsds>所属分类:
<select name="cat_id" id="cat_id">
<%
sql="select * from newcat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
response.write "<optgroup label='"&rs1("cat_name")&"'>"
sql="select * from newcat where sid="&rs1("cat_id")
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
%>
<option value="<%=rs2("cat_id")%>"<%if rs2("cat_id")=rs("cat_id") then response.write "selected" end if%>>├ <%=rs2("cat_name")%></option>
<%
rs2.movenext
loop
rs1.movenext
loop
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing%></select></td>
</tr>
<tr>
<td class=Hxcmsds>新闻标题:
<input name="news_title" type="text" class="textarea" id="news_title" size="50" value="<%=rs("news_title")%>">
<select name="news_color" id="news_color">
<option value="<%=rs("news_color")%>" selected>默认醒目</option>
<option value="">取销醒目</option>
<option value="red">红色醒目</option>
<option value="green">绿色醒目</option>
<option value="blue">蓝色醒目</option>
<option value="#FF00FF">粉红醒目</option>
</select></td>
</tr>
<tr>
<td class=Hxcmsds>新闻作者:
<input name="news_author" type="text" id="writer" size="20" style="width:150px" value="<%=rs("news_author")%>"> <button onClick="writer.value='佚名'" class=button>佚名</button> <button onClick="writer.value='网络'" class=button>网络</button> <button onClick="writer.value='<%=webceo%>'" class=button><%=webceo%></button>
</td>
</tr>
<tr>
<td class=Hxcmsds>新闻来源:
<input name="news_ahome" type="text" id="writer1" size="20" style="width:150px" value="<%=rs("news_ahome")%>"> <button onClick="writer1.value='网络转摘'" class=button>网络转摘</button> <button onClick="writer1.value='本站原创'" class=button>本站原创</button> <button onClick="writer1.value='<%=webname%>'" class=button><%=webname%></button>
</td>
</tr>
<tr>
<td class=Hxcmsds>新闻添加:
<input name="tjuser" type="text" id="tjuser" size="20" style="width:150px" value="<%=rs("tjuser")%>">
</td>
</tr>
<tr>
<td class=Hxcmsds>新闻关键字
<input type="text" name="news_keyword" size="20" style="width:150px" id="news_keyword" value="<%=rs("news_keyword")%>"> 多个用 | 隔开。</td>
</tr>
<tr>
<td class=Hxcmsds><span id=advance>设为图片新闻</span> <input name="hx66" type="checkbox" id="hx66" value="1" <%if rs("isimg")=1 then response.write "checked" end if%> onClick=showimg()> (勾选上为图片新闻)</td>
</tr>
<tr>
<td>
<table width="100%" border="1" align="seft" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" id="img" style="display: none">
<tr class=Hxcmsds>
<td width="20%" align="right">首页幻灯和缩略图片地址:</td>
<td width="40%"><input type="text" name="images" size="40" value="<%=rs("images")%>"></td>
<td width="40%">如为空,缩略图则显无图片、幻灯不显示。此图片地址<=50字符</td>
</tr>
<tr class=Hxcmsds>
<td align="right">图片显在内容:</td>
<td align="left"><input type="checkbox" name="hx6666" value="1" <%if rs("imgyes")=1 then response.write "checked" end if%>></td>
<td width="20%">此图片是否在内容里显示,勾选上为是。</td>
</tr>
<tr class=Hxcmsds>
<td align="right">首页幻灯和缩略图片上传:</td>
<td align="left" height="25" colspan=2><iframe frameborder=0 width=290 height=25 scrolling=no src="upload.asp?action=xwpic"></iframe></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class=Hxcmsds><textarea name="news_content" style="display:none"><%=Server.HtmlEncode(rs("news_content"))%></textarea>
<IFRAME ID="eWebEditor1" SRC="eWebEditor/eWebEditor.asp?id=news_content&style=hxcms" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="320"></IFRAME>
</td>
</tr>
<tr>
<td class=Hxcmsqs height="30" align="center"> <input name="istop" type="checkbox" id="istop" value="1" <%if rs("istop")=1 then response.write "checked" end if%>>
置顶 <input name="Submit" type="submit" class="button" id="Submit" value="确定修改">
<input name="Reset" type="reset" class="button" id="Reset" value="清空重写">
[<a href="admin_news.asp">返回</a>] </td>
</tr>
<input type="hidden" name="id" value="<%=rs("news_id")%>">
<input type="hidden" name="action" value="editnew">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%rs.close
set rs=nothing
end if
'****************************************************
' Hxcms 7.5 Power by Hx66.net
' Web: http://www.Hx66.net,http://www.Hx66.net/home
' Copyright (C) 2006 Hx66.net All Rights Reserved.
'****************************************************
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?