Net/pukiwiki/plugin
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#topicpath
* plugin tips [#w2f88651]
** paraedit.inc.php 0.8[#z51de1ad]
*** pukiwiki 1.5.1 への組み込み方 [#w5a25274]
+ DL
-- http://taru.s223.xrea.com/index.php?PukiWiki%2Fvanish ...
-- plugin/ 配下にコピーする。
+ lib/pukiwiki.php の編集
++ メイン処理(// Main)の直前に次の二行を追加。(paraedit 0...
include_once(PLUGIN_DIR . 'paraedit.inc.php');
$post["msg"] = _plugin_paraedit_parse_postmsg($post["msg...
+ skin (skin/pukiwiki.skin.ja.php) の書換え
-- skin/pukiwiki.skin.php内の二箇所を書き換え
++ 1ヵ所目
--- 変更前
<?php echo $body ?>
--- 変更後
<?php include_once 'plugin/paraedit.inc.php'; echo _plug...
--- (注意) InputHelper と ParaEdit を併用する場合は下記の...
php include_once 'plugin/input_helper.inc.php'; include_...
echo plugin_input_helper_echo( _plugin_paraedit_mkeditli...
++ 2ヵ所目
pkwk_common_headers();
の直前あたりに
// ParaEdit
if(exist_plugin('paraedit')) {
$body = _plugin_paraedit_mkeditlink($body);
}
を追加。↑のもinclude_onceよりexist_pluginの方がスマートな...
+ lib/convert_html.php の編集。
class Heading extends Element 内にある、
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 la...
$paraedit_flag = (preg_match("/^content_1_/", $this->i...
return $this->msg_top . $this->wrap(parent::toString(),
'h' . $this->level, ' id="' . $this->id . $paraedit_fl...
/*
return $this->msg_top . $this->wrap(parent::toString(),
'h' . $this->level, ' id="' . $this->id . '"');
*/
}
-- ちょっと補足:改変3行目の後ろの方にあるid=の一文字前...
+ paraedit.inc.php 自体への変更
-- pukiwiki1.5.1, PHP7 以降では、以下の変更が必要
++ 2箇所ある split() を explode() に変更
+++ 1箇所目
// $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) {
+++ 2箇所目
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);
終了行:
#topicpath
* plugin tips [#w2f88651]
** paraedit.inc.php 0.8[#z51de1ad]
*** pukiwiki 1.5.1 への組み込み方 [#w5a25274]
+ DL
-- http://taru.s223.xrea.com/index.php?PukiWiki%2Fvanish ...
-- plugin/ 配下にコピーする。
+ lib/pukiwiki.php の編集
++ メイン処理(// Main)の直前に次の二行を追加。(paraedit 0...
include_once(PLUGIN_DIR . 'paraedit.inc.php');
$post["msg"] = _plugin_paraedit_parse_postmsg($post["msg...
+ skin (skin/pukiwiki.skin.ja.php) の書換え
-- skin/pukiwiki.skin.php内の二箇所を書き換え
++ 1ヵ所目
--- 変更前
<?php echo $body ?>
--- 変更後
<?php include_once 'plugin/paraedit.inc.php'; echo _plug...
--- (注意) InputHelper と ParaEdit を併用する場合は下記の...
php include_once 'plugin/input_helper.inc.php'; include_...
echo plugin_input_helper_echo( _plugin_paraedit_mkeditli...
++ 2ヵ所目
pkwk_common_headers();
の直前あたりに
// ParaEdit
if(exist_plugin('paraedit')) {
$body = _plugin_paraedit_mkeditlink($body);
}
を追加。↑のもinclude_onceよりexist_pluginの方がスマートな...
+ lib/convert_html.php の編集。
class Heading extends Element 内にある、
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 la...
$paraedit_flag = (preg_match("/^content_1_/", $this->i...
return $this->msg_top . $this->wrap(parent::toString(),
'h' . $this->level, ' id="' . $this->id . $paraedit_fl...
/*
return $this->msg_top . $this->wrap(parent::toString(),
'h' . $this->level, ' id="' . $this->id . '"');
*/
}
-- ちょっと補足:改変3行目の後ろの方にあるid=の一文字前...
+ paraedit.inc.php 自体への変更
-- pukiwiki1.5.1, PHP7 以降では、以下の変更が必要
++ 2箇所ある split() を explode() に変更
+++ 1箇所目
// $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) {
+++ 2箇所目
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);
ページ名: