LifeType 1.0/Plugins/recentcomments

LifeType 1.0/Plugins/recentcomments

出自LifeType 中文文件計畫

(修訂版本間差異)
跳轉到: 導航, 搜尋
第5行: 第5行:
'''版本''': 1.0
'''版本''': 1.0
-
'''下載連結''': http://prdownloads.sourceforge.net/plog/recentcomments.zip?download
+
'''下載連結''': http://prdownloads.sourceforge.net/lifetype/recentcomments.zip?download
'''程式授權''': GPL
'''程式授權''': GPL

在2005年12月15日 (四) 05:52所做的修訂版本


名稱: 最近迴響

版本: 1.0

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

程式授權: GPL

作者Mark Wu

用途

本外掛程式提供網誌的最近迴響列表。

設定

你可以在 設定中心->最近活動管理下找到本外掛設定頁面。

你可以使用:

  1. $recentcomments->isEnabled() 來檢查外掛是否啟用。
  2. $recentcomments->getRecentComments( $maxComments , $based ) 來取得最近迴響。

其中:

  1. $maxComments 是你所要顯示的最大迴響數目。預設值是10。
  2. $based 是用來傳回整個網站或是整個網誌的迴響。 "BLOG"表示整個網誌,"SITE"表示整個網站。預設值是"BLOG"。

將下列代碼新增到footer.templateheader.template

{if $recentcomments->isEnabled()}
<h2>Recent Comments</h2>
{assign var=comments value=$recentcomments->getRecentComments()}
<ul>
{foreach from=$comments item=comment}
{assign var=commentpostid value=$comment->getArticleId()}
{assign var=commentpost value=$recentcomments->getArticle($commentpostid)}
<li><a title="View comments by {$comment->getUsername()}" href="{$url->postPermalink($commentpost)}#{$comment->getId()}"><b>{$comment->getUsername()}:</b>{$comment->getText()|truncate:100:"..."|strip_tags}</a></li>
{/foreach}
</ul>            
{/if}

注意事項