首页 > 网站 > 建站经验 > 正文

3.1-超简单实现公用标签

2024-08-30 19:06:10
字体:
来源:转载
供稿:网友
适用系统:3.1
实现思想:一个标签应用于所有模版,自动读取所生成类别下(包含子类)的内容
修改文件:Admin/Refresh/RefreshFunction.asp
实现方法(较3.0SP2版本多了第二步):
第一步、打开Admin/Refresh/RefreshFunction.asp文件
查找
Function ChirldClassID(ClassEnameStr)

下面约4、5行处,将

Set RsChirldFunObj = Conn.Execute("Select ClassID from FS_NewsClass where ParentID=(Select ClassID from FS_NewsClass where ClassEName='"&ClassEnameStr&"') order by AddTime,id desc")
Set ChirldClassObj = Conn.Execute("Select ClassID from FS_NewsClass where ClassEName='"&ClassEnameStr&"' order by ID desc")

替换为:

If ClassEnameStr="Thisclass" then
Set RsChirldFunObj = Conn.Execute("Select ClassID from FS_NewsClass where ParentID='"&RefreshID&"' order by AddTime,id desc")
Set ChirldClassObj = Conn.Execute("Select ClassID from FS_NewsClass where ClassID='"&RefreshID&"' order by ID desc")
Else
Set RsChirldFunObj = Conn.Execute("Select ClassID from FS_NewsClass where ParentID=(Select ClassID from NewsClass where ClassEName='"&ClassEnameStr&"') order by AddTime,id desc")
Set ChirldClassObj = Conn.Execute("Select ClassID from FS_NewsClass where ClassEName='"&ClassEnameStr&"' order by ID desc")
End if


第二步:最新新闻、热点新闻、推荐新闻处另外修改(假如还有其它项目请回帖)
查找

dim TemppID,TemppSql,EndClassIDList
If ClassEName<>"" then
If SoonClassStr="1" then
TemppSql="select ClassID from FS_NewsClass where ClassEName='" & ClassEName & "'"
Set TemppID=conn.execute(TemppSql)
EndClassIDList= "'" & TemppID(0) & "'" & AllChildClassIDStrList(TemppID(0))
Else
TemppSql="select ClassID from FS_NewsClass where ClassEName='" & ClassEName & "'"
Set TemppID=conn.execute(TemppSql)
EndClassIDList="'" & TemppID(0) & "'"
End if
Else
EndClassIDList=""
end if 替换为:
'kimli修改_公用标签
dim TemppID,TemppSql,EndClassIDList
If ClassEName="" then
EndClassIDList=""
Elseif ClassEName="Thisclass" then
EndClassIDList= "'" &RefreshID& "'" & AllChildClassIDStrList(RefreshID)
Else
If SoonClassStr="1" then
TemppSql="select ClassID from FS_NewsClass where ClassEName='" & ClassEName & "'"
Set TemppID=conn.execute(TemppSql)
EndClassIDList= "'" & TemppID(0) & "'" & AllChildClassIDStrList(TemppID(0))
Else
TemppSql="select ClassID from FS_NewsClass where ClassEName='" & ClassEName & "'"
Set TemppID=conn.execute(TemppSql)
EndClassIDList="'" & TemppID(0) & "'"
End if
End if
'kimli修改_公用标签结束


第三步、制作标签方法
实例、制作一个公用_分类页_推荐图片新闻

共2页上一页12下一页
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表