Skip to:
Content

BuddyPress.org

Ticket #5918: 5918.patch

File 5918.patch, 3.8 KB (added by boonebgorges, 10 years ago)
  • src/bp-templates/bp-legacy/buddypress-functions.php

    diff --git src/bp-templates/bp-legacy/buddypress-functions.php src/bp-templates/bp-legacy/buddypress-functions.php
    index 4a97d84..326ef22 100644
    function bp_legacy_theme_post_update() { 
    705705                exit( '-1' );
    706706
    707707        if ( empty( $_POST['content'] ) )
    708                 exit( '-1<div id="message" class="error"><p>' . __( 'Please enter some content to post.', 'buddypress' ) . '</p></div>' );
     708                exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'Please enter some content to post.', 'buddypress' ) . '</p></div>' );
    709709
    710710        $activity_id = 0;
    711711        if ( empty( $_POST['object'] ) && bp_is_active( 'activity' ) ) {
    function bp_legacy_theme_post_update() { 
    720720        }
    721721
    722722        if ( empty( $activity_id ) )
    723                 exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem posting your update; please try again.', 'buddypress' ) . '</p></div>' );
     723                exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'There was a problem posting your update; please try again.', 'buddypress' ) . '</p></div>' );
    724724
    725725        $last_recorded = ! empty( $_POST['since'] ) ? date( 'Y-m-d H:i:s', intval( $_POST['since'] ) ) : 0;
    726726        if ( $last_recorded ) {
    function bp_legacy_theme_new_activity_comment() { 
    772772        $feedback = __( 'There was an error posting your reply. Please try again.', 'buddypress' );
    773773
    774774        if ( empty( $_POST['content'] ) ) {
    775                 exit( '-1<div id="message" class="error"><p>' . esc_html__( 'Please do not leave the comment area blank.', 'buddypress' ) . '</p></div>' );
     775                exit( '-1<div id="message" class="error bp-ajax-message"><p>' . esc_html__( 'Please do not leave the comment area blank.', 'buddypress' ) . '</p></div>' );
    776776        }
    777777
    778778        if ( empty( $_POST['form_id'] ) || empty( $_POST['comment_id'] ) || ! is_numeric( $_POST['form_id'] ) || ! is_numeric( $_POST['comment_id'] ) ) {
    779                 exit( '-1<div id="message" class="error"><p>' . esc_html( $feedback ) . '</p></div>' );
     779                exit( '-1<div id="message" class="error bp-ajax-message"><p>' . esc_html( $feedback ) . '</p></div>' );
    780780        }
    781781
    782782        $comment_id = bp_activity_new_comment( array(
    function bp_legacy_theme_new_activity_comment() { 
    791791                        unset( $bp->activity->errors['new_comment'] );
    792792                }
    793793
    794                 exit( '-1<div id="message" class="error"><p>' . esc_html( $feedback ) . '</p></div>' );
     794                exit( '-1<div id="message" class="error bp-ajax-message"><p>' . esc_html( $feedback ) . '</p></div>' );
    795795        }
    796796
    797797        // Load the new activity item into the $activities_template global
    function bp_legacy_theme_delete_activity() { 
    852852        do_action( 'bp_activity_before_action_delete_activity', $activity->id, $activity->user_id );
    853853
    854854        if ( ! bp_activity_delete( array( 'id' => $activity->id, 'user_id' => $activity->user_id ) ) )
    855                 exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' );
     855                exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' );
    856856
    857857        do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id );
    858858        exit;
    function bp_legacy_theme_delete_activity_comment() { 
    888888        do_action( 'bp_activity_before_action_delete_activity', $_POST['id'], $comment->user_id );
    889889
    890890        if ( ! bp_activity_delete_comment( $comment->item_id, $comment->id ) )
    891                 exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' );
     891                exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' );
    892892
    893893        do_action( 'bp_activity_action_delete_activity', $_POST['id'], $comment->user_id );
    894894        exit;