| 1 | # -*- perl -*- |
|---|
| 2 | ### ユーザ設定項目 ### |
|---|
| 3 | |
|---|
| 4 | # -------------------------------------------------------------------- |
|---|
| 5 | # 日記の名前 |
|---|
| 6 | $changelog_name = "Perl News - らくだニュース"; |
|---|
| 7 | |
|---|
| 8 | # -------------------------------------------------------------------- |
|---|
| 9 | # ChangeLog を公開する URL (絶対 URL を強く推奨) - RSS に必要 |
|---|
| 10 | # 例: $clog_url = "http://chalow.net/"; |
|---|
| 11 | $clog_url = "http://perl-users.jp/news/"; # 必ず URL を設定して下さい |
|---|
| 12 | |
|---|
| 13 | # -------------------------------------------------------------------- |
|---|
| 14 | # インデックスページ (index.html) で最近何日分を表示するか |
|---|
| 15 | # (コマンドラインオプション "-n" でも指定できます) |
|---|
| 16 | $opt_topn = 7; |
|---|
| 17 | |
|---|
| 18 | # -------------------------------------------------------------------- |
|---|
| 19 | # 日ごとにページを作るか (0:NO, 1:YES) --- obsolete |
|---|
| 20 | #$day_page_mode = 1; |
|---|
| 21 | |
|---|
| 22 | # -------------------------------------------------------------------- |
|---|
| 23 | # 作成するページの単位 (0:月, 1:日, 2:アイテム) |
|---|
| 24 | $page_mode = 2; |
|---|
| 25 | |
|---|
| 26 | # -------------------------------------------------------------------- |
|---|
| 27 | # 自動文字列置換 |
|---|
| 28 | $auto_replace = ' |
|---|
| 29 | s!(<blockquote>)!</p>$1!g; |
|---|
| 30 | s!(</blockquote>)!$1<p>!g; |
|---|
| 31 | '; |
|---|
| 32 | |
|---|
| 33 | # -------------------------------------------------------------------- |
|---|
| 34 | # ファイルの最初に出てくる「<!-- ReplaceOnce -->」を置き換える文字列 |
|---|
| 35 | $replace_once = << "__REPLACE_ONCE" |
|---|
| 36 | <!-- 広告とか --> |
|---|
| 37 | __REPLACE_ONCE |
|---|
| 38 | ; |
|---|
| 39 | |
|---|
| 40 | # -------------------------------------------------------------------- |
|---|
| 41 | # CSS ファイル |
|---|
| 42 | $css_file = "/css/news.css"; |
|---|
| 43 | #$css_file = "clover/clover.css"; |
|---|
| 44 | |
|---|
| 45 | # -------------------------------------------------------------------- |
|---|
| 46 | # RSSファイル名 |
|---|
| 47 | $rss_filename = "cl.rdf"; |
|---|
| 48 | |
|---|
| 49 | # -------------------------------------------------------------------- |
|---|
| 50 | # RSSに最近何日分表示するか(0の場合は $opt_topn と同じ) |
|---|
| 51 | $rss_topn = 0; |
|---|
| 52 | |
|---|
| 53 | # -------------------------------------------------------------------- |
|---|
| 54 | # 日付の後に曜日(Mon, Tue, ...)を表示するか (1:yes or 0:no) |
|---|
| 55 | $show_day_of_week = 1; |
|---|
| 56 | |
|---|
| 57 | # -------------------------------------------------------------------- |
|---|
| 58 | # 月ページで、日付を降順 (新しい日付が上) で表示するか (1:yes or 0:no) |
|---|
| 59 | $reverse_order_days = 1; |
|---|
| 60 | |
|---|
| 61 | # -------------------------------------------------------------------- |
|---|
| 62 | # アイテムヘッダーのフォーマットをどうするか |
|---|
| 63 | # (0:"* HOGE:", 1:"* HOGE", 2:"HOGE:",3:"HOGE") |
|---|
| 64 | $item_header_style = 1; |
|---|
| 65 | |
|---|
| 66 | # -------------------------------------------------------------------- |
|---|
| 67 | # 表示するとき引用記号 ('>' or '|') を消すか (1:YES, 0:NO) |
|---|
| 68 | $remove_quote_mark = 1; |
|---|
| 69 | |
|---|
| 70 | # -------------------------------------------------------------------- |
|---|
| 71 | # item header で h3 タグを使うか (1:YES, 0:NO) - tDiary との互換性のため |
|---|
| 72 | $use_h3_for_item_header = 1; |
|---|
| 73 | |
|---|
| 74 | # -------------------------------------------------------------------- |
|---|
| 75 | # item header の先頭の記号にアンカーをつけるか (1:YES, 0:NO) |
|---|
| 76 | $use_item_anchor = 1; |
|---|
| 77 | |
|---|
| 78 | # -------------------------------------------------------------------- |
|---|
| 79 | # item header の先頭の記号の指定 |
|---|
| 80 | # 『日記のセクションの先頭(サブタイトルの行頭)に挿入される、リンク用の |
|---|
| 81 | # アンカー文字列を指定します。なお「<span class="panchor">_</span>」を |
|---|
| 82 | # 指定すると、テーマによっては自動的に画像アンカーがつくようになりま |
|---|
| 83 | # す。』(tDiary の skel/conf.rhtml より) |
|---|
| 84 | $item_header_mark = qq(<span class="sanchor">■</span>); |
|---|
| 85 | |
|---|
| 86 | # -------------------------------------------------------------------- |
|---|
| 87 | # RSS を出力するか (1:YES, 0:NO) |
|---|
| 88 | $output_rss = 1; |
|---|
| 89 | |
|---|
| 90 | # -------------------------------------------------------------------- |
|---|
| 91 | # 日記の説明 for RSS : 例: "日々のあれこれ。" |
|---|
| 92 | $changelog_description = "Perl界隈の人たちがPerlのニュースをPOSTしていきます"; |
|---|
| 93 | |
|---|
| 94 | # -------------------------------------------------------------------- |
|---|
| 95 | # 他の年の同じ日付 (月日) へのリンクを張るか (1:YES, 0:NO) |
|---|
| 96 | $same_date_jump = 1; |
|---|
| 97 | |
|---|
| 98 | # -------------------------------------------------------------------- |
|---|
| 99 | # 日付一覧をカレンダー表示にするか (1:YES, 0:NO) |
|---|
| 100 | $calendar_style = 0; |
|---|
| 101 | |
|---|
| 102 | # -------------------------------------------------------------------- |
|---|
| 103 | # 検索用ファイル (cl.itemlist) を作るか (1:YES, 0:NO) |
|---|
| 104 | $output_itemlist = 1; |
|---|
| 105 | |
|---|
| 106 | # -------------------------------------------------------------------- |
|---|
| 107 | # 見出し一覧 (JavaScript ファイル) で出力する日数 |
|---|
| 108 | $latest_titles_num = 10; |
|---|
| 109 | |
|---|
| 110 | # -------------------------------------------------------------------- |
|---|
| 111 | # カテゴリページを作るか (0:NO, 1:YES) |
|---|
| 112 | $output_cat_pages = 0; |
|---|
| 113 | |
|---|
| 114 | # -------------------------------------------------------------------- |
|---|
| 115 | # カテゴリページ中のエントリ数の上限 |
|---|
| 116 | # ($output_cat_pages = 1 のときのみ有効) |
|---|
| 117 | $cat_page_entry_max = 20; |
|---|
| 118 | |
|---|
| 119 | # -------------------------------------------------------------------- |
|---|
| 120 | # カテゴリ別item表示のためのCGIを指定する(カテゴリ名は %%CAT%% で置き換え) |
|---|
| 121 | # ($output_cat_pages = 0 のときのみ有効) |
|---|
| 122 | #$cat_page_cgi = "clsearch.cgi?cat=%%CAT%%"; |
|---|
| 123 | $cat_page_cgi = ""; |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | ###################################################################### |
|---|
| 127 | ## テンプレート |
|---|
| 128 | |
|---|
| 129 | |
|---|
| 130 | my $javascripts = << "__JAVASCRIPTS" |
|---|
| 131 | <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> |
|---|
| 132 | <script type="text/javascript"> |
|---|
| 133 | _uacct = "UA-4463402-1"; |
|---|
| 134 | urchinTracker(); |
|---|
| 135 | </script> |
|---|
| 136 | |
|---|
| 137 | <script type="text/javascript" src="/js/codepress/codepress.js"></script> |
|---|
| 138 | __JAVASCRIPTS |
|---|
| 139 | ; |
|---|
| 140 | |
|---|
| 141 | # (サイドメニュー、サイドバー) |
|---|
| 142 | my $side_menu = << "___SIDE_MENU" |
|---|
| 143 | <div class="stdbox"> |
|---|
| 144 | <table> |
|---|
| 145 | <tr><td>カテゴリ</td></tr> |
|---|
| 146 | <tr><td><TMPL_VAR name=category_list></td></tr> |
|---|
| 147 | <!--<tr><td><script language="JavaScript" src="cl-cat.js"></script></td></tr>--> |
|---|
| 148 | </table> |
|---|
| 149 | </div> |
|---|
| 150 | <p/> |
|---|
| 151 | |
|---|
| 152 | <div class="stdbox"> |
|---|
| 153 | <table> |
|---|
| 154 | <tr><td>最近の話題</td></tr> |
|---|
| 155 | <tr><td><TMPL_VAR name=latest_item_list></script></td></tr> |
|---|
| 156 | <!--<tr><td><script language="JavaScript" src="cl.js"></script></td></tr>--> |
|---|
| 157 | </table> |
|---|
| 158 | </div> |
|---|
| 159 | <p/> |
|---|
| 160 | |
|---|
| 161 | <div class="stdbox"> |
|---|
| 162 | <table><tr><td>リンク</td></tr><tr><td> |
|---|
| 163 | - <a href="http://chalow.org/">chalow</a><br> |
|---|
| 164 | - <a href="http://chalow.net/">たつをの ChangeLog</a><br> |
|---|
| 165 | </td></tr></table> |
|---|
| 166 | </div> |
|---|
| 167 | <p/> |
|---|
| 168 | |
|---|
| 169 | <div class="stdbox"> |
|---|
| 170 | <table> |
|---|
| 171 | <tr><td>過去ログ</td></tr> |
|---|
| 172 | <tr><td style="font-size:11px;text-align:center"> |
|---|
| 173 | <TMPL_VAR name=month_page_list> |
|---|
| 174 | </td></tr> |
|---|
| 175 | </table> |
|---|
| 176 | </div> |
|---|
| 177 | <p/> |
|---|
| 178 | ___SIDE_MENU |
|---|
| 179 | ; |
|---|
| 180 | |
|---|
| 181 | |
|---|
| 182 | # インデックスページのテンプレート |
|---|
| 183 | $index_page_template = << "___INDEX_PAGE_TEMPLATE" |
|---|
| 184 | <html lang="ja"> |
|---|
| 185 | <head> |
|---|
| 186 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> |
|---|
| 187 | <TMPL_IF name=css_file> |
|---|
| 188 | <link rel=stylesheet href="<TMPL_VAR name=css_file>" media=all> |
|---|
| 189 | </TMPL_IF> |
|---|
| 190 | <link rel="alternate" type="application/rss+xml" title="RSS" |
|---|
| 191 | href="<TMPL_VAR name=rss_file>"> |
|---|
| 192 | <title><TMPL_VAR name=cl_name></title> |
|---|
| 193 | $javascripts |
|---|
| 194 | </head> |
|---|
| 195 | <body> |
|---|
| 196 | <p class="adminmenu"><a href="index.html">最新</a> / <a href="<TMPL_VAR name=rss_file>">RSS</a></p> |
|---|
| 197 | <h1><a href="index.html"><TMPL_VAR name=cl_name></a></h1> |
|---|
| 198 | |
|---|
| 199 | <div id="content"> |
|---|
| 200 | <p class="calendar"><TMPL_VAR name=ym> / <TMPL_VAR name=day_list></p> |
|---|
| 201 | |
|---|
| 202 | <p>最近 <TMPL_VAR name=ndays> 日分 / <a href="<TMPL_VAR name=ym>.html">今月の一覧</a> |
|---|
| 203 | </p> |
|---|
| 204 | <TMPL_LOOP name=entries> |
|---|
| 205 | <TMPL_VAR name=content> |
|---|
| 206 | </TMPL_LOOP> |
|---|
| 207 | <p class="calendar"><TMPL_VAR name=month_page_list></p> |
|---|
| 208 | <p>最終更新時間: <TMPL_VAR name=lastupdate></p> |
|---|
| 209 | </div> |
|---|
| 210 | |
|---|
| 211 | <div id="links">$side_menu</div> |
|---|
| 212 | <div id="footer"><TMPL_VAR name=signature></div> |
|---|
| 213 | </body></html> |
|---|
| 214 | ___INDEX_PAGE_TEMPLATE |
|---|
| 215 | ; |
|---|
| 216 | |
|---|
| 217 | # 月ページのテンプレート |
|---|
| 218 | $month_page_template = << "___MONTH_PAGE_TEMPLATE" |
|---|
| 219 | <html lang="ja"> |
|---|
| 220 | <head> |
|---|
| 221 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> |
|---|
| 222 | <TMPL_IF name=css_file> |
|---|
| 223 | <link rel=stylesheet href="<TMPL_VAR name=css_file>" media=all> |
|---|
| 224 | </TMPL_IF> |
|---|
| 225 | <link rel="alternate" type="application/rss+xml" title="RSS" |
|---|
| 226 | href="<TMPL_VAR name=rss_file>"> |
|---|
| 227 | <title><TMPL_VAR name=cl_name> / <TMPL_VAR name=ym></title> |
|---|
| 228 | $javascripts |
|---|
| 229 | </head> |
|---|
| 230 | <body> |
|---|
| 231 | <div style="width:750px"> |
|---|
| 232 | <p class="adminmenu"> |
|---|
| 233 | <TMPL_IF name=back><a href="<TMPL_VAR name=back>.html">前の月</a> / </TMPL_IF> |
|---|
| 234 | <TMPL_IF name=next><a href="<TMPL_VAR name=next>.html">次の月</a> / </TMPL_IF> |
|---|
| 235 | <a href="index.html">最新</a></p> |
|---|
| 236 | <h1><a href="index.html"><TMPL_VAR name=cl_name></a> / <TMPL_VAR name=ym></h1> |
|---|
| 237 | <p class="calendar"><TMPL_VAR name=day_list></p> |
|---|
| 238 | <p class="calendar"><TMPL_VAR name=month_page_list></p> |
|---|
| 239 | <TMPL_LOOP name=entries><TMPL_VAR name=content></TMPL_LOOP> |
|---|
| 240 | <p class="calendar"><TMPL_VAR name=month_page_list></p> |
|---|
| 241 | <p>最終更新時間: <TMPL_VAR name=lastupdate></p> |
|---|
| 242 | <TMPL_VAR name=signature> |
|---|
| 243 | </div> |
|---|
| 244 | <div id="links">$side_menu</div> |
|---|
| 245 | <div id="footer"><TMPL_VAR name=signature></div> |
|---|
| 246 | </body></html> |
|---|
| 247 | ___MONTH_PAGE_TEMPLATE |
|---|
| 248 | ; |
|---|
| 249 | |
|---|
| 250 | # 日ページのテンプレート |
|---|
| 251 | $day_page_template = << "___DAY_PAGE_TEMPLATE" |
|---|
| 252 | <html lang="ja"> |
|---|
| 253 | <head> |
|---|
| 254 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> |
|---|
| 255 | <TMPL_IF name=css_file> |
|---|
| 256 | <link rel=stylesheet href="<TMPL_VAR name=css_file>" media=all> |
|---|
| 257 | </TMPL_IF> |
|---|
| 258 | <link rel="alternate" type="application/rss+xml" title="RSS" |
|---|
| 259 | href="<TMPL_VAR name=rss_file>"> |
|---|
| 260 | <title><TMPL_VAR name=cl_name> / <TMPL_VAR name=ymd></title> |
|---|
| 261 | $javascripts |
|---|
| 262 | </head> |
|---|
| 263 | <body> |
|---|
| 264 | <div style="width:750px"> |
|---|
| 265 | <p class="adminmenu"> |
|---|
| 266 | <TMPL_IF name=back><a href="<TMPL_VAR name=back>.html">前の日</a> / </TMPL_IF> |
|---|
| 267 | <TMPL_IF name=next><a href="<TMPL_VAR name=next>.html">次の日</a> / </TMPL_IF> |
|---|
| 268 | <a href="index.html">最新</a> / <a href="<TMPL_VAR name=ym>.html"><TMPL_VAR name=ym></a></p> |
|---|
| 269 | <h1><a href="index.html"><TMPL_VAR name=cl_name></a> / <TMPL_VAR name=ymd></h1> |
|---|
| 270 | <p class="calendar"><TMPL_VAR name=day_list></p> |
|---|
| 271 | <TMPL_VAR name=content> |
|---|
| 272 | <p class="calendar"><TMPL_VAR name=month_page_list></p> |
|---|
| 273 | <p>最終更新時間: <TMPL_VAR name=lastupdate></p> |
|---|
| 274 | <TMPL_VAR name=signature> |
|---|
| 275 | </div> |
|---|
| 276 | <div id="links">$side_menu</div> |
|---|
| 277 | <div id="footer"><TMPL_VAR name=signature></div> |
|---|
| 278 | </body></html> |
|---|
| 279 | ___DAY_PAGE_TEMPLATE |
|---|
| 280 | ; |
|---|
| 281 | |
|---|
| 282 | # アイテムページのテンプレート |
|---|
| 283 | #$item_page_template = << "___PAGE_TEMPLATE" |
|---|
| 284 | $item_page_template = << "___PAGE_TEMPLATE" |
|---|
| 285 | <html lang="ja"><head> |
|---|
| 286 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> |
|---|
| 287 | <TMPL_IF name=css_file> |
|---|
| 288 | <link rel=stylesheet href="<TMPL_VAR name=css_file>" media=all> |
|---|
| 289 | </TMPL_IF> |
|---|
| 290 | <link rel="alternate" type="application/rss+xml" title="RSS" |
|---|
| 291 | href="<TMPL_VAR name=rss_file>"> |
|---|
| 292 | <title><TMPL_VAR name=header_text></title> |
|---|
| 293 | $javascripts |
|---|
| 294 | </head><body> |
|---|
| 295 | <TMPL_IF name=back><a href="<TMPL_VAR name=back>.html">Prev</a></TMPL_IF> |
|---|
| 296 | <TMPL_IF name=next> / <a href="<TMPL_VAR name=next>.html">Next</a></TMPL_IF> |
|---|
| 297 | / <a href="index.html"><TMPL_VAR name=cl_name></a> |
|---|
| 298 | <h1><TMPL_VAR name=header><TMPL_VAR name=cat></h1> |
|---|
| 299 | <div class="day"> |
|---|
| 300 | <a href="<TMPL_VAR name=ymd>.html"><TMPL_VAR name=ymd></a> |
|---|
| 301 | <div class="body"> |
|---|
| 302 | <!-- start:<TMPL_VAR name=ymdi> --> |
|---|
| 303 | <div class="section"> |
|---|
| 304 | <p><TMPL_VAR name=content></p> |
|---|
| 305 | <TMPL_IF name=referrer> |
|---|
| 306 | <div class="referer"><span>Referrer (Inside): |
|---|
| 307 | <TMPL_VAR name=referrer></span></div> |
|---|
| 308 | </TMPL_IF> |
|---|
| 309 | <p><a href="<TMPL_VAR name=ymdi>.html">permlink</a></p> |
|---|
| 310 | </div> |
|---|
| 311 | <!-- end:<TMPL_VAR name=ymdi> --> |
|---|
| 312 | </div></div> |
|---|
| 313 | <!--<p>last update: <TMPL_VAR name=lastupdate></p>--> |
|---|
| 314 | <div id="links">$side_menu</div> |
|---|
| 315 | <TMPL_VAR name=signature> |
|---|
| 316 | </div> |
|---|
| 317 | </body></html> |
|---|
| 318 | ___PAGE_TEMPLATE |
|---|
| 319 | ; |
|---|
| 320 | |
|---|
| 321 | |
|---|
| 322 | # カテゴリページのテンプレート |
|---|
| 323 | $cat_page_template = << "TMPL" |
|---|
| 324 | <html lang="ja"> |
|---|
| 325 | <head> |
|---|
| 326 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> |
|---|
| 327 | <TMPL_IF name=css_file> |
|---|
| 328 | <link rel=stylesheet href="<TMPL_VAR name=css_file>" media=all> |
|---|
| 329 | </TMPL_IF> |
|---|
| 330 | <link rel="alternate" type="application/rss+xml" title="RSS" |
|---|
| 331 | href="<TMPL_VAR name=rss_file>"> |
|---|
| 332 | <title><TMPL_VAR name=cat_name> / <TMPL_VAR name=cl_name></title> |
|---|
| 333 | $javascripts |
|---|
| 334 | </head> |
|---|
| 335 | <body> |
|---|
| 336 | <a href="index.html">ChangeLog 最新ページ</a> |
|---|
| 337 | <TMPL_IF name=page_list> |
|---|
| 338 | / <a href="<TMPL_VAR name=first_page>">カテゴリ最新ページ</a> / |
|---|
| 339 | <TMPL_IF name=back><a href="<TMPL_VAR name=back>">前ページ</a></TMPL_IF> |
|---|
| 340 | <TMPL_VAR name=page_list> |
|---|
| 341 | <TMPL_IF name=next><a href="<TMPL_VAR name=next>">次ページ</a></TMPL_IF> |
|---|
| 342 | / page <TMPL_VAR name=page_id> (<TMPL_VAR name=page_num>) |
|---|
| 343 | </TMPL_IF> |
|---|
| 344 | <h1><TMPL_VAR name=cat_name> - <a href="index.html"><TMPL_VAR name=cl_name></a></h1> |
|---|
| 345 | <div> |
|---|
| 346 | 最終更新時間: <TMPL_VAR name=lastupdate> |
|---|
| 347 | <TMPL_LOOP name=entries> |
|---|
| 348 | <div class="day"><h2><span class="date"><TMPL_VAR name=eh></span></h2> |
|---|
| 349 | <div class="body"><TMPL_VAR name=cont></div></div> |
|---|
| 350 | </TMPL_LOOP> |
|---|
| 351 | <!--<TMPL_VAR name=ym><TMPL_VAR name=day_list>--> |
|---|
| 352 | <TMPL_VAR name=signature> |
|---|
| 353 | </div> |
|---|
| 354 | <div id="links">$side_menu</div> |
|---|
| 355 | <div id="footer"><TMPL_VAR name=signature></div> |
|---|
| 356 | </body></html> |
|---|
| 357 | TMPL |
|---|
| 358 | ; |
|---|
| 359 | |
|---|
| 360 | # item のテンプレート |
|---|
| 361 | $item_template = << "EACHITEM" |
|---|
| 362 | <!-- start:<TMPL_VAR name=ymdi> --> |
|---|
| 363 | <div class="section"> |
|---|
| 364 | <h3 class="subtitle"><TMPL_VAR name=header> <TMPL_VAR name=cat></h3> |
|---|
| 365 | <p><TMPL_VAR name=content></p> |
|---|
| 366 | <TMPL_IF name=readmore> |
|---|
| 367 | <p>《<a href="<TMPL_VAR name=url>">続きを読む</a>》</p> |
|---|
| 368 | </TMPL_IF> |
|---|
| 369 | <!--<div class="posted"><span><TMPL_VAR name=author></span></div>--> |
|---|
| 370 | <TMPL_IF name=referrer> |
|---|
| 371 | <div class="referer"><span>Referrer (Inside): |
|---|
| 372 | <TMPL_VAR name=referrer></span></div> |
|---|
| 373 | </TMPL_IF> |
|---|
| 374 | <div class="referer"><span> |
|---|
| 375 | [ <a href="<TMPL_VAR name=url>">固定リンク</a> ] |
|---|
| 376 | </span></div> |
|---|
| 377 | <!--<TMPL_VAR name=id>--> |
|---|
| 378 | </div> |
|---|
| 379 | <!-- end:<TMPL_VAR name=ymdi> --> |
|---|
| 380 | <!-- ReplaceOnce --> |
|---|
| 381 | EACHITEM |
|---|
| 382 | ; |
|---|
| 383 | |
|---|
| 384 | # entry (date) のテンプレート |
|---|
| 385 | $entry_template = << "DAYENTRY" |
|---|
| 386 | <div class="day"> |
|---|
| 387 | <h2><span class="date"><TMPL_VAR name=header></span></h2> |
|---|
| 388 | |
|---|
| 389 | <div class="body"> |
|---|
| 390 | |
|---|
| 391 | <TMPL_IF name=message_top><TMPL_VAR name=message_top></TMPL_IF> |
|---|
| 392 | |
|---|
| 393 | <TMPL_IF name=same_date> |
|---|
| 394 | <div class="calendar"><TMPL_VAR name=same_date></div> |
|---|
| 395 | </TMPL_IF> |
|---|
| 396 | |
|---|
| 397 | <TMPL_VAR name=content> |
|---|
| 398 | |
|---|
| 399 | <TMPL_IF name=referrer><div class="referer"><span>Referrer (Inside): |
|---|
| 400 | <TMPL_VAR name=referrer></span></div></TMPL_IF> |
|---|
| 401 | |
|---|
| 402 | <TMPL_IF name=message_bottom><TMPL_VAR name=message_bottom></TMPL_IF> |
|---|
| 403 | <!-- |
|---|
| 404 | <div class="comment"> |
|---|
| 405 | <div class="caption">[ |
|---|
| 406 | <a href='./kuttukibbs.cgi?id=<TMPL_VAR name=ymd>'>コメント</a> | |
|---|
| 407 | <a href="tb/tb.cgi?__mode=list&tb_id=<TMPL_VAR name=id>">トラックバック |
|---|
| 408 | (<script language="JavaScript" src="tb/tb_data/<TMPL_VAR name=id>.js"> |
|---|
| 409 | </script>)</a> ]</div> |
|---|
| 410 | <script language="JavaScript" type="text/javascript" |
|---|
| 411 | src="kblog/<TMPL_VAR name=ymd>.js"></script> |
|---|
| 412 | </div> |
|---|
| 413 | --> |
|---|
| 414 | </div> |
|---|
| 415 | </div> |
|---|
| 416 | DAYENTRY |
|---|
| 417 | ; |
|---|
| 418 | |
|---|
| 419 | |
|---|
| 420 | ###################################################################### |
|---|
| 421 | ## プラグイン |
|---|
| 422 | |
|---|
| 423 | ### コメントアウト |
|---|
| 424 | # usage: {{com('これは HTML 変換時に削られます')}} |
|---|
| 425 | sub com { } |
|---|
| 426 | |
|---|
| 427 | ### clsearch キーワード検索 URL 作成 |
|---|
| 428 | # usage: {{clsearch('海老名 映画館')}} |
|---|
| 429 | # usage: {{clsearch('海老名 映画館', 1)}} |
|---|
| 430 | sub clsearch { |
|---|
| 431 | my ($k, $mode) = @_; |
|---|
| 432 | my $o = $k; |
|---|
| 433 | $k =~ s/([^0-9a-z_ ])/'%'.unpack('H2', $1)/gei; |
|---|
| 434 | $k =~ s/\s/+/g; |
|---|
| 435 | $mode = "&mode=$mode" if (defined $mode); |
|---|
| 436 | return qq(<a href="clsearch.cgi?key=$k$mode">$o</a>); |
|---|
| 437 | } |
|---|
| 438 | |
|---|
| 439 | ### google キーワード検索 URL 作成 |
|---|
| 440 | # usage: {{google_search('海老名 映画館')}} |
|---|
| 441 | sub google_search { |
|---|
| 442 | my ($k) = @_; |
|---|
| 443 | my $o = $k; |
|---|
| 444 | $k =~ s/([^0-9a-z_ ])/'%'.unpack('H2', $1)/gei; |
|---|
| 445 | $k =~ s/\s/+/g; |
|---|
| 446 | my $c = "ie=EUC-JP&oe=EUC-JP&"; |
|---|
| 447 | return qq(<a href="http://www.google.co.jp/search?${c}q=$k">$o</a>); |
|---|
| 448 | } |
|---|
| 449 | |
|---|
| 450 | ### Bulkfeeds キーワード検索 |
|---|
| 451 | # usage: {{bulkfeeds('海老名 映画')}} |
|---|
| 452 | sub bulkfeeds { |
|---|
| 453 | my ($k) = @_; |
|---|
| 454 | my $o = $k; |
|---|
| 455 | $k = Jcode->new($k)->utf8; |
|---|
| 456 | $k =~ s/([^0-9a-z_ ])/'%'.unpack('H2', $1)/gei; |
|---|
| 457 | $k =~ s/\s/+/g; |
|---|
| 458 | return qq(<a href="http://bulkfeeds.net/app/search2?q=$k">$o</a>); |
|---|
| 459 | } |
|---|
| 460 | |
|---|
| 461 | ### amazon リンクの作成 |
|---|
| 462 | # usage: {{amazon('ASIN', 'STR')}} |
|---|
| 463 | sub amazon { |
|---|
| 464 | my ($asin, $str) = @_; |
|---|
| 465 | my $prefix = "http://www.amazon.co.jp/exec/obidos/ASIN"; |
|---|
| 466 | # my $suffix = ""; |
|---|
| 467 | my $suffix = "ytoshomepage-22/ref=nosim"; # アソシID使用時 |
|---|
| 468 | $str =~ s/(\s|^)(\S+\.(jpg|jpeg|png|gif))/$1<img src="$2">/gi; |
|---|
| 469 | $str =~ s/$/<br>/gm; |
|---|
| 470 | $str =~ s/<br>\Z//m; |
|---|
| 471 | return qq(<a href="$prefix/$asin/$suffix">$str</a>); |
|---|
| 472 | } |
|---|
| 473 | |
|---|
| 474 | sub az {amazon(@_)} |
|---|
| 475 | sub azs {amazon_search(@_)} |
|---|
| 476 | sub bf {bulkfeeds(@_)} |
|---|
| 477 | sub cls {clsearch(@_)} |
|---|
| 478 | sub gs {google_search(@_)} |
|---|
| 479 | |
|---|
| 480 | ### amazon サーチ結果リンクの作成 |
|---|
| 481 | # usage: {{amazon_search('STR' [,'MODE'])}} |
|---|
| 482 | sub amazon_search { |
|---|
| 483 | my ($str, $mode) = @_; |
|---|
| 484 | my $k = Jcode->new($str)->utf8; |
|---|
| 485 | $k =~ s/([^0-9a-z_ ])/'%'.unpack('H2', $1)/gei; |
|---|
| 486 | $k =~ s/\s/+/g; |
|---|
| 487 | my $aid = "ytoshomepage-22"; |
|---|
| 488 | $mode = "blended" if not defined $mode; |
|---|
| 489 | return '<a href="http://www.amazon.co.jp/exec/obidos/external-search'. |
|---|
| 490 | "?tag=$aid&keyword=$k&mode=$mode\">$str</a>"; |
|---|
| 491 | } |
|---|
| 492 | |
|---|
| 493 | ### 普通の amazon アソシエイトリンクの作成 |
|---|
| 494 | # usage: {{amazon_link('ASIN', 'ID', 'STR')}} |
|---|
| 495 | sub amazon_link { |
|---|
| 496 | my ($asin, $id, $str) = @_; |
|---|
| 497 | my $prefix = "http://www.amazon.co.jp/exec/obidos/ASIN"; |
|---|
| 498 | $str =~ s/(\s|^)(\S+\.(jpg|jpeg|png|gif))/$1<img src="$2">/gi; |
|---|
| 499 | $str =~ s/$/<br>/gm; |
|---|
| 500 | $str =~ s/<br>\Z//m; |
|---|
| 501 | return qq(<a href="$prefix/$asin/$id/ref=nosim">$str</a>); |
|---|
| 502 | } |
|---|
| 503 | |
|---|
| 504 | ### 後ろめたい amazon アソシエイトリンクの作成 |
|---|
| 505 | # ref. http://chalow.net/2003-11-06-2.html |
|---|
| 506 | # usage: {{qualmish_amazon_link('ASIN', 'ID', 'STR')}} |
|---|
| 507 | sub qualmish_amazon_link { |
|---|
| 508 | my ($asin, $id, $str) = @_; |
|---|
| 509 | my $prefix = "http://www.amazon.co.jp/exec/obidos/ASIN"; |
|---|
| 510 | $str =~ s/(\s|^)(\S+\.(jpg|jpeg|png|gif))/$1<img src="$2">/gi; |
|---|
| 511 | $str =~ s/$/<br>/gm; |
|---|
| 512 | $str =~ s/<br>\Z//m; |
|---|
| 513 | return qq(<a href="$prefix/$asin/$id/ref=nosim" |
|---|
| 514 | onMouseOver="window.status='$prefix/$asin'; return true;" |
|---|
| 515 | onMouseOut="window.status=''; return true;">$str</a>); |
|---|
| 516 | } |
|---|
| 517 | |
|---|
| 518 | ### URL を短く表示 |
|---|
| 519 | # usage: {{shorten_url('http://example.com/abc/def/00101033/ |
|---|
| 520 | # 0123456/aaaaaaaaaaaa/aaaaaaaaaaaa/index.html')}} |
|---|
| 521 | sub shorten_url { |
|---|
| 522 | my ($url, $max) = @_; |
|---|
| 523 | $max = 60 if not defined $max; |
|---|
| 524 | $url =~ s/\s+//gsm; |
|---|
| 525 | my $urlstr = $url; |
|---|
| 526 | $urlstr =~ s/^(.{$max}).+$/$1 .../; |
|---|
| 527 | return qq(<a href="$url">$urlstr</a>); |
|---|
| 528 | } |
|---|
| 529 | |
|---|
| 530 | ### カテゴリページへのリンク |
|---|
| 531 | # usage: {{cat('プログラミング')}} |
|---|
| 532 | sub cat { |
|---|
| 533 | my ($cn) = @_; |
|---|
| 534 | my $url = get_category_filename($cn); |
|---|
| 535 | return qq(<a href="$url">$cn</a>); |
|---|
| 536 | } |
|---|