質問箱/2225
の編集
Top
/
質問箱
/
2225
[
トップ
] [
編集
|
差分
|
履歴
|
添付
|
リロード
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
Wikiを試したい方へ:
「この」Wikiは、
PukiWiki
のための公式Wikiです。
テスト書き込みなどは
お試しサイト
https://pukiwiki.osdn.jp/_trial/
をご利用ください
**[[質問箱/2225]] [#u6421ec3] |RIGHT:70|LEFT:410|c |~カテゴリ|| |~サマリ|複数行入力フォームの pcomment| |~バージョン|1.4.3| |~投稿者|[[korosuke]]| |~状態|質問| |~投稿日|&new{2004-06-20 (SUN) 22:39:20};| ***質問 [#w7689439] comment プラグインを用いた際に複数行入力フォーム(textarea) を用いることができるように comment2 という名前で以下のように修正をしたのですが、pcomment で実現しようとしたときに、ソースが長すぎてよくわかりませんでした。 少し読んだところ、- によるリストの代わりに ----\n による水平ラインを引いているのですが、pcomment においてそのようにすると改変箇所が多くなりそうでした。 どなたかご助力お願いできませんか? もしくはそのようなものをすでに作っている方はいませんか? よろしくお願いします。 --- comment.inc.php 2004-05-21 17:14:00.000000000 +0900 +++ comment2.inc.php 2004-05-26 21:09:55.644003200 +0900 @@ -26,7 +26,7 @@ // コメントが投稿された場合、内容をメールで送る先 //define('COMMENT_MAIL',FALSE); -function plugin_comment_action() +function plugin_comment2_action() { global $script,$vars,$post,$now; global $_title_updated,$_no_name; @@ -40,7 +40,7 @@ } $head = ''; - if (preg_match('/^(-{1,2})(.*)/',$post['msg'],$match)) + if (preg_match('/^(----\n)(.*)/',$post['msg'],$match)) { $head = $match[1]; $post['msg'] = $match[2]; @@ -69,7 +69,7 @@ } if (preg_match('/^#comment/',$line) and $comment_no++ == $post['comment_no']) { - $postdata = rtrim($postdata)."\n-$comment\n"; + $postdata = rtrim($postdata)."\n----\n$comment\n"; if ($comment_ins) { $postdata .= "\n"; @@ -98,7 +98,7 @@ return $retvars; } -function plugin_comment_convert() +function plugin_comment2_convert() { global $script,$vars,$digest; global $_btn_comment,$_btn_name,$_msg_comment; @@ -131,13 +131,14 @@ <div> <input type="hidden" name="comment_no" value="$comment_no" /> <input type="hidden" name="refer" value="$s_page" /> - <input type="hidden" name="plugin" value="comment" /> + <input type="hidden" name="plugin" value="comment2" /> <input type="hidden" name="nodate" value="$nodate" /> <input type="hidden" name="above" value="$above" /> <input type="hidden" name="digest" value="$digest" /> $nametags - <input type="text" name="msg" size="$comment_cols" /> <input type="submit" name="comment" value="$_btn_comment" /> + <br /> + <textarea name="msg" cols="$comment_cols" rows="4"></textarea> </div> </form> EOD; ***回答 [#n259841f] //#comment
**[[質問箱/2225]] [#u6421ec3] |RIGHT:70|LEFT:410|c |~カテゴリ|| |~サマリ|複数行入力フォームの pcomment| |~バージョン|1.4.3| |~投稿者|[[korosuke]]| |~状態|質問| |~投稿日|&new{2004-06-20 (SUN) 22:39:20};| ***質問 [#w7689439] comment プラグインを用いた際に複数行入力フォーム(textarea) を用いることができるように comment2 という名前で以下のように修正をしたのですが、pcomment で実現しようとしたときに、ソースが長すぎてよくわかりませんでした。 少し読んだところ、- によるリストの代わりに ----\n による水平ラインを引いているのですが、pcomment においてそのようにすると改変箇所が多くなりそうでした。 どなたかご助力お願いできませんか? もしくはそのようなものをすでに作っている方はいませんか? よろしくお願いします。 --- comment.inc.php 2004-05-21 17:14:00.000000000 +0900 +++ comment2.inc.php 2004-05-26 21:09:55.644003200 +0900 @@ -26,7 +26,7 @@ // コメントが投稿された場合、内容をメールで送る先 //define('COMMENT_MAIL',FALSE); -function plugin_comment_action() +function plugin_comment2_action() { global $script,$vars,$post,$now; global $_title_updated,$_no_name; @@ -40,7 +40,7 @@ } $head = ''; - if (preg_match('/^(-{1,2})(.*)/',$post['msg'],$match)) + if (preg_match('/^(----\n)(.*)/',$post['msg'],$match)) { $head = $match[1]; $post['msg'] = $match[2]; @@ -69,7 +69,7 @@ } if (preg_match('/^#comment/',$line) and $comment_no++ == $post['comment_no']) { - $postdata = rtrim($postdata)."\n-$comment\n"; + $postdata = rtrim($postdata)."\n----\n$comment\n"; if ($comment_ins) { $postdata .= "\n"; @@ -98,7 +98,7 @@ return $retvars; } -function plugin_comment_convert() +function plugin_comment2_convert() { global $script,$vars,$digest; global $_btn_comment,$_btn_name,$_msg_comment; @@ -131,13 +131,14 @@ <div> <input type="hidden" name="comment_no" value="$comment_no" /> <input type="hidden" name="refer" value="$s_page" /> - <input type="hidden" name="plugin" value="comment" /> + <input type="hidden" name="plugin" value="comment2" /> <input type="hidden" name="nodate" value="$nodate" /> <input type="hidden" name="above" value="$above" /> <input type="hidden" name="digest" value="$digest" /> $nametags - <input type="text" name="msg" size="$comment_cols" /> <input type="submit" name="comment" value="$_btn_comment" /> + <br /> + <textarea name="msg" cols="$comment_cols" rows="4"></textarea> </div> </form> EOD; ***回答 [#n259841f] //#comment
テキスト整形のルールを表示する