Goal
在每一頁wiki page上顯示本頁最後更新日期
Solution
我懶得切到history頁面看最後修改日期,又沒外掛可用,只好自己試,作法很簡單
- modify local/config.php,add:
$LastUpdate = "<div id='last_udpate'>last updated at " . @strftime("%Y/%m/%d", filectime("$WorkDir/$pagename")) . "</div>";
- modify template(pub/skins/XXX/XXX.tmpl),add the following code before
<!--PageText-->
:
$LastUpdate
- modify your CSS(pub/skins/XXX/XXX.css),我是設為靠右占一行空間:
#last_udpate { display: block; text-align: right; font-weight: bold; }
2006-10-23 udpated:strftime()之前補上’@',新增頁面時才不會因找不到檔案輸出錯誤訊息。FALSE = 0 -> 時間顯示1970/01/01,a bad but easy way to fix this.
沒有留言:
張貼留言