示例#1
0
    /**
     * Echo the user list within loop
     *
     * @param array $args
     * @return 
     * @version 1.0.2
     */
    public static function the_user_list(array $args)
    {
        $args = array_merge(['classes' => 'g-phone-1-3', 'user_id' => null, 'extra_title' => '', 'extra' => 'point', 'target' => theme_functions::$link_target], $args);
        /**
         * extra point value
         */
        switch ($args['extra']) {
            /**
             * user point
             */
            case 'point':
                if (class_exists('theme_custom_point')) {
                    $point_value = theme_custom_point::get_point($args['user_id']);
                }
                break;
                /**
                 * user fav be_count
                 */
            /**
             * user fav be_count
             */
            case 'fav':
                if (class_exists('custom_post_fav')) {
                    $point_value = custom_post_fav::get_user_be_fav_count($args['user_id']);
                }
                break;
                /**
                 * user posts count
                 */
            /**
             * user posts count
             */
            case 'posts':
                if (class_exists('theme_custom_author_profile')) {
                    $point_value = theme_custom_author_profile::get_count('works', $args['user_id']);
                } else {
                    $point_value = count_user_posts($args['user_id']);
                }
                break;
            default:
                $point_value = null;
        }
        if (!empty($args['extra_title']) && $point_value) {
            $args['extra_title'] = str_replace('%', $point_value, $args['extra_title']);
        }
        $display_name = theme_cache::get_the_author_meta('display_name', $args['user_id']);
        $avatar_url = theme_cache::get_avatar_url($args['user_id']);
        ?>
		<div class="user-list <?php 
        echo $args['classes'];
        ?>
">
			<a 
				href="<?php 
        echo theme_cache::get_author_posts_url($args['user_id']);
        ?>
" 
				title="<?php 
        echo $display_name;
        ?>
" 
				target="<?php 
        echo $args['target'];
        ?>
" 
			>
				<div class="avatar-container">
					<img src="<?php 
        echo theme_functions::$avatar_placeholder;
        ?>
" data-src="<?php 
        echo $avatar_url;
        ?>
" alt="<?php 
        echo $display_name;
        ?>
" class="avatar">
				</div>
				<h3 class="author"><?php 
        echo $display_name;
        ?>
</h3>
				<?php 
        if ($args['extra']) {
            ?>
					<div class="extra">
						<span class="<?php 
            echo $args['extra'];
            ?>
" title="<?php 
            echo $args['extra_title'];
            ?>
">
							<?php 
            echo number_format($point_value);
            ?>
						</span>
					</div>
				<?php 
        }
        /** end args extra */
        ?>
			</a>
		</div>
		<?php 
    }
示例#2
0
    /**
     * My statistics
     */
    public static function my_statistics()
    {
        $current_user_id = theme_cache::get_current_user_id();
        ?>
		<div class="panel">
			<div class="heading">
				<i class="fa fa-pie-chart"></i>
				<?php 
        echo ___('My statistics');
        ?>
			</div>
			<div class="content">
				<a class="media" href="<?php 
        echo theme_custom_user_settings::get_tabs('history')['url'];
        ?>
" title="<?php 
        echo ___('Views my histories');
        ?>
">
					<div class="media-left">
						<img class="media-object" src="<?php 
        echo theme_custom_point::get_point_img_url();
        ?>
" alt="">
					</div>
					<div class="media-body">
						<h4 class="media-heading"><strong class="total-point"><?php 
        echo number_format(theme_custom_point::get_point($current_user_id));
        ?>
</strong></h4>
					</div>
				</a>
				<div class="row">
					<!-- posts count -->
					<div class="g-phone-1-2">
						<?php 
        echo sprintf(___('My posts: %s'), '<a href="' . theme_cache::get_author_posts_url($current_user_id) . '">' . theme_custom_author_profile::get_count('works', $current_user_id) . '</a>');
        ?>
					</div>
					<!-- comments count -->
					<div class="g-phone-1-2">
						<?php 
        echo sprintf(___('My comments: %s'), '<a href="' . theme_custom_author_profile::get_tabs('comments', $current_user_id)['url'] . '">' . theme_custom_author_profile::get_count('comments', $current_user_id) . '</a>');
        ?>
					</div>
					<!-- followers count -->
					<div class="g-phone-1-2">
						<?php 
        echo sprintf(___('My followers: %s'), '<a href="' . theme_custom_author_profile::get_tabs('followers_count', $current_user_id)['url'] . '">' . theme_custom_author_profile::get_count('followers_count', $current_user_id) . '</a>');
        ?>
					</div>
					<!-- following count -->
					<div class="g-tablet-1-2 g-desktop-1-3">
						<?php 
        echo sprintf(___('My following: %s'), '<a href="' . theme_custom_author_profile::get_tabs('following_count', $current_user_id)['url'] . '">' . theme_custom_author_profile::get_count('following_count', $current_user_id) . '</a>');
        ?>
					</div>
				</div>
			</div>
		</div>
		<?php 
    }
示例#3
0
echo ___('Statistics');
?>
</legend>
		<table class="table">
			<tbody>
				<tr>
					<th><?php 
echo ___('Works');
?>
</th>
					<td><a href="<?php 
echo theme_custom_author_profile::get_tabs('works', $author)['url'];
?>
">
						<?php 
$author_posts_count = theme_custom_author_profile::get_count('works', $author);
echo (int) $author_posts_count !== 0 ? $author_posts_count : '-';
?>
					</a></td>
				</tr>
				<tr>
					<th><?php 
echo ___('Comments');
?>
</th>
					<td>
						<a href="<?php 
echo theme_custom_author_profile::get_tabs('comments', $author)['url'];
?>
">
						<?php