給Zoe Song – 加迴響

在部落格HowTo中, Topic 15記錄了甘老師教的加迴響。
 
由於每個人使用的模版不同, code也會小有不同, 除了甘老師貼的code外, 必須按照每個模版的設計, 小有改變。
 
例如: Zoe老師選用的模版是0911_01, 下列藍色部分是原來就在right.template中; 紫色部分是貼入甘老師的code; 紅色的兩行是按照此模版, 加入的兩段。
 
存檔, 應該就可以顯示迴響了。試試看, 不難的。 
 

…..
<div class="date">
<h2>{$locale->tr("calendar")}</h2>
{$calendar}
</div>
<div class="article">
<h2>最新迴響</h2>
{assign var=comments value= $recentcomments->getRecentComments()}
<table width="180" border="0" cellspacing="0" cellpadding="0">
<tr><ul>
<div align="left">
{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></br>
{$comment->getText()|truncate:100:"…"|strip_tags}
</a>{/foreach}</ul></tr></table>
</div> 
<div class="recently">
<h2>{$locale->tr("recently")}</h2>
….. 
 
 
另外, 文建會的動畫插入, 會自動播放, 很吵。  
建議:  可以用分段隔開, 就不會在首頁聽到不明來源的聲音了。

Posted in 問題與討論 by with comments disabled.