Ejemplo n.º 1
0
        function query_members()
        {
            global $wpdb;
            $show = isset($attr['show']) ? (int) $attr['show'] : 20;
            $orderby = isset($attr['orderby']) ? trim($attr['orderby']) : 'video';
            $order = isset($attr['order']) ? trim($attr['order']) : 'DESC';
            $user_array = array('number' => $show, 'orderby' => 'post_count', 'order' => 'DESC');
            $users = get_users($user_array);
            if (!empty($users)) {
                foreach ($users as $user) {
                    $user_data = get_user_by('id', $user->ID);
                    $content .= '
	                    <div class="channel-header">
							
							<div class="channel-image"><a href="' . get_author_posts_url($user->ID) . '">' . get_avatar($user->ID) . '</a></div>
							
							<div class="channel-info">
								<h3>' . $user_data->display_name . '</h3>
								
								<span class="channel-item"><strong>' . __('Videos:', 'mars') . '</strong> ' . mars_get_user_postcount($user->ID) . '</span>
								<span class="channel-item"><strong>' . __('Likes:', 'mars') . '</strong> ' . mars_get_user_metacount($user->ID, 'like_key') . '</span>
								<span class="channel-item"><strong>' . __('Views:', 'mars') . '</strong> ' . mars_get_user_metacount($user->ID, 'count_viewed') . '</span>
							</div>
						</div>
					';
                }
            }
            return $content;
        }
Ejemplo n.º 2
0
        function videotube_author_header()
        {
            global $videotube, $wp_query;
            //print_r( $wp_query );
            $header = null;
            $user_id = isset($wp_query->query_vars['author']) ? $wp_query->query_vars['author'] : null;
            $user_data = get_user_by('id', $user_id);
            if ($videotube['enable_channelpage'] == 0 || !isset($videotube['enable_channelpage'])) {
                $header .= '<h3>' . $user_data->display_name . '</h3>';
            } else {
                $header .= '
                    <div class="channel-header">
						
						<div class="channel-image">' . get_avatar($user_id) . '</div>
						
						<div class="channel-info">
							<h3>' . $user_data->display_name . '</h3>
							
							<span class="channel-item"><strong>' . __('Videos:', 'mars') . '</strong> ' . mars_get_user_postcount($user_id) . '</span>
							<span class="channel-item"><strong>' . __('Likes:', 'mars') . '</strong> ' . mars_get_user_metacount($user_id, 'like_key') . '</span>
							<span class="channel-item"><strong>' . __('Views:', 'mars') . '</strong> ' . mars_get_user_metacount($user_id, 'count_viewed') . '</span>
							';
                if ($user_data->user_url) {
                    $header .= '<span class="channel-item"><a ref="nofollow" href="' . $user_data->user_url . '"><i class="fa fa-home"></i></a></span>';
                }
                $header .= '
						</div>
						<div class="channel-description">' . wp_kses_data(nl2br($user_data->description)) . '</div>
					</div>
					
					<h3>Videos by: ' . $user_data->display_name . '</h3>
				';
            }
            return $header;
        }