Changeset 2970 for branches/plugin/bbp-includes/bbp-user-template.php
- Timestamp:
- 04/01/2011 01:33:09 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-user-template.php
r2914 r2970 146 146 global $user_identity; 147 147 148 if ( is_user_logged_in() ) 149 $current_user_name = $user_identity; 150 else 151 $current_user_name = __( 'Anonymous', 'bbpress' ); 148 $current_user_name = is_user_logged_in() ? $user_identity : __( 'Anonymous', 'bbpress' ); 152 149 153 150 return apply_filters( 'bbp_get_current_user_name', $current_user_name ); … … 538 535 * @param int $user_id Optional. User id 539 536 * @uses bbp_get_user_profile_url() To get the user profile url 540 * @uses apply_filters() Calls 'bbp_get_ favorites_permalink' with the541 * user profile url and user id537 * @uses apply_filters() Calls 'bbp_get_subscriptions_permalink' with 538 * the user profile url and user id 542 539 * @return string Permanent link to user subscriptions page 543 540 */ … … 759 756 global $bbp; 760 757 761 return _wp_get_user_contactmethods( $bbp->displayed_user ); 758 // Get the core WordPress contact methods 759 $contact_methods = _wp_get_user_contactmethods( $bbp->displayed_user ); 760 761 return apply_filters( 'bbp_edit_user_contact_methods', $contact_methods ); 762 762 } 763 763 764 764 /** Login *********************************************************************/ 765 766 /** 767 * Handle the login and registration template notices 768 * 769 * @since bbPress (r2970) 770 */ 771 function bbp_login_notices() { 772 global $bbp; 773 774 // loggedout was passed 775 if ( !empty( $_GET['loggedout'] ) && ( true == $_GET['loggedout'] ) ) { 776 $bbp->errors->add( 'loggedout', __( 'You are now logged out.', 'bbpress' ), 'message' ); 777 778 // registration is disabled 779 } elseif ( !empty( $_GET['registration'] ) && ( 'disabled' == $_GET['registration'] ) ) { 780 $bbp->errors->add( 'registerdisabled', __( 'New user registration is currently not allowed.', 'bbpress' ) ); 781 782 // Prompt user to check their email 783 } elseif ( !empty( $_GET['checkemail'] ) && in_array( $_GET['checkemail'], array( 'confirm', 'newpass', 'registered' ) ) ) { 784 785 switch ( $_GET['checkemail'] ) { 786 787 // Email needs confirmation 788 case 'confirm' : 789 $bbp->errors->add( 'confirm', __( 'Check your e-mail for the confirmation link.', 'bbpress' ), 'message' ); 790 break; 791 792 // User requested a new password 793 case 'newpass' : 794 $bbp->errors->add( 'newpass', __( 'Check your e-mail for your new password.', 'bbpress' ), 'message' ); 795 break; 796 797 // User is newly registered 798 case 'registered' : 799 $bbp->errors->add( 'registered', __( 'Registration complete. Please check your e-mail.', 'bbpress' ), 'message' ); 800 break; 801 } 802 } 803 } 765 804 766 805 /** … … 779 818 */ 780 819 function bbp_logged_in_redirect( $url = '' ) { 820 821 // Bail if user is not logged in 781 822 if ( !is_user_logged_in() ) 782 823 return; 783 824 825 // Setup the profile page to redirect to 784 826 $redirect_to = !empty( $url ) ? $url : bbp_get_user_profile_url( bbp_get_current_user_id() ); 827 828 // Do a safe redirect and exit 785 829 wp_safe_redirect( $redirect_to ); 786 830 exit; … … 813 857 * @since bbPress (r2815) 814 858 * 859 * @uses bbp_login_url() To get the login url 860 * @uses bbp_redirect_to_field() To output the redirect to field 815 861 * @uses wp_nonce_field() To generate hidden nonce fields 816 862 */ … … 818 864 ?> 819 865 820 <input type="hidden" name="action" value=" bbp-user-register" id="bbp_user_register" />866 <input type="hidden" name="action" value="register" /> 821 867 <input type="hidden" name="user-cookie" value="1" /> 868 869 <?php bbp_redirect_to_field( add_query_arg( array( 'checkemail' => 'registered' ), bbp_login_url() ) ); ?> 822 870 823 871 <?php wp_nonce_field( 'bbp-user-register' ); … … 862 910 * 863 911 * @param mixed $args Optional. If an integer, it is used as reply id. 864 * @uses bbp_get_reply_id() To get the reply id865 912 * @uses bbp_is_topic() To check if it's a topic page 913 * @uses bbp_get_topic_author_link() To get the topic author link 866 914 * @uses bbp_is_reply() To check if it's a reply page 915 * @uses bbp_get_reply_author_link() To get the reply author link 916 * @uses get_post_field() To get the post author 867 917 * @uses bbp_is_reply_anonymous() To check if the reply is by an 868 918 * anonymous user 869 * @uses bbp_get_reply_author() To get the replyauthor name870 * @uses bbp_get_ reply_author_url() To get the reply authorurl871 * @uses bbp_get_reply_author_avatar() To get the replyauthor avatar919 * @uses get_the_author_meta() To get the author name 920 * @uses bbp_get_user_profile_url() To get the author profile url 921 * @uses get_avatar() To get the author avatar 872 922 * @uses apply_filters() Calls 'bbp_get_reply_author_link' with the 873 923 * author link and args
Note: See TracChangeset
for help on using the changeset viewer.