Skip to:
Content

bbPress.org

Changeset 3170


Ignore:
Timestamp:
05/18/2011 10:21:42 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Make forums settings section descriptions more verbose. Separate root slug section from single slugs. Add section for future RSS feed topics/replies per page.

Location:
branches/plugin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-admin/bbp-admin.php

    r3158 r3170  
    206206        register_setting  ( 'bbpress',               '_bbp_replies_per_page',              'intval'                                                                 );
    207207
     208        /** Per RSS Page Section **********************************************/
     209
     210        // Add the per page section
     211        add_settings_section( 'bbp_per_rss_page',    __( 'Per RSS Page',      'bbpress' ), 'bbp_admin_setting_callback_per_rss_page_section', 'bbpress'                     );
     212
     213        // Topics per page setting
     214        add_settings_field( '_bbp_topics_per_page',  __( 'Topics Per Page',   'bbpress' ), 'bbp_admin_setting_callback_topics_per_rss_page',  'bbpress', 'bbp_per_rss_page' );
     215        register_setting  ( 'bbpress',               '_bbp_topics_per_rss_page',           'intval'                                                                         );
     216
     217        // Replies per page setting
     218        add_settings_field( '_bbp_replies_per_page', __( 'Replies Per Page',  'bbpress' ), 'bbp_admin_setting_callback_replies_per_rss_page', 'bbpress', 'bbp_per_rss_page' );
     219        register_setting  ( 'bbpress',               '_bbp_replies_per_rss_page',          'intval'                                                                         );
     220
    208221        /** Slug Section ******************************************************/
    209222
    210223        // Add the per page section
    211         add_settings_section( 'bbp_slugs',          __( 'Forums',        'bbpress' ), 'bbp_admin_setting_callback_slugs_section',   'bbpress'              );
     224        add_settings_section( 'bbp_root_slug',   __( 'Forum Base',    'bbpress' ), 'bbp_admin_setting_callback_root_slug_section',   'bbpress'                  );
    212225
    213226        // Root slug setting
    214         add_settings_field( '_bbp_root_slug',       __( 'Forum base',    'bbpress' ), 'bbp_admin_setting_callback_root_slug',       'bbpress', 'bbp_slugs' );
    215         register_setting  ( 'bbpress',              '_bbp_root_slug',                 'esc_sql'                                                            );
     227        add_settings_field( '_bbp_root_slug',    __( 'Forum base',    'bbpress' ), 'bbp_admin_setting_callback_root_slug',           'bbpress', 'bbp_root_slug' );
     228        register_setting  ( 'bbpress',           '_bbp_root_slug',                 'esc_sql'                                                                    );
    216229
    217230        // Include root setting
    218         add_settings_field( '_bbp_include_root',    __( 'Include base?', 'bbpress' ), 'bbp_admin_setting_callback_include_root',    'bbpress', 'bbp_slugs' );
    219         register_setting  ( 'bbpress',              '_bbp_include_root',              'intval'                                                             );
     231        add_settings_field( '_bbp_include_root', __( 'Include base?', 'bbpress' ), 'bbp_admin_setting_callback_include_root',        'bbpress', 'bbp_root_slug' );
     232        register_setting  ( 'bbpress',           '_bbp_include_root',              'intval'                                                                     );
     233
     234        // Add the per page section
     235        add_settings_section( 'bbp_single_slugs',   __( 'Single Slugs',  'bbpress' ), 'bbp_admin_setting_callback_single_slug_section', 'bbpress'                     );
     236
     237        // Forum slug setting
     238        add_settings_field( '_bbp_forum_slug',      __( 'Forum slug',    'bbpress' ), 'bbp_admin_setting_callback_forum_slug',          'bbpress', 'bbp_single_slugs' );
     239        register_setting  ( 'bbpress',             '_bbp_forum_slug',                 'sanitize_title'                                                                );
     240
     241        // Topic slug setting
     242        add_settings_field( '_bbp_topic_slug',      __( 'Topic slug',    'bbpress' ), 'bbp_admin_setting_callback_topic_slug',          'bbpress', 'bbp_single_slugs' );
     243        register_setting  ( 'bbpress',             '_bbp_topic_slug',                 'sanitize_title'                                                                );
     244
     245        // Topic tag slug setting
     246        add_settings_field( '_bbp_topic_tag_slug', __( 'Topic tag slug', 'bbpress' ), 'bbp_admin_setting_callback_topic_tag_slug',      'bbpress', 'bbp_single_slugs' );
     247        register_setting  ( 'bbpress',             '_bbp_topic_tag_slug',             'sanitize_title'                                                                );
     248
     249        // Reply slug setting
     250        add_settings_field( '_bbp_reply_slug',      __( 'Reply slug',    'bbpress' ), 'bbp_admin_setting_callback_reply_slug',          'bbpress', 'bbp_single_slugs' );
     251        register_setting  ( 'bbpress',             '_bbp_reply_slug',                 'sanitize_title'                                                                );
    220252
    221253        // User slug setting
    222         add_settings_field( '_bbp_user_slug',       __( 'User base',     'bbpress' ), 'bbp_admin_setting_callback_user_slug',       'bbpress', 'bbp_slugs' );
    223         register_setting  ( 'bbpress',              '_bbp_user_slug',                 'sanitize_title'                                                     );
     254        add_settings_field( '_bbp_user_slug',       __( 'User base',     'bbpress' ), 'bbp_admin_setting_callback_user_slug',           'bbpress', 'bbp_single_slugs' );
     255        register_setting  ( 'bbpress',              '_bbp_user_slug',                 'sanitize_title'                                                                );
    224256
    225257        // View slug setting
    226         add_settings_field( '_bbp_view_slug',       __( 'View base',     'bbpress' ), 'bbp_admin_setting_callback_view_slug',       'bbpress', 'bbp_slugs' );
    227         register_setting  ( 'bbpress',              '_bbp_view_slug',                 'sanitize_title'                                                     );
    228 
    229         // Forum slug setting
    230         add_settings_field( '_bbp_forum_slug',      __( 'Forum slug',    'bbpress' ), 'bbp_admin_setting_callback_forum_slug',      'bbpress', 'bbp_slugs' );
    231         register_setting  ( 'bbpress',             '_bbp_forum_slug',                 'sanitize_title'                                                     );
    232 
    233         // Topic slug setting
    234         add_settings_field( '_bbp_topic_slug',      __( 'Topic slug',    'bbpress' ), 'bbp_admin_setting_callback_topic_slug',      'bbpress', 'bbp_slugs' );
    235         register_setting  ( 'bbpress',             '_bbp_topic_slug',                 'sanitize_title'                                                     );
    236 
    237         // Reply slug setting
    238         add_settings_field( '_bbp_reply_slug',      __( 'Reply slug',    'bbpress' ), 'bbp_admin_setting_callback_reply_slug',      'bbpress', 'bbp_slugs' );
    239         register_setting  ( 'bbpress',             '_bbp_reply_slug',                 'sanitize_title'                                                     );
    240 
    241         // Topic tag slug setting
    242         add_settings_field( '_bbp_topic_tag_slug', __( 'Topic tag slug', 'bbpress' ), 'bbp_admin_setting_callback_topic_tag_slug',  'bbpress', 'bbp_slugs' );
    243         register_setting  ( 'bbpress',             '_bbp_topic_tag_slug',             'sanitize_title'                                                     );
     258        add_settings_field( '_bbp_view_slug',       __( 'View base',     'bbpress' ), 'bbp_admin_setting_callback_view_slug',           'bbpress', 'bbp_single_slugs' );
     259        register_setting  ( 'bbpress',              '_bbp_view_slug',                 'sanitize_title'                                                                );
    244260
    245261        do_action( 'bbp_register_admin_settings' );
  • branches/plugin/bbp-admin/bbp-settings.php

    r3119 r3170  
    2121?>
    2222
    23             <p><?php _e( 'Main settings for the bbPress plugin', 'bbpress' ); ?></p>
     23    <p><?php _e( 'Main settings for the bbPress plugin', 'bbpress' ); ?></p>
    2424
    2525<?php
     
    3636?>
    3737
    38             <input name="_bbp_edit_lock" type="text" id="_bbp_edit_lock" value="<?php form_option( '_bbp_edit_lock' ); ?>" class="small-text" />
    39             <label for="_bbp_edit_lock"><?php _e( 'minutes', 'bbpress' ); ?></label>
     38    <input name="_bbp_edit_lock" type="text" id="_bbp_edit_lock" value="<?php form_option( '_bbp_edit_lock' ); ?>" class="small-text" />
     39    <label for="_bbp_edit_lock"><?php _e( 'minutes', 'bbpress' ); ?></label>
    4040
    4141<?php
     
    5252?>
    5353
    54             <input name="_bbp_throttle_time" type="text" id="_bbp_throttle_time" value="<?php form_option( '_bbp_throttle_time' ); ?>" class="small-text" />
    55             <label for="_bbp_throttle_time"><?php _e( 'seconds', 'bbpress' ); ?></label>
     54    <input name="_bbp_throttle_time" type="text" id="_bbp_throttle_time" value="<?php form_option( '_bbp_throttle_time' ); ?>" class="small-text" />
     55    <label for="_bbp_throttle_time"><?php _e( 'seconds', 'bbpress' ); ?></label>
    5656
    5757<?php
     
    6868?>
    6969
    70             <input id="_bbp_enable_favorites" name="_bbp_enable_favorites" type="checkbox" id="_bbp_enable_favorites" value="1" <?php checked( true, bbp_is_favorites_active() ); ?> />
    71             <label for="_bbp_enable_favorites"><?php _e( 'Allow users to mark topics as favorites?', 'bbpress' ); ?></label>
     70    <input id="_bbp_enable_favorites" name="_bbp_enable_favorites" type="checkbox" id="_bbp_enable_favorites" value="1" <?php checked( true, bbp_is_favorites_active() ); ?> />
     71    <label for="_bbp_enable_favorites"><?php _e( 'Allow users to mark topics as favorites?', 'bbpress' ); ?></label>
    7272
    7373<?php
     
    8484?>
    8585
    86             <input id="_bbp_enable_subscriptions" name="_bbp_enable_subscriptions" type="checkbox" id="_bbp_enable_subscriptions" value="1" <?php checked( true, bbp_is_subscriptions_active() ); ?> />
    87             <label for="_bbp_enable_subscriptions"><?php _e( 'Allow users to subscribe to topics', 'bbpress' ); ?></label>
     86    <input id="_bbp_enable_subscriptions" name="_bbp_enable_subscriptions" type="checkbox" id="_bbp_enable_subscriptions" value="1" <?php checked( true, bbp_is_subscriptions_active() ); ?> />
     87    <label for="_bbp_enable_subscriptions"><?php _e( 'Allow users to subscribe to topics', 'bbpress' ); ?></label>
    8888
    8989<?php
     
    100100?>
    101101
    102             <input id="_bbp_allow_anonymous" name="_bbp_allow_anonymous" type="checkbox" id="_bbp_allow_anonymous" value="1" <?php checked( true, bbp_allow_anonymous() ); ?> />
    103             <label for="_bbp_allow_anonymous"><?php _e( 'Allow guest users without accounts to create topics and replies', 'bbpress' ); ?></label>
     102    <input id="_bbp_allow_anonymous" name="_bbp_allow_anonymous" type="checkbox" id="_bbp_allow_anonymous" value="1" <?php checked( true, bbp_allow_anonymous() ); ?> />
     103    <label for="_bbp_allow_anonymous"><?php _e( 'Allow guest users without accounts to create topics and replies', 'bbpress' ); ?></label>
    104104
    105105<?php
     
    116116?>
    117117
    118             <p><?php _e( 'Per page settings for the bbPress plugin', 'bbpress' ); ?></p>
     118    <p><?php _e( 'Per page settings for the bbPress plugin', 'bbpress' ); ?></p>
    119119
    120120<?php
     
    131131?>
    132132
    133             <input name="_bbp_topics_per_page" type="text" id="_bbp_topics_per_page" value="<?php form_option( '_bbp_topics_per_page' ); ?>" class="small-text" />
    134             <label for="_bbp_topics_per_page"><?php _e( 'per page', 'bbpress' ); ?></label>
     133    <input name="_bbp_topics_per_page" type="text" id="_bbp_topics_per_page" value="<?php form_option( '_bbp_topics_per_page' ); ?>" class="small-text" />
     134    <label for="_bbp_topics_per_page"><?php _e( 'per page', 'bbpress' ); ?></label>
    135135
    136136<?php
     
    147147?>
    148148
    149             <input name="_bbp_replies_per_page" type="text" id="_bbp_replies_per_page" value="<?php form_option( '_bbp_replies_per_page' ); ?>" class="small-text" />
    150             <label for="_bbp_replies_per_page"><?php _e( 'per page', 'bbpress' ); ?></label>
     149    <input name="_bbp_replies_per_page" type="text" id="_bbp_replies_per_page" value="<?php form_option( '_bbp_replies_per_page' ); ?>" class="small-text" />
     150    <label for="_bbp_replies_per_page"><?php _e( 'per page', 'bbpress' ); ?></label>
     151
     152<?php
     153}
     154
     155/** Start Per RSS Page Section ************************************************/
     156
     157/**
     158 * Per page settings section description for the settings page
     159 *
     160 * @since bbPress (r2786)
     161 */
     162function bbp_admin_setting_callback_per_rss_page_section() {
     163?>
     164
     165    <p><?php _e( 'Per RSS page settings for the bbPress plugin', 'bbpress' ); ?></p>
     166
     167<?php
     168}
     169
     170/**
     171 * Topics per RSS page setting field
     172 *
     173 * @since bbPress (r2786)
     174 *
     175 * @uses form_option() To output the option value
     176 */
     177function bbp_admin_setting_callback_topics_per_rss_page() {
     178?>
     179
     180    <input name="_bbp_topics_per_rss_page" type="text" id="_bbp_topics_per_rss_page" value="<?php form_option( '_bbp_topics_per_rss_page' ); ?>" class="small-text" />
     181    <label for="_bbp_topics_per_rss_page"><?php _e( 'per page', 'bbpress' ); ?></label>
     182
     183<?php
     184}
     185
     186/**
     187 * Replies per RSS page setting field
     188 *
     189 * @since bbPress (r2786)
     190 *
     191 * @uses form_option() To output the option value
     192 */
     193function bbp_admin_setting_callback_replies_per_rss_page() {
     194?>
     195
     196    <input name="_bbp_replies_per_rss_page" type="text" id="_bbp_replies_per_rss_page" value="<?php form_option( '_bbp_replies_per_rss_page' ); ?>" class="small-text" />
     197    <label for="_bbp_replies_per_rss_page"><?php _e( 'per page', 'bbpress' ); ?></label>
    151198
    152199<?php
     
    160207 * @since bbPress (r2786)
    161208 */
    162 function bbp_admin_setting_callback_slugs_section() {
     209function bbp_admin_setting_callback_root_slug_section() {
    163210
    164211    // Flush rewrite rules when this section is saved
     
    166213        flush_rewrite_rules(); ?>
    167214
    168             <p><?php printf( __( 'If you like, you may enter custom structures for your forum, topic, reply, and tag URLs here. If you change any of these, all previous links will stop working. If you leave these empty the defaults will be used.', 'bbpress' ), get_admin_url( null, 'options-permalink.php' ) ); ?></p>
     215    <p><?php printf( __( 'Include a custom root slug to prefix your forums pages with. This should be partnered with a WordPress page to act as the home of your forums.', 'bbpress' ), get_admin_url( null, 'options-permalink.php' ) ); ?></p>
    169216
    170217<?php
     
    181228?>
    182229
    183             <input name="_bbp_root_slug" type="text" id="_bbp_root_slug" class="regular-text code" value="<?php form_option( '_bbp_root_slug' ); ?>" />
     230        <input name="_bbp_root_slug" type="text" id="_bbp_root_slug" class="regular-text code" value="<?php form_option( '_bbp_root_slug' ); ?>" />
     231        <p class="description"><?php _e( 'Typical installations should have a page with this same slug.', 'bbpress' ); ?></p>
    184232
    185233<?php
     
    196244?>
    197245
    198             <input id="_bbp_include_root" name="_bbp_include_root" type="checkbox" id="_bbp_include_root" value="1" <?php checked( true, get_option( '_bbp_include_root', true ) ); ?> />
    199             <label for="_bbp_include_root"><?php _e( 'Prefix the root slug before the following slugs?', 'bbpress' ); ?></label>
     246    <input id="_bbp_include_root" name="_bbp_include_root" type="checkbox" id="_bbp_include_root" value="1" <?php checked( true, get_option( '_bbp_include_root', true ) ); ?> />
     247    <label for="_bbp_include_root"><?php _e( 'Prefix the root slug before the following slugs?', 'bbpress' ); ?></label>
     248
     249<?php
     250}
     251
     252/**
     253 * Slugs settings section description for the settings page
     254 *
     255 * @since bbPress (r2786)
     256 */
     257function bbp_admin_setting_callback_single_slug_section() {
     258
     259    // Flush rewrite rules when this section is saved
     260    if ( isset( $_GET['settings-updated'] ) && isset( $_GET['page'] ) )
     261        flush_rewrite_rules(); ?>
     262
     263    <p><?php printf( __( 'You can enter custom structures for your forum, topic, reply, and tag URLs here. If you change any of these, all previous links will stop working. If you leave these empty the defaults will be used.', 'bbpress' ), get_admin_url( null, 'options-permalink.php' ) ); ?></p>
    200264
    201265<?php
     
    212276?>
    213277
    214             <input name="_bbp_user_slug" type="text" id="_bbp_user_slug" class="regular-text code" value="<?php form_option( '_bbp_user_slug' ); ?>" />
     278    <input name="_bbp_user_slug" type="text" id="_bbp_user_slug" class="regular-text code" value="<?php form_option( '_bbp_user_slug' ); ?>" />
    215279
    216280<?php
     
    227291?>
    228292
    229             <input name="_bbp_view_slug" type="text" id="_bbp_view_slug" class="regular-text code" value="<?php form_option( '_bbp_view_slug' ); ?>" />
     293    <input name="_bbp_view_slug" type="text" id="_bbp_view_slug" class="regular-text code" value="<?php form_option( '_bbp_view_slug' ); ?>" />
    230294
    231295<?php
     
    242306?>
    243307
    244             <input name="_bbp_forum_slug" type="text" id="_bbp_forum_slug" class="regular-text code" value="<?php form_option( '_bbp_forum_slug' ); ?>" />
     308    <input name="_bbp_forum_slug" type="text" id="_bbp_forum_slug" class="regular-text code" value="<?php form_option( '_bbp_forum_slug' ); ?>" />
    245309
    246310<?php
     
    257321?>
    258322
    259             <input name="_bbp_topic_slug" type="text" id="_bbp_topic_slug" class="regular-text code" value="<?php form_option( '_bbp_topic_slug' ); ?>" />
     323    <input name="_bbp_topic_slug" type="text" id="_bbp_topic_slug" class="regular-text code" value="<?php form_option( '_bbp_topic_slug' ); ?>" />
    260324
    261325<?php
     
    272336?>
    273337
    274             <input name="_bbp_reply_slug" type="text" id="_bbp_reply_slug" class="regular-text code" value="<?php form_option( '_bbp_reply_slug' ); ?>" />
     338    <input name="_bbp_reply_slug" type="text" id="_bbp_reply_slug" class="regular-text code" value="<?php form_option( '_bbp_reply_slug' ); ?>" />
    275339
    276340<?php
     
    287351?>
    288352
    289             <input name="_bbp_topic_tag_slug" type="text" id="_bbp_topic_tag_slug" class="regular-text code" value="<?php form_option( '_bbp_topic_tag_slug' ); ?>" />
     353    <input name="_bbp_topic_tag_slug" type="text" id="_bbp_topic_tag_slug" class="regular-text code" value="<?php form_option( '_bbp_topic_tag_slug' ); ?>" />
    290354
    291355<?php
  • branches/plugin/bbp-includes/bbp-core-options.php

    r3145 r3170  
    5555        // Forums per page
    5656        '_bbp_forums_per_page'      => '50',
     57
     58        // Topics per RSS page
     59        '_bbp_topics_per_rss_page'  => '25',
     60
     61        // Replies per RSS page
     62        '_bbp_replies_per_rss_page' => '25',
    5763
    5864        /** Slugs *************************************************************/
Note: See TracChangeset for help on using the changeset viewer.