Skip to:
Content

bbPress.org


Ignore:
Timestamp:
09/17/2012 12:03:03 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Capabilities:

  • Remove experimental Bozo functionality. We can use the 'participate' to prevent forum participation without creating topics or replies.
  • Introduce functions to reset, save, and remove user capabilities.
  • Use these functions in both theme-side and admin-side profiles.
  • Add capabilities to bbp-twentyten theme. This will be moved into the stand-alone bbp-twentyten theme soon'ish.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bbp-includes/bbp-reply-functions.php

    r4218 r4222  
    221221    if ( !bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) {
    222222        $reply_status = bbp_get_pending_status_id();
    223 
    224     // Maybe set as bozo status
    225     } elseif ( bbp_is_user_bozo() ) {
    226         $reply_status = bbp_get_bozo_status_id();
    227223
    228224    // Default
     
    391387
    392388    // Define local variable(s)
    393     $reply = $reply_id = $topic_id = $forum_id = $anonymous_data = 0;
     389    $reply = $reply_id = $reply_author = $topic_id = $forum_id = $anonymous_data = 0;
    394390    $reply_title = $reply_content = $reply_edit_reason = $terms = '';
    395391
     
    422418
    423419        // Check users ability to create new reply
    424         if ( !bbp_is_reply_anonymous( $reply_id ) ) {
     420        if ( ! bbp_is_reply_anonymous( $reply_id ) ) {
    425421
    426422            // User cannot edit this reply
     
    430426            }
    431427
     428            // Set reply author
     429            $reply_author = bbp_get_reply_author_id( $reply_id );
     430
    432431        // It is an anonymous post
    433432        } else {
     
    494493    /** Reply Blacklist *******************************************************/
    495494
    496     if ( !bbp_check_for_blacklist( $anonymous_data, bbp_get_reply_author_id( $reply_id ), $reply_title, $reply_content ) )
     495    if ( !bbp_check_for_blacklist( $anonymous_data, $reply_author, $reply_title, $reply_content ) )
    497496        bbp_add_error( 'bbp_reply_blacklist', __( '<strong>ERROR</strong>: Your reply cannot be edited at this time.', 'bbpress' ) );
    498497
     
    500499
    501500    // Maybe put into moderation
    502     if ( !bbp_check_for_moderation( $anonymous_data, bbp_get_reply_author_id( $reply_id ), $reply_title, $reply_content ) ) {
     501    if ( !bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) {
    503502        $reply_status = bbp_get_pending_status_id();
    504 
    505     // Maybe set as bozo status
    506     } elseif ( bbp_is_user_bozo() ) {
    507         $reply_status = bbp_get_bozo_status_id();
    508503
    509504    // Default
     
    544539        'post_content' => $reply_content,
    545540        'post_status'  => $reply_status,
    546         'post_parent'  => $reply->post_parent,
    547         'post_author'  => $reply->post_author,
     541        'post_parent'  => $topic_id,
     542        'post_author'  => $reply_author,
    548543        'post_type'    => bbp_get_reply_post_type()
    549544    ) );
     
    589584
    590585        // Update counts, etc...
    591         do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply->post_author , true /* Is edit */ );
     586        do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author , true /* Is edit */ );
    592587
    593588        /** Additional Actions (After Save) ***********************************/
Note: See TracChangeset for help on using the changeset viewer.