日記
tDiaryのPHP版を作成しました (18:07)Edit

(念のため、これは4月1日の記事ですからねー)

データはtDiary互換となっており、現在ここのデータをそのまま使用しているβ版サイトを、http://pdiary.ishinao.net/index.phpで動作させています。URLからわかるようにpDiaryと名づけました。

tDiary: 2.1系に先駆けて、

  • フルUTF-8化!(β版サイトの文字コードを確認してください)
  • Rubyで書かれたtDiaryプラグインがそのまま動作!

などの特徴があります。

現在記法はWikiスタイルのみサポートしており、そのレンダリングエンジンにはPHP用汎用WikiParserを利用しています。

まだすべての機能が実装されていませんが、β版のソースコードはこちらからダウンロードできます。是非おためしください。

どうも上のダウンロードリンクがおかしいようなので

ソースを貼り付けておきます。

<?php
$url = 'http://tdiary.ishinao.net/index.rb?'.$_SERVER['QUERY_STRING'];
$html = file_get_contents($url);
$html = str_replace('tdiary.ishinao.net', 'pdiary.ishinao.net', $html);
$html = preg_replace('/\.\/([0-9]+)\.html/', './index.php?date=$1', $html);
$html = str_replace('"./?', '"./index.php?', $html);
$html = str_replace('ツッコミを入れる', 'ツッコミは入れれない', $html);
$html = str_replace('"投稿"', '"投稿できない"', $html);
$html = str_replace('<a href="http://www.tdiary.org/">tDiary</a> version 2.0.0', '<a href="http://pdiary.ishinao.net/index.php">pDiary</a> version 0.0.1', $html);
$html = str_replace('<a href="http://www.ruby-lang.org/">Ruby</a> version 1.8.1', '<a href="http://www.php.net/">PHP</a> version 4.3.10', $html);
$html = str_replace('euc-jp', 'utf-8', $html);
$html = mb_convert_encoding($html, 'utf-8', 'euc-jp');
header('content-type: text/html; charset=utf-8');
echo $html;
?>

Published At2005-04-01 00:00Updated At2005-04-01 00:00