📄 editad_news.asp
字号:
<!--#include file="conn.asp"-->
<%if session("china_admin")="" then
response.redirect "login.asp"
end if
dim theid,dtitle,dcolor,dbgcolor1,dcu,dlei,dispic,dpic,dtext,dstop,dtop,dmoney,sql,rs
theid=request("id")
if isnumeric(theid)=false then
response.write "<script>alert('参数错误,关闭窗口!');window.close();</script>"
response.end
end if
dtitle=HtmlEncode(trim(request.form("dtitle")))
dcolor=HtmlEncode(trim(request.form("dcolor")))
dbgcolor1=HtmlEncode(trim(request.form("dbgcolor1")))
dcu=HtmlEncode(trim(request.form("dcu")))
dpic=HtmlEncode(trim(request.form("dpic")))
dtext=HtmlEncode2(request.form("dtext"))
dstop=HtmlEncode(trim(request.form("dstop")))
dtop=HtmlEncode(trim(request.form("dtop")))
city_oneid=HtmlEncode(trim(request.form("city_one")))
city_twoid=HtmlEncode(trim(request.form("city_two")))
city_threeid=HtmlEncode(trim(request.form("city_three")))
dlei=HtmlEncode(trim(request.form("dlei")))
if dmoney<>"" then
if isnumeric(dmoney)=false then
response.write "<script>alert('信息费用请填写数字,立即返回!');history.back();</script>"
response.end
end if
end if
if city_oneid<>"" then
set rs=server.createobject("adodb.recordset")
rs.open "select city from china_city where twoid=0 and threeid=0 and id="&city_oneid,conn,1,1
city_one=rs("city")
rs.close
if city_twoid<>"" then
rs.open "select city from china_city where id="&city_oneid&" and threeid=0 and twoid="&city_twoid,conn,1,1
city_two=rs("city")
rs.close
end if
if city_twoid<>"" and city_threeid<>"" then
rs.open "select city from china_city where id="&city_oneid&" and twoid="&city_twoid&" and threeid="&city_threeid,conn,1,1
city_three=rs("city")
rs.close
end if
set rs=nothing
end if
sql="select * from news_data where adid="&theid
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if dtitle<>"" then
rs("title")=dtitle
rs("color")=dcolor
rs("bgcolor1")=dbgcolor1
rs("cu")=dcu
rs("city_oneid")=city_oneid
rs("city_one")=city_one
rs("city_two")=city_two
if city_twoid="" then city_twoid=0
rs("city_twoid")=city_twoid
rs("city_three")=city_three
if city_threeid="" then city_threeid=0
rs("city_threeid")=city_threeid
rs("type")=dlei
if dpic="http://" then
dpic=""
end if
if rs("pic")<>dpic then
if rs("pic")<>"" and lcase(left(rs("pic"),7))<>"http://" then
'''''''''''删除图片开始''''''''''''''''
Set fdel = CreateObject("Scripting.FileSystemObject")
tempImageDir = Server.MapPath("../adpic/"&rs("pic")&"")
fdel.DeleteFile(tempImageDir)
set fdel=nothing
'''''''''''删除图片结束'''''''''''''''
end if
rs("pic")=dpic
end if
rs("text")=dtext
rs("stop")=dstop
rs("top")=dtop
rs("time")=request.form("time")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
''''''''''''''''''生成html开始''''''''''''''''''''''''''
ServerURL=CStr(Request.ServerVariables("SCRIPT_NAME"))
n=InStrRev(ServerURL,"/") '从右边第一个字符起查找"_"的位置,n为返回值
ServerURL=left(ServerURL, n-1)'显示从左边数第"n-1"个字符前面的字符,
n=InStrRev(ServerURL,"/") '从右边第一个字符起查找"_"的位置,n为返回值
ServerURL=left(ServerURL, n)'显示从左边数第"n"个字符前面的字符,
ServerURL="http://"&Request.ServerVariables("SERVER_NAME")&""&ServerURL&"news.asp?id="&theid&""
Set Mail1 = Server.CreateObject("CDO.Message")
Mail1.CreateMHTMLBody ServerURL,31
AA=Mail1.HTMLBody
Set Mail1 = Nothing
set objfso = Server.CreateObject("Scripting.FileSystemObject")
set htmout = objfso.CreateTextFile(server.mappath("../html/news/"&theid&".htm"))
AA=replace(AA,"post.asp","../../post.asp")
AA=replace(AA,"adpic/","../../adpic/")
AA=replace(AA,"link.asp","../../link.asp")
AA=replace(AA,"link_img.asp","../../link_img.asp")
AA=replace(AA,"index.asp","../../index.asp")
AA=replace(AA,"114/../../index.asp","../../114/index.asp")
AA=replace(AA,"ad.asp","../../ad.asp")
AA=replace(AA,"TV.asp","../../tv.asp")
AA=replace(AA,"user.asp","../../user.asp")
AA=replace(AA,"gbook.asp","../../gbook.asp")
AA=replace(AA,"city.asp","../../city.asp")
AA=replace(AA,"city_more.asp","../../city_more.asp")
AA=replace(AA,"reg.asp","../../reg.asp")
AA=replace(AA,"login.asp","../../login.asp")
AA=replace(AA,"search.asp","../../search.asp")
AA=replace(AA,"114/join.asp","../../114/join.asp")
AA=replace(AA,"114/qy../../login.asp","../../114/qylogin.asp")
AA=replace(AA,"fabu.asp","../../fabu.asp")
AA=replace(AA,"type.asp","../../type.asp")
AA=replace(AA,"rq_message.asp","../../rq_message.asp")
AA=replace(AA,"top.asp","../../top.asp")
AA=replace(AA,"money.asp","../../money.asp")
AA=replace(AA,"pic.asp","../../pic.asp")
AA=replace(AA,"bbs/","../../bbs/")
AA=replace(AA,"html/news/","")
AA=replace(AA,"about.asp","../../about.asp")
htmout.write replace(AA,"images/","../../images/")
htmout.close
set htmout=nothing
set objfso=nothing
''''''''''''''''''生成html结束''''''''''''''''''''''''''
response.redirect "ok.asp"
response.end
end if%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>修改信息</title>
<SCRIPT LANGUAGE="JavaScript">
<!--//
function checkadd()
{
//检查年月日是否是合法日期
function isdate(intYear,intMonth,intDay){
if(isNaN(intYear)||isNaN(intMonth)||isNaN(intDay)) return false;
if(intMonth>12||intMonth<1) return false;
if ( intDay<1||intDay>31)return false;
if((intMonth==4||intMonth==6||intMonth==9||intMonth==11)&&(intDay>30)) return false;
if(intMonth==2){
if(intDay>29) return false;
if((((intYear%100==0)&&(intYear%400!=0))||(intYear%4!=0))&&(intDay>28))return false;
}
return true;
}
if (document.postart.dtitle.value.length<1)
{
alert("请填写信息标题!");
document.postart.dtitle.focus();
return false;
}
if (document.postart.dlei.value=="选择信息类别")
{
alert("请选择信息类别!");
document.postart.dlei.focus();
return false;
}
if (document.postart.dtext.value.length>20000)
{
alert("请把信息内容的字数控制在20000以内!");
document.postart.dtext.focus();
return false;
}
if (document.postart.dstop.value=="选择有效期")
{
alert("请选择有效期!");
document.postart.dstop.focus();
return false;
}
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
maxLen = 20000;
function checkMaxInput(form) {
if (form.dtext.value.length > maxLen)
form.remLen.value = 0;
else form.remLen.value = maxLen - form.dtext.value.length;
}
// End -->
</script>
<script language="javascript" type="text/javascript">
<!--
function changeColor(o) {
document.getElementById("colorBox").style.color = o.value;
}
//-->
</script>
<script language="javascript" type="text/javascript">
<!--
function changeColor1(o) {
document.getElementById("colorBox1").style.background = o.value;
}
//-->
</script>
</head>
<body background="images/background.gif">
<div align="center">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
<tr>
<td height="20" bgcolor="#799AE1" align="center"><font color="#FFFFFF" style="font-size:14px">编
辑 新 闻 内 容</font></td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF"> <br>
<form action="" method="post" name="postart" onsubmit="return checkadd()">
<table width="98%" border="0" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
<tr bgcolor="#FFFFFF">
<td width="27%" height="26" align="right">新闻标题:</td>
<td height="26" colspan="2">
<input type="text" name="dtitle" size="40" maxlength="40" value="<%=rs("title")%>">
<font color="#FF0000">*<%=rs("ip")%></font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="26" align="right">是否加粗:</td>
<td height="26" colspan="2">
<input type="radio" value="no" <%if rs("cu")="no" then%>checked<%end if%> name="dcu">
否
<input type="radio" value="yes" name="dcu" <%if rs("cu")="yes" then%>checked<%end if%>>
是</td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="right">标题颜色:</td>
<td width="160" height="26">
<input name="dcolor" type="text" id="dcolor" onchange="changeColor(this);" value="<%=rs("color")%>" size="8" />
<input type="button" name="Submit" value="选择颜色" onclick="window.open('../colorpicker.html', 'colorPicker', 'width=200, height=160');" />
</td>
<td rowspan="2">
<div align="center">
<table width="182" height="24" border="0" cellpadding="0" cellspacing="1" bgcolor="#cae2f8">
<tr>
<td align="center" <%if rs("bgcolor1")<>"" then%>bgcolor="<%=rs("bgcolor1")%>"<%else%>bgcolor="#EFF7FE"<%end if%>>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -