Name: stickyposts
Latest version: 1.0
Download link: http://sourceforge.net/projects/lifetype/
License: GPL
Author: lss

Description

This plugin offers features to get all articles from specific article cateogries as announcements and sticky articles.

Configuration

In ControlCenter:

   1. Create two categories for Sticky and Annouce.
   2. You can configure this plugin in controlcetner >> StickyPosts .
   3. maxStickys and maxAnnouces are numbers of sticky/announce articles for display in blog. The default value is 5.
   4. Select category for store sticky/announce articles. 

In tempalte file, You can use:

   1. $stickyposts->isEnabled() to check the plugin is enabled or not.
   2. $stickyposts->getArticles( 'sticky' ) to get an array of articles for sticky.
      This will get max articles you set in controlcenter.
   3. $stickyposts->getArticles( 'announce' ) to get an array of articles for announce.
      This will get max articles you set in controlcenter.
   4. $stickyposts->getArticles( 12 ) to get an array of all articles for categoryId = 12.
   5. $stickyposts->getCategory( 'sticky' ) to get an category object for sticky articles.
   6. $stickyposts->getCategory( 'announce' ) to get an category object for annuonce articles.
   7. $stickyposts->getCategory( 12 ) to get an category object for categoryId = 12. 

Where the 'sticky' and 'announce' are plugin reverse string.

Example: This is a very simple example for use stikcyposts plugin in template, Rewrite it as you like. This example modifies main.template of template 'blueish'.

{include file="$blogtemplate/header.template"}
<div id="content">
{if $stickyposts->isEnabled()}
  <h2>Sticky Posts</h2>
  {assign var=stickys value=$stickyposts->getArticles('sticky')}
  {foreach from=$stickys item=post}
      <h2 class="title"><a href="{$url->postPermalink($post)}">{$post->getTopic()}</a></h2>
  {/foreach}
  {assign var=stickyCategory value=$stickyposts->getCategory('sticky')}
  <h4><a href="{$url->categoryLink($stickyCategory)}">more sticky posts</a></h4>
  
  <h2>Announce Posts</h2>
  {assign var=stickys value=$stickyposts->getArticles('announce')}
  {foreach from=$stickys item=post}
      <h2 class="title"><a href="{$url->postPermalink($post)}">{$post->getTopic()}</a></h2>
  {/foreach}
  {assign var=announceCategory value=$stickyposts->getCategory('announce')}
  <h4><a href="{$url->categoryLink($announceCategory)}">more announce posts</a></h4>
  
  {foreach from=$posts item=post}
    {include file="$blogtemplate/post.template"}
  {/foreach}
{/if}  
</div>
{include file="$blogtemplate/panel.template"}
{include file="$blogtemplate/footer.template"}

Notes

May someone kindly make an good example of template. I make a very bad one.

Retrieved from "http://wiki.lifetype.net/index.php/PLog_1.0/Plugins/stickyposts"

Categories: Plugins
