動(dòng)易CMS如何實(shí)現(xiàn)“頂”排行_動(dòng)易Cms教程
SiteWeaver6.6加入了頂功能,有些用戶想頂之后查看文章的時(shí)候顯示的是頂?shù)淖疃嗟奈恼拢@個(gè)可以用一個(gè)自定義標(biāo)簽來(lái)實(shí)現(xiàn),下面說一下實(shí)現(xiàn)的步驟。
自定義標(biāo)簽定義如下。
標(biāo)簽名:{$MY_頂排行(參數(shù)列表)}
參數(shù):
Num 顯示“頂”排行的個(gè)數(shù)
ChannelID 頻道ID,0為不限制,如需取多個(gè)頻道請(qǐng)用逗號(hào)隔開,中括號(hào)括起,比如[1,2,3]
ClassID 欄目ID,0為不限制,如需取多個(gè)頻道請(qǐng)用逗號(hào)隔開,中括號(hào)括起,比如[1,2,3]
TitleLen 標(biāo)題長(zhǎng)度
ContentLen 內(nèi)容長(zhǎng)度
ShowContnet 是否顯示內(nèi)容,True為顯示,F(xiàn)alse為不顯示
ShowOthers 是否顯示加入收藏,推薦給好友等內(nèi)容,True為顯示,F(xiàn)alse為不顯示
sql語(yǔ)句:
access數(shù)據(jù)庫(kù):
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ù)庫(kù):
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)更好的方法,請(qǐng)跟帖說明。
標(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>
--------------
效果圖


- MAC錯(cuò)誤的解決方法
- 如何屏蔽動(dòng)易后臺(tái)導(dǎo)航里的某個(gè)功能菜單?
- 動(dòng)易.NET版本留言自動(dòng)選定欄目方法
- 動(dòng)易SiteFactoty整合Discuz!NT3.0
- 在任意位置獲取根節(jié)點(diǎn)ID標(biāo)簽
- 如何開啟SiteWeaver6.8的支持,反對(duì)功能
- Windows 2008安裝動(dòng)易.NET系統(tǒng)之四----動(dòng)易系統(tǒng)安裝篇
- Windows 2008安裝動(dòng)易.NET系統(tǒng)之三----數(shù)據(jù)庫(kù)篇
- Windows 2008安裝動(dòng)易.NET系統(tǒng)之二----IIS、目錄環(huán)境配置篇
- 數(shù)據(jù)庫(kù)修復(fù),SQL Server 2005內(nèi)部操作不一致的處理
- 如何安裝動(dòng)易.net程序權(quán)限配置
- 為什么提示對(duì)Windows系統(tǒng)文件夾下的Temp目錄沒有訪問權(quán)限?
- 相關(guān)鏈接:
- 教程說明:
動(dòng)易Cms教程-動(dòng)易CMS如何實(shí)現(xiàn)“頂”排行
。