LifeType 1.0/Plugins/karma

LifeType 1.0/Plugins/karma

出自LifeType 中文文件計畫

(修訂版本間差異)
跳轉到: 導航, 搜尋
(注意事項)
第53行: 第53行:
= 注意事項 =
= 注意事項 =
-
 
-
其他需要使用者特別注意的事項,或是告知潛在的問題。
 
[[Category:Plugins]]
[[Category:Plugins]]

在2006年11月4日 (六) 07:50所做的修訂版本


名稱: karma

版本: 1.0

下載連結http://prdownloads.sourceforge.net/lifetype/1.1_karma.zip?download

程式授權: GPL

作者Oscar Renalias

用途

This plugin offers karma rating for posts and allows your readers to rate up or down posts and even to have them removed from the front page automatically whenever they reach a certain amount of negative votes.

設定

After unpacking the plugin, make sure to move the karma.php file to the root folder of pLog, so that it appears at the same level as index.php or admin.php. If not, the plugin will not work and you will get repeated 404 errors when trying to place votes for a post.

The plugin uses 2 custom post fields in order to store the information about votes, so it is not advisable to remove these fields:

  • positiveVotes
  • negativeVotes

Posts that have been moderated down will be marked with a custom status called "Karma Moderated down". In order to change either the status of the moderation status of the post or the number of votes it has received, the only thing we need to is to edit the post and save it. However, this is not recommended.

The following changes to the postandcomments.template files are needed in order to display the correct links to allow users to give positive or negative votes to a post:

  1. {if !empty($karma)}
  2. {if $karma->isEnabled()}
  3. {assign">assign">assign var="positiveKarma" value=$post->getField("positiveKarma")}
  4. {if $positiveKarma == ""}{assign">assign">assign var="positiveKarma" value=0}{/if}
  5. {assign">assign">assign var="negativeKarma" value=$post->getField("negativeKarma")}
  6. {if $negativeKarma == ""}{assign">assign">assign var="negativeKarma" value=0}{/if}
  7.  :: {$locale->tr("karma")} (<a href="{$karma->getPositiveUrl($post)}">+{$positiveKarma}</a>/<a href="{$karma->getNegativeUrl($post)}">-{$negativeKarma}</a>)
  8. {/if}
  9. {/if}

It is also possible to make the plugin generate a page including all the moderated down articles. In order to create a link to that page, add the following Smarty code anywhere in your templates:

  1. {if !empty($karma)}
  2. {if $karma->isEnabled()}
  3. <li><a title="{$locale->tr("karma_moderated_down_articles")}" href="{$karma->pluginTemplatePage()}">{$locale->tr("karma_moderated_down_articles")}</a></li>
  4. {/if}
  5. {/if}

The template used to generate this page can be found under plugins/karma/templates/moderateddownlist.template. The same template file is used for all blogs.

注意事項