3.2.sp1实现通用标签[方法说明]_风讯Cms教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

通用标签一直是大家所希望有的,前段时间,我改了几个标签,实现通用。我本来在想能否用更简单的方法来实现,但是一直没想出来,呵呵~(水平太差^_^)。就只好提供一个标签函数修改的方法给大家参考一下,并非所有的标签都可以用。修改的时候,请注重一下。

我用推荐新闻的标签函数做个示例:

打开\ foosun\admin\Refresh\RefreshFunction.asp 搜索:Function RecNews找到推荐新闻的标签函数:

Function RecNews(ClassEName,SoonClassStr,NewNumberStr,TitleNumberStr,RowNumberStr,NaviPicStr,CompatPicStr,OpenTypeStr,CSSStyleStr,RowHeightStr,TxtNaviStr)
Dim RecNewsSql,RsRecNewsObj,i
TitleNumberStr = GetTitleNumberStr(TitleNumberStr)
OpenTypeStr = GetOpenTypeStr(OpenTypeStr)
CompatPicStr = GetCompatPicStr(CompatPicStr,"","",RowNumberStr)
NaviPicStr = GetNewsNavitionStr(TxtNaviStr,NaviPicStr)
if RowHeightStr <> "" then RowHeightStr = " Height=""" & RowHeightStr & """"
'-------------
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 '当标签所选栏目为空时
If SoonClassStr="1" then '当选择了包含子类时
Select Case Fun_Refresh_Type '选择当前所在的类别
Case "Class" '当当前类别为栏目的时候
EndClassIDList = "'" & Fun_Refresh_ID & "'" & AllChildClassIDStrList(Fun_Refresh_ID) 'EndClassIDList取值为当前的栏目的栏目id加其所有子栏目的栏目id
Case "News" '当当前的列别为新闻页面时
dim temp1rs,temp1sql,temp1id
temp1sql = "select classid from fs_news where newsid = '" & Fun_Refresh_ID & "'"
set temp1rs = conn.execute(temp1sql)
if not temp1rs.eof then
temp1id = temp1rs("classid")
end if
EndClassIDList = "'" & temp1id & "'" 'EndClassIDList取值为当前新闻所在的栏目id
Case Else
EndClassIDList = "" '当当前类别不在所列出的类别之内时EndClassIDList取空值
End Select
else '当标签所选栏目为空,并却不包含子类时
EndClassIDList = "'" & Fun_Refresh_ID & "'" 'EndClassIDList取值为当前栏目的栏目id
end if
end if
if EndClassIDList <> "" then '当EndClassIDList的值不为空的时候

查看更多 风讯cms教程  风讯cms模板

共2页上一页12下一页
来源:模板无忧//所属分类:风讯Cms教程/更新时间:2006-06-17
相关风讯Cms教程