カテゴリ | |
---|---|
サマリ | 雛形となるtemplateを絞りたい |
バージョン | 1.4.5_1 |
投稿者 | アッカ |
状態 | 質問 |
投稿日 | 2005-07-11 (月) 20:09:03 |
普通に雛形を使ってページを作成しようとすると、 すべてのページがリストボックスに一覧表示され困っています。 雛形となるページを絞ることはできないんでしょうか?
@@ -146,7 +146,7 @@ global $script, $vars, $rows, $cols, $hr, $function_freeze; global $_btn_addtop, $_btn_preview, $_btn_repreview, $_btn_update, $_btn_cancel, $_msg_help, $_btn_notchangetimestamp; - global $whatsnew, $_btn_template, $_btn_load, $non_list, $load_template_func; + global $whatsnew, $_btn_template, $_btn_load, $template_list, $load_template_func; $refer = $template = $addtag = $add_top = ''; @@ -164,9 +164,9 @@ if($load_template_func && $b_template) { $pages = array(); - $non_list_pattern = '/' . $non_list . '/'; + $template_list_pattern = '/' . $template_list . '/'; foreach(get_existpages() as $_page) { - if ($_page == $whatsnew || preg_match($non_list_pattern, $_page)) + if ($_page == $whatsnew || (!preg_match($template_list_pattern, $_page))) continue; $s_page = htmlspecialchars($_page); $pages[$_page] = ' <option value="' . $s_page . '">' .pukiwiki.ini.phpで、
@@ -359,6 +359,7 @@ $auto_template_rules = array( '((.+)\/([^\/]+))' => '\2/template' ); +$template_list = 'template$'; ///////////////////////////////////////////////// // Automatically add fixed heading anchorのように正規表現でリストするページを指定するとか。 -- 2005-07-11 (月) 22:13:39
@@ -359,6 +359,7 @@ $auto_template_rules = array( '((.+)\/([^\/]+))' => '\2/template' ); +$template_list = 'template*';
先頭にtemplateとつくページを雛形としてリストアップします。
if($load_template_func && $b_template) { $pages = array(); + $template_list_pattern = '/' . $template_list . '/'; foreach(get_existpages() as $_page) { - if ($_page == $whatsnew || check_non_list($_page)) + if ($_page == $whatsnew || (! preg_match($template_list_pattern, $_page))) continue; $s_page = htmlspecialchars($_page); $pages[$_page] = ' <option value="' . $s_page . '">' .
if($load_template_func && $b_template) { $tpage_names = array(); // Pages marked as template $template_page = ':config/Templates'; $page_max = 100;で、固定的な設定$page_max の数値を減らすだけです -- 2016-08-04 (木) 21:33:41
if (preg_match('/template/i', $_page)) { $tpage_names[] = $_page; } else {のif 条件文を変更する
} else { if (count($page_names) >= $page_max) continue; $page_names[] = $_page; }で、$page_names[] = $_page; と格納される前に continue で抜ける条件を追加する