Plugin Directory

Changeset 1124088


Ignore:
Timestamp:
03/31/2015 02:19:20 AM (11 years ago)
Author:
Webnist
Message:

Add Grouping multiple pages

Location:
custom-nextpage/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • custom-nextpage/trunk/custom-nextpage.php

    r1123345 r1124088  
    55Description: MultiPage is a customizable plugin. Can any title on the page.
    66Author: Webnist
    7 Version: 1.0.6
     7Version: 1.1.0
    88Author URI: http://profiles.wordpress.org/webnist
    99License: GPLv2 or later
     
    4646            'beforetext'       => '',
    4747            'aftertext'        => '',
     48            'show_all'         => 1,
     49            'end_size'         => 1,
     50            'mid_size'         => 2,
    4851            'show_boundary'    => 1,
    4952            'show_adjacent'    => 1,
     
    5962        $this->beforetext       = $this->options['beforetext'] ? $this->options['beforetext'] : '';
    6063        $this->aftertext        = $this->options['aftertext'] ? $this->options['aftertext'] : '';
     64        $this->show_all         = $this->options['show_all'] ? $this->options['show_all'] : '';
     65        $this->end_size         = $this->options['end_size'] ? $this->options['end_size'] : 1;
     66        $this->mid_size         = $this->options['mid_size'] ? $this->options['mid_size'] : 2;
    6167        $this->show_boundary    = $this->options['show_boundary'] ? $this->options['show_boundary'] : '';
    6268        $this->show_adjacent    = $this->options['show_adjacent'] ? $this->options['show_adjacent'] : '';
     
    140146        $output = '';
    141147        if ( $multipage ) {
    142             $show_boundary     = esc_html( apply_filters( 'custom_next_page_show_boundary', $this->show_boundary ) );
    143             $show_adjacent     = esc_html( apply_filters( 'custom_next_page_show_adjacent', $this->show_adjacent ) );
    144             $firstpagelink     = esc_html( apply_filters( 'custom_next_page_firstpagelink', $this->firstpagelink ) );
     148            $show_all         = (boolean) $this->show_all;
     149            $end_size         = $this->end_size;
     150            $mid_size         = $this->mid_size;
     151            $show_boundary    = esc_html( apply_filters( 'custom_next_page_show_boundary', $this->show_boundary ) );
     152            $show_adjacent    = esc_html( apply_filters( 'custom_next_page_show_adjacent', $this->show_adjacent ) );
     153            $firstpagelink    = esc_html( apply_filters( 'custom_next_page_firstpagelink', $this->firstpagelink ) );
    145154            $lastpagelink     = esc_html( apply_filters( 'custom_next_page_lastpagelink', $this->lastpagelink ) );
    146155            $nextpagelink     = esc_html( apply_filters( 'custom_next_page_nextpagelink', $this->nextpagelink ) );
     
    162171                    $output .= '<li class="previous">' . $link . $previouspagelink . '</a></li>';
    163172            }
    164             for ( $i = 1; $i <= $numpages; $i++ ) {
    165                 if ( $page === $i ) {
    166                     $link  = '<li class="numpages current"><span>' . $i . '</span></li>';
     173
     174            $p_base   = get_permalink();
     175            $p_format = '%#%';
     176
     177            if($word = strpos($p_base, '?')){
     178                $p_base = get_option(home).(substr(get_option(home), -1 ,1) === '/' ? '' : '/')
     179                    .'%_%'.substr($p_base, $word);
     180            } else{
     181                $p_base .= (substr($p_base, -1 ,1) === '/' ? '' : '/') .'%_%';
     182            }
     183            $nav_list = paginate_links(array(
     184                'base'      => $p_base,
     185                'format'    => $p_format,
     186                'total'     => $numpages,
     187                'current'   => ($page ? $page : 1),
     188                'show_all'  => $show_all,
     189                'end_size'  => $end_size,
     190                'mid_size'  => $mid_size,
     191                'prev_next' => false,
     192                'type'      => 'array',
     193            ));
     194            foreach ( $nav_list as $nav ) {
     195                if ( stristr( $nav, 'span' ) ) {
     196                    if ( stristr( $nav, 'dots' ) ) {
     197                        $output .= '<li class="numpages dots"><span>' . strip_tags( $nav ) . '</span></li>';
     198                    } else {
     199                        $output .= '<li class="numpages current"><span>' . strip_tags( $nav ) . '</span></li>';
     200                    }
    167201                } else {
    168                     $link  = '<li class="numpages">' . _wp_link_page( $i ) . $i . '</a></li>';
     202                    $output .= '<li class="numpages">' . $nav . '</li>';
    169203                }
    170                 $output .= $link;
    171             }
     204            }
     205
    172206            $i = $page + 1;
    173207            if ( $i <= $numpages ) {
  • custom-nextpage/trunk/includes/class-admin-menu.php

    r1015430 r1124088  
    108108
    109109        add_settings_field(
     110            'custom-next-page-show_all',
     111            __( 'Show all numbers', $this->domain ),
     112            array( &$this, 'check_field' ),
     113            $this->plugin_basename,
     114            'general',
     115            array(
     116                'name'  => 'custom-next-page[show_all]',
     117                'value' => $this->show_all,
     118            )
     119        );
     120        add_settings_field(
     121            'custom-next-page-end_size',
     122            __( 'End size', $this->domain ),
     123            array( &$this, 'text_field' ),
     124            $this->plugin_basename,
     125            'general',
     126            array(
     127                'name'  => 'custom-next-page[end_size]',
     128                'value' => $this->end_size,
     129                'class' => 'small-text',
     130                'desc'  => __( 'How many numbers on either the start and the end list edges.', $this->domain ),
     131            )
     132        );
     133        add_settings_field(
     134            'custom-next-page-mid_size',
     135            __( 'Mid size', $this->domain ),
     136            array( &$this, 'text_field' ),
     137            $this->plugin_basename,
     138            'general',
     139            array(
     140                'name'  => 'custom-next-page[mid_size]',
     141                'value' => $this->mid_size,
     142                'class' => 'small-text',
     143                'desc'  => __( 'How many numbers to either side of current page, but not including current page.', $this->domain ),
     144            )
     145        );
     146        add_settings_field(
    110147            'custom-next-page-boundary',
    111148            __( 'The first and last page links displayed.', $this->domain ),
     
    223260        $id      = ! empty( $id ) ? $id : $name;
    224261        $desc    = ! empty( $desc ) ? $desc : '';
    225         $output  = '<input type="text" name="' . $name .'" id="' . $id .'" class="regular-text" value="' . $value .'" />' . "\n";
     262        $class   = ! empty( $class ) ? $class: 'regular-text';
     263        $output  = '<input type="text" name="' . $name .'" id="' . $id .'" class="' . $class . '" value="' . $value .'" />' . "\n";
    226264        if ( $desc )
    227265            $output .= '<p class="description">' . $desc . '</p>' . "\n";
     
    300338    public function register_setting_check( $value ) {
    301339        $value['filter']        = (int) $value['filter'];
     340        $value['show_all']      = (int) $value['show_all'];
     341        $value['end_size']      = (int) $value['end_size'];
     342        $value['end_size']      = (int) $value['end_size'];
    302343        $value['show_boundary'] = (int) $value['show_boundary'];
    303344        $value['show_adjacent'] = (int) $value['show_adjacent'];
  • custom-nextpage/trunk/languages/custom-nextpage-ja.po

    r1071540 r1124088  
    55"Project-Id-Version: Custom Nextpage 0.9.8\n"
    66"Report-Msgid-Bugs-To: http://wordpress.org/tag/custom-nextpage\n"
    7 "POT-Creation-Date: 2014-10-03 04:12:45+00:00\n"
    8 "PO-Revision-Date: 2014-10-03 13:21+0900\n"
     7"POT-Creation-Date: 2015-03-30 06:27:28+00:00\n"
     8"PO-Revision-Date: 2015-03-30 15:28+0900\n"
    99"Last-Translator: Webnist <webnist@webnist.org>\n"
    1010"Language-Team: LANGUAGE <LL@li.org>\n"
     
    1616"Plural-Forms: nplurals=1; plural=0;\n"
    1717
    18 #: custom-nextpage.php:50 custom-nextpage.php:63
    19 #: includes/class-admin-menu.php:316
     18#: custom-nextpage.php:53 custom-nextpage.php:69
     19#: includes/class-admin-menu.php:358
    2020msgid "&#171;"
    2121msgstr "&#171;"
    2222
    23 #: custom-nextpage.php:51 custom-nextpage.php:64
    24 #: includes/class-admin-menu.php:315
     23#: custom-nextpage.php:54 custom-nextpage.php:70
     24#: includes/class-admin-menu.php:357
    2525msgid "&#187;"
    2626msgstr "&#187;"
    2727
    28 #: custom-nextpage.php:52 custom-nextpage.php:65
     28#: custom-nextpage.php:55 custom-nextpage.php:71
    2929msgid "&gt;"
    3030msgstr "&gt;"
    3131
    32 #: custom-nextpage.php:53 custom-nextpage.php:66
     32#: custom-nextpage.php:56 custom-nextpage.php:72
    3333msgid "&lt;"
    3434msgstr "&lt;"
     
    5959msgstr "新しいオプションに変換します。"
    6060
    61 #: includes/class-admin-menu.php:55 includes/class-admin-menu.php:308
     61#: includes/class-admin-menu.php:55 includes/class-admin-menu.php:350
    6262msgid "Convert"
    6363msgstr "コンバート"
     
    6767msgstr "設定の初期化"
    6868
    69 #: includes/class-admin-menu.php:58 includes/class-admin-menu.php:329
     69#: includes/class-admin-menu.php:58 includes/class-admin-menu.php:371
    7070msgid "Initialization"
    7171msgstr "初期化"
     
    8888
    8989#: includes/class-admin-menu.php:111
     90msgid "Show all numbers"
     91msgstr "全て表示"
     92
     93#: includes/class-admin-menu.php:122
     94msgid "End size"
     95msgstr "End size"
     96
     97#: includes/class-admin-menu.php:130
     98msgid "How many numbers on either the start and the end list edges."
     99msgstr "ページ番号のリストの両端(最初と最後)にいくつの数字を表示するか。"
     100
     101#: includes/class-admin-menu.php:135
     102msgid "Mid size"
     103msgstr "Mid size"
     104
     105#: includes/class-admin-menu.php:143
     106msgid ""
     107"How many numbers to either side of current page, but not including current "
     108"page."
     109msgstr ""
     110"現在のページの両側にいくつの数字を表示するか。ただし現在のページは含みませ"
     111"ん。"
     112
     113#: includes/class-admin-menu.php:148
    90114msgid "The first and last page links displayed."
    91115msgstr "最初と最後のリンクを表示する"
    92116
    93 #: includes/class-admin-menu.php:123
     117#: includes/class-admin-menu.php:160
    94118msgid "Next and previous page links to display."
    95119msgstr "次と前のリンクを表示する"
    96120
    97 #: includes/class-admin-menu.php:135
     121#: includes/class-admin-menu.php:172
    98122msgid "Text For First Page"
    99123msgstr "最初のページリンクのテキスト"
    100124
    101 #: includes/class-admin-menu.php:147
     125#: includes/class-admin-menu.php:184
    102126msgid "Text For Last Page"
    103127msgstr "最後のページリンクのテキスト"
    104128
    105 #: includes/class-admin-menu.php:159
     129#: includes/class-admin-menu.php:196
    106130msgid "Text For Next Page"
    107131msgstr "次のページリンクのテキスト"
    108132
    109 #: includes/class-admin-menu.php:171
     133#: includes/class-admin-menu.php:208
    110134msgid "Text For Previous Page"
    111135msgstr "前のページリンクのテキスト"
    112136
    113 #: includes/class-admin-menu.php:183
     137#: includes/class-admin-menu.php:220
    114138msgid "Style"
    115139msgstr "スタイル"
    116140
    117 #: includes/class-admin-menu.php:190
     141#: includes/class-admin-menu.php:227
    118142msgid "Select Style type"
    119143msgstr "スタイルの選択"
    120144
    121 #: includes/class-admin-menu.php:197
     145#: includes/class-admin-menu.php:234
    122146msgid "Default"
    123147msgstr "デフォルト"
    124148
    125 #: includes/class-admin-menu.php:198 includes/class-admin-menu.php:207
     149#: includes/class-admin-menu.php:235 includes/class-admin-menu.php:244
    126150msgid "Style Edit"
    127151msgstr "スタイル編集"
    128152
    129 #: includes/class-admin-menu.php:199
     153#: includes/class-admin-menu.php:236
    130154msgid "Disable"
    131155msgstr "無効化"
    132156
    133 #: includes/class-admin-menu.php:215
     157#: includes/class-admin-menu.php:252
    134158msgid ""
    135159"Press ctrl-space to activate autocompletion. <span class=\"button button-"
  • custom-nextpage/trunk/languages/custom-nextpage.pot

    r1001285 r1124088  
    1 # Copyright (C) 2014 Custom Nextpage
     1# Copyright (C) 2015 Custom Nextpage
    22# This file is distributed under the same license as the Custom Nextpage package.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Custom Nextpage 1.0.0\n"
     5"Project-Id-Version: Custom Nextpage 1.1.0\n"
    66"Report-Msgid-Bugs-To: http://wordpress.org/tag/custom-nextpage\n"
    7 "POT-Creation-Date: 2014-10-03 04:12:45+00:00\n"
     7"POT-Creation-Date: 2015-03-30 06:27:28+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=UTF-8\n"
    1010"Content-Transfer-Encoding: 8bit\n"
    11 "PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
     11"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
    1212"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1313"Language-Team: LANGUAGE <LL@li.org>\n"
    1414
    15 #: custom-nextpage.php:50 custom-nextpage.php:63
    16 #: includes/class-admin-menu.php:316
     15#: custom-nextpage.php:53 custom-nextpage.php:69
     16#: includes/class-admin-menu.php:358
    1717msgid "&#171;"
    1818msgstr ""
    1919
    20 #: custom-nextpage.php:51 custom-nextpage.php:64
    21 #: includes/class-admin-menu.php:315
     20#: custom-nextpage.php:54 custom-nextpage.php:70
     21#: includes/class-admin-menu.php:357
    2222msgid "&#187;"
    2323msgstr ""
    2424
    25 #: custom-nextpage.php:52 custom-nextpage.php:65
     25#: custom-nextpage.php:55 custom-nextpage.php:71
    2626msgid "&gt;"
    2727msgstr ""
    2828
    29 #: custom-nextpage.php:53 custom-nextpage.php:66
     29#: custom-nextpage.php:56 custom-nextpage.php:72
    3030msgid "&lt;"
    3131msgstr ""
     
    4343msgstr ""
    4444
    45 #. #-#-#-#-#  custom-nextpage.pot (Custom Nextpage 1.0.0)  #-#-#-#-#
     45#. #-#-#-#-#  custom-nextpage.pot (Custom Nextpage 1.1.0)  #-#-#-#-#
    4646#. Plugin Name of the plugin/theme
    4747#: includes/class-admin-menu.php:15
     
    5757msgstr ""
    5858
    59 #: includes/class-admin-menu.php:55 includes/class-admin-menu.php:308
     59#: includes/class-admin-menu.php:55 includes/class-admin-menu.php:350
    6060msgid "Convert"
    6161msgstr ""
     
    6565msgstr ""
    6666
    67 #: includes/class-admin-menu.php:58 includes/class-admin-menu.php:329
     67#: includes/class-admin-menu.php:58 includes/class-admin-menu.php:371
    6868msgid "Initialization"
    6969msgstr ""
     
    8686
    8787#: includes/class-admin-menu.php:111
     88msgid "Show all numbers"
     89msgstr ""
     90
     91#: includes/class-admin-menu.php:122
     92msgid "End size"
     93msgstr ""
     94
     95#: includes/class-admin-menu.php:130
     96msgid "How many numbers on either the start and the end list edges."
     97msgstr ""
     98
     99#: includes/class-admin-menu.php:135
     100msgid "Mid size"
     101msgstr ""
     102
     103#: includes/class-admin-menu.php:143
     104msgid ""
     105"How many numbers to either side of current page, but not including current "
     106"page."
     107msgstr ""
     108
     109#: includes/class-admin-menu.php:148
    88110msgid "The first and last page links displayed."
    89111msgstr ""
    90112
    91 #: includes/class-admin-menu.php:123
     113#: includes/class-admin-menu.php:160
    92114msgid "Next and previous page links to display."
    93115msgstr ""
    94116
    95 #: includes/class-admin-menu.php:135
     117#: includes/class-admin-menu.php:172
    96118msgid "Text For First Page"
    97119msgstr ""
    98120
    99 #: includes/class-admin-menu.php:147
     121#: includes/class-admin-menu.php:184
    100122msgid "Text For Last Page"
    101123msgstr ""
    102124
    103 #: includes/class-admin-menu.php:159
     125#: includes/class-admin-menu.php:196
    104126msgid "Text For Next Page"
    105127msgstr ""
    106128
    107 #: includes/class-admin-menu.php:171
     129#: includes/class-admin-menu.php:208
    108130msgid "Text For Previous Page"
    109131msgstr ""
    110132
    111 #: includes/class-admin-menu.php:183
     133#: includes/class-admin-menu.php:220
    112134msgid "Style"
    113135msgstr ""
    114136
    115 #: includes/class-admin-menu.php:190
     137#: includes/class-admin-menu.php:227
    116138msgid "Select Style type"
    117139msgstr ""
    118140
    119 #: includes/class-admin-menu.php:197
     141#: includes/class-admin-menu.php:234
    120142msgid "Default"
    121143msgstr ""
    122144
    123 #: includes/class-admin-menu.php:198 includes/class-admin-menu.php:207
     145#: includes/class-admin-menu.php:235 includes/class-admin-menu.php:244
    124146msgid "Style Edit"
    125147msgstr ""
    126148
    127 #: includes/class-admin-menu.php:199
     149#: includes/class-admin-menu.php:236
    128150msgid "Disable"
    129151msgstr ""
    130152
    131 #: includes/class-admin-menu.php:215
     153#: includes/class-admin-menu.php:252
    132154msgid ""
    133155"Press ctrl-space to activate autocompletion. <span class=\"button button-"
  • custom-nextpage/trunk/readme.txt

    r1123345 r1124088  
    55Requires at least: 3.6
    66Tested up to: 4.0
    7 Version: 1.0.6
     7Version: 1.1.0
    88License: GPLv2 or later
    99
     
    4343== Changelog ==
    4444
     45= 1.1.0 =
     46Add Grouping multiple pages
     47
    4548= 1.0.6 =
    4649Fixed bug: Change WP_PLUGIN_URL to WP_PLUGIN_DIR for file_get_contents
Note: See TracChangeset for help on using the changeset viewer.