📄 admin_article.asp
字号:
Rs.addnew
Rs("classid") = strClassid(1)
Rs("title") = DownsysClass.ChkFormStr(Request.Form("topic"))
Rs("rootid") = strClassid(0)
Rs("classname") = strClassid(2)
Rs("content") = TxtContent
Rs("writer") = writer
Rs("images") = Request.Form("images")
Rs("isCommend") = Request.Form("isCommend")
Rs("isimg") = Request.Form("isimg")
Rs("source") = source
Rs("username") = Session(DownsysClass.CacheName & "AdminName")
Rs("isTop") = Request.Form("isTop")
Rs("ArticleType") = Request.Form("ArticleType")
Rs("DayHits") = 0
Rs("WeekHits") = 0
Rs("MonthHits") = 0
Rs("Hits") = 0
Rs("HitsTime") = DownsysClass.NowTime
Rs("infotime") = DownsysClass.NowTime
Rs("isUpdate") = 1
Rs("isLock") = 0
Rs.Update
Rs.Close
Rs.Open "select top 1 id from NC_Article order by id desc", Conn, 1, 1
articleid = Rs("id")
Rs.Close
Set Rs = Nothing
SQL = "update NC_class set ArticleNum=ArticleNum+1,isUpdate=1 where depth<>0 and classid=" & strClassid(1)
DownsysClass.Execute SQL
SQL = "update NC_class set ArticleNum=ArticleNum+1,isUpdate=1 where depth=0 and rootid=" & strClassid(0)
DownsysClass.Execute SQL
'//////生成HTML//////
If Request.form("isCreateHtml")="yes" then
Dim DownloadClass
Set DownloadClass = New Create_Article_Cls
DownloadClass.GetArticle(articleid)
Set DownloadClass = Nothing
End If
NC_Admin.Succeed_Msg ("<li>添加" & Request.Form("topic") & "成功!</li>")
Response.Write "<meta http-equiv=""refresh"" content=""2;url='" & Request.ServerVariables("HTTP_REFERER") & "'"">" & vbCrLf
End If
End Sub
Private Sub savemodify()
Call checksave
If Founderr = False Then
SQL = "select * from NC_Article where id=" & Request("id")
Rs.Open SQL, Conn, 1, 3
Rs("classid") = strClassid(1)
Rs("title") = DownsysClass.ChkFormStr(Request.Form("topic"))
Rs("rootid") = strClassid(0)
Rs("classname") = strClassid(2)
Rs("content") = TxtContent
Rs("writer") = writer
Rs("images") = Request.Form("images")
Rs("isCommend") = Request.Form("isCommend")
Rs("isimg") = Request.Form("isimg")
Rs("source") = source
Rs("isTop") = Request.Form("isTop")
Rs("ArticleType") = Request.Form("ArticleType")
Rs("isUpdate") = 1
Rs("isLock") = 0
If Trim(Request.Form("upinfotime")) = "yes" Then
Rs("infotime") = DownsysClass.NowTime
End If
Rs.Update
ArticleID = Rs("id")
Rs.Close
Set Rs = Nothing
SQL = "update NC_class set isUpdate=1 where depth<>0 and classid=" & strClassid(1)
DownsysClass.Execute SQL
SQL = "update NC_class set isUpdate=1 where depth=0 and rootid=" & strClassid(0)
DownsysClass.Execute SQL
'//////生成HTML//////
If Request.form("isCreateHtml")="yes" then
Dim DownloadClass
Set DownloadClass = New Create_Article_Cls
DownloadClass.GetArticle(articleid)
Set DownloadClass = Nothing
End If
NC_Admin.Succeed_Msg ("<li>修改" & Request.Form("topic") & "成功!</li>")
Response.Write "<meta http-equiv=""refresh"" content=""2;url='" & Request.ServerVariables("HTTP_REFERER") & "'"">" & vbCrLf
End If
End Sub
Private Sub batdel()
If Founderr = False Then
DownsysClass.Execute ("delete from NC_Article where id in (" & selarticleid & ")")
DownsysClass.Execute ("delete from NC_InfoEssay where infoid in (" & selarticleid & ")")
If CInt(DownsysClass.Setting(5)) = 0 Then
DelArticleHtml=split(selarticleid, ", ")
Dim DownloadClass
Set DownloadClass = New Create_Article_Cls
For j = 0 To Ubound(DelArticleHtml)
DownloadClass.DelArticle(DelArticleHtml(j))
Next
Set DownloadClass = Nothing
End If
'NC_Admin.Succeed_Msg ("批量删除操作成功!")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End If
End Sub
Private Sub batdele()
If Founderr = False Then
DownsysClass.Execute ("update NC_Article set isLock=1,isUpdate=1 where id in (" & selarticleid & ")")
If CInt(DownsysClass.Setting(5)) = 0 Then
DelArticleHtml=split(selarticleid, ", ")
Dim DownloadClass
Set DownloadClass = New Create_Article_Cls
For j = 0 To Ubound(DelArticleHtml)
DownloadClass.DelArticle(DelArticleHtml(j))
Next
Set DownloadClass = Nothing
End If
'NC_Admin.Succeed_Msg ("你选择的文件已成功放入回收站!")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End If
End Sub
Private Sub batmove()
Dim selclass
selclass = Split(Trim(Request.Form("classid")), ",")
If Trim(Request.Form("classid")) <> "" Then
DownsysClass.Execute ("update NC_Article set rootid='" & selclass(0) & "',classid='" & selclass(1) & "',ClassName='" & selclass(2) & "',isUpdate=1 where id in (" & selarticleid & ")")
Response.Write ("批量移动操作成功")
Else
Response.Write ("不能移动到一级分类,请选择正确的分类!")
End If
End Sub
Private Sub upindate()
DownsysClass.Execute ("update [NC_Article] set infotime=" & DownsysClass.SqlString & " where id in (" & selarticleid & ")")
Response.Write "更新时间成功"
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Sub isCommend()
DownsysClass.Execute ("update NC_Article set isCommend=1 where id in (" & selarticleid & ")")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Sub noCommend()
DownsysClass.Execute ("update NC_Article set isCommend=0 where id in (" & selarticleid & ")")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Sub isTop()
DownsysClass.Execute ("update NC_Article set isTop=1 where id in (" & selarticleid & ")")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Sub noTop()
DownsysClass.Execute ("update NC_Article set isTop=0 where id in (" & selarticleid & ")")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Sub BatCreateHtml()
Dim DownloadClass, GetArticleHtml, o, p
o = 0
Response.Write "<table width=""400"" border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbCrLf
Response.Write "<tr> " & vbCrLf
Response.Write "<td bgcolor=000000>" & vbCrLf
Response.Write " <table width=""400"" border=""0"" cellspacing=""0"" cellpadding=""1"">" & vbCrLf
Response.Write "<tr> " & vbCrLf
Response.Write "<td bgcolor=ffffff height=9><img src=""images/bar9.gif"" width=0 height=16 id=img2 name=img2 align=absmiddle></td></tr></table>" & vbCrLf
Response.Write "</td></tr></table></td></tr><tr> " & vbCrLf
Response.Write "<td align=center bgcolor=000000> <span id=txt2 name=txt2 style=""font-size:9pt"">0</span><span style=""font-size:9pt"">%</span> <span id=txt3 name=txt3 style=""font-size:9pt"">0</span></td></tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Flush
GetArticleHtml = Split(selarticleid, ",")
p = Ubound(GetArticleHtml)
Set DownloadClass = New Create_Article_Cls
Do while o <= p
DownloadClass.GetArticle(Cint(trim(GetArticleHtml(o))))
Response.Write "<script>img2.width=" & Fix((o + 1) / (p + 1) * 400) & ";" & vbCrLf
Response.Write "txt2.innerHTML=""生成进度:" & FormatNumber((o + 1) / (p + 1) * 100, 4, -1) & """;" & vbCrLf
Response.Write "txt3.innerHTML=""共有 <B><font color=RED>" & p + 1 & "</font></B> 个 正在生成第 " & o + 1 & " 个"";" & vbCrLf
Response.Write "img2.title=""(" & o + 1 & ")"";</script>" & vbCrLf
o = o + 1
Loop
Response.Write "<script>txt3.innerHTML=""完成! 总共生成<B><font color=RED>" & p + 1 & "</font></B> 个文件"";</script>" & vbCrLf
Response.Write "<script>img2.width=400;txt2.innerHTML=""100"";</script>"
Set DownloadClass = Nothing
NC_Admin.Succeed_Msg ("完成! 总共生成<B><font color=RED>" & p + 1 & "</font></B> 个文件")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Sub showpage()
Dim n
If pagination = 0 Then
If totalnumber Mod maxperpage = 0 Then
n = totalnumber \ maxperpage
Else
n = totalnumber \ maxperpage + 1
End If
Response.Write "<table cellspacing=1 width='100%' border=0><form method=Post action=?clasid=" & Request("clasid") & "><tr><td align=center> " & vbCrLf
Response.Write "<font color='red'>" & strclassname & "</font> "
If CurrentPage < 2 Then
Response.Write "共有文章 <font COLOR=#FF0000><strong>" & totalnumber & "</strong></font> 篇 首 页 上一页 "
Else
Response.Write "共有文章 <font COLOR=#FF0000><strong>" & totalnumber & "</strong></font> 篇 <a href=?page=1&clasid=" & Request("calsid") & ">首 页</a> "
Response.Write "<a href=?page=" & CurrentPage - 1 & "&clasid=" & Request("clasid") & ">上一页</a> "
End If
If n - CurrentPage < 1 Then
Response.Write "下一页 尾 页" & vbCrLf
Else
Response.Write "<a href=?page=" & (CurrentPage + 1) & "&clasid=" & Request("clasid") & ">下一页</a>"
Response.Write " <a href=?page=" & n & "&clasid=" & Request("clasid") & ">尾 页</a>" & vbCrLf
End If
Response.Write " 页次:<strong><font color=red>" & CurrentPage & "</font>/" & n & "</strong>页 "
Response.Write " 转到:"
If GotoPageType = 1 Then
Response.Write " <select name='page' size='1' style=""font-size: 9pt"" onChange='javascript:submit()'>" & vbCrLf
For ii = 1 To n
Response.Write "<option value='" & ii & "' "
If CurrentPage = CInt(ii) Then
Response.Write "selected "
End If
Response.Write ">第" & ii & "页</option>"
Next
Response.Write "</select> " & vbCrLf
Else
Response.Write "<input name=page size=3> <input type=submit name=Submit value='GO'>"
End If
Response.Write "</td></tr></FORM></table>" & vbCrLf
Else
n = CurrentPage
If n < maxpagecount Then
n = maxpagecount
End If
Response.Write "<table width=""100%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""2"">"
Response.Write " <tr><form method=""POST"" action='?clasid=" & Request("clasid") & "'>"
Response.Write " <td align=""center""><font color='red'>" & strclassname & "</font> 共有文章 <font COLOR=#FF0000><strong>"
Response.Write totalnumber
Response.Write "</strong></font> 篇 <a href=?page=1&clasid=" & Request("clasid") & " title=返回第一页><font face=""Webdings"">97</font></a> "
For ii = pagestart To pageend
If ii = 0 Then ii = 1
If ii = CurrentPage Then
Response.Write "<font color='red'><strong>" & ii & "</strong></font> "
Else
Response.Write "<a href=?page=" & ii & "&clasid=" & Request("clasid") & " title=第" & ii & "页><strong>" & ii & " </strong></a>"
End If
Next
Response.Write "<a href=?page="
Response.Write maxpagecount
Response.Write "&clasid=" & Request("clasid") & " title=尾页><font face=""Webdings"">8:</font></a> 页次:<strong><font color=red>"
Response.Write CurrentPage
Response.Write "</font>/"
Response.Write maxpagecount
Response.Write "</strong>页 转到:"
If GotoPageType = 1 Then
Response.Write " <select name='page' size='1' style=""font-size: 9pt"" onChange='javascript:submit()'>" & vbCrLf
For ii = 1 To n
Response.Write "<option value='" & ii & "' "
If CurrentPage = CInt(ii) Then
Response.Write "selected "
End If
Response.Write ">第" & ii & "页</option>"
Next
Response.Write "</select> " & vbCrLf
Else
Response.Write "<input name=page size=3> <input type=submit name=Submit value='GO'>"
End If
Response.Write " </td></form></tr></table>" & vbCrLf
End If
End Sub
Private Function ClassJumpMenu()
Dim CacheJumpMenu
Dim SQL
Dim Rs1
Dim i
DownsysClass.Name = "ClassJumpMenu"
If DownsysClass.ObjIsEmpty() Then
CacheJumpMenu = "<select onchange=""if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}"">" & vbCrLf
CacheJumpMenu = CacheJumpMenu & "<option value=admin_article.asp>≡全部文章列表≡</option>" & vbCrLf
Set Rs1 = CreateObject("Adodb.recordset")
SQL = "select * from NC_Class order by rootid,orders"
Rs1.Open SQL, Conn, 1, 1
DownsysClass.SqlQueryNum = DownsysClass.SqlQueryNum + 1
Do While Not Rs1.EOF
CacheJumpMenu = CacheJumpMenu & "<option value=""admin_article.asp?clasid=" & Rs1("classid") & """ {ClassID=" & Rs1("classid") & "}"
If Trim(Request("clasid")) <> "" Then
If CLng(Request("clasid")) = Rs1("classid") Then CacheJumpMenu = CacheJumpMenu & " selected"
End If
CacheJumpMenu = CacheJumpMenu & ">"
If Rs1("depth") = 1 Then CacheJumpMenu = CacheJumpMenu & " ├ "
If Rs1("depth") > 1 Then
For i = 2 To Rs1("depth")
CacheJumpMenu = CacheJumpMenu & " "
Next
CacheJumpMenu = CacheJumpMenu & " ├ "
End If
CacheJumpMenu = CacheJumpMenu & Rs1("ClassName") & "</option>" & vbCrLf
Rs1.movenext
Loop
Rs1.Close
Set Rs1 = Nothing
CacheJumpMenu = CacheJumpMenu & "</select>"
DownsysClass.Value = CacheJumpMenu
End If
ClassJumpMenu = DownsysClass.Value
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -