名稱: 文章置頂及公告 版本: 1.1 ( 支持LifeType 1.1.x) 下載連結: http://sourceforge.net/projects/lifetype/ or http://www.pactofshadow.com/lifetype/2/articleperma/40.html 程式授權: GPL 作者: lss(1.0) / EagleKing(porting to 1.1) 用途 提供網志做文章置頂及用文章做為網站公告。 設定 後台管理部份: 1. 首先請建立兩個文章分類存放公告及置頂文章。 2. 你可以在 個人網志設定 >> 置頂及公告文章設定 進行各項設定。 3. 預設的置頂文章數目及公告文章數目是 5 篇文章,你可以修改成你要顯示的數目。 4. 在選單中選擇存放置頂文章及公告文章的分類。 在樣版檔案裡,你可以使用: 1. $stickyposts->isEnabled() 檢查 plugin 是否已經啟用。 2. $stickyposts->getArticles( 'sticky' ) 傳回置頂文章的 article 陣列,最多傳回所設定的置頂文章數目。 3. $stickyposts->getArticles( 'announce' ) 傳回公告文章的 article 陣列,最多傳回所設定的公告文章數目。 4. $stickyposts->getArticles( 12 ) 傳回指定文章分類 ID 的所有文章 article 陣列。本例中的 12 為文章分類 ID。 5. $stickyposts->getCategory( 'sticky' ) 傳回用於置頂文章的 category 物件,可用來做成更多置頂文章超連結。 6. $stickyposts->getCategory( 'announce' ) 傳回用於公告文章的 category 物件,可用來做成更多公告文章超連結。 7. $stickyposts->getCategory( 12 ) 傳回指定文章分類 ID 的 category 物件。 其中 'sticky' 和 'announce' 是 plugin 的保留字。 樣版檔範例: 以默認的 'standrad' 樣版為例做修改。 在{if $category}

{$locale->tr("category")}: {$category->getName()}

{/if} 下面添加 {if empty($showAll) && $stickyposts->isEnabled()}

Sticky Posts

{assign var=stickys value=$stickyposts->getArticles('sticky')} {foreach from=$stickys item=post}

{$post->getTopic()}

{/foreach} {assign var=stickyCategory value=$stickyposts->getCategory('sticky')}

More Sticky...

Announce Posts

{assign var=stickys value=$stickyposts->getArticles('announce')} {foreach from=$stickys item=post}

{$post->getTopic()}

{/foreach} {assign var=announceCategory value=$stickyposts->getCategory('announce')}

More Announce...

{/if}