メインコンテンツにローカルの投稿コンテンツを指定した場合に最新のコメントを確認できるようイメージを追加表示できるようにしました。
--- plugin.php.bak 2008-08-04 02:34:30.000000000 +0900
+++ plugin.php 2008-08-04 04:29:16.000000000 +0900
@@ -79 +79,20 @@
- $str .= '<a href="' . $url . '">' . $title . '</a><br />';
+ //$str .= '<a href="' . $url . '">' . $title . '</a><br />';
+ $str .= '<a href="' . $url . '">' . $title . '</a>';
+ if (strpos($url, 'index.php') !== false) {
+ $inentry = substr($url, strpos($url, '=') + 1, strlen($url) - (strpos($url, '=') + 1));
+ $indate = substr($inentry, 5, 6);
+ $iny = substr($indate, 0, 2);
+ $inm = substr($indate, 2, 2);
+ $indir = CONTENT_DIR . $iny . '/' . $inm . '/' . $inentry . '/comments/';
+ $in_array = sb_folder_listing($indir, array( '.txt', '.gz'));
+ $lastcomment = array_pop($in_array);
+ if (!is_null($lastcomment)) {
+ $lastdate = substr($lastcomment, 7, 6);
+ if ((mktime(0, 0, 0, date("m"), date("d"), date("y")) - mktime(0, 0, 0, substr($lastdate,2,2), substr($lastdate,4,2), substr($lastdate,0,2))) / (60 * 60 * 24) < 3) {
+ $str .= '<a href="' . $url . '"><img src="images/hot.png" border="0" /></a>';
+ } else {
+ $str .= '<a href="' . $url . '"><img src="images/cold.png" border="0" /></a>';
+ }
+ }
+ }
+ $str .= '<br />';
@@ -210 +229 @@
-?>
\ No newline at end of file
+?>
hot.png と cold.png は任意の画像データに上書きできるので、画像のアップロードからアップロードしてください。