Tommy 碎碎念

Tommy Wu's blog

LifeType RecentComment 顯示修正
post by tommy @ 21 十月, 2012 15:41

前幾天在有人新增 comment 之後, 發現整個網站的顯示格式大亂. 找了一下, 發現是在顯示最近留言功能裡頭, 會把留言截短之後再透過 strip_tags 處理. 像是這樣:

<li><a title="View comments by {$comment->getUsername()}" href="{$url->postPermalink($commentpost)}#{$comment->getId()}"><b>{$comment->getUsername()}¡G</b>{$comment->getText()|truncate:100:"..."|strip_tags}</a></li>

但是, 先做 truncate, 就可能造成 tag 變成有頭沒有尾, 所以後面的 strip_tags 也就沒什麼作用了.

改成先做 strip_tags 再去處理 truncate 就應該可以避免這個問題了.

<li><a title="View comments by {$comment->getUsername()}" href="{$url->postPermalink($commentpost)}#{$comment->getId()}"><b>{$comment->getUsername()}¡G</b>{$comment->getText()|strip_tags|truncate:100:"..."}</a></li>

改好後看起來就正常了.  (如果怕有其它的情形... 也許後面再加上一個 escap 來濾掉一些字元也可以)

Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade to LifeType 1.2.12 r7162
post by tommy @ 25 十一月, 2011 09:30

Server 改用 nginx/fastcgi/php-fpm 的方式執行. 由於新加入的 php5-intl 與原本的 Locale 衝突, 所以順便升級到 1.2.12 2011/11/24 的 snapshot 版本.

Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade LifeType to 1.2.7
post by tommy @ 31 三月, 2008 11:15
upgrade LifeType to 1.2.7, modify authimage, show extra 2 digits.
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade LifeType to 1.2.5
post by tommy @ 23 十二月, 2007 09:49
upgrade to LifeType 1.2.5
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade LifeType to 1.2.4
post by tommy @ 20 七月, 2007 13:22
upgrade LifeType to 1.2.4
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade LifeType to 1.2.3
post by tommy @ 09 六月, 2007 21:03
upgrade LifeType to 1.2.3.
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade LifeType to 1.2.2
post by tommy @ 19 五月, 2007 04:40
upgrade to LifeType 1.2.2
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade LifeType to 1.2.1
post by tommy @ 16 四月, 2007 17:18
upgrade lifetype to 1.2.1
Del.icio.us Furl HEMiDEMi Technorati MyShare
新增 TinyMCE 的 insertcode 外掛, 並修正某些外掛無法使用 gzip 壓縮的問題
post by tommy @ 04 四月, 2007 21:51

新增 TinyMCE 的 insertcode 外掛, 並修正某些外掛無法使用 gzip 壓縮的問題. (閱讀全文)

Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade to LifeType 1.2
post by tommy @ 21 三月, 2007 11:35

upgrade to LifeType 1.2

新增一些書籤網站的連結在每篇文章後面. 並修正 LifeType 1.2 對於 & 的處理問題.

Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade LifeType to 1.1.6
post by tommy @ 26 二月, 2007 22:23
upgrade LifeType to 1.1.6
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade LifeType to 1.1.5
post by tommy @ 02 二月, 2007 17:11
upgrade to LifeType 1.1.5, also upgrade bad behavior to 2.0.10.
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade to LifeType 1.1.4
post by tommy @ 13 元月, 2007 18:47
upgrade to LifeType 1.1.4
Del.icio.us Furl HEMiDEMi Technorati MyShare
加上 Bad Behavior 2
post by tommy @ 12 元月, 2007 14:43
近來 spam trackback 不少, 每天都有, 所以加上 Bad Behavior 2, 希望能擋掉一些.
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade TinyMCE GZIP to 1.10
post by tommy @ 07 元月, 2007 18:42
upgrade TinyMCE GZIP to 1.10
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade to LifeType 1.1.3
post by tommy @ 12 十二月, 2006 13:17
upgrade to LifeType 1.1.3
Del.icio.us Furl HEMiDEMi Technorati MyShare
更改 LifeType Admin Panel 寬度
post by tommy @ 04 十二月, 2006 08:43
參考: http://blog.teatime.com.tw/1/post/161
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade to LifeType 1.1.2
post by tommy @ 16 十一月, 2006 13:10
upgrade to LifeType 1.1.2
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade TinyMCE to 2.0.8
post by tommy @ 24 十月, 2006 21:17
upgrade TinyMCE to 2.0.8
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade to LifeType 1.1.1
post by tommy @ 23 十月, 2006 11:32
upgrade to LifeType 1.1.1
Del.icio.us Furl HEMiDEMi Technorati MyShare
加入自製 BlogLook 外掛
post by tommy @ 23 十月, 2006 10:47
加入自製 BlogLook 外掛.
Del.icio.us Furl HEMiDEMi Technorati MyShare
更改 authimage 的圖形
post by tommy @ 16 十月, 2006 13:54
將 authimage 的圖形產生方式改用 better captcha 的方式.
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade to LifeType 1.1
post by tommy @ 07 九月, 2006 15:40
upgrade to LifeType 1.1 (閱讀全文)
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade to LifeType 1.1 beta 2
post by tommy @ 16 八月, 2006 19:08
upgrade to LifeType 1.1 beta 2
Del.icio.us Furl HEMiDEMi Technorati MyShare
upgrade to LifeType 1.1 20060801 snapshot
post by tommy @ 02 八月, 2006 13:48
upgrade to LifeType 1.1 20060801 snapshot (閱讀全文)
Del.icio.us Furl HEMiDEMi Technorati MyShare
Bad Behavior 已經阻擋了 208 個過去 7 天試圖闖關的垃圾迴響與引用。
Power by LifeType. Template design by JamesHuang. Valid XHTML and CSS