参照原贴 lino http://bbs.foosun.net/dispbbs.asp?boardID=6&ID=11753&page=8
建议先备份下述三个文件:
Admin\Refresh\RefreshFunction.asp
Admin\Refresh\Function.asp
Admin\Refresh\cls_refresh.asp
第一步:打开Admin\Refresh\RefreshFunction.asp ,拉到倒数第二行(也就是%>前面),,把下面的代码复制上去
'=============End=============================================
'******************************
'根据ID得到当前所在栏目的名称
'author:lino
'Start
'修改 newstar
'*****************************
Function nowclass()
Select Case Fun_Refresh_Type
Case "Class"
nowclass = GetClassNameById(Fun_Refresh_ID)
Case "News"
nowclass = GetNewsClassNameById(Fun_Refresh_ID)
Case "Special"
nowclass = GetSpecialClassNameById(Fun_Refresh_ID)
Case "DownLoad"
nowclass = GetDownloadClassNameById(Fun_Refresh_ID)
Case Else
nowclass = ""
End Select
End Function
'栏目名称
Function GetClassNameById(ClassID)
Dim SqlClass,RsClassObj
if ClassID = "" then Exit Function
'**********3.2 sp1
Set RsClassObj = Conn.Execute("Select ClassCName from FS_NewsClass where ClassID='" & ClassID & "'")
if Not RsClassObj.Eof then
GetClassNameById=RsClassObj("ClassCName")
end if
RsClassObj.Close
Set RsClassObj = Nothing
End Function
'新闻所在的类目
Function GetNewsClassNameById(NewsID)
Dim SqlClass,RsClassObj
if NewsID = "" then Exit Function
'********** 3.2sp1 **********
Set RsClassObj = Conn.Execute("Select ClassID from FS_News where NewsID='" & NewsID & "' ")
if Not RsClassObj.Eof then
GetNewsClassNameById=RsClassObj("ClassID")
GetNewsClassNameById=GetClassNameById(GetNewsClassNameById)
end if
RsClassObj.Close
Set RsClassObj = Nothing
End Function
'专题所在的类目
Function GetSpecialClassNameById(SpecialID)
Dim SqlClass,RsClassObj
if SpecialID = "" then Exit Function
'********** 3.2sp1 **********
Set RsClassObj = Conn.Execute("Select CName from FS_Special where SpecialID='" & SpecialID & "' ")
if Not RsClassObj.Eof then
GetSpecialClassNameById=RsClassObj("CName")
end if
RsClassObj.Close
Set RsClassObj = Nothing
End Function
'下载所在的类目
Function GetDownloadClassNameById(DownloadID)
Dim SqlClass,RsClassObj
if DownloadID = "" then Exit Function
'**********3.2 sp1 **********
Set RsClassObj = Conn.Execute("Select ClassID from FS_Download where DownloadID='" & DownloadID & "' ")
if Not RsClassObj.Eof then
GetDownloadClassNameById=RsClassObj("ClassID")
GetDownloadClassNameById=GetClassNameById(GetDownloadClassNameById)
end if
RsClassObj.Close
Set RsClassObj = Nothing
End Function
'**************************
'End
'**************************
第二步:打开Admin\Refresh\Function.asp 倒数第二行(也就是%>前面),,把下面的代码复制上去
'******************************
'把{FS_当前类目}转成类目名称
'author:lino
'修改 newstar
'Start
'*****************************
Function Replacenowclass(m_TempletContent)
Dim whatIsClass,Select_Function
whatIsClass=nowclass()
m_TempletContent=replace(m_TempletContent,"{FS_当前类目}",whatIsCLass)
Replacenowclass=m_TempletContent
End Function
'**************************
'End
'**************************
第三步:打开Admin\Refresh\cls_refresh.asp
搜索 Sub ReplaceAllLable() ,把下面代码放在其下一行
'**************
'Replace Lable
'**************
m_TempletContent=Replacenowclass(m_TempletContent)
找到Private Sub Analyze_Lable(f_Lable_Cont)
Dim i
m_Label_Para_Name_Array = Array(_
下一行添加 Array("nowclass"),_
找到 Private Function Select_Function()
Select Case LCase(m_Prar_Cont_Array(0))
下一行添加
'当前类目
Case "nowclass"
If UBound(m_Prar_Cont_Array) = 1 then : Select_Function = nowclass() : Else : Select_Function = "" : Exit Function :
End if (因显示问题换行,此处 End if 应与上行连在一起 )
第四步: 打开 foosun/Editer/LableEditer.asp
找到 <td width="30"><div align="center"><img src="../Images/Lable/Mall_Images/PayStyle.gif" alt="支付方式" width="24"
height="24" class="Btn" onClick="InsertScript('Mall_PayStyle')"></div></td>
下一行添加
<!-- 当前类目 开始 -->
<td width="1"> <div align="center" class="ToolSeparator"></div></td>
<td width="30"><div align="center"><img onClick="InsertScript('nowclass');" class="Btn" alt="当前类目"
src="../Images/Lable/nowclass.gif" width="24" height="24"></div></td>
<!-- 当前类目 结束 -->
找到: case 'RSS':
ReturnValue='{%=RSS()%}';
break;
下一行添加:
case 'nowclass':
ReturnValue='{%=nowclass()%}';
break;
感谢:风雨行 提醒!
第五步:将nowclass.gif复制到:foosun/Images/Lable/
OK,现在你可以在一个模板中用{FS_{FS_当前类目}_热点}、{FS_{FS_当前类目}_推荐}等等标签去体会通用标签的强大了!
应用过程中,如有错误提示,请及时跟贴说明。
[upload=rar]viewFile.asp?ID=4731[/upload][此贴子已经被作者于2006-7-24 10:51:00编辑过]
支持下
免费版能用不?
免费版出现
免费版出现
那三个文件我打包上来,请楼主分析分析,谢谢啦
[upload=rar]viewFile.asp?ID=4753[/upload]/Foosun/itv13wAdmin/Refresh/Cls_Refresh.asp,行 473
'当前类目
Case "nowclass"
If UBound(m_Prar_Cont_Array) = 1 then : Select_Function = nowclass() : Else : Select_Function = "" : Exit Function :
End if
end if 没有与上一行连接起来。
应该是:If UBound(m_Prar_Cont_Array) = 1 then : Select_Function = nowclass() : Else : Select_Function = "" : Exit Function : End if 一行显示就对了! 请修改后测试!
没用过通用标签
通用标签共有几个可以用的
下面还有代码呢!忘了发上来了吧!
case 'nowclass':
ReturnValue='{%=nowclass()%}';
break;
[此贴子已经被作者于2006-7-17 11:28:38编辑过]
第一次用通用标签 看了一下,还得建好多标签!只是模版里的名字不用改了!!
要是只用一个标签就好了!!这才是真正的通用标签
建议写的明白一点.象我这样的新手看的不是很明白她的用法.呵
{FS_{FS_当前类目}_热点} 例如这个:其中的{FS_当前类目} 代表自动转换到当前的栏目 ,可是后边的_热点
代表什么意思呢?
如果每个频道,摸班都是一样的,在相同的位置放不同栏目的相同内容形式,该怎么做标签呢?
呵呵,为了更多人的方便学习,麻烦拉~
[此贴子已经被作者于2006-7-24 11:03:14编辑过]
如果标题:一个子类栏目要显示上级父目录的热点内容还有同级的内容时 可以用以下 更改
红色为 新增内容
前题是 必须要修改1楼所说的 所有内容
'栏目名称
Function GetClassNameById(ClassID)
Dim SqlClass,RsClassObj
if ClassID = "" then Exit Function
'**********3.2 sp1
Set RsClassObj = Conn.Execute("Select ClassCName,ParentID from FS_NewsClass where ClassID='" & ClassID & "'")
if Not RsClassObj.Eof then
do while RsClassObj("ParentID") <> 0
Set RsClassObj = Conn.Execute("Select ParentID,ClassCName from FS_NewsClass where ClassID='" & RsClassObj("ParentID") & "'")
if RsClassObj.Eof then Exit do
GetClassNameById=RsClassObj("ClassCName")
loop
end if
RsClassObj.Close
Set RsClassObj = Nothing
End Function
另解说怎么来用:
首先要自定义 几个 热点新闻标签如:{FS_动漫热点}{FS_摄像热点}{FS_文学热点}
在一个模板中可以这样来引用 {FS_{FS_当前类目}热点} 这样的标签
当你发布后 找到动画、摄像、文学等的父目录里的热点内容来显示:
如动画 上级为 动漫 当你访问到动画这个页面里 显示的就是 动漫大栏目里的 很多热点内容
[此贴子已经被作者于2006-7-31 16:21:17编辑过]
我使用了,{FS_{FS_当前类目}_热点}最后显示{FS_最新信息_热点}
并没有调用出最新里面的内容,我单独{FS_最新信息_热点}是能使用的。
大家知道什么原因吗?