Plugin articlereferers
From LifeType Wiki
Name: Article Referers
Latest version: 1.0
Download link: http://prdownloads.sourceforge.net/lifetype/1.1_articlereferers.zip?download
License: GPL
Author: Mark Wu
[edit] Description
This plugin offers you to get the referers of the specific article.
[edit] Configuration
The plugin configuration page can be found under Control Center->Recent Activities Management.
You can use any of the following methods:
- $articlereferers->isEnabled() to check the plugin is enabled or not.
- $articlereferers->getArticleReferers( $articleId, $maxReferers , $sortByField ) to get the article referers.
Where:
- $articleId is the specific ariticle id
- $maxReferers is the the max referers you want to show. 0 means show all referers. Default is 10.
- $sortByField is the order of referers. 1 means sort by hits, and 2 means order by last visit date. Default is 1
The following is an example of usage, add the next lines to postandcomments.template:
Add the following code to postandcomments.template:
{if $articlereferers && $articlereferers->isEnabled()}
<p>
<h3>{$locale->tr("referers")}</h3>
{assign var=postid value=$post->getId()}
{assign var=referers value=$articlereferers->getArticleReferers($postid)}
{foreach from=$referers item=referer}
<li><a href="{$referer->getUrl()}">{$referer->getUrl()|truncate:60:"..."|escape}</a> ({$referer->getCount()})</li>
{/foreach}
</p>
{/if}
