華龍國小LifeType學習網

使用hostblock來阻擋特定主機

天發現,在目前這網誌裡出現了一堆「垃圾文章逆向連結」,在管理後台的統計資料裡,也可以看到。每次都是1、200百筆的垃圾,實在很討厭。

去看了 /var/log/httpd/access.log,查到了該IP,原本想使用學校防火牆直接檔掉這個IP,不過突然想到,LT裡不知道有沒有這樣功能的plugins?

找到了,就是hostblock 這個plugin。

 (閱讀全文)


修改gallery plugin

之前在論壇上有人討論使用gallery plugin 無法回到上一層相簿的問題。

我這裡Gallery的版本原為Gallery2,因為這問題並沒有在我這發生過,心想會不會是 Gallery2.1RC1 的關係,所以在我將Gallery2升級到2.1RC1 之後,這問題就產生了。

還好在 Tommy 碎碎念 的網站上,已寫出了幾篇文章,就可以解決我的這些問題。

真是太感謝 Tommy了。

 (閱讀全文)


最多閱讀文章 (Top Read Posts)

本外掛程式提供依照閱讀次數由大到小所排序的文章列表~from LifeType中文文件計畫

 

結果:
例如在我這blog右邊有個『熱門文章』的區塊,它會顯示我這blog裡閱讀次數最多的前10篇文章(文章篇數可自行設定)‧

 (閱讀全文)


「最近迴響」的語法

{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 href="{$url->postPermalink($commentpost)}#{$comment->getId()}">
<b>{$comment->getUsername()}:</b>
{$comment->getText()|truncate:100:"..."|strip_tags}
</a>
</li>
{/foreach}
</ul>
{/if}

Cool資料來源


檢查plog的plugin是否啟動的語法

 

 {if !empty($recentcomments)} // 檢查 plugin 存不存在
{if $recentcomments->isenabled()} // 檢查 plugin 有沒有啟動。
....
....
{/if}
{/if}

這樣就可以避免如果使用者沒裝 plugin 時會造成錯誤。Innocent

from: pLog 中文開發論壇