当模型允许生成静态页面时,管理页面如下:
此主题相关图片如下:001.jpg
不允许生成静态页面时如下:
此主题相关图片如下:002.jpg
修改方法:
打开
admin/Include/RefreshHtmlSave.asp
找到
Case "ID"
ID=KS.G("ID")
'R_Sql = "Select top 2 * from " & Table & R_Sql & " and ID<=" & ID & " Order By ID desc"
R_Sql="Select Top 2 * From " & Table & R_SQL&" and ID IN(Select top 2 id from " & Table & R_Sql & " And ID<=" & id & " Order By ID Desc) Order By ID"
RefreshTotalNum=conn.execute("select count(id) from " & Table &" where verific=1 and ID<=" & ID)(0)
If RefreshTotalNum>2 Then RefreshTotalNum=2
在下面添加:
Case "BatchInfo"
IDS=KS.G("IDS")
R_Sql="Select * From " & Table & " Where Verific=1 and ID IN("&IDS&") Order By ID"
RefreshTotalNum=conn.execute("Select count(id) From " & Table & " Where Verific=1 and ID IN("&IDS&")")(0)
打开
KS_Cls/Kesion.PublicCls.asp
增加一个函数来判断当前模型是否允许发布静态页面
Function IsAllowPublish(CHID)
Dim RS:Set RS=Server.CreateObject("ADODB.RECORDSET")
RS.Open "Select FsoHtmlTF from KS_Channel where ChannelID="&CHID,conn,1,1
IsAllowPublish=RS(0)
RS.Close:Set RS=Nothing
End Function
在admin/KS.Article.asp中找到:
.Write "<li class='parent'><span class=child onmouseover=""this.parentNode.className='parent_border'"" onMouseOut=""this.parentNode.className='parent'"" title=""加入专题"" onClick=""AddToSpecial();""><img src='images/ico/as.gif' border='0' align='absmiddle'>加入专题</span></li>"
在下面加上一行:
if KS.IsAllowPublish(ChannelID)="1" then
.Write "<li class='parent'><span class=child onmouseover=""this.parentNode.className='parent_border'"" onMouseOut=""this.parentNode.className='parent'"" title=""批量发布"" onClick=""BatchPublish();""><img src='images/ico/verify.gif' border='0' align='absmiddle'>发布</span></li>"
end if
将
.Write "<li></li><div><select OnChange=""location.href='KS.Article.asp?ComeFrom=" & ComeFrom & "&ChannelID=" & ChannelID & "&id='+this.value;parent.frames['BottomFrame'].location.href='KS.Split.asp?ButtonSymbol=ViewFolder&FolderID='+this.value;"" style='width:100px' name='id'>"
改为
.Write "<li></li><div><select OnChange=""location.href='KS.Article.asp?ComeFrom=" & ComeFrom & "&ChannelID=" & ChannelID & "&id='+this.value;parent.frames['BottomFrame'].location.href='KS.Split.asp?ButtonSymbol=ViewFolder&FolderID='+this.value;"" style='width:90px' name='id'>"
找到
Response.Write (" <a href=""?Action=Recely&Page=" & Page & "&" & SearchParam & "&ID=" & SQL(0,I) & """ onclick=""return (confirm('确定将该" & KS.C_S(ChannelID,3) & "放入回收站吗?'))"">回收站</a>")
End If
Else
在下面添加:
if KS.IsAllowPublish(ChannelID)="1" then
PublishStr="<a href='Include/RefreshHtmlSave.asp?Types=Content&RefreshFlag=InfoID&ChannelID=" & ChannelID &"&StartID="&SQL(0,I)&"&EndID="&SQL(0,I)&"'>生成</a> | "
Else
PublishStr=""
End if
接着将下面这段
.Write (" <a href='?Page=" & Page & "&Action=Edit&" &SearchParam&"&ID=" & SQL(0,I) & "' onclick='parent.frames[""BottomFrame""].location.href=""KS.Split.asp?ChannelID=" & ChannelID &"&ComeFrom="&ComeFrom&"&OpStr="&Server.URLEncode("编辑" & KS.C_S(ChannelID,3)) & "&ButtonSymbol=AddInfo&FolderID=" & ID & """;'>修改</a> | <a href=""?Action=Recely&Page=" & Page & "&" & SearchParam & "&ID=" & SQL(0,I) & """ onclick=""return (confirm('确定将该" & KS.C_S(ChannelID,3) & "放入回收站吗?'))"">回收站</a>")
改为
.Write (PublishStr&"<a href='?Page=" & Page & "&Action=Edit&" &SearchParam&"&ID=" & SQL(0,I) & "' onclick='parent.frames[""BottomFrame""].location.href=""KS.Split.asp?ChannelID=" & ChannelID &"&ComeFrom="&ComeFrom&"&OpStr="&Server.URLEncode("编辑" & KS.C_S(ChannelID,3)) & "&ButtonSymbol=AddInfo&FolderID=" & ID & """;'>修改</a> | <a href=""?Action=Recely&Page=" & Page & "&" & SearchParam & "&ID=" & SQL(0,I) & """ onclick=""return (confirm('确定将该" & KS.C_S(ChannelID,3) & "放入回收站吗?'))"">回收站</a>")
在300行左右找个位置增加一个JS函数:
function BatchPublish(){
var ids=get_Ids(document.myform);
if(ids!=''){
var ids_array=ids.split(',');
if(confirm("确定要发布所选择的内容吗?")){
window.location='Include/RefreshHtmlSave.asp?Types=Content&RefreshFlag=BatchInfo&ChannelID=<%=ChannelID%>&IDS='+ids_array;
}
}else{
alert('请选择要发布的<%=KS.C_S(ChannelID,3)%>!');
}
}
搞定!!!