/**
 * Output the link for the displayed user's profile.
 */
function bp_displayed_user_link()
{
    echo bp_get_displayed_user_link();
}
示例#2
0
 function rt_theme_compat_reset_post($args = array())
 {
     global $wp_query, $post;
     // Switch defaults if post is set
     global $rtmedia_query;
     if (isset($wp_query->post)) {
         if (isset($rtmedia_query->query) && isset($rtmedia_query->query["media_type"]) && $rtmedia_query->query["media_type"] == "album" && isset($rtmedia_query->media_query["album_id"])) {
             foreach ($rtmedia_query->album as $al) {
                 if ($al->id == $rtmedia_query->media_query["album_id"]) {
                     $wp_query->post = get_post($al->media_id);
                     break;
                 }
             }
         } else {
             if (isset($rtmedia_query->media) && count($rtmedia_query->media) == 1 && $rtmedia_query->media) {
                 $wp_query->post = get_post($rtmedia_query->media[0]->media_id);
             }
         }
         $dummy = wp_parse_args($args, array('ID' => $wp_query->post->ID, 'post_status' => $wp_query->post->post_status, 'post_author' => $wp_query->post->post_author, 'post_parent' => $wp_query->post->post_parent, 'post_type' => 'rtmedia', 'post_date' => $wp_query->post->post_date, 'post_date_gmt' => $wp_query->post->post_date_gmt, 'post_modified' => $wp_query->post->post_modified, 'post_modified_gmt' => $wp_query->post->post_modified_gmt, 'post_content' => $wp_query->post->post_content, 'post_title' => $wp_query->post->post_title, 'post_excerpt' => $wp_query->post->post_excerpt, 'post_content_filtered' => $wp_query->post->post_content_filtered, 'post_mime_type' => $wp_query->post->post_mime_type, 'post_password' => $wp_query->post->post_password, 'post_name' => $wp_query->post->post_name, 'guid' => $wp_query->post->guid, 'menu_order' => $wp_query->post->menu_order, 'pinged' => $wp_query->post->pinged, 'to_ping' => $wp_query->post->to_ping, 'ping_status' => $wp_query->post->ping_status, 'comment_status' => $wp_query->post->comment_status, 'comment_count' => $wp_query->post->comment_count, 'filter' => $wp_query->post->filter, 'is_404' => false, 'is_page' => false, 'is_single' => false, 'is_archive' => false, 'is_tax' => false));
     } else {
         $dummy = wp_parse_args($args, array('ID' => 0, 'post_status' => 'public', 'post_author' => 0, 'post_parent' => 0, 'post_type' => 'bp_member', 'post_date' => 0, 'post_date_gmt' => 0, 'post_modified' => 0, 'post_modified_gmt' => 0, 'post_content' => '', 'post_title' => '', 'post_excerpt' => '', 'post_content_filtered' => '', 'post_mime_type' => '', 'post_password' => '', 'post_name' => '', 'guid' => '', 'menu_order' => 0, 'pinged' => '', 'to_ping' => '', 'ping_status' => '', 'comment_status' => 'closed', 'comment_count' => 0, 'filter' => 'raw', 'is_404' => false, 'is_page' => false, 'is_single' => false, 'is_archive' => false, 'is_tax' => false));
     }
     if (function_exists("bp_is_group")) {
         if (bp_is_group()) {
             $dummy['post_type'] = "bp_group";
             if ("bp-default" != get_option('stylesheet')) {
                 $dummy['post_title'] = '<a href="' . bp_get_group_permalink(groups_get_current_group()) . '">' . bp_get_current_group_name() . '</a>';
             }
         } else {
             $dummy['post_type'] = "bp_member";
             if ("bp-default" != get_option('stylesheet')) {
                 $dummy['post_title'] = '<a href="' . bp_get_displayed_user_link() . '">' . bp_get_displayed_user_fullname() . '</a>';
             }
         }
     } else {
         global $rtmedia_query;
         $dummy['comment_status'] = 'closed';
         if (isset($rtmedia_query->media_query)) {
             if (isset($rtmedia_query->media_query["media_author"])) {
                 $dummy["post_author"] = $rtmedia_query->media_query["media_author"];
             }
             if (isset($rtmedia_query->media_query["id"])) {
                 //var_dump($rtmedia_query);
                 //echo $rtmedia_query->media_query["id"];
             }
         }
     }
     // Bail if dummy post is empty
     if (empty($dummy)) {
         return;
     }
     // Set the $post global
     $post = new WP_Post((object) $dummy);
     // Copy the new post global into the main $wp_query
     $wp_query->post = $post;
     $wp_query->posts = array($post);
     // Prevent comments form from appearing
     $wp_query->post_count = 1;
     $wp_query->is_404 = $dummy['is_404'];
     $wp_query->is_page = $dummy['is_page'];
     $wp_query->is_single = $dummy['is_single'];
     $wp_query->is_archive = $dummy['is_archive'];
     $wp_query->is_tax = $dummy['is_tax'];
     // Clean up the dummy post
     unset($dummy);
     /**
      * Force the header back to 200 status if not a deliberate 404
      *
      * @see http://bbpress.trac.wordpress.org/ticket/1973
      */
     if (!$wp_query->is_404()) {
         status_header(200);
     }
 }
示例#3
0
<?php

/**
 * BuddyPress - Users Photos
 *
 * @package BuddyBoss
 */
?>

<?php 
get_header('buddypress');
?>

	<header class="entry-header">
		<h1 class="entry-title"><?php 
echo '<a href="' . bp_get_displayed_user_link() . '">' . bp_get_displayed_user_fullname() . '</a>';
?>
</h1>
	</header>
	<div class="entry-content" id="content">
		<div id="buddypress">

			<?php 
do_action('bp_before_member_plugin_template');
?>

			<div id="item-header">

				<?php 
bp_get_template_part('members/single/member-header');
?>
/**
 * Output the link for the displayed user's profile.
 *
 * @since 1.2.4
 */
function bp_displayed_user_link()
{
    echo esc_url(bp_get_displayed_user_link());
}
示例#5
0
    $notes = $count > 0 ? $user->mod_notes['history'] : array();
    $moderator = bp_core_get_user_displayname(get_current_user_id());
    $date = date('M j, Y', current_time('timestamp'));
    // Validate form contents
    if (empty($_POST['note-content'])) {
        $error = 'You have to actually write something, dummy!';
    } else {
        $note = wpautop($_POST['note-content']);
    }
    // Add the note to the array
    if (!$error) {
        $notes[] = array('note' => trim($note), 'moderator' => $moderator, 'date' => $date);
        // Update the usermeta
        update_user_meta($user->id, 'moderator_notes', $notes);
        // Redirect
        wp_redirect(bp_get_displayed_user_link() . 'infractions/notes', 302);
    }
}
?>


<?php 
get_header();
?>
	
	<div id="content" role="main">
		<?php 
apoc_breadcrumbs();
?>

		<?php 
 /**
  * Update the global $post with the displayed user's data
  *
  * @since BuddyPress (1.7)
  */
 public function single_dummy_post()
 {
     bp_theme_compat_reset_post(array('ID' => 0, 'post_title' => '<a href="' . bp_get_displayed_user_link() . '">' . bp_get_displayed_user_fullname() . '</a>', 'post_author' => 0, 'post_date' => 0, 'post_content' => '', 'post_type' => 'bp_members', 'post_status' => 'publish', 'is_archive' => true, 'comment_status' => 'closed'));
 }
 inner-sidebar-mobile">


		<a id="close-buddypress-mobile-sidebar" class="close-panel-button" href="#">
			<i class="fa fa-times-circle"></i> Close menu
		</a>

		<?php 
if (bp_is_user()) {
    ?>
			<div id="user-sidebar-menu" class="widget">
				<?php 
    bp_displayed_user_avatar('width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height());
    ?>
				<?php 
    $userLink = bp_get_displayed_user_link();
    ?>
				<strong><?php 
    echo bp_core_get_user_displayname(bp_displayed_user_id());
    ?>
</strong>
				<br>
			</div>
		<?php 
}
?>

		<?php 
do_action('wf_open_bp_mobile_sidebar');
?>
		<?php 
 function rw_display_user_profile_rating()
 {
     if (RWLogger::IsOn()) {
         $params = func_get_args();
         RWLogger::LogEnterence("rw_display_user_profile_rating", $params);
     }
     // Get displayed user id.
     $user_id = bp_displayed_user_id();
     // User rating class.
     $rclass = "user";
     $align_str = self::_getOption(WP_RW__USERS_ALIGN);
     $align = json_decode($align_str);
     $enabled = isset($align) && isset($align->hor);
     if ($enabled && WP_RW__AVAILABILITY_HIDDEN !== $this->rw_validate_availability("user")) {
         // Check if user rating isn't specifically excluded.
         if (false === $this->rw_validate_visibility($user_id, $rclass)) {
             return;
         }
         // Get user profile user-rating-id.
         $user_urid = $this->_getUserRatingGuid(WP_RW__USER_SECONDERY_ID, $user_id);
         // Queue user profile rating.
         self::QueueRatingData($user_urid, bp_get_displayed_user_fullname(), bp_get_displayed_user_link(), $rclass);
         echo '<div><div class="rw-ui-container rw-class-' . $rclass . ' rw-urid-' . $user_urid . '"></div></div>';
     }
     /* Forum posts accamulator rating.
        ----------------------------------------------------*/
     /*    $rclass = $rclass . "-forum-post";
           // Get user profile user-rating-id.
           $user_urid = $this->_getUserRatingGuid(WP_RW__FORUM_POST_SECONDERY_ID, $user_id);
           
           // Queue user profile rating.
           self::QueueRatingData($user_urid, bp_get_displayed_user_fullname(), bp_get_displayed_user_link(), $rclass);
           
           echo '<div><div class="rw-ui-container rw-class-' . $rclass . ' rw-urid-' . $user_urid . '"></div></div>';*/
 }
示例#9
0
<?php

/**
 * Apocrypha Theme Moderator Notes Component
 * Andrew Clayton
 * Version 2.0
 * 11-09-2014
 */
// Get the currently displayed user
global $user;
$level = $user->warnings['level'] > 0 ? $user->warnings['level'] : 0;
$points = 1;
$action_url = bp_get_displayed_user_link() . 'infractions';
// Process new warnings
if (isset($_POST['issue_warning_nonce']) && wp_verify_nonce($_POST['issue_warning_nonce'], 'issue-warning')) {
    // Validate data
    $warnings = $level > 0 ? $user->warnings['history'] : array();
    $moderator = bp_core_get_user_displayname(get_current_user_id());
    // Warning points
    $points = $_POST['warning-points'];
    // Warning reason
    if (empty($_POST['warning-reason'])) {
        $error = 'You must supply a reason for issuing this warning.';
    } else {
        $reason = wpautop($_POST['warning-reason']);
    }
    // Warning date
    if ('' != $_POST['warning-date']) {
        $date = date('M j, Y', strtotime($_POST['warning-date'], current_time('timestamp')));
    } else {
        $date = date('M j, Y', current_time('timestamp'));