www.gusucode.com > 学校共青团组织网站源代码 > 学校共青团组织网站源代码/626/admin/admin_news_add.asp
<!--#include file = admin_chk.asp --> <!--#include file = admin_conn.asp --> <!--#include file = titleb.asp --> <html> <head> <!--#include file = language.asp --> <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" bgcolor="#EFEFDE"> <% 'ON ERROR RESUME NEXT titlecolor=trim(request("titlecolor")) tgid=trim(request("tgid")) ztid=0 eaddtime=year(now())&"-"&month(now())&"-"&day(now())&" "&hour(time())&":"&Minute(now())&":"&Second(now()) ehit=0 zz=session("admin__user") ehtml=Request.Cookies("html") 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") htitle=rs("htitle") tj=trim(rs("tj")) ztid=rs("ztid") lmid=rs("lm3") if lmid="0" then lmid=rs("lm2") if lmid="0" then lmid=rs("lm") lm2id=rs("lm2") ehtml=rs("html") pic=trim(rs("pic")) content=rs("content") yurl=rs("yurl") url=rs("url") titlecolor=rs("titlecolor") xgnews=rs("xgnews") ontop=rs("ontop") TouTiao=rs("TouTiao") zz=rs("zz") laiyuan=rs("laiyuan") piczz=rs("piczz") eaddtime=datetime(rs("time")) eHit=rs("hit") rs.close set rs=nothing else lmid=trim(request("lmid")) html=trim(request("html")) end if if tgid<>"" then Set rs = Server.CreateObject("ADODB.RecordSet") rs.Open "select * from [usertougao] where id="&tgid,conn,1,1 title=rs("title") content=rs("content") zz=rs("adduser") lmid=rs("lmid") eaddtime=datetime(rs("addtime")) end if if lmid="" then lmid=00 if (not isNumeric(ztid)) then ztid=0 end if if (not isNumeric(eHit)) then ehit=0 end if %> <div align="center"> <table border="0" width="760" id="table1" cellspacing="0" cellpadding="0" > <tr> <td> <div align="center"> <table border="0" cellpadding="0" cellspacing="0" width="100%" id="table3"> <tr> <td> </td> <td> </td> <td > <p align="right"> </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 < 1) { alert("在 新闻信息标题 域中,请至少输入 1 个字符。"); 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.addtime.value == "") { alert("请在 日期时间 域中输入值。"); theForm.addtime.focus(); return (false); } if (theForm.addtime.value.length < 1) { alert("在 日期时间 域中,请至少输入 1 个字符。"); theForm.addtime.focus(); return (false); } if (theForm.addtime.value.length > 30) { alert("在 日期时间 域中,请最多输入 30 个字符。"); theForm.addtime.focus(); return (false); } if (theForm.hit.value == "") { alert("请在 阅读数 域中输入值。"); theForm.hit.focus(); return (false); } if (theForm.hit.value.length < 1) { alert("在 阅读数 域中,请至少输入 1 个字符。"); theForm.hit.focus(); return (false); } if (theForm.hit.value.length > 9) { alert("在 阅读数 域中,请最多输入 9 个字符。"); theForm.hit.focus(); return (false); } return (true); } //--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="../admin_news_add_save.asp?id=<%=id%>&tgid=<%=tgid%>" name="FrontPage_Form1" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript"> <table border="0" width="753" id="table2" cellpadding="5" style="border-collapse: collapse" bordercolor="#80ABF4"> <tr> <td width="11%" align="center">新闻信息标题</td> <td width="41%"> <!--webbot bot="Validation" s-display-name="新闻信息标题" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="100" --><input type="text" name="title" size="48" maxlength="100" value='<%=title%>'></td> <td width="45%"> <select size="1" name="titlecolor"> <option value=" ">默认颜色</option> <% ii=255 for i=16 to 255 Randomize an="" an= int((255-16+1) * RND +16) a=hex(i) b=hex(ii) c=hex(i) 'i=i+99 ccc=a+b+c 'Response.Write i&":<font color="&ccc&">"&CCC&"</font><br>" %> <OPTION <% if titlecolor="#"&ccc&"" then response.write " selected "%> value="#<%=ccc%>" style="background-color:#<%=ccc%>"></OPTION> <% ii=ii-1 next ii=255 for i=16 to 255 Randomize an="" an= int((255-16+1) * RND +16) a=hex(i) b=hex(ii) c=hex(ii) 'i=i+99 ccc=a+b+c 'Response.Write i&":<font color="&ccc&">"&CCC&"</font><br>" %> <OPTION <% if titlecolor="#"&ccc&"" then response.write " selected "%> value="#<%=ccc%>" style="background-color:#<%=ccc%>"></OPTION> <% ii=ii-1 next ii=255 for i=16 to 255 Randomize an="" an= int((255-16+1) * RND +16) a=hex(i) b=hex(i) c=hex(i) 'i=i+99 ccc=a+b+c 'Response.Write i&":<font color="&ccc&">"&CCC&"</font><br>" %> <OPTION <% if titlecolor="#"&ccc&"" then response.write " selected "%> value="#<%=ccc%>" style="background-color:#<%=ccc%>"></OPTION> <% ii=ii-1 next %> <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">副标题</td> <td width="41%"> <input type="text" name="htitle" size="48" maxlength="100" value='<%=htitle%>'></td> <td width="45%"><input type="submit" value=" 保 存 "><textarea name="content" style="display:none" cols="1" rows="1"><%if content<>"" then response.write content%></textarea></td> </tr> <tr> <td width="11%" align="center">栏目选择</td> <td width="41%"> <% if Request.Cookies("admindj")="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 %> <option value='<%=rs("id")%>|0|0' <% if clng(lmid)=clng(rs("id")) then response.write " selected" %>><%=rs("lm")%>(1级)</option> <% 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")%>|0' <% if clng(lmid)=clng(rs2("id")) then response.write " selected" %>> ├<%=rs2("lm2")%>(2级)</option> <% Set rs33 = Server.CreateObject("ADODB.RecordSet") rs33.Open "select * from [lm] where lm3<>'' and lmid='"&rs2("id")&"' order by id asc",conn,1,1 while not rs33.eof %> <option value='<%=rs2("lmid")%>|<%=rs2("id")%>|<%=rs33("id")%>' <% if clng(lmid)=clng(rs33("id")) then response.write " selected" %>> ├<%=rs33("lm3")%>(3级)</option> <% rs33.movenext wend 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> <% admin_sql = "select * from admin where [user]='"&adminuser&"' order by id desc" Set admin_rs = Server.CreateObject("ADODB.RecordSet") admin_rs.Open admin_sql,conn,1,1 admin_lmid=admin_rs("lmid") for kkk=1 to 31 admin_lmid=replace(admin_lmid,chr(i),"") next 'Response.Write admin_lmid array_admin_lmid=split(admin_lmid,",") For i=0 to ubound(array_admin_lmid) aaa=array_admin_lmid(i) '取出编辑者拥有的权限ID号. if aaa="" then aaa=0 lm_1_sql = "select * from lm where id="&aaa Set lm_1_rs = Server.CreateObject("ADODB.RecordSet") lm_1_rs.Open lm_1_sql,conn,1,1 while not lm_1_rs.eof if lm_1_rs("lm")<>"" then %> <option value='<%=lm_1_rs("id")%>|0|0' <% if clng(lmid)=clng(lm_1_rs("id")) then response.write " selected" %>><%=lm_1_rs("lm")%>(1级) </option> <% ElseIf lm_1_rs("lm2")<>"" then %> <option value='<%=lm_1_rs("lmid")%>|<%=lm_1_rs("id")%>|0' <% if clng(lmid)=clng(lm_1_rs("id")) then response.write " selected" %>> ├ <%=lm_1_rs("lm2")%>(2级)</option> <% Elseif lm_1_rs("lm3")<>"" then get_1_id_sql="select lmid from [lm] where id="&clng(lm_1_rs("lmid")) set get_1_id_rs = Server.CreateObject("ADODB.RecordSet") get_1_id_rs.Open get_1_id_sql,conn,1,1 lmid31=get_1_id_rs("lmid") get_1_id_rs.close set get_1_id_rs=nothing %> <option value='<%=lmid31%>|<%=lm_1_rs("lmid")%>|<%=lm_1_rs("id")%>' <% if clng(lmid)=clng(lm_1_rs("id")) then response.write " selected" %>> ├ <%=lm_1_rs("lm3")%>(3级)</option> <% end if '结尾配对lm_1_rs("lm")<>"" lm_1_rs.movenext wend lm_1_rs.close set lm_1_rs=nothing next admin_rs.close set admin_rs=nothing %> </select> <%end if%></td> <td width="45%"> <div align="center"> <table border="0" cellpadding="0" cellspacing="0" width="100%" id="table4"> <tr> <td width="31">专题</td> <td ><select size="1" name="ztid"> <option value="0">请选择:::</option> <% set rszt = Server.CreateObject("ADODB.RecordSet") rszt.Open "select id,title from [NewsZT] order by id asc",conn,1,1 while not rszt.eof %> <option value="<%=rszt("id")%>" <% if clng(ztid)=clng(rszt("id")) then Response.Write " selected "%>><%=rszt("title")%></option> <% rszt.movenext wend rszt.close:set rszt=nothing %> </select></td> </tr> </table> </div> </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="53%" colspan="2"> <input type="checkbox" <% if pic<>"" then Response.Write " checked "%> name="tuwen" value="1" id=tu><label for=tu>图片新闻</label> <% if Request.Cookies("admindj")="1" then %> <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> <input type="checkbox" name="TouTiao" <%if TouTiao=1 then response.write " checked "%> value="1" id=TouTiao><label for=TouTiao title='设置头条后,其它所有头条将自动取消!'>设置为头条</label> <% end if if config("lrySH")=1 or Request.Cookies("admindj")="1" then %> <input type="checkbox" <%if ehtml="1" then response.write " checked "%> name="html" value="1" id=html><label for=html>生成HTML</label> <% end if %> </td> <td width="45%" rowspan="10"> </td> </tr> <% if Request.Cookies("admindj")="1" then %> <tr> <td width="11%" align="center">添加时间</td> <td width="41%"> <!--webbot bot="Validation" s-display-name="日期时间" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="30" --><input type="text" name="addtime" size="20" value="<%=eaddtime%>" maxlength="30"> 格式:<%=year(now())&"-"&month(now())&"-"&day(now())&" "&hour(time())&":"&Minute(now())&":"&Second(now())%></td> </tr> <tr> <td width="11%" align="center">阅读数</td> <td width="41%"> <!--webbot bot="Validation" s-display-name="阅读数" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="9" --><input type="text" name="hit" size="20" value="<%=ehit%>" maxlength="9"> </td> </tr> <% end if %> <tr> <td width="11%" align="center">文章来源</td> <td width="41%"> <input type="text" name="laiyuan" size="20" maxlength="40" value="<%=laiyuan%>"></td> </tr> <tr> <td width="11%" align="center">文章作者</td> <td width="41%"> <input type="text" name="zz" size="20" value="<%=zz%>" maxlength="50"></td> </tr> <tr> <td width="11%" align="center">图片作者</td> <td width="41%"> <input type="text" name="piczz" size="20" value="<%=piczz%>" maxlength="50"></td> </tr> <tr> <td width="11%" align="center">原贴地址</td> <td width="41%"> <input type="text" name="YURL" size="47" value='<%=yurl%>'></td> </tr> <tr> <td width="11%" align="center">跳转URL</td> <td width="41%"> <input type="text" name="URL" size="47" value='<%=url%>'><br> <font color="#808080">填写网址,自动打开此URL。不显示新闻内容</font></td> </tr> <tr> <td width="11%"> <p align="center">图片地址</td> <td width="41%"> <input type="text" name="pic" size="47" value="<%=pic%>"><br> <font color="#808080">此地址将做为图片新闻的缩略图,如果为空,默认是新闻内容中第一幅图片。</font></td> </tr> <tr> <td width="11%"> <p align="center">相关新闻</td> <td width="41%"> <input type="text" name="xgnews" size="20" value="<%=xgnews%>"> (填写关键字)</td> </tr> </table> <p align="center"><input type="submit" value=" 保 存 "> <input type="reset" value=" 重 置 " name="B2"></p> </form> <p> </td> </tr> </table> </div> </body> </html> <% conn.close set conn=nothing %>