因为有些文章不想放出来,但审核后只能删除了,很不方便,于是修改了程序,加入取消审核功能。
修改ks.Article.asp
找到
if (!(CutCopyPower=='False'))
{
DocMenuArr[DocMenuArr.length]=new ContextMenuItem("parent.Cut();",'剪 切(X)','disabled');
DocMenuArr[DocMenuArr.length]=new ContextMenuItem("parent.Copy();",'复 制(C)','disabled');
}
改为:
if (!(CutCopyPower=='False'))
{
DocMenuArr[DocMenuArr.length]=new ContextMenuItem("parent.Cut();",'剪 切(X)','disabled');
DocMenuArr[DocMenuArr.length]=new ContextMenuItem("parent.Copy();",'复 制(C)','disabled');
DocMenuArr[DocMenuArr.length]=new ContextMenuItem("parent.sh();",'取消审核(C)','disabled');
}
找到:
function Delete()
{ GetSelectStatus('FolderID','ArticleID');
if (!((SelectedFile=='')&&(SelectedFolder=='')))
{ if (confirm('确定删除选中的目录或<%=KS.C_S(ChannelID,3)%>吗?'))
{if (SelectedFolder!='')
location="admin_Article.asp?ChannelID=<%=ChannelID%>&Action=DelFolder&Page="+Page+"&FolderID="+SelectedFolder;
if (SelectedFile!='')
location='admin_Article.asp?Action=DelInfo&Page='+Page+'&'+SearchParam+'&NewsID='+SelectedFile;
}
SelectedFile='';
SelectedFolder='';
}
else alert('请选择要删除的'+TempStr+'或<%=KS.C_S(ChannelID,3)%>!');
}
在后面加入:
function sh()
{ GetSelectStatus('FolderID','ArticleID');
if (!((SelectedFile=='')&&(SelectedFolder=='')))
{ if (confirm('确定将选中的<%=KS.C_S(ChannelID,3)%>取消审核吗?'))
{
if (SelectedFile!='')
location.href="?ChannelID=<%=ChannelID%>&Page="+Page+"&Action=shBack&NewsID="+SelectedFile;
}
SelectedFile='';
SelectedFolder='';
}
else alert('请选择要取消审核的<%=KS.C_S(ChannelID,3)%>!');
}
找到:
Case "Paste"
If Not KS.ReturnPowerResult(ChannelID, "M" & ChannelID & "10011") Then
Call KS.ReturnErr(1, "")
Else
Call ArticlePaste()
End If
在后面加入:
Case "shBack"
Call shBackAll()
找到:Sub ArticleMain()
在其前面加入:(结果如下)
Sub shBackAll()
'取消文章审核操作
dim k
ChannelID = Trim(Request.QueryString("ChannelID"))
NewsID = Trim(Request.QueryString("NewsID"))
NewsID = Split(NewsID, ",")
Dim RS:Set RS=Server.CreateObject("ADODB.Recordset")
For K = LBound(NewsID) To UBound(NewsID)
'删除评论
conn.Execute ("Delete From KS_Comment Where ChannelID=" & ChannelID &" and InfoID=" & NewsID(K))
RS.Open "Select * FROM " & KS.C_S(ChannelID,2) &" Where NewsID='" & NewsID(K) & "'", conn, 1, 3
If RS.EOF And RS.BOF Then
Call KS.AlertHistory("参数传递出错!", -1)
Set KS = Nothing
Response.End
Else
FolderID = Trim(RS("Tid"))
on error resume next
FExt = Mid(Trim(RS("Fname")), InStrRev(Trim(RS("Fname")), ".")) '分离出扩展名
Fname = Replace(Trim(RS("Fname")), FExt, "") '分离出文件名 如 2005/9-10/1254ddd
'删除物理文件
CurrPath = Replace(KS.Setting(3) & KS.C_S(ChannelID,8) & KS.C_C(folderid,2),"//","/")
ArticleContentArr = Split(RS("ArticleContent"), "[NextPage]")
TotalPage = UBound(ArticleContentArr) + 1
If TotalPage > 1 Then
For I = LBound(ArticleContentArr) To UBound(ArticleContentArr)
If I = 0 Then
CurrPathAndName = CurrPath & RS("Fname")
Else
CurrPathAndName = CurrPath & Fname & "_" & (I + 1) & FExt
End If
Call KS.DeleteFile(CurrPathAndName)
Next
Else
CurrPathAndName = CurrPath & RS("Fname")
Call KS.DeleteFile(CurrPathAndName)
End If
RS("Verific")=0
RS.update
End If
RS.Close
Next
Set RS = Nothing
'生成栏目页和首页
dim atid,Tid,sql
sql="select ID,TN from KS_Class where ID='"&FolderID&"'"
set atid=conn.execute(sql)
Tid=atid(1)
if Tid="0" then
Tid=atid(0)
end if
response.Write "<div style=""margin-top:15px;border: #E7E7E7;height:296; overflow: auto; width:100%"">"
If KS.C_S(ChannelID,7)=0 Then
Else
If KS.C_S(ChannelID,9)<>1 Then
Dim FolderIDArr:FolderIDArr=Split(left(KS.C_C(Tid,8),Len(KS.C_C(Tid,8))-1),",")
For I=0 To Ubound(FolderIDArr)
response.Write "<div align=center><iframe src=""Include/RefreshHtmlSave.Asp?ChannelID=" & ChannelID &"&Types=Folder&RefreshFlag=ID&FolderID=" & FolderIDArr(i) &""" width=""100%"" height=""90"" frameborder=""0"" allowtransparency='true'></iframe></div>"
Next
End If
End If
If Split(KS.Setting(5),".")(1)="asp" or KS.C_S(ChannelID,9)<>3 Then
' .Write "<div style=""margin-left:140;color:blue;height:25px""><li>由于 <a href=""" & KS.GetDomain & """ target=""_blank""><font color=red>网站首页</font></a> 没有启用生成HTML的功能或发布选项没有开启,所以没有生成!</li></div>"
Else
response.Write "<div align=center><iframe src=""Include/RefreshIndex.asp?ChannelID=" & ChannelID &"&RefreshFlag=Info"" width=""100%"" height=""80"" frameborder=""0"" allowtransparency='true'></iframe></div>"
End If
response.Write "</div>"
response.Write "<div align=center>"
If KeyWord = "" Then
Response.Write ("<a href='admin_Article.asp?ChannelID=" & ChannelID &"&ID=" & FolderID & "&Page=" & Page & "'>操作成功!按此返回</at>")
Else
Response.Write ("<a href='admin_Article.asp?ChannelID=" & ChannelID &"&KeyWord=" & KeyWord & "&SearchType=" & SearchType & "&StartDate=" & StartDate & "&EndDate=" & EndDate & "&ID=" & FolderID & "&Page=" & Page & "'>操作成功!请按此返回</a>")
End If
response.Write "</div>"
End Sub
Sub ArticleMain()