Changeset 3501 for branches/plugin/bbp-includes/bbp-reply-functions.php
- Timestamp:
- 09/09/2011 09:43:33 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-reply-functions.php
r3468 r3501 610 610 611 611 // Set transient for throttle check (only on new, not edit) 612 if ( empty( $is_edit ) ) 612 if ( empty( $is_edit ) ) { 613 613 set_transient( '_bbp_' . bbp_current_author_ip() . '_last_posted', time() ); 614 } 614 615 615 616 // Website is optional 616 if ( !empty( $bbp_anonymous_website ) ) 617 if ( !empty( $bbp_anonymous_website ) ) { 617 618 update_post_meta( $reply_id, '_bbp_anonymous_website', $bbp_anonymous_website, false ); 619 } 618 620 619 621 } else { 620 if ( empty( $is_edit ) && !current_user_can( 'throttle' ) ) 622 if ( empty( $is_edit ) && !current_user_can( 'throttle' ) ) { 621 623 update_user_meta( $author_id, '_bbp_last_posted', time() ); 624 } 622 625 } 623 626 … … 628 631 629 632 // Subscribed and unsubscribing 630 if ( true == $subscribed && false == $subscheck ) 633 if ( true == $subscribed && false == $subscheck ) { 631 634 bbp_remove_user_subscription( $author_id, $topic_id ); 632 635 633 636 // Subscribing 634 elseif ( false == $subscribed && true == $subscheck )637 } elseif ( false == $subscribed && true == $subscheck ) { 635 638 bbp_add_user_subscription( $author_id, $topic_id ); 639 } 636 640 } 637 641 … … 728 732 729 733 // Last reply and active ID's 730 bbp_update_topic_last_reply_id 731 bbp_update_topic_last_active_id 734 bbp_update_topic_last_reply_id ( $ancestor, $reply_id ); 735 bbp_update_topic_last_active_id( $ancestor, $active_id ); 732 736 733 737 // Get the last active time if none was passed 734 if ( empty( $last_active_time ) ) 738 $topic_last_active_time = $last_active_time; 739 if ( empty( $last_active_time ) ) { 735 740 $topic_last_active_time = get_post_field( 'post_date', bbp_get_topic_last_active_id( $ancestor ) ); 736 else 737 $topic_last_active_time = $last_active_time; 738 739 bbp_update_topic_last_active_time ( $ancestor, $topic_last_active_time ); 741 } 742 743 // Only update if reply is published 744 if ( bbp_is_reply_published( $reply_id ) ) { 745 bbp_update_topic_last_active_time( $ancestor, $topic_last_active_time ); 746 } 740 747 741 748 // Counts … … 754 761 bbp_update_forum_last_active_id( $ancestor, $active_id ); 755 762 756 if ( empty( $last_active_time ) ) 763 // Get the last active time if none was passed 764 $forum_last_active_time = $last_active_time; 765 if ( empty( $last_active_time ) ) { 757 766 $forum_last_active_time = get_post_field( 'post_date', bbp_get_forum_last_active_id( $ancestor ) ); 758 else 759 $forum_last_active_time = $last_active_time; 760 761 bbp_update_forum_last_active_time( $ancestor, $forum_last_active_time ); 767 } 768 769 // Only update if reply is published 770 if ( bbp_is_reply_published( $reply_id ) ) { 771 bbp_update_forum_last_active_time( $ancestor, $forum_last_active_time ); 772 } 762 773 763 774 // Counts
Note: See TracChangeset
for help on using the changeset viewer.