SiteWeaver6.6加入了頂功能,有些用戶想頂之后查看文章的時(shí)候顯示的是頂?shù)淖疃嗟奈恼拢@個(gè)可以用一個(gè)自定義標(biāo)簽來實(shí)現(xiàn),下面說一下實(shí)現(xiàn)的步驟。
自定義標(biāo)簽定義如下。
標(biāo)簽名:{$MY_頂排行(參數(shù)列表)}
參數(shù):
Num 顯示“頂”排行的個(gè)數(shù)
ChannelID 頻道ID,0為不限制,如需取多個(gè)頻道請用逗號隔開,中括號括起,比如[1,2,3]
ClassID 欄目ID,0為不限制,如需取多個(gè)頻道請用逗號隔開,中括號括起,比如[1,2,3]
TitleLen 標(biāo)題長度
ContentLen 內(nèi)容長度
ShowContnet 是否顯示內(nèi)容,True為顯示,F(xiàn)alse為不顯示
ShowOthers 是否顯示加入收藏,推薦給好友等內(nèi)容,True為顯示,F(xiàn)alse為不顯示
sql語句:
access數(shù)據(jù)庫:
select top {input(0)} * from PE_Article where status=3 and Deleted = {$PE_False} and MY_upart<>'' and ChannelID in ({input(1)}) and ClassID in ({input(2)}) Order by cint(MY_upart) desc
Sql數(shù)據(jù)庫:
select top {input(0)} * from PE_Article where status=3 and Deleted = {$PE_False} and MY_upart<>'' and ChannelID in ({input(1)}) and ClassID in ({input(2)}) Order by convert(int,MY_upart) desc
注:自定義字段暫時(shí)沒有整數(shù)型的,所以排序的時(shí)候需要轉(zhuǎn)化為數(shù)字型,如果您發(fā)現(xiàn)更好的方法,請跟帖說明。
標(biāo)簽內(nèi)容:
<table style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid;">
<tr>
<td>{Loop}{Infobegin}
<table width=100%>
<tr>
<td width=80 style="border-bottom: 1px dashed #ccc;"><IFRAME style="MARGIN-LEFT: 15px" src="{$InstallDir}ding.asp?articleid={$Field(0,Text,0,0,0)}" frameBorder=0 width=60 scrolling=no height=70></IFRAME></td>
<td style="border-bottom: 1px dashed #ccc;">
<table width=100%>
<tr>
<td style="FONT-SIZE: 10pt; text-align: left;"><A href="{$InstallDir}{$Field(0,GetUrl,Article,1)}"><STRONG>{$Field(3,Text,{input(3)},0,0)}</STRONG></A></td>
</tr>
{$YN({input(5)},<tr><td>{$Field(19,Text,{input(4)},2,0)} <A href="{$InstallDir}{$Field(0,GetUrl,Article,1)}">>>詳細(xì)</A> </td></tr>,)}
{$YN({input(6)},<tr><td><IMG src="{$InstallDir}images/Special_List7.gif" border=0><A href="{$InstallDir}User/User_Favorite.asp?Action=Add&ChannelID={$Field(1,Text,0,0,0)}&InfoID={$Field(0,Text,0,0,0)}">加入收藏</A> <IMG src="{$InstallDir}images/Special_List7.gif" border=0><A href="{$InstallDir}{$Field(1,GetChannel,1)}/SendMail.asp?ArticleID={$Field(0,Text,0,0,0)}" target=_self>推薦給朋友</A></td></tr>,)}
</table>
</td>
</tr>
</table>
{Infoend}{/Loop} </td>
</tr> </table>
--------------
效果圖
|
新聞熱點(diǎn)
疑難解答
圖片精選