Admin_Article.asp
上传用户:angela
上传日期:2022-05-11
资源大小:853k
文件大小:31k
源码类别:

外挂编程

开发平台:

ASP/ASPX

  1. <!--#include file="setup.asp"-->
  2. <!--#include file="check.asp"-->
  3. <%
  4. If Not CheckAdmin("ArticleList") Then
  5.     Server.Transfer("showerr.asp")
  6.     Response.End
  7. End If
  8. Dim Rs2,rscat,selID
  9. titlename="文章管理"
  10. Admin_header
  11. function isInteger(para)
  12.        on error resume next
  13.        dim str
  14.        dim l,i
  15.        if isNUll(para) then 
  16.           isInteger=false
  17.           exit function
  18.        end if
  19.        str=cstr(para)
  20.        if trim(str)="" then
  21.           isInteger=false
  22.           exit function
  23.        end if
  24.        l=len(str)
  25.        for i=1 to l
  26.            if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
  27.               isInteger=false 
  28.               exit function
  29.            end if
  30.        next
  31.        isInteger=true
  32.        if err.number<>0 then err.clear
  33. end function
  34. if request.QueryString("guiqi")="del" then'
  35. SoftID=trim(request("SoftID"))
  36. Action=Trim(Request("Action"))
  37. tab=request("tab")
  38. url=request("url")
  39. if Action="" then
  40. response.Write"<script>alert('参数不足!');</script>"
  41. response.Write"<script>history.go(-1);</script>"
  42. end if
  43. if SoftID="" then
  44. response.Write"<script>alert('请选择要操作的记录!');</script>"
  45. response.Write"<script>history.go(-1);</script>"
  46. end if
  47. call DelSoft()
  48.   call closeconn()
  49. sub DelSoft()
  50. if instr(SoftID,",")>0 then
  51. SoftID=replace(SoftID," ","")
  52. sqlDel="select * from "&tab&" where id in (" & SoftID & ")"
  53. else
  54. SoftID=Clng(SoftID)
  55. sqlDel="select * from "&tab&" where id =" & SoftID
  56. end if
  57. Set rsDel= Server.CreateObject("ADODB.Recordset")
  58. rsDel.open sqlDel,conn,1,3
  59. do while not rsDel.eof
  60. rsDel.delete
  61. rsDel.movenext
  62. loop
  63. rsDel.close
  64. set rsDel=nothing
  65. response.Write"<script>alert('恭喜您!批量删除成功!');location.href='"&url&"';</script>"
  66. end sub
  67. end if
  68. if Request.form("MM_insert") then
  69. if request.Form("action")="newartcat" then
  70. sql="select * from Gq_newsclass"
  71. set rs=server.createobject("adodb.recordset")
  72. rs.open sql,conn,1,3
  73. rs.addnew
  74. dim cat_name
  75. cat_name=trim(replace(request.form("cat_name"),"'",""))
  76. if cat_name="" then
  77.   founderr=true
  78.    Response.Write("<script language=javascript>alert('你必须填写文章分类');history.back(1);</script>")
  79. else
  80.   rs("cat_name")=cat_name
  81. end if
  82. if founderr then
  83.   call closeconn()
  84.   response.end
  85. else
  86.   rs.update
  87.   rs.close
  88.   set rs=nothing
  89.   response.redirect "admin_article.asp"
  90. end if
  91. end if
  92. if request.Form("action")="editartcat" then
  93. if request.Form("id")="" then
  94.   founderr=true
  95. Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
  96. else
  97.   if not isInteger(request.form("id")) then
  98.     founderr=true
  99. Response.Write("<script language=javascript>alert('非法的id参数');history.back(1);</script>")
  100.   end if
  101. end if
  102. if founderr then
  103.   call closeconn()
  104.   response.End
  105. end if
  106. sql="select * from Gq_newsclass where cat_id="&cint(request.form("id"))
  107. set rs=server.createobject("adodb.recordset")
  108. rs.open sql,conn,1,3
  109. cat_name=trim(replace(request.form("cat_name"),"'",""))
  110. if cat_name="" then
  111.   founderr=true
  112. Response.Write("<script language=javascript>alert('你必须填写文章分类');history.back(1);</script>")
  113. else
  114.   rs("cat_name")=cat_name
  115. end if
  116. if founderr then
  117.   call closeconn()
  118.   response.end
  119. else
  120.   rs.update
  121.   rs.close
  122.   set rs=nothing
  123.   response.redirect "admin_article.asp"
  124. end if
  125. end if
  126. if request.Form("action")="delartcat" then
  127. if request.Form("id")="" then
  128.   founderr=true
  129. Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
  130. else
  131.   if not isInteger(request.form("id")) then
  132.     founderr=true
  133. Response.Write("<script language=javascript>alert('非法的id参数');history.back(1);</script>")
  134.   end if
  135. end if
  136. if founderr then
  137.   call closeconn()
  138.   response.End
  139. end if
  140. sql="select * from Gq_newsclass where cat_id="&cint(request.form("id"))
  141. set rs=server.createobject("adodb.recordset")
  142. rs.open sql,conn,1,3
  143.   rs.delete
  144.   rs.close
  145.   set rs=nothing
  146.   response.redirect "admin_article.asp"
  147. end if
  148. end if
  149. sql="select * from Gq_newsclass order by cat_id DESC"
  150. set rs=server.createobject("adodb.recordset")
  151. rs.open sql,conn,1,1
  152. %>
  153. <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
  154. <tr> 
  155. <th>文章管理</th>
  156. </tr>
  157. <tr>
  158. <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>
  159. </tr>
  160. </table>
  161. <br>
  162. <%
  163. Action = LCase(Request("action"))
  164. Select Case Trim(Action)
  165. Case "batdel"
  166. Call batdel()
  167. Case "bathtml"
  168. Call ContentIDHtml(1,selID)
  169. Case "batclassdel"
  170. Call batclassdel()
  171. Case "batclasshtml"
  172. Call artClassHtml(1,selID)
  173. Call artpageHtml()
  174. End Select
  175. if request.QueryString("action")="fl" then%>
  176. <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
  177. <tr> 
  178. <th width="5%">选择</th>
  179. <th width="70%">分类名称</th>
  180. <th width="25%">操作</th>
  181. </tr>
  182. <%
  183. Response.Write " <form name=selform method=Get action="""">"
  184. Response.Write " <input type=hIDden name=action value=''>"
  185. do while not rs.eof
  186. Response.Write "<tr>"
  187. Response.Write " <td " & CenterClass & "><input type=""checkbox"" name=""selID"" value="""
  188. Response.Write Rs("cat_id")
  189. Response.Write """></td>"
  190. %>
  191. <td class="TableRow2"><a href="#"><%=rs("cat_name")%></a></td>
  192. <td align="center" class="TableRow2">
  193. <a href="admin_article.asp?id=<%=rs("cat_id")%>&action=editartcat">编辑</a>&nbsp;
  194. <a href="admin_article.asp?id=<%=rs("cat_id")%>&action=delartcat">删除</a></td>
  195. </tr>
  196. <%rs.movenext
  197. loop
  198. if rs.bof and rs.eof then%>
  199. <tr align="center"> 
  200. <td colspan="3" class="TableRow2">当前没有文章分类!</td>
  201. </tr>
  202. <%
  203. end if
  204. Response.Write "<TR height=25>" & vbCrLf
  205. Response.Write "<TD " & LeftClass & " colspan=9><B>操作选项:<B> "
  206. Response.Write "<input class=Button type=button value='全选' onClick=""CheckAll(this.form)"">"
  207. Response.Write "<input class=Button type=button value='撤消' onClick=""CheckCel(this.form)"">"
  208. Response.Write "<input class=Button type=button value='反选' onClick=""CheckSel(this.form)""> "
  209. Response.Write "<input class=Button type=""submit"" name=""Submit1"" value=""批量删除"" onclick=""document.selform.action.value='batclassdel';""> "
  210. Response.Write "<input class=Button type=""submit"" name=""Submit2"" value=""生成HTML"" onclick=""document.selform.action.value='batclasshtml';"">"
  211. Response.Write "</td>" & vbCrLf
  212. Response.Write "</tr>" & vbCrLf
  213. Response.Write "</form>" & vbCrLf
  214. %>
  215. </table>
  216. <%end if
  217. if request.QueryString("action")="newartcat" then%>
  218. <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
  219. <form name="form1" method="post" action="admin_article.asp?action=art&artcat_art=<%=request.querystring("artcat_id")%>">
  220. <tr> 
  221. <th>文章分类管理--添加分类</th>
  222. </tr>
  223. <tr> 
  224. <td class=tablerow1>分类名称:<input type="text" name="cat_name" size="40"></td>
  225. </tr>
  226. <tr> 
  227. <td class=tablerow1 align="center" height="30">
  228. <input class=Button type="submit" name="Submit" value="确定新增" class="button">
  229. <input class=Button type="reset" name="reset" value="清空重写" class="button">
  230. <input class=Button type="button" value=" 返 回 "  onClick="location.href='admin_article.asp'" class="button"></td>
  231. </tr>
  232. <input type="hidden" name="action" value="newartcat">
  233. <input type="hidden" name="MM_insert" value="true">
  234. </form>
  235. </table>
  236. <%end if
  237. if request.QueryString("action")="editartcat" then
  238. if request.querystring("id")="" then
  239. Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
  240. call closeconn()
  241.   response.end
  242. else
  243.   if not isinteger(request.querystring("id")) then
  244. Response.Write("<script language=javascript>alert('非法的id参数');history.back(1);</script>")
  245. call closeconn()
  246. response.end
  247.   end if
  248. end if
  249. sql="select * from Gq_newsclass where cat_id="&cint(request.querystring("id"))
  250. set rs=server.createobject("adodb.recordset")
  251. rs.open sql,conn,1,1
  252. %>
  253. <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
  254. <form name="form1" method="post" action="admin_article.asp">
  255. <tr> 
  256. <th>文章分类管理--修改分类</th>
  257. </tr>
  258. <tr> 
  259. <td class=tablerow1>分类名称:<input name="cat_name" type="text" class="textarea" id="cat_name" size="40" value="<%=rs("cat_name")%>"></td>
  260. </tr>
  261. <tr> 
  262. <td class=tablerow1 align="center" height="30">
  263. <input class=Button name="Submit" type="submit" id="Submit" value="确定修改">
  264. <input class=Button type="button" value=" 返 回 "  onClick="location.href='admin_article.asp'"></td>
  265. </tr>
  266. <input type="hidden" name="id" value="<%=rs("cat_id")%>">
  267. <input type="hidden" name="action" value="editartcat">
  268. <input type="hidden" name="MM_insert" value="true">
  269. </form>
  270. </table>
  271. <%end if
  272. if request.QueryString("action")="delartcat" then
  273. if request.querystring("id")="" then
  274. Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
  275. call closeconn()
  276.   response.end
  277. else
  278.   if not isinteger(request.querystring("id")) then
  279. Response.Write("<script language=javascript>alert('非法的id参数');history.back(1);</script>")
  280. call closeconn()
  281. response.end
  282.   end if
  283. end if
  284. sql="select * from Gq_newsclass where cat_id="&cint(request.querystring("id"))
  285. set rs=server.createobject("adodb.recordset")
  286. rs.open sql,conn,1,1
  287.   %>
  288. <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
  289. <form name="form1" method="post" action="admin_article.asp">
  290. <tr> 
  291. <th>文章分类管理--删除分类</th>
  292. </tr>
  293. <tr> 
  294. <td class=tablerow1>分类名称- <%=rs("cat_name")%></td>
  295. </tr>
  296. <tr> 
  297. <td class=tablerow1 align="center" height="30">
  298. <input name="Submit" type="submit" class="button" id="Submit" value="确定删除">
  299. <input type="button" value=" 返 回 "  onClick="location.href='admin_article.asp'" class="button"></td>
  300. </tr>
  301. <input type="hidden" name="id" value="<%=rs("cat_id")%>">
  302. <input type="hidden" name="action" value="delartcat">
  303. <input type="hidden" name="MM_insert" value="true">
  304. </form>
  305. </table>
  306. <%end if
  307. if request.QueryString("action")="" then
  308. Dim tablestyle, strContent
  309. Dim maxperpage,CurrentPage,Pcount,totalrec,totalnumber
  310. maxperpage = AdminPage
  311. totalrec = 0
  312. Pcount = 1
  313. CurrentPage = tee5.ChkNumeric(Request("page"))
  314. If CurrentPage = 0 Then CurrentPage = 1
  315. Response.Write "<script src=""/js/showpage.js"" type=""text/javascript""></script>" & vbCrLf
  316. Response.Write "<table border=""0"" cellspacing=""1"" cellpadding=""3"" align=center class=""tableBorder"">"
  317. Response.Write " <tr>"
  318. Response.Write "<th wIDth=""5%"">选择</th>"
  319. Response.Write "<th wIDth=""*"">文章标题</th>"
  320. Response.Write "<th wIDth=""15%"">操作</th>"
  321. Response.Write "<th wIDth=""5%"">推荐</th>"
  322. Response.Write "<th wIDth=""10%"">更新日期</th>"
  323. Response.Write "</tr>"
  324. Response.Write "<tr>"
  325. Response.Write " <form name=form method=Get action="""">"
  326. Response.Write "<td class=tablerow1 colspan=""5"" align=""right""><b>文章导航:</b>"
  327. Response.Write "<select name=""go"" style=""margin:-3px"" onChange='window.location=form.go.options[form.go.selectedIndex].value'>"
  328. Response.Write "<option value=""admin_article.asp"">≡全部文章列表≡</option>"
  329. sql="select * from Gq_newsclass"
  330. set Rs2=server.createobject("adodb.recordset")
  331. Rs2.open sql,conn,1,1
  332. do while not Rs2.eof
  333. Response.Write "<option value=""admin_article.asp?action=cat&cat_id="
  334. Response.Write Rs2("cat_id")
  335. Response.Write """>"
  336. Response.Write Rs2("cat_name")
  337. Response.Write "</option>"
  338. Rs2.movenext
  339. loop
  340. if Rs2.bof and Rs2.eof then
  341. Response.Write "<option value="""">当前没有分类</option>"
  342. end if
  343. Rs2.Close:Set Rs2 = Nothing
  344. Response.Write "</select>"
  345. Response.Write "</td>"
  346. Response.Write "</tr></form>"
  347. Response.Write " <form name=selform method=Get action="""">"
  348. Response.Write " <input type=hIDden name=action value=''>"
  349. set Rs = server.createobject("adodb.recordset")
  350. If Request.querystring("cat_id") <> "" then
  351. 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"
  352. Else
  353. 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"
  354. End If
  355. Rs.open Sql,conn,1,3
  356. If Rs.eof and Rs.bof then 
  357. Response.Write "<tr><td " & CenterClass & " colspan='5'>当前无任何文章!</td></tr>"
  358. Else
  359. totalrec = Rs.RecordCount
  360. Pcount = CLng(totalrec / maxperpage)  '得到总页数
  361. If Pcount < totalrec / maxperpage Then Pcount = Pcount + 1
  362. If CurrentPage < 1 Then CurrentPage = 1
  363. If CurrentPage > Pcount Then CurrentPage = Pcount
  364. Rs.PageSize = maxperpage
  365. Rs.AbsolutePage = CurrentPage
  366. i = 0
  367. Do While Not Rs.EOF And i < maxperpage
  368. If Not Response.IsClientConnected Then ResponseEnd
  369. strContent = year(rs("art_date")) & month(rs("art_date")) & day(rs("art_date"))
  370. Response.Write " <tr>"
  371. Response.Write " <td " & CenterClass & "><input type=""checkbox"" name=""selID"" value="""
  372. Response.Write Rs("ID")
  373. Response.Write """></td>"
  374. Response.Write " <td " & LeftClass & ">[" & Rs("Cat_Name") & "] "
  375. 'Response.Write "<a href=""/html/Article/" & Rs("Cat_ID") & "/" & strContent & "/News_" & rs("id")
  376. 'Response.Write ".html"">"
  377. Response.Write Left(Rs("art_title"),25)
  378. 'Response.Write "...</a>"
  379. Response.Write "...</td>"
  380. Response.Write " <td " & CenterClass & "><a href=""admin_article.asp?ID="
  381. Response.Write Rs("ID")
  382. Response.Write "&cat_id="
  383. Response.Write Rs("Cat_ID")
  384. Response.Write "&action=editart"">编辑</a> | <a href=""admin_article.asp?selID="
  385. Response.Write Rs("ID")
  386. Response.Write "&action=batdel"">删除</a></td>"
  387. Response.Write " <td " & CenterClass & ">"
  388. If Rs("isbest")=1 Then Response.Write "<font color=red>√</font>" Else Response.Write "×"
  389. Response.Write "</td>"
  390. Response.Write " <td " & CenterClass & ">"
  391. If Rs("art_date") >= Date() then
  392. Response.Write "<FONT color=""#FF0000"">"&year(Rs("art_date"))&"-"&month(Rs("art_date"))&"-"&day(Rs("art_date"))&"</FONT >" & vbCrLf
  393. Else
  394. Response.Write "<FONT color=""#999999"">"&year(Rs("art_date"))&"-"&month(Rs("art_date"))&"-"&day(Rs("art_date"))&"</FONT >" & vbCrLf
  395. End If
  396. Response.Write "</td>"
  397. Response.Write "</tr>"
  398. Rs.movenext
  399. i = i + 1
  400. If i >= maxperpage Then Exit Do
  401. Loop
  402. End If
  403. Rs.Close:Set Rs = Nothing
  404. Response.Write "<TR height=25>" & vbCrLf
  405. Response.Write "<TD " & LeftClass & " colspan=9><B>操作选项:<B> "
  406. Response.Write "<input class=Button type=button value='全选' onClick=""CheckAll(this.form)"">"
  407. Response.Write "<input class=Button type=button value='撤消' onClick=""CheckCel(this.form)"">"
  408. Response.Write "<input class=Button type=button value='反选' onClick=""CheckSel(this.form)""> "
  409. Response.Write "<input class=Button type=""submit"" name=""Submit1"" value=""批量删除"" onclick=""document.selform.action.value='batdel';""> "
  410. Response.Write "<input class=Button type=""submit"" name=""Submit2"" value=""生成HTML"" onclick=""document.selform.action.value='bathtml';"">"
  411. Response.Write "</td>" & vbCrLf
  412. Response.Write "</tr>" & vbCrLf
  413. Response.Write "</form>" & vbCrLf
  414. Response.Write "<TR height=25>" & vbCrLf
  415. Response.Write "<TD " & RightClass & " colspan=9>" & vbCrLf
  416. tee5.ShowListPage CurrentPage,Pcount,totalrec,maxperpage,"","文章管理"
  417. Response.Write "</TD></TR></TABLE>" & vbCrLf
  418. end if
  419. if request.Form("action")="newart" then
  420. set rs=server.createobject("adodb.recordset")
  421. sql="select * from Gq_article"
  422. rs.open sql,conn,1,3
  423. rs.addnew
  424. dim poster,artfrom,title,writer,copyright,content,artisbest,catid
  425. catid=cint(request.form("cat_id"))
  426. title=trim(replace(request.form("art_title"),"'",""))
  427. writer=trim(replace(request.form("writer"),"'",""))
  428. copyright=trim(replace(request.form("copyright"),"'",""))
  429. artisbest=request.form("isbest")
  430. content=rtrim(replace(request.form("content"),"",""))
  431. if catid<1 then
  432.   founderr=true
  433. Response.Write("<script language=javascript>alert('你必须选择文章的分类!');history.back(1);</script>")
  434. else
  435.   rs("cat_id")=catid
  436. end if
  437. if title="" then
  438.   founderr=true
  439. Response.Write("<script language=javascript>alert('你必须填写文章的标题!');history.back(1);</script>")
  440. else
  441.   rs("art_title")=title
  442. end if
  443. if content="" then
  444.   founderr=true
  445. Response.Write("<script language=javascript>alert('你必须填写文章的内容!');history.back(1);</script>")
  446. else
  447.   rs("content")=content
  448. end if
  449. if writer="" then
  450.   founderr=true
  451. Response.Write("<script language=javascript>alert('文章的作者不会没有吧?');history.back(1);</script>")
  452. else
  453.   rs("writer")=writer
  454. end if
  455. if copyright="" then
  456.   founderr=true
  457. Response.Write("<script language=javascript>alert('你必须填写文章来源');history.back(1);</script>")
  458. else
  459.   rs("copyright")=copyright
  460. end if
  461. if cint(artisbest)=1 then
  462.   rs("isbest")=cint(artisbest)
  463. end if
  464. if founderr then
  465.   response.end
  466. else
  467.   rs.update
  468.   rs.close
  469.   set rs=nothing
  470.   'sql="update allcount set articlecount = articlecount + 1"
  471.   'tee5.Execute(sql)
  472.   
  473.   response.redirect "admin_article.asp"
  474. end if
  475. end if
  476. if request.Form("action")="editart" then
  477. if request.Form("id")="" then
  478.   founderr=true
  479. Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
  480. else
  481.   if not isInteger(request.form("id")) then
  482.     founderr=true
  483. Response.Write("<script language=javascript>alert('非法的文章id参数。');history.back(1);</script>")
  484.   end if
  485. end if
  486. if founderr then
  487.   response.End
  488. end if
  489. sql="select * from Gq_article where id="&cint(request.Form("id"))
  490. set rs=server.createobject("adodb.recordset")
  491. rs.open sql,conn,1,3
  492. catid=cint(request.form("cat_id"))
  493. title=trim(replace(request.form("art_title"),"'",""))
  494. artisbest=request.form("isbest")
  495. content=rtrim(replace(request.form("content"),"",""))
  496. content=trim(replace(content," ","&nbsp;"))
  497. if catid<1 then
  498.   founderr=true
  499. Response.Write("<script language=javascript>alert('你必须选择文章的分类!');history.back(1);</script>")
  500. else
  501.   rs("cat_id")=catid
  502. end if
  503. if title="" then
  504.   founderr=true
  505. Response.Write("<script language=javascript>alert('你必须填写文章的标题!');history.back(1);</script>")
  506. else
  507.   rs("art_title")=title
  508. end if
  509. if content="" then
  510.   founderr=true
  511. Response.Write("<script language=javascript>alert('你必须填写文章的内容!');history.back(1);</script>")
  512. else
  513.   rs("content")=content
  514. end if
  515. rs("isbest")=cint(artisbest)
  516. if founderr then
  517.   call closeconn()
  518.   response.end
  519. else
  520.   rs.update
  521.   rs.close
  522.   set rs=nothing
  523.   response.redirect "admin_article.asp"
  524. end if
  525. end if
  526. if request.Form("action")="delart" then
  527. if request.Form("id")="" then
  528.   founderr=true
  529. Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
  530. else
  531.   if not isInteger(request.form("id")) then
  532.     founderr=true
  533. Response.Write("<script language=javascript>alert('非法的文章id参数。');history.back(1);</script>")
  534.   end if
  535. end if
  536. if founderr then
  537.   call closeconn()
  538.   response.End
  539. end if
  540. sql="select * from Gq_article where id="&cint(request.Form("id"))
  541. set rs=server.createobject("adodb.recordset")
  542. rs.open sql,conn,1,3
  543. rs.delete
  544. rs.close
  545. set rs=nothing
  546. sql="update allcount set articlecount = articlecount - 1"
  547. tee5.Execute(sql)
  548. response.redirect "admin_article.asp"
  549. end if
  550. if request.QueryString("action")="newart" then
  551. %>
  552. <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
  553. <form action="" method="post" name="guiqiform" onSubmit="return CheckForm(this);">
  554. <tr> 
  555. <th colspan="3">文章管理--添加文章</th>
  556. </tr>
  557. <tr> 
  558. <td width="12%" align="right" class="TableRow1">文章标题:</td>
  559. <td class="TableRow1"><input type="text" name="art_title" size="60" class="textarea"></td>
  560. </tr>
  561. <tr> 
  562. <td align="right" class="TableRow1">文章作者:</td>
  563. <td class="TableRow1"><input type="text" name="writer" size="40" class="textarea" value="<%=session("LoginName")%>"></td>
  564. </tr>
  565. <tr> 
  566. <td align="right" class="TableRow1">文章来源:</td>
  567. <td class="TableRow1"><input type="text" name="copyright" size="40" class="textarea" value="<%=tee5.WebName%>"></td>
  568. </tr>
  569. <tr> 
  570. <td align="right" class="TableRow1">所属分类:</td>
  571. <td class="TableRow1"><select name="cat_id">
  572. <%
  573. sql="select * from Gq_newsclass"
  574. set rs=tee5.Execute(sql)
  575. do while not rs.eof%>
  576. <option value="<%=rs("cat_id")%>"><%=rs("cat_name")%></option>
  577. <%rs.movenext
  578. loop
  579. rs.close
  580. set rs=nothing%>
  581. </select></td>
  582. </tr>
  583. <tr>
  584. <td align="right" class="TableRow1">文章内容:</td>
  585. <td class="TableRow1">
  586. <table border="1" align="center" cellpadding="0" cellspacing="0">
  587. <tr>
  588. <td width="750" height="350" align="center"><textarea name="content" style="display:none" id="content"></textarea>
  589. <SCRIPT src="inc/post.js"></SCRIPT></td>
  590. </tr></table></td>
  591. </tr>
  592. <tr> 
  593. <td class="TableRow1" colspan="3" height="30" align="center">
  594. <input type="checkbox" name="isbest" value="1"> 推荐&nbsp;&nbsp;&nbsp;
  595. <input class=Button type="submit" name="Submit" value=" 发 布 " class="button">&nbsp;&nbsp;
  596. <input class=Button type="reset" name="Reset" value=" 重 写 " onclick="ClearReset()">
  597. </td>
  598. </tr>
  599. <input type="hidden" name="action" value="newart">
  600. <input type="hidden" name="MM_insert" value="true">
  601. </form>
  602. </table>
  603. <%end if
  604. if request.QueryString("action")="editart" then
  605. if request.querystring("id")="" then
  606. Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
  607. call closeconn()
  608.   response.end
  609. else
  610.   if not isinteger(request.querystring("id")) then
  611. Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
  612. call closeconn()
  613. response.end
  614.   end if
  615. end if
  616. if request.querystring("cat_id")="" then
  617. Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
  618. call closeconn()
  619.   response.end
  620. else
  621.   if not isinteger(request.querystring("cat_id")) then
  622. Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
  623. call closeconn()
  624. response.end
  625.   end if
  626. end if
  627. sql="select * from Gq_article where id="&cint(request.querystring("id"))
  628. set rs=server.createobject("adodb.recordset")
  629. rs.open sql,conn,1,1
  630. %>
  631. <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
  632. <form action="" method="post" name="guiqiform" onSubmit="return CheckForm(this);">
  633. <tr> 
  634. <th colspan="3">文章管理--修改文章</th>
  635. </tr>
  636. <tr> 
  637. <td width="12%" align="right" class="TableRow1">文章标题:</td>
  638. <td class="TableRow1"><input name="art_title" type="text" class="textarea" id="art_title" size="60" value="<%=rs("art_title")%>"></td>
  639. </tr>
  640. <tr> 
  641. <td width="12%" align="right" class="TableRow1">文章作者:</td>
  642. <td class="TableRow1"><input name="writer" type="text" class="textarea" id="writer" size="40" value="<%=rs("writer")%>"></td>
  643. </tr>
  644. <tr> 
  645. <td width="12%" align="right" class="TableRow1">文章来源:</td>
  646. <td class="TableRow1"><input name="copyright" type="text" class="textarea" id="copyright" size="40" value="<%=rs("copyright")%>"></td>
  647. </tr>
  648. <tr> 
  649. <td width="12%" align="right" class="TableRow1">所属分类:</td>
  650. <td class="TableRow1">
  651. <select name="cat_id" id="cat_id">
  652. <%
  653. sql="select * from Gq_newsclass"
  654. set Rs2=tee5.Execute(sql)
  655. do while not Rs2.eof%>
  656. <option value="<%=Rs2("cat_id")%>"<%if cint(Rs2("cat_id"))=cint(request("cat_id")) then response.Write " selected"%>><%=Rs2("cat_name")%></option>
  657. <%Rs2.movenext
  658. loop
  659. Rs2.close
  660. set Rs2=nothing
  661. %>
  662. </select></td>
  663. </tr>
  664. <tr>
  665. <td align="right" class="TableRow1">文章内容:</td>
  666. <td class="TableRow1">
  667. <table border="1" align="center" cellpadding="0" cellspacing="0">
  668. <tr>
  669. <td width="750" height="350" align="center"><textarea name="content" style="display:none" id="content"><%=rs("content")%></textarea>
  670. <SCRIPT src="inc/post.js"></SCRIPT></td>
  671. </tr></table></td>
  672. </tr>
  673. <tr> 
  674. <td class="TableRow1" colspan="3" height="30" align="center">
  675. <input type="checkbox" name="isbest" value="1" id="isbest" <%if rs("isbest")=1 then response.write "checked" end if%>>推荐&nbsp;&nbsp;
  676. <input class=Button name="Submit" type="submit" class="button" id="Submit" value=" 编 辑 ">&nbsp;&nbsp;
  677. <input class=Button type="button" value=" 返 回 "  onClick="location.href='admin_article.asp'" class="button"></td>
  678. </tr>
  679. <input type="hidden" name="id" value="<%=rs("id")%>">
  680. <input type="hidden" name="action" value="editart">
  681. <input type="hidden" name="MM_insert" value="true">
  682. </form>
  683. </table>
  684. <%end if
  685. if request.QueryString("action")="delart" then
  686. if request.querystring("id")="" then
  687. Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
  688. call closeconn()
  689.   response.end
  690. else
  691.   if not isinteger(request.querystring("id")) then
  692. Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
  693. call closeconn()
  694. response.end
  695.   end if
  696. end if
  697. if request.querystring("cat_id")="" then
  698. Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
  699. call closeconn()
  700.   response.end
  701. else
  702.   if not isinteger(request.querystring("cat_id")) then
  703. Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
  704. call closeconn()
  705. response.end
  706.   end if
  707. end if
  708. sql="select * from Gq_article where id="&cint(request.querystring("id"))
  709. set rs=server.createobject("adodb.recordset")
  710. rs.open sql,conn,1,1
  711.   %>
  712. <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
  713. <form name="addart" method="post" action="">
  714. <tr> 
  715. <th colspan="3">文章管理--删除文章</th>
  716. </tr>
  717. <tr> 
  718. <td class="TableRow1">标题- <%=rs("art_title")%></td>
  719. </tr>
  720. <tr> 
  721. <td class="TableRow1">所属分类 
  722. <%
  723. sql="select * from Gq_newsclass where cat_id="&cint(request.querystring("cat_id"))
  724. set Rs2=tee5.Execute(sql)
  725. %>
  726. <%=Rs2("cat_name")%>
  727. <%
  728. Rs2.close
  729. set Rs2=nothing%>
  730. </td>
  731. </tr>
  732. <tr> 
  733. <td class="TableRow1"><%=ubb2html(formatStr(autourl(rs("content"))), true, true)%></td>
  734. </tr>
  735. <tr> 
  736. <td class="TableRow1" height="30" align="center">
  737. <input name="Submit" type="submit" class="button" id="Submit" value=" 删 除 ">&nbsp;&nbsp;
  738. <input type="button" value=" 返 回 "  onClick="location.href='admin_article.asp'" class="button"></td>
  739. </tr>
  740. <input type="hidden" name="id" value="<%=rs("id")%>">
  741. <input type="hidden" name="action" value="delart">
  742. <input type="hidden" name="MM_insert" value="true">
  743. </form>
  744. </table>
  745. <%rs.close
  746. set rs=nothing
  747. end if
  748. Sub BatDel()
  749. If Len(Request("selID")) = "" then
  750. response.write "<script>alert('非法操作');history.back()</script>"
  751. Else
  752.          If Len(Request("selID")) > 0 Then
  753.                  SQL = "DELETE FROM [Gq_Article] WHERE ID in (" & Request("selID") & ")"
  754.                  tee5.Execute (SQL)
  755. End If
  756. End If
  757.         Succeed ("恭喜您!删除成功,请继续其他操作。")
  758. End Sub
  759. Sub ContentIDHtml(Pattern,selID)
  760. Dim SQLID, AllID
  761. Dim totalnum, FileUrl, FolderPath, FileName, FilePath
  762. On Error Resume Next
  763. selID = Request("selID")
  764. AllID = Split(selID, ",")
  765. If selID = "" Then
  766. Response.Write "<script>alert('请选择后操作');history.back()</script>"
  767. End If
  768. totalnum = tee5.Execute("SELECT COUNT(*) FROM [Gq_Article] WHERE ID in (" & selID & ")")(0)
  769. SQL = "SELECT * FROM Gq_Article WHERE ID in (" & selID & ")"
  770. Set rs = tee5.Execute(SQL)
  771. SQL=Rs.GetRows(totalnum)
  772. Set Rs = Nothing
  773. If Pattern = 1 then SQLID= UBound(AllID): Else SQLID= UBound(SQL,2)
  774. If Pattern = 1 then Response.Write "<ol>"
  775. If Pattern = 1 then Response.Write "<b>生成文章内容(HTML)开始......</b><br><br>"
  776. For i = 0 To SQLID
  777. FolderPath = tee5.ServerDir & "wz/"
  778. tee5.CreatPathEx (FolderPath)
  779. FileUrl    = tee5.WebUrl & "/Temp/8.asp?ID=" & Clng(SQL(0,i))
  780. FileName   = "News_" & SQL(0,i)
  781. FilePath   = FolderPath & FileName & ".html"
  782. Call GetRemoteFiels(FileUrl, FolderPath, FileName)
  783. If Pattern = 1 then Response.Write "<li style=""font-size: 12px;"">生成文章内容HTML页完成... <a href=" & FilePath & " target=_blank>" & Server.MapPath(FilePath) & "</a></li>" & vbNewLine
  784. Response.Flush
  785. Next
  786. If Pattern = 1 then Response.Write "<br><br><b>恭喜您!文章内容HTML全部生成完毕!</b>"
  787. If Pattern = 1 then Response.Write "</ol>"
  788. End Sub
  789. Sub artClassHtml(Pattern,selID)
  790. Dim SQLID, AllID
  791. Dim totalnum, FileUrl, FolderPath, FileName, FilePath, totalnumll
  792. On Error Resume Next
  793. selID = Request("selID")
  794. AllID = Split(selID, ",")
  795. If selID = "" Then
  796. Response.Write "<script>alert('请选择后操作');history.back()</script>"
  797. End If
  798. '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)
  799. totalnum = tee5.Execute("SELECT COUNT(*) FROM [Gq_newsclass] WHERE cat_id in (" & selID & ")")(0)
  800. SQL = "SELECT * FROM Gq_newsclass WHERE cat_id in (" & selID & ")"
  801. Set rs = tee5.Execute(SQL)
  802. SQL=Rs.GetRows(totalnum)
  803. Set Rs = Nothing
  804. If Pattern = 1 then SQLID= UBound(AllID): Else SQLID= UBound(SQL,2)
  805. If Pattern = 1 then Response.Write "<ol>"
  806. If Pattern = 1 then Response.Write "<b>生成文章分类(HTML)开始......</b><br><br>"
  807. For i = 0 To SQLID
  808. FolderPath = tee5.ServerDir & "wz/"
  809. tee5.CreatPathEx (FolderPath)
  810. FileUrl    = tee5.WebUrl & "/Temp/5.asp?Cat_ID=" & Clng(SQL(0,i))
  811. FileName   = SQL(0,i)
  812. FilePath   = FolderPath & FileName & ".html"
  813. Call GetRemoteFiels(FileUrl, FolderPath, FileName)
  814. If Pattern = 1 then Response.Write "<li style=""font-size: 12px;"">生成文章分类HTML页完成... <a href=" & FilePath & " target=_blank>" & Server.MapPath(FilePath) & "</a></li>" & vbNewLine
  815. Response.Flush
  816. Next
  817. If Pattern = 1 then Response.Write "<br><br><b>恭喜您!文章分类HTML全部生成完毕!</b>"
  818. If Pattern = 1 then Response.Write "</ol>"
  819. End Sub
  820. Sub artpageHtml()
  821. Dim selID, Sqlstr, Sqlart, Rsart
  822. Dim totalnum, FileUrl, FolderPath, FileName, FilePath, N
  823. selID=Request("selID") 
  824. IF Len(Replace(selID,",",""))<1 Then
  825. Response.Write "<script>alert('请选择后操作');history.back()</script>"
  826. End IF
  827. set Rs=Server.CreateObject("adodb.recordset")
  828. Sqlstr="select Cat_ID From Gq_Newsclass Where Cat_ID in (" & selID & ")"
  829. Rs.Open sqlstr,Conn,1,1
  830. While Not Rs.EOF
  831. Sqlart="select Cat_ID From Gq_Article Where Cat_ID="&Rs("Cat_ID")&""
  832. set Rsart=Server.createObject("adodb.recordset")
  833. Rsart.open Sqlart,conn,1,1
  834. if not Rsart.eof then
  835. totalnum=Rsart.recordcount
  836. N = totalnumtee5.maxperpage + 1
  837. If N=0 Then
  838. N = 1
  839. End If
  840. For i = 1 To N
  841. FileUrl    = tee5.WebUrl & "/Temp/5.asp?Cat_ID=" & Clng(Rs("Cat_ID")) & "&page=" & i
  842. FolderPath = tee5.ServerDir & "wz/" & Clng(Rs("Cat_ID")) & tee5.ServerDir
  843. tee5.CreatPathEx (FolderPath)
  844. FileName   = "News_" & tee5.Supplemental(i,3)
  845. FilePath   = FolderPath & FileName & ".html"
  846. Call GetRemoteFiels(FileUrl, FolderPath, FileName)
  847. Next
  848. end if
  849. Rsart.close
  850. set Rsart=nothing
  851. Rs.movenext
  852. wend
  853. Rs.close
  854. set Rs=nothing
  855. End Sub
  856. Admin_footer
  857. CloseConn
  858. %>