lonwiki.comとして再導入するために1.5.2(2019/09/24現在最新)を導入。
前wikiの1.5.0およびphp5.5からの対応の為にメモの再編集と追記を。
ベースは1.5.0時の設定およびプラグイン導入のメモ書きがベース。
- //$script_directory_index = 'index.php'; + $script_directory_index = 'index.php';
- $modifier = 'anonymous'; + $modifier = 'ろんさん非公式wiki';
- $modifierlink = 'http://pukiwiki.example.com/'; + $modifierlink = 'http://www.usamimi.info/~who/lonwiki.com';
- $defaultpage = 'FrontPage'; // Top / Default page + $defaultpage = 'シンプルなスクーターサイト'; // Top / Default page
- $nowikiname = 0; + $nowikiname = 1;
- $attach_link = 1; + $attach_link = 0;
- $related_link = 1; + $related_link = 0;
$defaultpage表示時にページタイトルを非表示に。($defaultpageと$page_titleが同一)
67行目辺り
+ <?php if ($title !== $defaultpage) { ?>
<title><?php echo $title ?> - <?php echo $page_title ?></title>
+ <?php } else {?>
+ <title><?php echo $title ?></title>
+ <?php } ?>
padding:0px; border:0px; - margin:auto; text-align:left; color:inherit; background-color:#ccd5dd;
( # (3) url - (?:(?:https?|ftp|news):\/\/|mailto:)[\w\/\@\$()!?&%#:;.,~'=*+-]+ + (?:(?:\+?https?|\+?ftp|\+?news):\/\/|mailto:)[\w\/\@\$()!?&%#:;.,~'=*+-]+ ) (?($s1)\]\]) # close bracket EOD;418行辺り
function toString()
{
if (FALSE) {
$rel = '';
} else {
$rel = ' rel="nofollow"';
}
+ if (preg_match("/^(\+)(.*)/", $this->name, $regs)) {
+ return '<a href="' . $regs[2] . '" target="_blank" ' . $rel . '>' . $this->alias . '</a>';
+ }else{
return '<a href="' . $this->name . '"' . $rel . '>' . $this->alias . '</a>';
+ }
}
PukiWiki別窓リンク参考(問題がありましたらご報告下さい。) // Create and write diff
$oldpostdata = is_page($page) ? join('', get_source($page)) : '';
$diffdata = do_diff($oldpostdata, $postdata);
+ // add client info
+ global $now;
+ $referer = htmlspecialchars($_SERVER['HTTP_REFERER']);
+ $user_agent = htmlspecialchars($_SERVER['HTTP_USER_AGENT']);
+ $diffdata .= "IP:{$_SERVER['REMOTE_ADDR']} TIME:\"$now\" REFERER:\"$referer\" USER_AGENT:\"$user_agent\"\n";
file_write(DIFF_DIR, $page, $diffdata);
// Create backup break;
}
}
-unset($agents, $matches);
+//unset($agents, $matches);
// Profile-related init and setting
define('UA_PROFILE', isset($user_agent['profile']) ? $user_agent['profile'] : '');
美麻Wikiでシステム的に修正している点参考(問題がありましたらご報告下さい。)前回まではプラグインのs.inc.phpを導入していたが、1.5.2において正常に動作できなかったり、302リダイレクトを利用しているせいでURLが元に戻ってしまうため、他の方法により導入。
参考および導入サイト
PukiWikiのクソ長いURLをURL短縮ライブラリを組み込んで解決する!
こちらに詳しく書いてあるので当ページでの導入メモは省く。
見た目を変更
<div class="counter">
Counter: {$counter['total']},
today: {$counter['today']},
yesterday: {$counter['yesterday']}
</div>
から
<div class="counter">
total:{$counter['total']}<br>
today:{$counter['today']}<br>
yesterday:{$counter['yesterday']}
</div>
へ変更。- font-size:70%; + font-size:100%; + text-align: right;