Admin_Article.asp
资源名称:haohj.rar [点击查看]
上传用户:angela
上传日期:2022-05-11
资源大小:853k
文件大小:31k
源码类别:
外挂编程
开发平台:
ASP/ASPX
- <!--#include file="setup.asp"-->
- <!--#include file="check.asp"-->
- <%
- If Not CheckAdmin("ArticleList") Then
- Server.Transfer("showerr.asp")
- Response.End
- End If
- Dim Rs2,rscat,selID
- titlename="文章管理"
- Admin_header
- function isInteger(para)
- on error resume next
- dim str
- dim l,i
- if isNUll(para) then
- isInteger=false
- exit function
- end if
- str=cstr(para)
- if trim(str)="" then
- isInteger=false
- exit function
- end if
- l=len(str)
- for i=1 to l
- if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
- isInteger=false
- exit function
- end if
- next
- isInteger=true
- if err.number<>0 then err.clear
- end function
- if request.QueryString("guiqi")="del" then'
- SoftID=trim(request("SoftID"))
- Action=Trim(Request("Action"))
- tab=request("tab")
- url=request("url")
- if Action="" then
- response.Write"<script>alert('参数不足!');</script>"
- response.Write"<script>history.go(-1);</script>"
- end if
- if SoftID="" then
- response.Write"<script>alert('请选择要操作的记录!');</script>"
- response.Write"<script>history.go(-1);</script>"
- end if
- call DelSoft()
- call closeconn()
- sub DelSoft()
- if instr(SoftID,",")>0 then
- SoftID=replace(SoftID," ","")
- sqlDel="select * from "&tab&" where id in (" & SoftID & ")"
- else
- SoftID=Clng(SoftID)
- sqlDel="select * from "&tab&" where id =" & SoftID
- end if
- Set rsDel= Server.CreateObject("ADODB.Recordset")
- rsDel.open sqlDel,conn,1,3
- do while not rsDel.eof
- rsDel.delete
- rsDel.movenext
- loop
- rsDel.close
- set rsDel=nothing
- response.Write"<script>alert('恭喜您!批量删除成功!');location.href='"&url&"';</script>"
- end sub
- end if
- if Request.form("MM_insert") then
- if request.Form("action")="newartcat" then
- sql="select * from Gq_newsclass"
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,1,3
- rs.addnew
- dim cat_name
- cat_name=trim(replace(request.form("cat_name"),"'",""))
- if cat_name="" then
- founderr=true
- Response.Write("<script language=javascript>alert('你必须填写文章分类');history.back(1);</script>")
- else
- rs("cat_name")=cat_name
- end if
- if founderr then
- call closeconn()
- response.end
- else
- rs.update
- rs.close
- set rs=nothing
- response.redirect "admin_article.asp"
- end if
- end if
- if request.Form("action")="editartcat" then
- if request.Form("id")="" then
- founderr=true
- Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
- else
- if not isInteger(request.form("id")) then
- founderr=true
- Response.Write("<script language=javascript>alert('非法的id参数');history.back(1);</script>")
- end if
- end if
- if founderr then
- call closeconn()
- response.End
- end if
- sql="select * from Gq_newsclass where cat_id="&cint(request.form("id"))
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,1,3
- cat_name=trim(replace(request.form("cat_name"),"'",""))
- if cat_name="" then
- founderr=true
- Response.Write("<script language=javascript>alert('你必须填写文章分类');history.back(1);</script>")
- else
- rs("cat_name")=cat_name
- end if
- if founderr then
- call closeconn()
- response.end
- else
- rs.update
- rs.close
- set rs=nothing
- response.redirect "admin_article.asp"
- end if
- end if
- if request.Form("action")="delartcat" then
- if request.Form("id")="" then
- founderr=true
- Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
- else
- if not isInteger(request.form("id")) then
- founderr=true
- Response.Write("<script language=javascript>alert('非法的id参数');history.back(1);</script>")
- end if
- end if
- if founderr then
- call closeconn()
- response.End
- end if
- sql="select * from Gq_newsclass where cat_id="&cint(request.form("id"))
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,1,3
- rs.delete
- rs.close
- set rs=nothing
- response.redirect "admin_article.asp"
- end if
- end if
- sql="select * from Gq_newsclass order by cat_id DESC"
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,1,1
- %>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <tr>
- <th>文章管理</th>
- </tr>
- <tr>
- <td class=tablerow1><b>管理选项:</b><a href="admin_article.asp">文章首页</a> | <a href="?action=newart">添加文章</a> | <a href="?action=fl">分类管理</a> | <a href="?action=newartcat">添加分类</a> | <a href="createhtml.asp?action=artcontent">生成全部文章内容HTML</a></td>
- </tr>
- </table>
- <br>
- <%
- Action = LCase(Request("action"))
- Select Case Trim(Action)
- Case "batdel"
- Call batdel()
- Case "bathtml"
- Call ContentIDHtml(1,selID)
- Case "batclassdel"
- Call batclassdel()
- Case "batclasshtml"
- Call artClassHtml(1,selID)
- Call artpageHtml()
- End Select
- if request.QueryString("action")="fl" then%>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <tr>
- <th width="5%">选择</th>
- <th width="70%">分类名称</th>
- <th width="25%">操作</th>
- </tr>
- <%
- Response.Write " <form name=selform method=Get action="""">"
- Response.Write " <input type=hIDden name=action value=''>"
- do while not rs.eof
- Response.Write "<tr>"
- Response.Write " <td " & CenterClass & "><input type=""checkbox"" name=""selID"" value="""
- Response.Write Rs("cat_id")
- Response.Write """></td>"
- %>
- <td class="TableRow2"><a href="#"><%=rs("cat_name")%></a></td>
- <td align="center" class="TableRow2">
- <a href="admin_article.asp?id=<%=rs("cat_id")%>&action=editartcat">编辑</a>
- <a href="admin_article.asp?id=<%=rs("cat_id")%>&action=delartcat">删除</a></td>
- </tr>
- <%rs.movenext
- loop
- if rs.bof and rs.eof then%>
- <tr align="center">
- <td colspan="3" class="TableRow2">当前没有文章分类!</td>
- </tr>
- <%
- end if
- Response.Write "<TR height=25>" & vbCrLf
- Response.Write "<TD " & LeftClass & " colspan=9><B>操作选项:<B> "
- Response.Write "<input class=Button type=button value='全选' onClick=""CheckAll(this.form)"">"
- Response.Write "<input class=Button type=button value='撤消' onClick=""CheckCel(this.form)"">"
- Response.Write "<input class=Button type=button value='反选' onClick=""CheckSel(this.form)""> "
- Response.Write "<input class=Button type=""submit"" name=""Submit1"" value=""批量删除"" onclick=""document.selform.action.value='batclassdel';""> "
- Response.Write "<input class=Button type=""submit"" name=""Submit2"" value=""生成HTML"" onclick=""document.selform.action.value='batclasshtml';"">"
- Response.Write "</td>" & vbCrLf
- Response.Write "</tr>" & vbCrLf
- Response.Write "</form>" & vbCrLf
- %>
- </table>
- <%end if
- if request.QueryString("action")="newartcat" then%>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <form name="form1" method="post" action="admin_article.asp?action=art&artcat_art=<%=request.querystring("artcat_id")%>">
- <tr>
- <th>文章分类管理--添加分类</th>
- </tr>
- <tr>
- <td class=tablerow1>分类名称:<input type="text" name="cat_name" size="40"></td>
- </tr>
- <tr>
- <td class=tablerow1 align="center" height="30">
- <input class=Button type="submit" name="Submit" value="确定新增" class="button">
- <input class=Button type="reset" name="reset" value="清空重写" class="button">
- <input class=Button type="button" value=" 返 回 " onClick="location.href='admin_article.asp'" class="button"></td>
- </tr>
- <input type="hidden" name="action" value="newartcat">
- <input type="hidden" name="MM_insert" value="true">
- </form>
- </table>
- <%end if
- if request.QueryString("action")="editartcat" then
- if request.querystring("id")="" then
- Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
- call closeconn()
- response.end
- else
- if not isinteger(request.querystring("id")) then
- Response.Write("<script language=javascript>alert('非法的id参数');history.back(1);</script>")
- call closeconn()
- response.end
- end if
- end if
- sql="select * from Gq_newsclass where cat_id="&cint(request.querystring("id"))
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,1,1
- %>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <form name="form1" method="post" action="admin_article.asp">
- <tr>
- <th>文章分类管理--修改分类</th>
- </tr>
- <tr>
- <td class=tablerow1>分类名称:<input name="cat_name" type="text" class="textarea" id="cat_name" size="40" value="<%=rs("cat_name")%>"></td>
- </tr>
- <tr>
- <td class=tablerow1 align="center" height="30">
- <input class=Button name="Submit" type="submit" id="Submit" value="确定修改">
- <input class=Button type="button" value=" 返 回 " onClick="location.href='admin_article.asp'"></td>
- </tr>
- <input type="hidden" name="id" value="<%=rs("cat_id")%>">
- <input type="hidden" name="action" value="editartcat">
- <input type="hidden" name="MM_insert" value="true">
- </form>
- </table>
- <%end if
- if request.QueryString("action")="delartcat" then
- if request.querystring("id")="" then
- Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
- call closeconn()
- response.end
- else
- if not isinteger(request.querystring("id")) then
- Response.Write("<script language=javascript>alert('非法的id参数');history.back(1);</script>")
- call closeconn()
- response.end
- end if
- end if
- sql="select * from Gq_newsclass where cat_id="&cint(request.querystring("id"))
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,1,1
- %>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <form name="form1" method="post" action="admin_article.asp">
- <tr>
- <th>文章分类管理--删除分类</th>
- </tr>
- <tr>
- <td class=tablerow1>分类名称- <%=rs("cat_name")%></td>
- </tr>
- <tr>
- <td class=tablerow1 align="center" height="30">
- <input name="Submit" type="submit" class="button" id="Submit" value="确定删除">
- <input type="button" value=" 返 回 " onClick="location.href='admin_article.asp'" class="button"></td>
- </tr>
- <input type="hidden" name="id" value="<%=rs("cat_id")%>">
- <input type="hidden" name="action" value="delartcat">
- <input type="hidden" name="MM_insert" value="true">
- </form>
- </table>
- <%end if
- if request.QueryString("action")="" then
- Dim tablestyle, strContent
- Dim maxperpage,CurrentPage,Pcount,totalrec,totalnumber
- maxperpage = AdminPage
- totalrec = 0
- Pcount = 1
- CurrentPage = tee5.ChkNumeric(Request("page"))
- If CurrentPage = 0 Then CurrentPage = 1
- Response.Write "<script src=""/js/showpage.js"" type=""text/javascript""></script>" & vbCrLf
- Response.Write "<table border=""0"" cellspacing=""1"" cellpadding=""3"" align=center class=""tableBorder"">"
- Response.Write " <tr>"
- Response.Write "<th wIDth=""5%"">选择</th>"
- Response.Write "<th wIDth=""*"">文章标题</th>"
- Response.Write "<th wIDth=""15%"">操作</th>"
- Response.Write "<th wIDth=""5%"">推荐</th>"
- Response.Write "<th wIDth=""10%"">更新日期</th>"
- Response.Write "</tr>"
- Response.Write "<tr>"
- Response.Write " <form name=form method=Get action="""">"
- Response.Write "<td class=tablerow1 colspan=""5"" align=""right""><b>文章导航:</b>"
- Response.Write "<select name=""go"" style=""margin:-3px"" onChange='window.location=form.go.options[form.go.selectedIndex].value'>"
- Response.Write "<option value=""admin_article.asp"">≡全部文章列表≡</option>"
- sql="select * from Gq_newsclass"
- set Rs2=server.createobject("adodb.recordset")
- Rs2.open sql,conn,1,1
- do while not Rs2.eof
- Response.Write "<option value=""admin_article.asp?action=cat&cat_id="
- Response.Write Rs2("cat_id")
- Response.Write """>"
- Response.Write Rs2("cat_name")
- Response.Write "</option>"
- Rs2.movenext
- loop
- if Rs2.bof and Rs2.eof then
- Response.Write "<option value="""">当前没有分类</option>"
- end if
- Rs2.Close:Set Rs2 = Nothing
- Response.Write "</select>"
- Response.Write "</td>"
- Response.Write "</tr></form>"
- Response.Write " <form name=selform method=Get action="""">"
- Response.Write " <input type=hIDden name=action value=''>"
- set Rs = server.createobject("adodb.recordset")
- If Request.querystring("cat_id") <> "" then
- SQL = "SELECT A.ID, A.Cat_ID, A.Art_Title, A.Writer, A.Isbest, A.Art_Date, A.Art_Count, C.Cat_Name FROM [Gq_Article] A INNER JOIn [Gq_NewsClass] C ON A.Cat_ID=C.Cat_ID Where A.Cat_ID=" & Cint(Request.Querystring("Cat_ID")) & " Order By A.Art_Date desc"
- Else
- SQL = "SELECT A.ID, A.Cat_ID, A.Art_Title, A.Writer, A.Isbest, A.Art_Date, A.Art_Count, C.Cat_Name FROM [Gq_Article] A INNER JOIn [Gq_NewsClass] C ON A.Cat_ID=C.Cat_ID Order By A.Art_Date desc"
- End If
- Rs.open Sql,conn,1,3
- If Rs.eof and Rs.bof then
- Response.Write "<tr><td " & CenterClass & " colspan='5'>当前无任何文章!</td></tr>"
- Else
- totalrec = Rs.RecordCount
- Pcount = CLng(totalrec / maxperpage) '得到总页数
- If Pcount < totalrec / maxperpage Then Pcount = Pcount + 1
- If CurrentPage < 1 Then CurrentPage = 1
- If CurrentPage > Pcount Then CurrentPage = Pcount
- Rs.PageSize = maxperpage
- Rs.AbsolutePage = CurrentPage
- i = 0
- Do While Not Rs.EOF And i < maxperpage
- If Not Response.IsClientConnected Then ResponseEnd
- strContent = year(rs("art_date")) & month(rs("art_date")) & day(rs("art_date"))
- Response.Write " <tr>"
- Response.Write " <td " & CenterClass & "><input type=""checkbox"" name=""selID"" value="""
- Response.Write Rs("ID")
- Response.Write """></td>"
- Response.Write " <td " & LeftClass & ">[" & Rs("Cat_Name") & "] "
- 'Response.Write "<a href=""/html/Article/" & Rs("Cat_ID") & "/" & strContent & "/News_" & rs("id")
- 'Response.Write ".html"">"
- Response.Write Left(Rs("art_title"),25)
- 'Response.Write "...</a>"
- Response.Write "...</td>"
- Response.Write " <td " & CenterClass & "><a href=""admin_article.asp?ID="
- Response.Write Rs("ID")
- Response.Write "&cat_id="
- Response.Write Rs("Cat_ID")
- Response.Write "&action=editart"">编辑</a> | <a href=""admin_article.asp?selID="
- Response.Write Rs("ID")
- Response.Write "&action=batdel"">删除</a></td>"
- Response.Write " <td " & CenterClass & ">"
- If Rs("isbest")=1 Then Response.Write "<font color=red>√</font>" Else Response.Write "×"
- Response.Write "</td>"
- Response.Write " <td " & CenterClass & ">"
- If Rs("art_date") >= Date() then
- Response.Write "<FONT color=""#FF0000"">"&year(Rs("art_date"))&"-"&month(Rs("art_date"))&"-"&day(Rs("art_date"))&"</FONT >" & vbCrLf
- Else
- Response.Write "<FONT color=""#999999"">"&year(Rs("art_date"))&"-"&month(Rs("art_date"))&"-"&day(Rs("art_date"))&"</FONT >" & vbCrLf
- End If
- Response.Write "</td>"
- Response.Write "</tr>"
- Rs.movenext
- i = i + 1
- If i >= maxperpage Then Exit Do
- Loop
- End If
- Rs.Close:Set Rs = Nothing
- Response.Write "<TR height=25>" & vbCrLf
- Response.Write "<TD " & LeftClass & " colspan=9><B>操作选项:<B> "
- Response.Write "<input class=Button type=button value='全选' onClick=""CheckAll(this.form)"">"
- Response.Write "<input class=Button type=button value='撤消' onClick=""CheckCel(this.form)"">"
- Response.Write "<input class=Button type=button value='反选' onClick=""CheckSel(this.form)""> "
- Response.Write "<input class=Button type=""submit"" name=""Submit1"" value=""批量删除"" onclick=""document.selform.action.value='batdel';""> "
- Response.Write "<input class=Button type=""submit"" name=""Submit2"" value=""生成HTML"" onclick=""document.selform.action.value='bathtml';"">"
- Response.Write "</td>" & vbCrLf
- Response.Write "</tr>" & vbCrLf
- Response.Write "</form>" & vbCrLf
- Response.Write "<TR height=25>" & vbCrLf
- Response.Write "<TD " & RightClass & " colspan=9>" & vbCrLf
- tee5.ShowListPage CurrentPage,Pcount,totalrec,maxperpage,"","文章管理"
- Response.Write "</TD></TR></TABLE>" & vbCrLf
- end if
- if request.Form("action")="newart" then
- set rs=server.createobject("adodb.recordset")
- sql="select * from Gq_article"
- rs.open sql,conn,1,3
- rs.addnew
- dim poster,artfrom,title,writer,copyright,content,artisbest,catid
- catid=cint(request.form("cat_id"))
- title=trim(replace(request.form("art_title"),"'",""))
- writer=trim(replace(request.form("writer"),"'",""))
- copyright=trim(replace(request.form("copyright"),"'",""))
- artisbest=request.form("isbest")
- content=rtrim(replace(request.form("content"),"",""))
- if catid<1 then
- founderr=true
- Response.Write("<script language=javascript>alert('你必须选择文章的分类!');history.back(1);</script>")
- else
- rs("cat_id")=catid
- end if
- if title="" then
- founderr=true
- Response.Write("<script language=javascript>alert('你必须填写文章的标题!');history.back(1);</script>")
- else
- rs("art_title")=title
- end if
- if content="" then
- founderr=true
- Response.Write("<script language=javascript>alert('你必须填写文章的内容!');history.back(1);</script>")
- else
- rs("content")=content
- end if
- if writer="" then
- founderr=true
- Response.Write("<script language=javascript>alert('文章的作者不会没有吧?');history.back(1);</script>")
- else
- rs("writer")=writer
- end if
- if copyright="" then
- founderr=true
- Response.Write("<script language=javascript>alert('你必须填写文章来源');history.back(1);</script>")
- else
- rs("copyright")=copyright
- end if
- if cint(artisbest)=1 then
- rs("isbest")=cint(artisbest)
- end if
- if founderr then
- response.end
- else
- rs.update
- rs.close
- set rs=nothing
- 'sql="update allcount set articlecount = articlecount + 1"
- 'tee5.Execute(sql)
- response.redirect "admin_article.asp"
- end if
- end if
- if request.Form("action")="editart" then
- if request.Form("id")="" then
- founderr=true
- Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
- else
- if not isInteger(request.form("id")) then
- founderr=true
- Response.Write("<script language=javascript>alert('非法的文章id参数。');history.back(1);</script>")
- end if
- end if
- if founderr then
- response.End
- end if
- sql="select * from Gq_article where id="&cint(request.Form("id"))
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,1,3
- catid=cint(request.form("cat_id"))
- title=trim(replace(request.form("art_title"),"'",""))
- artisbest=request.form("isbest")
- content=rtrim(replace(request.form("content"),"",""))
- content=trim(replace(content," "," "))
- if catid<1 then
- founderr=true
- Response.Write("<script language=javascript>alert('你必须选择文章的分类!');history.back(1);</script>")
- else
- rs("cat_id")=catid
- end if
- if title="" then
- founderr=true
- Response.Write("<script language=javascript>alert('你必须填写文章的标题!');history.back(1);</script>")
- else
- rs("art_title")=title
- end if
- if content="" then
- founderr=true
- Response.Write("<script language=javascript>alert('你必须填写文章的内容!');history.back(1);</script>")
- else
- rs("content")=content
- end if
- rs("isbest")=cint(artisbest)
- if founderr then
- call closeconn()
- response.end
- else
- rs.update
- rs.close
- set rs=nothing
- response.redirect "admin_article.asp"
- end if
- end if
- if request.Form("action")="delart" then
- if request.Form("id")="" then
- founderr=true
- Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
- else
- if not isInteger(request.form("id")) then
- founderr=true
- Response.Write("<script language=javascript>alert('非法的文章id参数。');history.back(1);</script>")
- end if
- end if
- if founderr then
- call closeconn()
- response.End
- end if
- sql="select * from Gq_article where id="&cint(request.Form("id"))
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,1,3
- rs.delete
- rs.close
- set rs=nothing
- sql="update allcount set articlecount = articlecount - 1"
- tee5.Execute(sql)
- response.redirect "admin_article.asp"
- end if
- if request.QueryString("action")="newart" then
- %>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <form action="" method="post" name="guiqiform" onSubmit="return CheckForm(this);">
- <tr>
- <th colspan="3">文章管理--添加文章</th>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">文章标题:</td>
- <td class="TableRow1"><input type="text" name="art_title" size="60" class="textarea"></td>
- </tr>
- <tr>
- <td align="right" class="TableRow1">文章作者:</td>
- <td class="TableRow1"><input type="text" name="writer" size="40" class="textarea" value="<%=session("LoginName")%>"></td>
- </tr>
- <tr>
- <td align="right" class="TableRow1">文章来源:</td>
- <td class="TableRow1"><input type="text" name="copyright" size="40" class="textarea" value="<%=tee5.WebName%>"></td>
- </tr>
- <tr>
- <td align="right" class="TableRow1">所属分类:</td>
- <td class="TableRow1"><select name="cat_id">
- <%
- sql="select * from Gq_newsclass"
- set rs=tee5.Execute(sql)
- do while not rs.eof%>
- <option value="<%=rs("cat_id")%>"><%=rs("cat_name")%></option>
- <%rs.movenext
- loop
- rs.close
- set rs=nothing%>
- </select></td>
- </tr>
- <tr>
- <td align="right" class="TableRow1">文章内容:</td>
- <td class="TableRow1">
- <table border="1" align="center" cellpadding="0" cellspacing="0">
- <tr>
- <td width="750" height="350" align="center"><textarea name="content" style="display:none" id="content"></textarea>
- <SCRIPT src="inc/post.js"></SCRIPT></td>
- </tr></table></td>
- </tr>
- <tr>
- <td class="TableRow1" colspan="3" height="30" align="center">
- <input type="checkbox" name="isbest" value="1"> 推荐
- <input class=Button type="submit" name="Submit" value=" 发 布 " class="button">
- <input class=Button type="reset" name="Reset" value=" 重 写 " onclick="ClearReset()">
- </td>
- </tr>
- <input type="hidden" name="action" value="newart">
- <input type="hidden" name="MM_insert" value="true">
- </form>
- </table>
- <%end if
- if request.QueryString("action")="editart" then
- if request.querystring("id")="" then
- Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
- call closeconn()
- response.end
- else
- if not isinteger(request.querystring("id")) then
- Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
- call closeconn()
- response.end
- end if
- end if
- if request.querystring("cat_id")="" then
- Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
- call closeconn()
- response.end
- else
- if not isinteger(request.querystring("cat_id")) then
- Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
- call closeconn()
- response.end
- end if
- end if
- sql="select * from Gq_article where id="&cint(request.querystring("id"))
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,1,1
- %>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <form action="" method="post" name="guiqiform" onSubmit="return CheckForm(this);">
- <tr>
- <th colspan="3">文章管理--修改文章</th>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">文章标题:</td>
- <td class="TableRow1"><input name="art_title" type="text" class="textarea" id="art_title" size="60" value="<%=rs("art_title")%>"></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">文章作者:</td>
- <td class="TableRow1"><input name="writer" type="text" class="textarea" id="writer" size="40" value="<%=rs("writer")%>"></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">文章来源:</td>
- <td class="TableRow1"><input name="copyright" type="text" class="textarea" id="copyright" size="40" value="<%=rs("copyright")%>"></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">所属分类:</td>
- <td class="TableRow1">
- <select name="cat_id" id="cat_id">
- <%
- sql="select * from Gq_newsclass"
- set Rs2=tee5.Execute(sql)
- do while not Rs2.eof%>
- <option value="<%=Rs2("cat_id")%>"<%if cint(Rs2("cat_id"))=cint(request("cat_id")) then response.Write " selected"%>><%=Rs2("cat_name")%></option>
- <%Rs2.movenext
- loop
- Rs2.close
- set Rs2=nothing
- %>
- </select></td>
- </tr>
- <tr>
- <td align="right" class="TableRow1">文章内容:</td>
- <td class="TableRow1">
- <table border="1" align="center" cellpadding="0" cellspacing="0">
- <tr>
- <td width="750" height="350" align="center"><textarea name="content" style="display:none" id="content"><%=rs("content")%></textarea>
- <SCRIPT src="inc/post.js"></SCRIPT></td>
- </tr></table></td>
- </tr>
- <tr>
- <td class="TableRow1" colspan="3" height="30" align="center">
- <input type="checkbox" name="isbest" value="1" id="isbest" <%if rs("isbest")=1 then response.write "checked" end if%>>推荐
- <input class=Button name="Submit" type="submit" class="button" id="Submit" value=" 编 辑 ">
- <input class=Button type="button" value=" 返 回 " onClick="location.href='admin_article.asp'" class="button"></td>
- </tr>
- <input type="hidden" name="id" value="<%=rs("id")%>">
- <input type="hidden" name="action" value="editart">
- <input type="hidden" name="MM_insert" value="true">
- </form>
- </table>
- <%end if
- if request.QueryString("action")="delart" then
- if request.querystring("id")="" then
- Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
- call closeconn()
- response.end
- else
- if not isinteger(request.querystring("id")) then
- Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
- call closeconn()
- response.end
- end if
- end if
- if request.querystring("cat_id")="" then
- Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
- call closeconn()
- response.end
- else
- if not isinteger(request.querystring("cat_id")) then
- Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
- call closeconn()
- response.end
- end if
- end if
- sql="select * from Gq_article where id="&cint(request.querystring("id"))
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,1,1
- %>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <form name="addart" method="post" action="">
- <tr>
- <th colspan="3">文章管理--删除文章</th>
- </tr>
- <tr>
- <td class="TableRow1">标题- <%=rs("art_title")%></td>
- </tr>
- <tr>
- <td class="TableRow1">所属分类
- <%
- sql="select * from Gq_newsclass where cat_id="&cint(request.querystring("cat_id"))
- set Rs2=tee5.Execute(sql)
- %>
- <%=Rs2("cat_name")%>
- <%
- Rs2.close
- set Rs2=nothing%>
- </td>
- </tr>
- <tr>
- <td class="TableRow1"><%=ubb2html(formatStr(autourl(rs("content"))), true, true)%></td>
- </tr>
- <tr>
- <td class="TableRow1" height="30" align="center">
- <input name="Submit" type="submit" class="button" id="Submit" value=" 删 除 ">
- <input type="button" value=" 返 回 " onClick="location.href='admin_article.asp'" class="button"></td>
- </tr>
- <input type="hidden" name="id" value="<%=rs("id")%>">
- <input type="hidden" name="action" value="delart">
- <input type="hidden" name="MM_insert" value="true">
- </form>
- </table>
- <%rs.close
- set rs=nothing
- end if
- Sub BatDel()
- If Len(Request("selID")) = "" then
- response.write "<script>alert('非法操作');history.back()</script>"
- Else
- If Len(Request("selID")) > 0 Then
- SQL = "DELETE FROM [Gq_Article] WHERE ID in (" & Request("selID") & ")"
- tee5.Execute (SQL)
- End If
- End If
- Succeed ("恭喜您!删除成功,请继续其他操作。")
- End Sub
- Sub ContentIDHtml(Pattern,selID)
- Dim SQLID, AllID
- Dim totalnum, FileUrl, FolderPath, FileName, FilePath
- On Error Resume Next
- selID = Request("selID")
- AllID = Split(selID, ",")
- If selID = "" Then
- Response.Write "<script>alert('请选择后操作');history.back()</script>"
- End If
- totalnum = tee5.Execute("SELECT COUNT(*) FROM [Gq_Article] WHERE ID in (" & selID & ")")(0)
- SQL = "SELECT * FROM Gq_Article WHERE ID in (" & selID & ")"
- Set rs = tee5.Execute(SQL)
- SQL=Rs.GetRows(totalnum)
- Set Rs = Nothing
- If Pattern = 1 then SQLID= UBound(AllID): Else SQLID= UBound(SQL,2)
- If Pattern = 1 then Response.Write "<ol>"
- If Pattern = 1 then Response.Write "<b>生成文章内容(HTML)开始......</b><br><br>"
- For i = 0 To SQLID
- FolderPath = tee5.ServerDir & "wz/"
- tee5.CreatPathEx (FolderPath)
- FileUrl = tee5.WebUrl & "/Temp/8.asp?ID=" & Clng(SQL(0,i))
- FileName = "News_" & SQL(0,i)
- FilePath = FolderPath & FileName & ".html"
- Call GetRemoteFiels(FileUrl, FolderPath, FileName)
- If Pattern = 1 then Response.Write "<li style=""font-size: 12px;"">生成文章内容HTML页完成... <a href=" & FilePath & " target=_blank>" & Server.MapPath(FilePath) & "</a></li>" & vbNewLine
- Response.Flush
- Next
- If Pattern = 1 then Response.Write "<br><br><b>恭喜您!文章内容HTML全部生成完毕!</b>"
- If Pattern = 1 then Response.Write "</ol>"
- End Sub
- Sub artClassHtml(Pattern,selID)
- Dim SQLID, AllID
- Dim totalnum, FileUrl, FolderPath, FileName, FilePath, totalnumll
- On Error Resume Next
- selID = Request("selID")
- AllID = Split(selID, ",")
- If selID = "" Then
- Response.Write "<script>alert('请选择后操作');history.back()</script>"
- End If
- 'totalnumll = tee5.Execute("SELECT A.Cat_ID, C.Cat_ID FROM [Gq_Article] A INNER JOIn [Gq_NewsClass] C ON A.Cat_ID=C.Cat_ID And C.Cat_ID in (" & selID & ")")(0)
- totalnum = tee5.Execute("SELECT COUNT(*) FROM [Gq_newsclass] WHERE cat_id in (" & selID & ")")(0)
- SQL = "SELECT * FROM Gq_newsclass WHERE cat_id in (" & selID & ")"
- Set rs = tee5.Execute(SQL)
- SQL=Rs.GetRows(totalnum)
- Set Rs = Nothing
- If Pattern = 1 then SQLID= UBound(AllID): Else SQLID= UBound(SQL,2)
- If Pattern = 1 then Response.Write "<ol>"
- If Pattern = 1 then Response.Write "<b>生成文章分类(HTML)开始......</b><br><br>"
- For i = 0 To SQLID
- FolderPath = tee5.ServerDir & "wz/"
- tee5.CreatPathEx (FolderPath)
- FileUrl = tee5.WebUrl & "/Temp/5.asp?Cat_ID=" & Clng(SQL(0,i))
- FileName = SQL(0,i)
- FilePath = FolderPath & FileName & ".html"
- Call GetRemoteFiels(FileUrl, FolderPath, FileName)
- If Pattern = 1 then Response.Write "<li style=""font-size: 12px;"">生成文章分类HTML页完成... <a href=" & FilePath & " target=_blank>" & Server.MapPath(FilePath) & "</a></li>" & vbNewLine
- Response.Flush
- Next
- If Pattern = 1 then Response.Write "<br><br><b>恭喜您!文章分类HTML全部生成完毕!</b>"
- If Pattern = 1 then Response.Write "</ol>"
- End Sub
- Sub artpageHtml()
- Dim selID, Sqlstr, Sqlart, Rsart
- Dim totalnum, FileUrl, FolderPath, FileName, FilePath, N
- selID=Request("selID")
- IF Len(Replace(selID,",",""))<1 Then
- Response.Write "<script>alert('请选择后操作');history.back()</script>"
- End IF
- set Rs=Server.CreateObject("adodb.recordset")
- Sqlstr="select Cat_ID From Gq_Newsclass Where Cat_ID in (" & selID & ")"
- Rs.Open sqlstr,Conn,1,1
- While Not Rs.EOF
- Sqlart="select Cat_ID From Gq_Article Where Cat_ID="&Rs("Cat_ID")&""
- set Rsart=Server.createObject("adodb.recordset")
- Rsart.open Sqlart,conn,1,1
- if not Rsart.eof then
- totalnum=Rsart.recordcount
- N = totalnumtee5.maxperpage + 1
- If N=0 Then
- N = 1
- End If
- For i = 1 To N
- FileUrl = tee5.WebUrl & "/Temp/5.asp?Cat_ID=" & Clng(Rs("Cat_ID")) & "&page=" & i
- FolderPath = tee5.ServerDir & "wz/" & Clng(Rs("Cat_ID")) & tee5.ServerDir
- tee5.CreatPathEx (FolderPath)
- FileName = "News_" & tee5.Supplemental(i,3)
- FilePath = FolderPath & FileName & ".html"
- Call GetRemoteFiels(FileUrl, FolderPath, FileName)
- Next
- end if
- Rsart.close
- set Rsart=nothing
- Rs.movenext
- wend
- Rs.close
- set Rs=nothing
- End Sub
- Admin_footer
- CloseConn
- %>