Changeset 5442 for trunk/src/includes/users/template.php
- Timestamp:
- 07/11/2014 09:54:15 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/users/template.php (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/users/template.php
r5436 r5442 42 42 43 43 // Easy empty checking 44 if ( ! empty( $user_id ) && is_numeric( $user_id ) ) {44 if ( ! empty( $user_id ) && is_numeric( $user_id ) ) { 45 45 $bbp_user_id = $user_id; 46 46 47 47 // Currently viewing or editing a user 48 } elseif ( ( true === $displayed_user_fallback ) && ! empty( $bbp->displayed_user->ID ) ) {48 } elseif ( ( true === $displayed_user_fallback ) && ! empty( $bbp->displayed_user->ID ) ) { 49 49 $bbp_user_id = $bbp->displayed_user->ID; 50 50 51 51 // Maybe fallback on the current_user ID 52 } elseif ( ( true === $current_user_fallback ) && ! empty( $bbp->current_user->ID ) ) {52 } elseif ( ( true === $current_user_fallback ) && ! empty( $bbp->current_user->ID ) ) { 53 53 $bbp_user_id = $bbp->current_user->ID; 54 54 … … 310 310 311 311 // Maybe wrap the nicename 312 $retval = ! empty( $nicename ) ? ( $r['before'] . $nicename . $r['after'] ) : '';312 $retval = ! empty( $nicename ) ? ( $r['before'] . $nicename . $r['after'] ) : ''; 313 313 314 314 // Filter and return … … 460 460 if ( empty( $user_nicename ) ) { 461 461 $user = get_userdata( $user_id ); 462 if ( ! empty( $user->user_nicename ) ) {462 if ( ! empty( $user->user_nicename ) ) { 463 463 $user_nicename = $user->user_nicename; 464 464 } … … 554 554 */ 555 555 function bbp_get_admin_link( $args = '' ) { 556 if ( ! current_user_can( 'moderate' ) ) {556 if ( ! current_user_can( 'moderate' ) ) { 557 557 return; 558 558 } 559 559 560 if ( ! empty( $args ) && is_string( $args ) && ( false === strpos( $args, '=' ) ) ) {560 if ( ! empty( $args ) && is_string( $args ) && ( false === strpos( $args, '=' ) ) ) { 561 561 $args = array( 'text' => $args ); 562 562 } … … 610 610 // Get the author IP meta value 611 611 $author_ip = get_post_meta( $r['post_id'], '_bbp_author_ip', true ); 612 if ( ! empty( $author_ip ) ) {612 if ( ! empty( $author_ip ) ) { 613 613 $author_ip = $r['before'] . $author_ip . $r['after']; 614 614 … … 1119 1119 1120 1120 // Initial output is wrapped in a span, ajax output is hooked to this 1121 if ( ! empty( $wrap ) ) {1121 if ( ! empty( $wrap ) ) { 1122 1122 $html = '<span id="subscription-toggle">' . $html . '</span>'; 1123 1123 } … … 1150 1150 1151 1151 // Initial output is wrapped in a span, ajax output is hooked to this 1152 if ( ! empty( $wrap ) ) {1152 if ( ! empty( $wrap ) ) { 1153 1153 $html = '<span id="subscription-toggle">' . $html . '</span>'; 1154 1154 } … … 1215 1215 $public_display['display_username'] = $bbp->displayed_user->user_login; 1216 1216 1217 if ( ! empty( $bbp->displayed_user->nickname ) ) {1217 if ( ! empty( $bbp->displayed_user->nickname ) ) { 1218 1218 $public_display['display_nickname'] = $bbp->displayed_user->nickname; 1219 1219 } 1220 1220 1221 if ( ! empty( $bbp->displayed_user->first_name ) ) {1221 if ( ! empty( $bbp->displayed_user->first_name ) ) { 1222 1222 $public_display['display_firstname'] = $bbp->displayed_user->first_name; 1223 1223 } 1224 1224 1225 if ( ! empty( $bbp->displayed_user->last_name ) ) {1225 if ( ! empty( $bbp->displayed_user->last_name ) ) { 1226 1226 $public_display['display_lastname'] = $bbp->displayed_user->last_name; 1227 1227 } 1228 1228 1229 if ( ! empty( $bbp->displayed_user->first_name ) && !empty( $bbp->displayed_user->last_name ) ) {1229 if ( ! empty( $bbp->displayed_user->first_name ) && ! empty( $bbp->displayed_user->last_name ) ) { 1230 1230 $public_display['display_firstlast'] = $bbp->displayed_user->first_name . ' ' . $bbp->displayed_user->last_name; 1231 1231 $public_display['display_lastfirst'] = $bbp->displayed_user->last_name . ' ' . $bbp->displayed_user->first_name; … … 1233 1233 1234 1234 // Only add this if it isn't duplicated elsewhere 1235 if ( ! in_array( $bbp->displayed_user->display_name, $public_display ) ) {1235 if ( ! in_array( $bbp->displayed_user->display_name, $public_display ) ) { 1236 1236 $public_display = array( 'display_displayname' => $bbp->displayed_user->display_name ) + $public_display; 1237 1237 } … … 1475 1475 1476 1476 // loggedout was passed 1477 if ( ! empty( $_GET['loggedout'] ) && ( true === $_GET['loggedout'] ) ) {1477 if ( ! empty( $_GET['loggedout'] ) && ( true === $_GET['loggedout'] ) ) { 1478 1478 bbp_add_error( 'loggedout', __( 'You are now logged out.', 'bbpress' ), 'message' ); 1479 1479 1480 1480 // registration is disabled 1481 } elseif ( ! empty( $_GET['registration'] ) && ( 'disabled' === $_GET['registration'] ) ) {1481 } elseif ( ! empty( $_GET['registration'] ) && ( 'disabled' === $_GET['registration'] ) ) { 1482 1482 bbp_add_error( 'registerdisabled', __( 'New user registration is currently not allowed.', 'bbpress' ) ); 1483 1483 1484 1484 // Prompt user to check their email 1485 } elseif ( ! empty( $_GET['checkemail'] ) && in_array( $_GET['checkemail'], array( 'confirm', 'newpass', 'registered' ) ) ) {1485 } elseif ( ! empty( $_GET['checkemail'] ) && in_array( $_GET['checkemail'], array( 'confirm', 'newpass', 'registered' ) ) ) { 1486 1486 1487 1487 switch ( $_GET['checkemail'] ) { … … 1522 1522 1523 1523 // Bail if user is not logged in 1524 if ( ! is_user_logged_in() ) {1524 if ( ! is_user_logged_in() ) { 1525 1525 return; 1526 1526 } 1527 1527 1528 1528 // Setup the profile page to redirect to 1529 $redirect_to = ! empty( $url ) ? $url : bbp_get_user_profile_url( bbp_get_current_user_id() );1529 $redirect_to = ! empty( $url ) ? $url : bbp_get_user_profile_url( bbp_get_current_user_id() ); 1530 1530 1531 1531 // Do a safe redirect and exit … … 1671 1671 1672 1672 // Neither a reply nor a topic, so could be a revision 1673 if ( ! empty( $r['post_id'] ) ) {1673 if ( ! empty( $r['post_id'] ) ) { 1674 1674 1675 1675 // Generate title with the display name of the author 1676 1676 if ( empty( $r['link_title'] ) ) { 1677 $r['link_title'] = sprintf( ! bbp_is_reply_anonymous( $r['post_id'] ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), get_the_author_meta( 'display_name', $user_id ) );1677 $r['link_title'] = sprintf( ! bbp_is_reply_anonymous( $r['post_id'] ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), get_the_author_meta( 'display_name', $user_id ) ); 1678 1678 } 1679 1679 1680 1680 // Assemble some link bits 1681 $link_title = ! empty( $r['link_title'] ) ? ' title="' . $r['link_title'] . '"' : '';1681 $link_title = ! empty( $r['link_title'] ) ? ' title="' . $r['link_title'] . '"' : ''; 1682 1682 $anonymous = bbp_is_reply_anonymous( $r['post_id'] ); 1683 1683 … … 1750 1750 1751 1751 // User is a keymaster 1752 if ( ! empty( $user_id ) && bbp_is_user_keymaster( $user_id ) ) {1752 if ( ! empty( $user_id ) && bbp_is_user_keymaster( $user_id ) ) { 1753 1753 $retval = true; 1754 1754 … … 1793 1793 1794 1794 // Do not allow anonymous if not enabled 1795 } elseif ( ! is_user_logged_in() && bbp_allow_anonymous() ) {1795 } elseif ( ! is_user_logged_in() && bbp_allow_anonymous() ) { 1796 1796 $retval = true; 1797 1797 … … 1859 1859 1860 1860 // Do not allow anonymous if not enabled 1861 } elseif ( ! is_user_logged_in() && bbp_allow_anonymous() ) {1861 } elseif ( ! is_user_logged_in() && bbp_allow_anonymous() ) { 1862 1862 $retval = true; 1863 1863 … … 1896 1896 1897 1897 // Private forums 1898 if ( ! current_user_can( 'read_private_forums' ) ) {1898 if ( ! current_user_can( 'read_private_forums' ) ) { 1899 1899 $private = bbp_get_private_forum_ids(); 1900 1900 } 1901 1901 1902 1902 // Hidden forums 1903 if ( ! current_user_can( 'read_hidden_forums' ) ) {1903 if ( ! current_user_can( 'read_hidden_forums' ) ) { 1904 1904 $hidden = bbp_get_hidden_forum_ids(); 1905 1905 } … … 1909 1909 1910 1910 // There are forums that need to be ex 1911 if ( ! empty( $forum_ids ) ) {1911 if ( ! empty( $forum_ids ) ) { 1912 1912 $post__not_in = implode( ',', $forum_ids ); 1913 1913 }
Note: See TracChangeset
for help on using the changeset viewer.