Skip to:
Content

bbPress.org


Ignore:
Timestamp:
01/14/2011 02:55:38 AM (16 years ago)
Author:
johnjamesjacoby
Message:

Disallow uncapable users from creating topics in closed forums. Fixes #1452. Props GautamGupta

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-general-template.php

    r2790 r2804  
    361361         *  - tab: Tabindex value. False or integer
    362362         *  - options_only: Show only <options>? No <select>?
    363          *  - show_none: False or something like __( '(No Forum)', 'bbpress' ), will have value=""
    364          *  - none_found: False or something like __( 'No forums to post to!', 'bbpress' )
    365          *  - disable_categories: Disable forum categories? Defaults to true. Only for forums and when the category option is displayed.
    366          * @return string
     363         *  - show_none: False or something like __( '(No Forum)', 'bbpress' ),
     364         *                will have value=""
     365         *  - none_found: False or something like
     366         *                 __( 'No forums to post to!', 'bbpress' )
     367         *  - disable_categories: Disable forum categories and closed forums?
     368         *                         Defaults to true. Only for forums and when
     369         *                         the category option is displayed.
     370         * @uses BBP_Walker_Dropdown() As the default walker to generate the
     371         *                              dropdown
     372         * @uses current_user_can() To check if the current user can read
     373         *                           private forums
     374         * @uses walk_page_dropdown_tree() To generate the dropdown using the
     375         *                                  walker
     376         * @uses apply_filters() Calls 'bbp_get_dropdown' with the dropdown
     377         *                        and args
     378         * @return string The dropdown
    367379         */
    368380        function bbp_get_dropdown( $args = '' ) {
     
    414426                // Don't show private forums to normal users
    415427                if ( !current_user_can( 'read_private_forums' ) && empty( $r['meta_key'] ) && empty( $r['meta_value'] ) && empty( $r['meta_compare'] ) ) {
    416                         $r['meta_key']     = '_bbp_forum_visibility';
    417                         $r['meta_value']   = 'public';
    418                         $r['meta_compare'] = '==';
     428                        $r['meta_key']   = '_bbp_forum_visibility';
     429                        $r['meta_value'] = 'public';
    419430                }
    420431
     
    452463                // Display feedback
    453464                } else {
    454                         // Long short hand
    455                         $retval .= !empty( $none_found ) ? $none_found : $post_type == $bbp->topic_id ? __( 'No topics to post to!', 'bbpress' ) : $post_type == $bbp->forum_id ? __( 'No forums to post to!', 'bbpress' ) : __( 'No posts found!', 'bbpress' );
     465                        // @todo - No nested ternaries
     466                        $retval .= !empty( $none_found ) ? $none_found : ( $post_type == $bbp->topic_id ? __( 'No topics to post to!', 'bbpress' ) : ( $post_type == $bbp->forum_id ? __( 'No forums to post to!', 'bbpress' ) : __( 'No posts found!', 'bbpress' ) ) );
    456467                }
    457468
Note: See TracChangeset for help on using the changeset viewer.