名称: 文章置顶及公告 版本: 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}