LifeType 中文開發論壇

開發 => 外掛程式 => 主題作者是: sadspat 於 三月 25, 2006, 05:44:05 下午



主題: karma安裝一問
作者: sadspat三月 25, 2006, 05:44:05 下午
我已照著readme的指示更改post.template
但卻一直無法使用評鑑的功能,總是顯示The requested URL /life/karma.php was not found on this server.
問題出在哪?我上哪找karma.php啊~(已經弄一天了><)
各位前輩救救我呀~
如下
引用
<!-- {$url->postTrackbackLink($post)} -->
<h3>{$post->getTopic()}</h3>
{assign var="postDate" value=$post->getDateObject()}
{assign var="postOwner" value=$post->getUserInfo()}
<span class="date">{$postOwner->getUsername()} | {$locale->formatDate($postDate,"%d %B, %Y %H:%M")}</span>
<p>
 {$post->getText()}
</p>
<div class="footer">
   {foreach name=categories from=$post->getCategories() item=postcategory}
     <a href="{$url->categoryLink($postcategory)}">{$postcategory->getName()}</a>
     {if !$smarty.foreach.categories.last}, {/if}
   {/foreach}
:: <a href="{$url->postPermalink($post)}">{$locale->tr("comment on this")} ({$post->getTotalComments()})</a> :: <a title="{$locale->tr("permalink_title")}" href="{$url->postPermalink($post)}">{$locale->tr("permalink")}</a> :: <a href="{$url->postTrackbackStatsLink($post)}">{$locale->tr("trackbacks")} ({$post->getNumTrackbacks()})</a>
{if !empty($karma)}
{if $karma->isEnabled()}
{assign var="positiveKarma" value=$post->getField("positiveKarma")}{if $positiveKarma == ""}{assign var="positiveKarma" value=0}{/if}
{assign var="negativeKarma" value=$post->getField("negativeKarma")}{if $negativeKarma == ""}{assign var="negativeKarma" value=0}{/if}
 :: {$locale->tr("karma")} (<a href="{$karma->getPositiveUrl($post)}">+{$positiveKarma}</a>/<a href="{$karma->getNegativeUrl($post)}">-{$negativeKarma}</a>)
{/if}
{/if}
</div>


主題: Re: karma安裝一問
作者: bibicall三月 25, 2006, 09:19:50 下午
你有仔細依照 readme 說的步驟作嗎?

1. Configurate your Host Block plugin in your pLog control center
2. Modify you post.template with the follow code to get karma link:
程式碼:
{if !empty($karma)}
{if $karma->isEnabled()}
{assign var="positiveKarma" value=$post->getField("positiveKarma")}{if $positiveKarma == ""}{assign var="positiveKarma" value=0}{/if}
{assign var="negativeKarma" value=$post->getField("negativeKarma")}{if $negativeKarma == ""}{assign var="negativeKarma" value=0}{/if}
 :: {$locale->tr("karma")} (<a href="{$karma->getPositiveUrl($post)}">+{$positiveKarma}</a>/<a href="{$karma->getNegativeUrl($post)}">-{$negativeKarma}</a>)
{/if}
{/if}
3. Modify your header.template or footer.template to get unmoderated post link:
程式碼:
{if !empty($karma)}
{if $karma->isEnabled()}
<li><a title="{$locale->tr("karma_moderated_down_articles")}" href="{$karma->pluginTemplatePage()}">{$locale->tr("karma_moderated_down_articles")}</a></li>
{/if}
{/if}

又,karma資料夾是否有完整上傳到 plugin下面?


主題: Re: karma安裝一問
作者: sadspat三月 26, 2006, 03:07:37 上午
確實已照著做了
有出現+0、-0 不過按下去就是顯示Not Found
難道是貼錯地方了?

下午兩點更新
--------------------------------------------------------
剛剛用了很奇怪的方法、
就是將plog根目錄下的index.php
複製一份改為karma.php並放在plog的根目錄
結果竟然可以執行了
這是什麼原理呢?(還是原本就要這麼做啊?)