include_once(PLUGIN_DIR . 'paraedit.inc.php'); $post["msg"] = _plugin_paraedit_parse_postmsg($post["msg_before"], $post["msg"], $post["msg_after"]);
<?php echo $body ?>
<?php include_once 'plugin/paraedit.inc.php'; echo _plugin_paraedit_mkeditlink($body); ?>
php include_once 'plugin/input_helper.inc.php'; include_once 'plugin/input_helper.inc.php'; echo plugin_input_helper_echo( _plugin_paraedit_mkeditlink($body) );
pkwk_common_headers();の直前あたりに
// ParaEdit
if(exist_plugin('paraedit')) {
$body = _plugin_paraedit_mkeditlink($body);
}
を追加。↑のもinclude_onceよりexist_pluginの方がスマートな気が。 function toString()
{
return $this->msg_top . $this->wrap(parent::toString(),
'h' . $this->level, ' id="' . $this->id . '"');
}
を、次のように書き変える。
function toString()
{
// paraedit.inc.php 用の変更
// for enable paraedit.inc.php on pukiwiki 1.5.0 or later
$paraedit_flag = (preg_match("/^content_1_/", $this->id)) ? ' paraedit_flag=on' : '';
return $this->msg_top . $this->wrap(parent::toString(),
'h' . $this->level, ' id="' . $this->id . $paraedit_flag . '"');
/*
return $this->msg_top . $this->wrap(parent::toString(),
'h' . $this->level, ' id="' . $this->id . '"');
*/
}
// $vars[msg] を分割
$msg_before; $msg_now; $msg_after; // 編集行とその前後
$part = $vars['parnum'];
$index_num = 0;
$is_first_line = 1;
// for pukiwiki 1.5.0 or later
// foreach (split ("\n", $postdata) as $line) {
foreach (explode ("\n", $postdata) as $line) {function _plugin_paraedit_mkeditlink($body)
{
// [edit]リンクの作成
global $script, $get, $post, $vars;
// for pukiwiki 1.5.0 or later
// $lines = split("\n", $body);
$lines = explode("\n", $body);