📄 user_article_code.asp
字号:
<!--#include file="CommonCode.asp"-->
<!--#include file="../Include/PowerEasy.Common.Purview.asp"-->
<!--#include file="../Include/PowerEasy.Common.Manage.asp"-->
<!--#include file="../Include/PowerEasy.Common.Content.asp"-->
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005-2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************
Dim ArticleID, AuthorName, Status, ManageType
Dim IncludePic, UploadFiles, DefaultPicUrl
Dim ArticlePro1, ArticlePro2, ArticlePro3, ArticlePro4
Dim ClassID, SpecialID, OnTop, IsElite, IsHot, Created
Dim tClass, ClassName, RootID, ParentID, Depth, ParentPath, Child, arrChildID, ParentDir, ClassDir, ClassPurview
Sub Execute()
ChannelID = PE_CLng(Trim(Request("ChannelID")))
If ChannelID > 0 Then
Call GetChannel(ChannelID)
'Else
' FoundErr = True
' ErrMsg = ErrMsg & "<li>请指定要查看的频道ID!</li>"
' Response.Write ErrMsg
' Exit Sub
End If
ArticleID = Trim(Request("ArticleID"))
ClassID = PE_CLng(Trim(Request("ClassID")))
Status = Trim(Request("Status"))
AuthorName = Trim(Request("AuthorName"))
If Status = "" Then
Status = 9
Else
Status = PE_CLng(Status)
End If
If IsValidID(ArticleID) = False Then
ArticleID = ""
End If
ManageType = Trim(Request("ManageType"))
If Action = "" Then Action = "Manage"
FileName = "User_Article.asp?ChannelID=" & ChannelID & "&Action=" & Action & "&ManageType=" & ManageType
strFileName = FileName & "&ClassID=" & ClassID & "&Field=" & strField & "&keyword=" & Keyword
If AuthorName <> "" Then
AuthorName = ReplaceBadChar(AuthorName)
strFileName = strFileName & "&AuthorName=" & AuthorName
End If
If XmlDoc.Load(Server.MapPath(InstallDir & "Language/Gb2312_Channel_" & ChannelID & ".xml")) = False Then XmlDoc.Load (Server.MapPath(InstallDir & "Language/Gb2312.xml"))
ArticlePro1 = XmlText("Article", "ArticlePro1", "[图文]")
ArticlePro2 = XmlText("Article", "ArticlePro2", "[组图]")
ArticlePro3 = XmlText("Article", "ArticlePro3", "[推荐]")
ArticlePro4 = XmlText("Article", "ArticlePro4", "[注意]")
Response.Write "<table align='center'><tr align='center' valign='top'>"
If CheckUser_ChannelInput() = True Then
Response.Write "<td width='90'><a href='User_Article.asp?ChannelID=" & ChannelID & "&Action=Add'><img src='images/article_add.gif' border='0' align='absmiddle'><br>添加" & ChannelShortName & "</a></td>"
End If
Response.Write "<td width='90'><a href='User_Article.asp?ChannelID=" & ChannelID & "&Status=9'><img src='images/article_all.gif' border='0' align='absmiddle'><br>所有" & ChannelShortName & "</a></td>"
Response.Write "<td width='90'><a href='User_Article.asp?ChannelID=" & ChannelID & "&Status=-1'><img src='images/article_draft.gif' border='0' align='absmiddle'><br>草 稿</a></td>"
Response.Write "<td width='90'><a href='User_Article.asp?ChannelID=" & ChannelID & "&Status=0'><img src='images/article_unpassed.gif' border='0' align='absmiddle'><br>待审核的" & ChannelShortName & "</a></td>"
Response.Write "<td width='90'><a href='User_Article.asp?ChannelID=" & ChannelID & "&Status=3'><img src='images/article_passed.gif' border='0' align='absmiddle'><br>已审核的" & ChannelShortName & "</a></td>"
Response.Write "<td width='90'><a href='User_Article.asp?ChannelID=" & ChannelID & "&Status=-2'><img src='images/article_reject.gif' border='0' align='absmiddle'><br>未被采用的" & ChannelShortName & "</a></td>"
Response.Write "</tr></table>" & vbCrLf
Select Case Action
Case "Add"
Call Add
Case "Modify"
Call Modify
Case "SaveAdd", "SaveModify"
Call SaveArticle
Case "Preview"
Call Preview
Case "Show"
Call Show
Case "Del"
Call Del
Case "Receive"
Call Receive
Case "Manage"
Call main
End Select
If FoundErr = True Then
Call WriteErrMsg(ErrMsg, ComeUrl)
End If
End Sub
Sub main()
Call GetClass
If FoundErr = True Then Exit Sub
Call ShowJS_Main(ChannelShortName)
If ChannelID > 0 Then
Response.Write "<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>"
Response.Write " <tr class='title'>"
Response.Write " <td height='22'>" & GetRootClass() & "</td>"
Response.Write " </tr>" & GetChild_Root() & ""
Response.Write "</table><br>"
End If
If ManageType = "Receive" Then
Call ShowContentManagePath(ChannelShortName & "签收管理")
Else
Call ShowContentManagePath(ChannelShortName & "管理")
End If
Response.Write "<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr>"
Response.Write " <form name='myform' method='Post' action='User_Article.asp' onsubmit='return ConfirmDel();'>"
Response.Write " <td><table class='border' border='0' cellspacing='1' width='100%' cellpadding='0'>"
Response.Write " <tr class='title' height='22'> "
Response.Write " <td height='22' width='30' align='center'><strong>选中</strong></td>"
Response.Write " <td width='25' align='center'><strong>ID</strong></td>"
Response.Write " <td align='center' ><strong>" & ChannelShortName & "标题</strong></td>"
Response.Write " <td width='60' align='center' ><strong>录入</strong></td>"
Response.Write " <td width='40' align='center' ><strong>点击数</strong></td>"
Response.Write " <td width='80' align='center' ><strong>" & ChannelShortName & "属性</strong></td>"
If ManageType = "Receive" Then
Response.Write " <td width='60' align='center' ><strong>签收状态</strong></td>"
Response.Write " <td width='140' align='center' ><strong>签收操作</strong></td>"
Else
Response.Write " <td width='60' align='center' ><strong>审核状态</strong></td>"
Response.Write " <td width='80' align='center' ><strong>管理操作</strong></td>"
End If
Response.Write " </tr>"
Dim rsArticleList, sql, tmpChannelID
sql = "select A.ArticleID,A.ChannelID,A.ClassID,C.ClassName,C.ParentDir,C.ClassDir,C.ClassPurview,A.Title,A.Keyword,A.Author,A.CopyFrom,A.UpdateTime,A.DefaultPicUrl,A.Inputer,A.ReceiveType,"
If ManageType = "Receive" Then
sql = sql & "A.Receive,A.Received,"
End If
sql = sql & "A.Hits,A.OnTop,A.Elite,A.Status,A.IncludePic,A.Stars,A.PaginationType,A.InfoPoint from PE_Article A"
sql = sql & " left join PE_Class C on A.ClassID=C.ClassID where A.Deleted=" & PE_False
If ChannelID > 0 Then
sql = sql & " and A.ChannelID=" & ChannelID & " "
End If
If ManageType = "Receive" Then
sql = sql & " and A.ArticleID in (" & GetReceiveArticleID() & ") "
Else
sql = sql & " and A.Inputer='" & UserName & "' "
End If
Select Case Status
Case 3
sql = sql & " and A.Status=3"
Case 0
sql = sql & " and (A.Status=0 Or A.Status=1 Or A.Status=2)"
Case -1
sql = sql & " and A.Status=-1"
Case -2
sql = sql & " and A.Status=-2"
End Select
If ClassID > 0 Then
If Child > 0 Then
sql = sql & " and A.ClassID in (" & arrChildID & ")"
Else
sql = sql & " and A.ClassID=" & ClassID
End If
End If
If Keyword <> "" Then
Select Case strField
Case "Title"
sql = sql & " and A.Title like '%" & Keyword & "%' "
Case "Content"
sql = sql & " and A.Content like '%" & Keyword & "%' "
Case "Author"
sql = sql & " and A.Author like '%" & Keyword & "%' "
Case "Inputer"
sql = sql & " and A.Inputer='" & Keyword & "' "
Case Else
sql = sql & " and A.Title like '%" & Keyword & "%' "
End Select
End If
sql = sql & " order by A.ArticleID desc"
Set rsArticleList = Server.CreateObject("ADODB.Recordset")
rsArticleList.Open sql, Conn, 1, 1
If rsArticleList.BOF And rsArticleList.EOF Then
totalPut = 0
Response.Write "<tr class='tdbg'><td colspan='20' align='center'><br>" & GetStrNoItem(ClassID, Status) & "<br><br></td></tr>"
Else
totalPut = rsArticleList.RecordCount
If CurrentPage < 1 Then
CurrentPage = 1
End If
If (CurrentPage - 1) * MaxPerPage > totalPut Then
If (totalPut Mod MaxPerPage) = 0 Then
CurrentPage = totalPut \ MaxPerPage
Else
CurrentPage = totalPut \ MaxPerPage + 1
End If
End If
If CurrentPage > 1 Then
If (CurrentPage - 1) * MaxPerPage < totalPut Then
rsArticleList.Move (CurrentPage - 1) * MaxPerPage
Else
CurrentPage = 1
End If
End If
Dim ArticleNum, ArticlePath
ArticleNum = 0
Do While Not rsArticleList.EOF
If ChannelID = 0 Then
If rsArticleList("ChannelID") <> tmpChannelID Then
ChannelID = rsArticleList("ChannelID")
Call GetChannel(ChannelID)
tmpChannelID = rsArticleList("ChannelID")
End If
End If
Response.Write " <tr class='tdbg' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"">"
Response.Write " <td width='30' align='center'><input name='ArticleID' type='checkbox' onclick='unselectall()' id='ArticleID' value='" & rsArticleList("ArticleID") & "'></td>"
Response.Write " <td width='25' align='center'>" & rsArticleList("ArticleID") & "</td>"
Response.Write " <td>"
If rsArticleList("ClassID") <> ClassID Then
Response.Write "<a href='User_Article.asp?ChannelID=" & rsArticleList("ChannelID") & "&Action=Manage&ManageType=" & ManageType & "&ClassID=" & rsArticleList("ClassID") & "'>[" & rsArticleList("ClassName") & "]</a> "
End If
Response.Write GetInfoIncludePic(IncludePic)
Response.Write "<a href='User_Article.asp?ChannelID=" & rsArticleList("ChannelID") & "&Action=Show&ArticleID=" & rsArticleList("ArticleID") & "'"
Response.Write " title='" & GetLinkTips(rsArticleList("Title"), rsArticleList("Author"), rsArticleList("CopyFrom"), rsArticleList("UpdateTime"), rsArticleList("Hits"), rsArticleList("Keyword"), rsArticleList("Stars"), rsArticleList("PaginationType"), rsArticleList("InfoPoint")) & "'>" & rsArticleList("title") & "</a>"
Response.Write "</td>"
Response.Write " <td width='60' align='center'><a href='" & FileName & "&field=Inputer&keyword=" & rsArticleList("Inputer") & "' title='点击将查看此用户录入的所有" & ChannelShortName & "'>" & rsArticleList("Inputer") & "</a></td>"
Response.Write " <td width='40' align='center'>" & rsArticleList("Hits") & "</td>"
Response.Write " <td width='80' align='center'>" & GetInfoProperty(rsArticleList("OnTop"), rsArticleList("Hits"), rsArticleList("Elite"), rsArticleList("DefaultPicUrl")) & "</td>"
If ManageType = "Receive" Then
Response.Write " <td width='60' align='center' >"
If FoundInArr(rsArticleList("Received"), UserName, "|") = False Then
Response.Write "<font color=red>未签收</font>"
Else
Response.Write "<font color=green>已签收</font>"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -