Skip to:
Content

bbPress.org

Changeset 4171


Ignore:
Timestamp:
08/24/2012 08:12:00 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Bozos:

  • Add bozo post status to bbp_has_topics() and bbp_has_replies() if current user is a bozo.
Location:
branches/plugin/bbp-includes
Files:
2 edited

Legend:

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

    r4156 r4171  
    4444 *
    4545 * @param mixed $args All the arguments supported by {@link WP_Query}
     46 * @uses bbp_is_user_bozo() To add the bozo post status
    4647 * @uses bbp_show_lead_topic() Are we showing the topic as a lead?
    4748 * @uses bbp_get_topic_id() To get the topic id
     
    6869
    6970    // What are the default allowed statuses (based on user caps)
    70     if ( bbp_get_view_all( 'edit_others_replies' ) )
    71         $default_post_status = join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() ) );
    72     else
    73         $default_post_status = join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) );
    74 
    75     // Maybe Search
     71    if ( bbp_get_view_all( 'edit_others_replies' ) ) {
     72        $post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() );
     73    } else {
     74        $post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id() );
     75    }
     76
     77    // Add the bozo status if user is a bozo
     78    if ( bbp_is_user_bozo() ) {
     79        $post_statuses[] = bbp_get_bozo_status_id();
     80    }
     81
    7682    $default_reply_search = !empty( $_REQUEST['rs'] ) ? $_REQUEST['rs'] : false;
    7783    $default_post_parent  = ( bbp_is_single_topic() ) ? bbp_get_topic_id() : 'any';
    7884    $default_post_type    = ( bbp_is_single_topic() && bbp_show_lead_topic() ) ? bbp_get_reply_post_type() : array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
     85    $default_post_status  = join( ',', $post_statuses );
    7986
    8087    // Default query args
  • branches/plugin/bbp-includes/bbp-topic-template.php

    r4156 r4171  
    6363 * @param mixed $args All the arguments supported by {@link WP_Query}
    6464 * @uses current_user_can() To check if the current user can edit other's topics
     65 * @uses bbp_is_user_bozo() To add the bozo post status
    6566 * @uses bbp_get_topic_post_type() To get the topic post type
    6667 * @uses WP_Query To make query and get the topics
     
    8687
    8788    // What are the default allowed statuses (based on user caps)
    88     if ( bbp_get_view_all() )
    89         $default_post_status = join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() ) );
    90     else
    91         $default_post_status = join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) );
    92 
    93     $default_topic_search    = !empty( $_REQUEST['ts'] ) ? $_REQUEST['ts'] : false;
    94     $default_show_stickies   = (bool) ( bbp_is_single_forum() || bbp_is_topic_archive() ) && ( false === $default_topic_search );
    95     $default_post_parent     = bbp_is_single_forum() ? bbp_get_forum_id() : 'any';
     89    if ( bbp_get_view_all() ) {
     90        $post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() );
     91    } else {
     92        $post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id() );
     93    }
     94
     95    // Add the bozo status if user is a bozo
     96    if ( bbp_is_user_bozo() ) {
     97        $post_statuses[] = bbp_get_bozo_status_id();
     98    }
     99
     100    $default_topic_search  = !empty( $_REQUEST['ts'] ) ? $_REQUEST['ts'] : false;
     101    $default_show_stickies = (bool) ( bbp_is_single_forum() || bbp_is_topic_archive() ) && ( false === $default_topic_search );
     102    $default_post_parent   = bbp_is_single_forum() ? bbp_get_forum_id() : 'any';
     103    $default_post_status   = join( ',', $post_statuses );
    96104
    97105    // Default argument array
     
    659667    function bbp_get_topic_post_date( $topic_id = 0, $humanize = false, $gmt = false ) {
    660668        $topic_id = bbp_get_topic_id( $topic_id );
    661        
     669
    662670        // 4 days, 4 hours ago
    663671        if ( !empty( $humanize ) ) {
Note: See TracChangeset for help on using the changeset viewer.