5UCMS后台内容管理实现大类列表

  不说废话,直接上代码。实现后台内容大类分页,同前台一样,需要修改源码。在此cssHaier提醒您,若是没有ASP基础,请勿修改!

1,打开admin/admin_content.asp文件,找到以下代码

Sub Main()
If Len(Key) > 0 Then
If Instr(",ID,Cid,Commend,Views,Comments,Orders,Display,","," & DFieldKey & ",") > 0 Then
If Len(Key) > 0 And IsNumeric(Key) Then Sql = "[" & DFieldKey & "]=" & Key & ""
Else
Sql = "[" & DFieldKey & "] Like '%" & Key & "%'"
End If
End If

2、将以上代码整体替换成以下代码

Sub Main()
If Len(Key) > 0 Then
If Instr(",ID,Cid,Commend,Views,Comments,Orders,Display,","," & DFieldKey & ",") > 0 Then
' ↓修改栏目显示内容 by cssHaier↓
Dim Tag_Where,Cid,N
N= DB("Select [ChildID],[ChildIDs] from [{pre}Channel] where CID = "& Key,1)
If Len(N(0)) > 0 then
Cid=N(1)
Tag_Where="or [cid] in ("&N(1)")"
Else
Cid= Key
Tag_Where=""
End If
'↑修改大类显示内容↑
If Len(Key) > 0 And IsNumeric(Key) Then Sql = "[" & DFieldKey & "]=" & Key & Tag_Where""
Else
Sql = "[" & DFieldKey & "] Like '%" & Key & "%' "&Tag_Where
End If
End If

3、经测试,0409版和v1.2 2024版可用!

你可能感兴趣的:(sql,asp)