当前位置: 首页>>代码示例>>PHP>>正文


PHP bbp_get_user_reply_count_raw函数代码示例

本文整理汇总了PHP中bbp_get_user_reply_count_raw函数的典型用法代码示例。如果您正苦于以下问题:PHP bbp_get_user_reply_count_raw函数的具体用法?PHP bbp_get_user_reply_count_raw怎么用?PHP bbp_get_user_reply_count_raw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了bbp_get_user_reply_count_raw函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: widget


//.........这里部分代码省略.........
            ?>
</a>
					<?php 
            bbp_logout_link();
            ?>
				</div>

				<div class="clearfix"></div>

				<div class="list-group">
					<a href="<?php 
            bbp_user_profile_url(bbp_get_current_user_id());
            ?>
" class="list-group-item bbp-user-forum-role <?php 
            if (bbp_is_user_home() && bbp_is_single_user_profile()) {
                echo 'active';
            }
            ?>
">
						<span class="glyphicon ipt-icomoon-user4"></span> <?php 
            printf(__('%s Forum Role', 'ipt_kb'), '<span class="badge">' . bbp_get_user_display_role(bbp_get_current_user_id()) . '</span>');
            ?>
					</a>
					<a href="<?php 
            bbp_user_topics_created_url(bbp_get_current_user_id());
            ?>
" class="list-group-item bbp-user-topic-count <?php 
            if (bbp_is_user_home() && bbp_is_single_user_topics()) {
                echo 'active';
            }
            ?>
">
						<span class="glyphicon ipt-icomoon-bubbles4"></span> <?php 
            printf(__('%s Topics Started', 'ipt_kb'), '<span class="badge">' . bbp_get_user_topic_count_raw(bbp_get_current_user_id()) . '</span>');
            ?>
					</a>
					<a href="<?php 
            bbp_user_replies_created_url(bbp_get_current_user_id());
            ?>
" class="list-group-item bbp-user-reply-count <?php 
            if (bbp_is_user_home() && bbp_is_single_user_replies()) {
                echo 'active';
            }
            ?>
">
						<span class="glyphicon ipt-icomoon-reply"></span> <?php 
            printf(__('%s Replies Created', 'ipt_kb'), '<span class="badge">' . bbp_get_user_reply_count_raw(bbp_get_current_user_id()) . '</span>');
            ?>
					</a>
					<?php 
            if (bbp_is_favorites_active()) {
                ?>
					<a href="<?php 
                bbp_favorites_permalink(bbp_get_current_user_id());
                ?>
" class="list-group-item bbp-user-favorite-count <?php 
                if (bbp_is_user_home() && bbp_is_favorites()) {
                    echo 'active';
                }
                ?>
" title="<?php 
                printf(esc_attr__("Your Favorites", 'ipt_kb'));
                ?>
">
						<span class="glyphicon ipt-icomoon-heart"></span> <?php 
                printf(__('%s Favorites', 'ipt_kb'), '<span class="badge">' . count(bbp_get_user_favorites_topic_ids(bbp_get_current_user_id())) . '</span>');
                ?>
					</a>
					<?php 
            }
            ?>
					<?php 
            if (bbp_is_subscriptions_active()) {
                ?>
					<a href="<?php 
                bbp_subscriptions_permalink(bbp_get_current_user_id());
                ?>
" class="list-group-item bbp-user-subscribe-count <?php 
                if (bbp_is_user_home() && bbp_is_subscriptions()) {
                    echo 'active';
                }
                ?>
" title="<?php 
                printf(esc_attr__("Your Subscriptions", 'ipt_kb'));
                ?>
">
						<span class="glyphicon ipt-icomoon-bookmarks"></span> <?php 
                printf(__('%s Subscriptions', 'ipt_kb'), '<span class="badge">' . count(bbp_get_user_subscribed_topic_ids(bbp_get_current_user_id())) . '</span>');
                ?>
					</a>
					<?php 
            }
            ?>
				</div>
			</div>

		<?php 
        }
        echo $args['after_widget'];
    }
开发者ID:andychoi,项目名称:k-knowledgebase-theme-wp,代码行数:101,代码来源:class-ipt-kb-bbp-login-widget.php

示例2: do_action

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

		<?php 
bbp_reply_author_link(array('sep' => '', 'show_role' => true));
?>

		<div class="bbp-reply-post-date"><?php 
bbp_reply_post_date();
?>
</div>

		<div class="bbps-post-count"><?php 
printf(__('Post count: %s', 'framework'), bbp_get_user_reply_count_raw(bbp_get_reply_author_id()));
?>
</div>

		<?php 
if (bbp_is_user_keymaster()) {
    ?>

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

			<div class="bbp-reply-ip"><?php 
    bbp_author_ip(bbp_get_reply_id());
    ?>
</div>
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:30,代码来源:loop-single-reply.php

示例3: bbp_displayed_user_field

			<?php 
if (bbp_get_displayed_user_field('description')) {
    ?>

				<p class="bbp-user-description"><?php 
    bbp_displayed_user_field('description');
    ?>
</p>

			<?php 
}
?>

			<p class="bbp-user-forum-role"><?php 
printf(__('Forum Role: %s', 'firmasite'), bbp_get_user_display_role());
?>
</p>
			<p class="bbp-user-topic-count"><?php 
printf(__('Topics Started: %s', 'firmasite'), bbp_get_user_topic_count_raw());
?>
</p>
			<p class="bbp-user-reply-count"><?php 
printf(__('Replies Created: %s', 'firmasite'), bbp_get_user_reply_count_raw());
?>
</p>
		</div>
	</div><!-- #bbp-author-topics-started -->

	<?php 
do_action('bbp_template_after_user_profile');
开发者ID:paulmedwal,项目名称:edxforumspublic,代码行数:30,代码来源:user-profile.php

示例4: printf

" class="list-group-item active bbp-user-forum-role"><span class="glyphicon ipt-icon-user4"></span> <?php 
printf(__('%s Forum Role', 'ipt_kb'), '<span class="badge">' . bbp_get_user_display_role() . '</span>');
?>
</a>
				<a href="<?php 
bbp_user_topics_created_url();
?>
" class="list-group-item bbp-user-topic-count"><span class="glyphicon ipt-icon-bubbles4"></span> <?php 
printf(__('%s Topics Started:', 'ipt_kb'), '<span class="badge">' . bbp_get_user_topic_count_raw() . '</span>');
?>
</a>
				<a href="<?php 
bbp_user_replies_created_url();
?>
" class="list-group-item bbp-user-reply-count"><span class="glyphicon ipt-icon-reply"></span> <?php 
printf(__('%s Replies Created', 'ipt_kb'), '<span class="badge">' . bbp_get_user_reply_count_raw() . '</span>');
?>
</a>
				<?php 
if (bbp_is_favorites_active()) {
    ?>
					<a href="<?php 
    bbp_favorites_permalink();
    ?>
" class="list-group-item bbp-user-favorite-count"><span class="glyphicon ipt-icon-heart"></span> <?php 
    printf(__('%s Favorites', 'ipt_kb'), '<span class="badge">' . count(bbp_get_user_favorites_topic_ids()) . '</span>');
    ?>
</a>
				<?php 
}
?>
开发者ID:sleepystephen,项目名称:ipt-knowledgebase-theme-wp,代码行数:31,代码来源:user-profile.php

示例5: bbp_displayed_user_field

      <?php 
if (bbp_get_displayed_user_field('description')) {
    ?>

        <p class="bbp-user-description"><?php 
    bbp_displayed_user_field('description');
    ?>
</p>

      <?php 
}
?>

      <p class="bbp-user-forum-role"><?php 
printf(__('Forum Role: %s', 'bbpress'), bbp_get_user_display_role());
?>
</p>
      <p class="bbp-user-topic-count"><?php 
printf(__('Topics Started: %s', 'bbpress'), bbp_get_user_topic_count_raw());
?>
</p>
      <p class="bbp-user-reply-count"><?php 
printf(__('Replies Created: %s', 'bbpress'), bbp_get_user_reply_count_raw());
?>
</p>
    </div>
  </div><!-- #bbp-author-topics-started -->

  <?php 
do_action('bbp_template_after_user_profile');
开发者ID:hakkens,项目名称:davehakkens,代码行数:30,代码来源:user-profile.php

示例6: bbp_bump_user_reply_count

/**
 * Bump the reply count for a user by a certain amount.
 *
 * @since 2.6.0 bbPress (r5309)
 *
 * @param int $user_id
 * @param int $difference
 * @uses bbp_get_user_reply_count() To get the users current reply count
 * @uses bbp_set_user_reply_count() To set the users new reply count
 */
function bbp_bump_user_reply_count($user_id = 0, $difference = 1)
{
    // Bail if no bump
    if (empty($difference)) {
        return false;
    }
    // Validate user ID
    $user_id = bbp_get_user_id($user_id);
    if (empty($user_id)) {
        return false;
    }
    // Check meta for count, or query directly if not found
    $count = bbp_get_user_reply_count($user_id, true);
    if (empty($count)) {
        $count = bbp_get_user_reply_count_raw($user_id);
    }
    $difference = (int) $difference;
    $user_reply_count = (int) ($count + $difference);
    // Add them up and filter them
    $new_count = (int) apply_filters('bbp_bump_user_reply_count', $user_reply_count, $user_id, $difference, $count);
    return bbp_update_user_reply_count($user_id, $new_count);
}
开发者ID:CompositeUK,项目名称:clone.bbPress,代码行数:32,代码来源:functions.php

示例7: edd_bbp_sidebar

/**
 * EDD Forum Sidebar
 *
 * @since		1.0.0
 * @return		void
 */
function edd_bbp_sidebar()
{
    global $post;
    $user_id = get_the_author_meta('ID');
    $user_data = get_userdata($user_id);
    ?>
	<div class="box">

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

		<h3><?php 
    echo get_the_author_meta('first_name') . '  ' . get_the_author_meta('last_name');
    ?>
</h3>
		<p class="bbp-user-forum-role"><?php 
    printf('Forum Role: %s', bbp_get_user_display_role($user_id));
    ?>
</p>
		<p class="bbp-user-topic-count"><?php 
    printf('Topics Started: %s', bbp_get_user_topic_count_raw($user_id));
    ?>
</p>
		<p class="bbp-user-reply-count"><?php 
    printf('Replies Created: %s', bbp_get_user_reply_count_raw($user_id));
    ?>
</p>

		<div class="rcp_support_status">
			<h4>Priority Support Access</h4>
			<?php 
    if (function_exists('rcp_is_active')) {
        if (rcp_is_active($user_id)) {
            ?>
				<p>Has <strong>Priority Support</strong> access.</p>
			<?php 
        } elseif (rcp_is_expired($user_id)) {
            ?>
				<p><strong>Priority Support</strong> access has <span style="color:red;">expired</span>.</p>
			<?php 
        } else {
            ?>
				<p>Has no priority support accesss</p>
			<?php 
        }
    }
    ?>
		</div><!-- /.rcp_support_status -->

		<div class="edd_users_purchases">
			<h4>User's Purchases:</h4>
			<?php 
    $purchases = edd_get_users_purchases($user_data->user_email, 100, false, 'any');
    if ($purchases) {
        echo '<ul>';
        foreach ($purchases as $purchase) {
            echo '<li>';
            echo '<strong><a href="' . admin_url('edit.php?post_type=download&page=edd-payment-history&view=view-order-details&id=' . $purchase->ID) . '">#' . $purchase->ID . ' - ' . edd_get_payment_status($purchase, true) . '</a></strong><br/>';
            $downloads = edd_get_payment_meta_downloads($purchase->ID);
            foreach ($downloads as $download) {
                echo get_the_title($download['id']) . ' - ' . date('F j, Y', strtotime($purchase->post_date)) . '<br/>';
            }
            if (function_exists('edd_software_licensing')) {
                $licenses = edd_software_licensing()->get_licenses_of_purchase($purchase->ID);
                if ($licenses) {
                    echo '<strong>Licenses:</strong><br/>';
                    foreach ($licenses as $license) {
                        $key = edd_software_licensing()->get_license_key($license->ID);
                        echo '<a href="' . admin_url('edit.php?post_type=download&page=edd-licenses&s=' . $key) . '">' . $key . '</a>';
                        echo ' - ' . edd_software_licensing()->get_license_status($license->ID);
                        echo '<br/>';
                    }
                }
                echo '<hr/>';
            }
            echo '</li>';
        }
        echo '</ul>';
    } else {
        echo '<p>This user has never purchased anything.</p>';
    }
    ?>
		</div>
	</div>
	<?php 
}
开发者ID:Section214,项目名称:EDD-bbPress-Support,代码行数:93,代码来源:support-functions.php

示例8: bbp_displayed_user_field

			<?php 
if (bbp_get_displayed_user_field('description')) {
    ?>

				<p class="bbp-user-description"><?php 
    bbp_displayed_user_field('description');
    ?>
</p>

			<?php 
}
?>

			<p class="bbp-user-forum-role"><?php 
printf(esc_html__('Forum Role: %s', 'monsoon'), bbp_get_user_display_role());
?>
</p>
			<p class="bbp-user-topic-count"><?php 
printf(esc_html__('Topics Started: %s', 'monsoon'), bbp_get_user_topic_count_raw());
?>
</p>
			<p class="bbp-user-reply-count"><?php 
printf(esc_html__('Replies Created: %s', 'monsoon'), bbp_get_user_reply_count_raw());
?>
</p>
		</div>
	</div><!-- #bbp-author-topics-started -->

	<?php 
do_action('bbp_template_after_user_profile');
开发者ID:estrategasdigitales,项目名称:flazam,代码行数:30,代码来源:user-profile.php

示例9: bbp_get_reply_author_id

<?php

/**
 * Replies Loop - Single Reply
 *
 * @package bbPress
 * @subpackage Theme
 */
$cb_current_user = bbp_get_reply_author_id();
$cb_bbp_total_post_count = bbp_get_user_reply_count_raw($cb_current_user) + bbp_get_user_topic_count_raw($cb_current_user);
?>

<div id="post-<?php 
bbp_reply_id();
?>
" class="bbp-reply-header">

	<div class="bbp-meta">

		<span class="bbp-reply-post-date"><?php 
bbp_reply_post_date();
?>
</span>

		<?php 
if (bbp_is_single_user_replies()) {
    ?>

			<span class="bbp-header">
				<?php 
    _e('in reply to: ', 'bbpress');
开发者ID:luskyj89,项目名称:mt-wordpress,代码行数:31,代码来源:loop-single-reply.php

示例10: shortcode_handler


//.........这里部分代码省略.........
                         break;
                     case 'blog':
                         if (AA_is_wpmu()) {
                             $blog = get_active_blog_for_user($id);
                             if (!empty($blog->siteurl)) {
                                 $link = $blog->siteurl;
                             }
                         }
                         break;
                     case 'bp_memberpage':
                         if (function_exists('bp_core_get_user_domain')) {
                             $link = bp_core_get_user_domain($id);
                         } elseif (function_exists('bp_core_get_userurl')) {
                             // BP versions < 1.1
                             $link = bp_core_get_userurl($id);
                         }
                         break;
                     case 'bbpress_memberpage':
                         if (function_exists('bbp_get_user_profile_url')) {
                             $link = bbp_get_user_profile_url($id);
                         }
                         if (empty($link) || $link == 'http://') {
                             $link = false;
                         }
                         break;
                     case 'last_post':
                         $recent = get_posts(array('author' => $id, 'orderby' => 'date', 'order' => 'desc', 'numberposts' => 1));
                         $link = get_permalink($recent[0]->ID);
                         break;
                     case 'last_post_filtered':
                         $recent = get_posts(array('author' => $id, 'orderby' => 'date', 'order' => 'desc', 'numberposts' => 1));
                         $link = get_permalink($recent[0]->ID);
                         break;
                     case 'last_post_all':
                         $last_post = get_most_recent_post_of_user($id);
                         $link = get_permalink($last_post['post_id']);
                         break;
                 }
                 if ($link) {
                     $hrefStart = '<a href="' . $link . '">';
                 }
             }
             if (!empty($atts['show_name'])) {
                 $name = '<br />' . get_the_author_meta('display_name', $id);
                 $extraClass .= ' with-name';
             }
             if (!empty($atts['show_email'])) {
                 $userEmail = get_the_author_meta('user_email', $id);
                 $email = "<div class='email'><a href='mailto:" . $userEmail . "''>" . $userEmail . "</a></div>";
                 if (empty($email)) {
                     $extraClass .= 'email-missing';
                 } else {
                     $extraClass .= ' with-email';
                 }
             }
             if (!empty($atts['show_postcount'])) {
                 $name .= ' (' . ($postcount = $this->userlist->get_user_postcount($id) . ')');
             }
             if (!empty($atts['show_bbpress_post_count'])) {
                 if (function_exists('bbp_get_user_topic_count_raw')) {
                     $BBPRESS_postcount = bbp_get_user_topic_count_raw($id) + bbp_get_user_reply_count_raw($id);
                     $name .= ' (' . ($postcount = $BBPRESS_postcount . ')');
                 }
             }
             if (!empty($atts['show_biography'])) {
                 $biography = get_the_author_meta('description', $id);
                 if (0 < $bio_length) {
                     $biography = $this->userlist->truncate_html(wpautop($biography, true), apply_filters('aa_user_bio_length', $bio_length));
                 } else {
                     $biography = wpautop($biography, true);
                 }
                 if (!empty($atts['show_name'])) {
                     $bio = '<div class="bio bio-length-' . $atts['max_bio_length'] . '">' . $biography . '</div>';
                 }
                 if (empty($bio)) {
                     $extraClass .= ' biography-missing';
                 } else {
                     $extraClass .= ' with-biography bio-length-' . $bio_length;
                 }
             }
             // show last_post?
             if (isset($atts['show_last_post']) && strlen($atts['show_last_post']) > 0) {
                 $last_post = '<div class="last_post">' . $this->userlist->aa_get_last_post($id) . '</div>';
                 if (empty($last_post)) {
                     $extraClass .= ' last-post-missing';
                 } else {
                     $extraClass .= ' with-last-post';
                 }
             }
         }
     }
     $hrefend = '';
     if (!empty($hrefStart)) {
         $hrefend = '</a>';
     }
     if (!empty($style)) {
         $style = ' style="' . $style . '"';
     }
     return '<div class="shortcode-show-avatar ' . $extraClass . '"' . $style . '>' . $hrefStart . $avatar . $name . $last_post . $hrefend . $bio . $email . '</div>' . $content;
 }
开发者ID:arildoosilva,项目名称:besm_restricted_area,代码行数:101,代码来源:ShowAvatarShortcode.class.php

示例11: wi_bbp_sidebar

/**
 * Forum Sidebar
 *
 * @since        1.0.0
 * @return        void
 */
function wi_bbp_sidebar()
{
    global $post;
    $user_id = get_the_author_meta('ID');
    $user_data = get_userdata($user_id);
    ?>
	<div class="box">

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

		<h3><?php 
    echo get_the_author_meta('first_name') . '  ' . get_the_author_meta('last_name');
    ?>
</h3>

		<p class="bbp-user-forum-role"><?php 
    printf('Forum Role: %s', bbp_get_user_display_role($user_id));
    ?>
</p>

		<p class="bbp-user-topic-count"><?php 
    printf('Topics Started: %s', bbp_get_user_topic_count_raw($user_id));
    ?>
</p>

		<p class="bbp-user-reply-count"><?php 
    printf('Replies Created: %s', bbp_get_user_reply_count_raw($user_id));
    ?>
</p>


		<div class="wi_users_purchases">
			<h3><?php 
    _e('User\'s Purchases:', 'wi_bbp');
    ?>
</h3>
			<?php 
    $purchases = edd_get_users_purchases($user_data->user_email, 100, false, 'any');
    if ($purchases) {
        echo '<ul>';
        foreach ($purchases as $purchase) {
            echo '<li>';
            echo '<strong><a href="' . admin_url('edit.php?post_type=download&page=give-payment-history&view=view-order-details&id=' . $purchase->ID) . '">#' . $purchase->ID . ' - ' . edd_get_payment_status($purchase, true) . '</a></strong><br/>';
            $downloads = edd_get_payment_meta_downloads($purchase->ID);
            foreach ($downloads as $download) {
                echo get_the_title($download['id']) . ' - ' . date('F j, Y', strtotime($purchase->post_date)) . '<br/>';
            }
            //Check license key
            if (function_exists('edd_software_licensing')) {
                $licenses = edd_software_licensing()->get_licenses_of_purchase($purchase->ID);
                if ($licenses) {
                    echo '<strong>Licenses:</strong><br/>';
                    foreach ($licenses as $license) {
                        $key = edd_software_licensing()->get_license_key($license->ID);
                        echo '<a href="' . admin_url('edit.php?post_type=download&page=give-licenses&s=' . $key) . '">' . $key . '</a>';
                        echo ' - ' . edd_software_licensing()->get_license_status($license->ID);
                        echo '<br/>';
                    }
                }
                echo '<hr/>';
            }
            echo '</li>';
        }
        echo '</ul>';
    } else {
        echo '<p>This user has never purchased anything.</p>';
    }
    ?>
		</div>
	</div>
	<?php 
}
开发者ID:WordImpress,项目名称:bbPress-Support,代码行数:80,代码来源:support-functions.php

示例12: _e

_e('Forum Role', 'omega-td');
?>
</dt>
				<dd><?php 
echo bbp_get_user_display_role();
?>
</dd>
				<dt><?php 
_e('Topics Started', 'omega-td');
?>
</dt>
				<dd><?php 
echo bbp_get_user_topic_count_raw();
?>
</dd>
				<dt><?php 
_e('Replies Created', 'omega-td');
?>
</dt>
				<dd><?php 
echo bbp_get_user_reply_count_raw();
?>
</dd>
			</dl>

		</div>

	</div><!-- #bbp-author-topics-started -->

	<?php 
do_action('bbp_template_after_user_profile');
开发者ID:rinodung,项目名称:wordpress-demo,代码行数:31,代码来源:user-profile.php

示例13: test_bbp_get_user_reply_count_raw

 /**
  * @covers ::bbp_get_user_reply_count_raw
  */
 public function test_bbp_get_user_reply_count_raw()
 {
     $u = $this->factory->user->create();
     $t = $this->factory->topic->create();
     $r = $this->factory->reply->create_many(3, array('post_parent' => $t, 'post_author' => $u, 'reply_meta' => array('topic_id' => $t)));
     $count = bbp_get_user_reply_count_raw($u);
     $this->assertSame(3, $count);
     $r = $this->factory->reply->create_many(3, array('post_parent' => $t, 'post_author' => $u, 'reply_meta' => array('topic_id' => $t)));
     $count = bbp_get_user_reply_count_raw($u);
     $this->assertSame(6, $count);
 }
开发者ID:joeyblake,项目名称:bbpress,代码行数:14,代码来源:counts.php

示例14: bbp_get_reply_id

<?php

/**
 * Replies Loop - Single Reply
 *
 * @package bbPress
 * @subpackage Theme
 */
$reply_id = bbp_get_reply_id();
$user_id = bbp_get_reply_author_id($reply_id);
$topic_count = bbp_get_user_topic_count_raw($user_id);
$reply_count = bbp_get_user_reply_count_raw($user_id);
$post_count = (int) $topic_count + $reply_count;
?>


<li id="post-<?php 
bbp_reply_id();
?>
" <?php 
bbp_reply_class(0, array('media'));
?>
>

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

	<div class="bbp_author_details">
        <?php 
bbp_reply_author_link(array('sep' => '', 'size' => 92));
开发者ID:rinodung,项目名称:wordpress-demo,代码行数:31,代码来源:loop-single-reply.php

示例15: shortcode_handler


//.........这里部分代码省略.........
         if (!is_numeric($id)) {
             if (email_exists($id)) {
                 $id = email_exists($id);
             } else {
                 $isUser = false;
             }
         }
         if ($isUser) {
             $all_meta_for_user = get_user_meta($id);
             if (count($all_meta_for_user) == 0) {
                 $isUser = false;
             }
         }
         if ($isUser) {
             if (!empty($atts['user_link'])) {
                 switch ($atts['user_link']) {
                     case 'authorpage':
                         $link = get_author_posts_url($id);
                         break;
                     case 'website':
                         $link = get_the_author_meta('user_url', $id);
                         if (empty($link) || $link == 'http://') {
                             $link = false;
                         }
                         break;
                     case 'blog':
                         if (AA_is_wpmu()) {
                             $blog = get_active_blog_for_user($id);
                             if (!empty($blog->siteurl)) {
                                 $link = $blog->siteurl;
                             }
                         }
                         break;
                     case 'bp_memberpage':
                         if (function_exists('bp_core_get_user_domain')) {
                             $link = bp_core_get_user_domain($id);
                         } elseif (function_exists('bp_core_get_userurl')) {
                             // BP versions < 1.1
                             $link = bp_core_get_userurl($id);
                         }
                         break;
                     case 'bbpress_memberpage':
                         if (function_exists('bbp_get_user_profile_url')) {
                             $link = bbp_get_user_profile_url($id);
                         }
                         if (empty($link) || $link == 'http://') {
                             $link = false;
                         }
                         break;
                 }
                 if ($link) {
                     $hrefStart = '<a href="' . $link . '">';
                 }
             }
             if (!empty($atts['show_name'])) {
                 $name = '<br />' . get_the_author_meta('display_name', $id);
                 $extraClass .= ' with-name';
             }
             if (!empty($atts['show_email'])) {
                 $userEmail = get_the_author_meta('user_email', $id);
                 $email = "<div class='email'><a href='mailto:" . $userEmail . "''>" . $userEmail . "</a></div>";
                 if (empty($email)) {
                     $extraClass .= 'email-missing';
                 } else {
                     $extraClass .= ' with-email';
                 }
             }
             if (!empty($atts['show_postcount'])) {
                 require_once 'UserList.class.php';
                 $this->userlist = new UserList();
                 $name .= ' (' . ($postcount = $this->userlist->get_user_postcount($id) . ')');
             }
             if (!empty($atts['show_bbpress_post_count'])) {
                 if (function_exists('bbp_get_user_topic_count_raw')) {
                     $BBPRESS_postcount = bbp_get_user_topic_count_raw($id) + bbp_get_user_reply_count_raw($id);
                     $name .= ' (' . ($postcount = $BBPRESS_postcount . ')');
                 }
             }
             if (!empty($atts['show_biography'])) {
                 $bio = get_the_author_meta('description', $id);
                 if (!empty($atts['show_name'])) {
                     $bio = '<div class="bio">' . $bio . '</div>';
                 }
                 if (empty($bio)) {
                     $extraClass .= 'biography-missing';
                 } else {
                     $extraClass .= ' with-biography';
                 }
             }
         }
     }
     $hrefend = '';
     if (!empty($hrefStart)) {
         $hrefend = '</a>';
     }
     if (!empty($style)) {
         $style = ' style="' . $style . '"';
     }
     return '<div class="shortcode-show-avatar ' . $extraClass . '"' . $style . '>' . $hrefStart . $avatar . $name . $hrefend . $bio . $email . '</div>' . $content;
 }
开发者ID:minorbug,项目名称:wp-author-avatars,代码行数:101,代码来源:ShowAvatarShortcode.class.php


注:本文中的bbp_get_user_reply_count_raw函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。