NewsFeaturesDownloadsDevelopmentSupportAbout Us

Plugin secret

From LifeType Wiki


Name: Secret Post

Latest version: 1.1

Download link: http://prdownloads.sourceforge.net/lifetype/1.1_secret.zip?download

License: GPL

Author: The LifeType Project

Description

This plugin offers the password protect to specific articles, unless user provide the right password or they can not see the articles.

Configuration

The plugin configuration page can be found under Control Center->Security Management.

Please enable it before use it.

Notes

How to prevent the secret post show in Summary and RSS template? Here comes the solution (Take summary/post.template as example):

// get the value object of password_protected attribute
{assign var=isSecretField value=$post->getFieldObject("password_protected")}
// if the value object is empty or !=1 , then we show ths post in summary
{if empty($isSecretField) || $isSecretField->getValue() != 1}

{assign var="blog" value=$post->getBlogInfo()}
{assign var="request" value=$blog->getBlogRequestGenerator()}
<h5>{$post->getTopic()}</h5>
<div class="subtitle">
{$locale->tr("blog")} <a href="{$request->blogLink()}">{$blog->getBlog()}</a>
</div>
<p>
{$post->getText()|strip_tags|truncate:200:"..."}
</p>
<div class="peu">

{assign var="postCategories" value=$post->getCategories()}
{assign var="postOwner" value=$post->getUserInfo()}
{assign var="postDate" value=$post->getDateObject()}
<a href="{$request->postPermalink($post)}" class="noborder">
<img src="imgs/post.png" width="10" height="11" alt="Permalink" />
</a>
 {$locale->tr("posted_by")} {$postOwner->getUsername()}, {$locale->formatDate($postDate,"%e %B %Y")} |
<img src="imgs/comment.png" width="11" height="10" alt="{$locale->tr("comments")}" /> 
<a href="{$request->postPermalink($post)}#comments">{if $post->getTotalComments() eq 0}{$locale->tr("comment on this")}{else}{$post->getTotalComments()} {$locale->tr("comments")|capitalize}{/if}</a>
<br style="clear: both;" />
</div>
{/if}