用来查找相关" & ChannelShortName & ",可输入多个关键字,中间用“|”隔开。不能出现"'&?;:()等字符。"
End If
4、Admin/admin_SourceManage.asp
530行“关 键 字:”和“所属频道:”这两个TR之间添加关键字添加部分的HTML页面显示代码如下:
'--------------- 关键字分类处理 HUSW START -----------------------------
If ChannelID = 1002 Then '这里的ChannelID = 1002 为需要的频道ID,需要手工指定;
Response.Write "
"
Response.Write "
上级关键字:
"
Response.Write "
"
Response.Write "
"
Response.Write "
关键字排序:
"
Response.Write "
"
End If
' --------------- 关键字分类处理 HUSW END -----------------------------
602行修改关键字添加部分的处理代码.修改如下:
'--------------关键字分类处理修改 HUSW 2010/10/15 START ------------------
Sub SaveAddKeyword()
Dim KeyText,ParentID,Depth,OrderID
Dim rsKey, sqlKey
KeyText = Trim(Request("KeyText"))
ParentID = Trim(Request("ParentID"))
OrderID = Trim(Request("OrderID"))
If OrderID = "" Then
OrderID = 0
Else
OrderID = ReplaceBadChar(OrderID)
End If
If KeyText = "" Then
FoundErr = True
ErrMsg = ErrMsg & "
关键字不能为空!
"
Else
KeyText = ReplaceBadChar(KeyText)
End If
If FoundErr = True Then
Exit Sub
End If
sqlKey = "Select * from PE_NewKeys where ChannelID=" & ChannelID & " and KeyText='" & KeyText & "'"
Set rsKey = Server.CreateObject("Adodb.RecordSet")
rsKey.Open sqlKey, Conn, 1, 3
If Not (rsKey.BOF And rsKey.EOF) Then
FoundErr = True
ErrMsg = ErrMsg & "
数据库中已经存在此关键字!
"
rsKey.Close
Set rsKey = Nothing
Exit Sub
End If
If ParentID = 0 Then
Depth = 0
Else
Dim sqlKey2,rsKey2
sqlKey2 = "Select Depth from PE_NewKeys where ParentID=" & ParentID
Set rsKey2 = Server.CreateObject("Adodb.RecordSet")
rsKey2.Open sqlKey2, Conn, 1, 3
If Not (rsKey2.BOF And rsKey2.EOF) Then
Depth = rsKey2("Depth") + 1
End If
rsKey2.Close
Set rsKey2 = Nothing
End If
rsKey.addnew
rsKey("ChannelID") = ChannelID
rsKey("KeyText") = KeyText
rsKey("ParentID") = ParentID
rsKey("Depth") = Depth
rsKey("OrderID") = OrderID
rsKey("Hits") = 0
rsKey("LastUseTime") = Now()
rsKey.Update
rsKey.Close
Set rsKey = Nothing
Call CloseConn
Response.Redirect "Admin_SourceManage.asp?ChannelID=" & ChannelID & "&TypeSelect=Keyword"
End Sub
'--------------关键字分类处理修改 HUSW 2010/10/15 END -----------------------
关键字数据表PE_NewKeys添加ParentID、Depth、OrderID三个字段
ParentID 数字 长整型 父级ID
Depth 数字 长整型 分类深度
OrderID 数字 长整型 排序ID
按说还应该增加一个Next的字段,用来做树型列表用。因为本次要求不是那么严格,而且这个指定的关键字一旦完成,以后很少会改动,所以只做了添加关键字处理,而没有做删除及修改处理。关键字树列表那里也做的不够细。因为前提是够用即可。 实在讨厌了动易的标签模板,当然不能否认动易做的的确不错,只是我不喜欢而已。所以懒得再改了。
写到这里记录并分享一下,也希望可以帮助到与我有同样需要的朋友。 万恶的动易啊! 受不了了,快崩溃了~~~~
本文为本站原创,转载请注册出处!谢谢合作!
Generated by Bo-blog 2.1.2 beta 3