FoosunCMS-实现公用标签

来自站长百科
跳转至: 导航、​ 搜索

导航:返回上一页

FoosunCMS-实现公用标签



  • 适用系统:3.0SP2,其它系统应该类似
  • 实现思想:一个标签应用于所有模版,自动读取所生成类别下(包含子类)的内容
  • 修改文件:Admin/Refresh/RefreshFunction.asp
  • 实现方法(三行代码解决问题,呵呵):

第一步[ ]

打开Admin/Refresh/RefreshFunction.asp文件
查找
Function ChirldClassID(ClassEnameStr)
下面约4、5行处,将  
Set RsChirldFunObj = 
Conn.Execute("Select ClassID from 
NewsClass where ParentID=(
Select ClassID from NewsClass where 
ClassEName='"&ClassEnameStr&"') order by AddTime,id desc")
Set ChirldClassObj = 
Conn.Execute("Select ClassID from NewsClass 
where ClassEName='"&ClassEnameStr&"' order by ID desc")
替换为:
If ClassEnameStr="Thisclass" then
Set RsChirldFunObj = 
Conn.Execute("Select ClassID 
fromNewsClass where ParentID='"&RefreshID&"' order by AddTime,id desc")
Set ChirldClassObj = 
Conn.Execute("Select ClassID from 
NewsClass where ClassID='"&RefreshID&"' order by ID desc")
Else
Set RsChirldFunObj = 
Conn.Execute("Select ClassID from 
NewsClass where ParentID=
(Select ClassID from NewsClass where 
ClassEName='"&ClassEnameStr&"') order by AddTime,id desc")
Set ChirldClassObj = Conn.Execute("Select ClassID 
from NewsClass where ClassEName='"&ClassEnameStr&"' order by ID desc")
End if

第二步[ ]

制作标签方法

实例、制作一个公用_分类页_推荐图片新闻

{%=RecPic("Thisclass","4","1","1","30","0","4","120","80","","6")%}

上面的蓝色字Thisclass便是申明为当前类别及其下子类别!其它均为FoosunCMS默认,不用修改




参考来源[ ]