開始行: ***minicalendar_viewer.inc.phpの改造は続く [#p9319480] さてminicalendar_viewer.inc.php((このプラグイン名長いで... しかし、流石に今回改造に利用したwikinote.inc.phpに対し... 一応、この改造も整理して公開していこうと考えているので... //cut +当初wikinoteを利用するに当たって装飾タグ<ul><li>がごっつ... --やっぱり正規表現かな?しかし私は正規表現が全くわかりま... --minicalendar_viewer.inc.php #expand(400){{{ #code(diff){{ if (PLUGIN_MINICALENDAR_VIEWER_COMMENT === TRUE) { if (exist_plugin_inline('wikinote')) { //taru 06.0... + $wikinotepage = 'Note/' . $page; + $search_r = array ('@<ul[^>]*?>(.+?)</ul>@si', // u... + '@<li[^>]*?>(.+?)</li>@si', // li タグを削除 + '@<a href="[^>]*?>Article</a>@si', // Article リ... + '@>Comment@si'); // Commentの置き換え + $replace_r = array ('$1', + '$1', + '', + '><img src="'.IMAGE_URI.'plus/comment.png" width="1... + ); $comm = call_user_func(array(new PluginWikinote(array... $comm = preg_replace(array("'<p>'si","'</p>'si"), arr... - $tail .= str_replace('>Comment','><img src="'.IMAGE_... + $tail .= preg_replace($search_r, $replace_r, $comm); } } }} }}} --と、まぁこんな感じにしたら何故かうまく動いている様子で... --ちなみにdo_plugin_convertを使わずにcall_user_func(array... +wikinoteのdefault_template_contentsに無理やりくっつけたN... #expand(400){{{ -ってことで上のコードで定義している call_user_func(array(new PluginWikinote(array('templink'... -は、当初 call_user_func(array(new PluginWikinote(), 'convert')) -としていました。この'templink'オプションはwikinoteには元... -'templink'オプションが有効になるようにwikinote.inc.phpを... #code(diff){{ function PluginWikinote($args) { // Modify here for default values $this->options['prefix'] = 'Note/'; $this->options['mainlabel'] = 'Article'; $this->options['notelabel'] = 'Comment'; $this->options['except'] = '^$'; $this->options['noauto'] = FALSE; + $this->options['templink'] = FALSE; //taru 06.08... }} #code(diff){{ // do not touch, users global $vars; $this->parse_options($args); list($page, $notepage) = $this->parse_current($va... $is_none = $this->is_none($page); if ($is_none) { $this->inline = '1'; $this->convert = ''; } else { - $this->autocreate_wikinote($notepage); + $this->autocreate_wikinote($notepage,$page);... if ($this->error != '') { return "<p>#$this->... }} #code(diff){{ - function autocreate_wikinote($notepage) + function autocreate_wikinote($notepage,$page) { if ($this->options['noauto']) return; if ($this->is_page($notepage)) return; $contents = auto_template($notepage); if ($contents == '') { + if ($this->options['templink']){ //taru 06.08.22 + $contents = $this->default_template_content... + } else { $contents = $this->default_template_contents; + } } }} }}} +Articleのリンクをどうするか。これって消したいけど直接wik... # '@<a href="[^>]*?>Article</a>@si' を '' で置き換える... ***wikinote.inc.phpはちゃんと動くかな? [#c6ae9c15] #wikinote(mainlabel=本文,notelabel=コメント,noauto) 終了行: ***minicalendar_viewer.inc.phpの改造は続く [#p9319480] さてminicalendar_viewer.inc.php((このプラグイン名長いで... しかし、流石に今回改造に利用したwikinote.inc.phpに対し... 一応、この改造も整理して公開していこうと考えているので... //cut +当初wikinoteを利用するに当たって装飾タグ<ul><li>がごっつ... --やっぱり正規表現かな?しかし私は正規表現が全くわかりま... --minicalendar_viewer.inc.php #expand(400){{{ #code(diff){{ if (PLUGIN_MINICALENDAR_VIEWER_COMMENT === TRUE) { if (exist_plugin_inline('wikinote')) { //taru 06.0... + $wikinotepage = 'Note/' . $page; + $search_r = array ('@<ul[^>]*?>(.+?)</ul>@si', // u... + '@<li[^>]*?>(.+?)</li>@si', // li タグを削除 + '@<a href="[^>]*?>Article</a>@si', // Article リ... + '@>Comment@si'); // Commentの置き換え + $replace_r = array ('$1', + '$1', + '', + '><img src="'.IMAGE_URI.'plus/comment.png" width="1... + ); $comm = call_user_func(array(new PluginWikinote(array... $comm = preg_replace(array("'<p>'si","'</p>'si"), arr... - $tail .= str_replace('>Comment','><img src="'.IMAGE_... + $tail .= preg_replace($search_r, $replace_r, $comm); } } }} }}} --と、まぁこんな感じにしたら何故かうまく動いている様子で... --ちなみにdo_plugin_convertを使わずにcall_user_func(array... +wikinoteのdefault_template_contentsに無理やりくっつけたN... #expand(400){{{ -ってことで上のコードで定義している call_user_func(array(new PluginWikinote(array('templink'... -は、当初 call_user_func(array(new PluginWikinote(), 'convert')) -としていました。この'templink'オプションはwikinoteには元... -'templink'オプションが有効になるようにwikinote.inc.phpを... #code(diff){{ function PluginWikinote($args) { // Modify here for default values $this->options['prefix'] = 'Note/'; $this->options['mainlabel'] = 'Article'; $this->options['notelabel'] = 'Comment'; $this->options['except'] = '^$'; $this->options['noauto'] = FALSE; + $this->options['templink'] = FALSE; //taru 06.08... }} #code(diff){{ // do not touch, users global $vars; $this->parse_options($args); list($page, $notepage) = $this->parse_current($va... $is_none = $this->is_none($page); if ($is_none) { $this->inline = '1'; $this->convert = ''; } else { - $this->autocreate_wikinote($notepage); + $this->autocreate_wikinote($notepage,$page);... if ($this->error != '') { return "<p>#$this->... }} #code(diff){{ - function autocreate_wikinote($notepage) + function autocreate_wikinote($notepage,$page) { if ($this->options['noauto']) return; if ($this->is_page($notepage)) return; $contents = auto_template($notepage); if ($contents == '') { + if ($this->options['templink']){ //taru 06.08.22 + $contents = $this->default_template_content... + } else { $contents = $this->default_template_contents; + } } }} }}} +Articleのリンクをどうするか。これって消したいけど直接wik... # '@<a href="[^>]*?>Article</a>@si' を '' で置き換える... ***wikinote.inc.phpはちゃんと動くかな? [#c6ae9c15] #wikinote(mainlabel=本文,notelabel=コメント,noauto) ページ名: