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


PHP bp_activity_content_body函数代码示例

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


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

示例1: widget

	function widget($args, $instance) {
		global $bp;

		extract( $args );

		echo $before_widget;
		echo $before_title . $widget_name . $after_title;

		if ( empty( $instance['max_posts'] ) || !$instance['max_posts'] )
			$instance['max_posts'] = 10; ?>

		<?php if ( bp_has_activities( 'action=new_blog_post&max=' . $instance['max_posts'] . '&per_page=' . $instance['max_posts'] ) ) : ?>

			<ul id="blog-post-list" class="activity-list item-list">

				<?php while ( bp_activities() ) : bp_the_activity(); ?>

					<li>
						<div class="activity-content" style="margin: 0">

							<div class="activity-header">
								<?php bp_activity_action() ?>
							</div>

							<?php if ( bp_get_activity_content_body() ) : ?>
								<div class="activity-inner">
									<?php bp_activity_content_body() ?>
								</div>
							<?php endif; ?>

						</div>
					</li>

				<?php endwhile; ?>

			</ul>

		<?php else : ?>
			<div id="message" class="info">
				<p><?php _e( 'Sorry, there were no blog posts found. Why not write one?', 'buddypress' ) ?></p>
			</div>
		<?php endif; ?>

		<?php echo $after_widget; ?>
	<?php
	}
开发者ID:n-sane,项目名称:zaroka,代码行数:46,代码来源:bp-blogs-widgets.php

示例2: bp_activity_content_body

        <?php 
}
?>
    </div>

	<div class="activity-content">


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

			<div class="activity-inner fs-have-thumbnail">

				<?php 
    bp_activity_content_body();
    ?>

			</div>

		<?php 
}
?>

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

		<?php 
if (is_user_logged_in()) {
    ?>
开发者ID:paulmedwal,项目名称:edxforumspublic,代码行数:31,代码来源:entry.php

示例3: widget

    /**
     * Display the networkwide posts widget.
     *
     * @see WP_Widget::widget() for description of parameters.
     *
     * @param array $args     Widget arguments.
     * @param array $instance Widget settings, as saved by the user.
     */
    public function widget($args, $instance)
    {
        $title = !empty($instance['title']) ? esc_html($instance['title']) : __('Recent Networkwide Posts', 'buddypress');
        if (!empty($instance['link_title'])) {
            $title = '<a href="' . bp_get_blogs_directory_permalink() . '">' . esc_html($title) . '</a>';
        }
        /**
         * Filters the Blogs Recent Posts widget title.
         *
         * @since BuddyPress (2.2.0)
         * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
         *
         * @param string $title    The widget title.
         * @param array  $instance The settings for the particular instance of the widget.
         * @param string $id_base  Root ID for all widgets of this type.
         */
        $title = apply_filters('widget_title', $title, $instance, $this->id_base);
        echo $args['before_widget'];
        echo $args['before_title'] . $title . $args['after_title'];
        if (empty($instance['max_posts']) || empty($instance['max_posts'])) {
            $instance['max_posts'] = 10;
        }
        // Override some of the contextually set parameters for bp_has_activities()
        $args = array('action' => 'new_blog_post', 'max' => $instance['max_posts'], 'per_page' => $instance['max_posts'], 'user_id' => 0, 'scope' => false, 'object' => false, 'primary_id' => false);
        ?>

		<?php 
        if (bp_has_activities($args)) {
            ?>

			<ul id="blog-post-list" class="activity-list item-list">

				<?php 
            while (bp_activities()) {
                bp_the_activity();
                ?>

					<li>
						<div class="activity-content" style="margin: 0">
							<div class="activity-header"><?php 
                bp_activity_action();
                ?>
</div>

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

								<div class="activity-inner"><?php 
                    bp_activity_content_body();
                    ?>
</div>

							<?php 
                }
                ?>

						</div>
					</li>

				<?php 
            }
            ?>

			</ul>

		<?php 
        } else {
            ?>

			<div id="message" class="info">
				<p><?php 
            _e('Sorry, there were no posts found. Why not write one?', 'buddypress');
            ?>
</p>
			</div>

		<?php 
        }
        ?>

		<?php 
        echo $args['after_widget'];
        ?>
	<?php 
    }
开发者ID:AceMedia,项目名称:BuddyPress,代码行数:94,代码来源:bp-blogs-widgets.php

示例4: feed_content

    /**
     * Output the feed's item content.
     */
    protected function feed_content()
    {
        bp_activity_content_body();
        switch ($this->id) {
            // Also output parent activity item if we're on a specific feed.
            case 'favorites':
            case 'friends':
            case 'mentions':
            case 'personal':
                if ('activity_comment' == bp_get_activity_action_name()) {
                    ?>
				<strong><?php 
                    _e('In reply to', 'buddypress');
                    ?>
</strong> -
				<?php 
                    bp_activity_parent_content();
                    ?>
			<?php 
                }
                break;
        }
    }
开发者ID:mawilliamson,项目名称:wordpress,代码行数:26,代码来源:class-bp-activity-feed.php

示例5: swa_activity_entry

function swa_activity_entry($show_avatar = false)
{
    ?>
 <?php 
    do_action('bp_before_activity_entry');
    ?>
    <li class="<?php 
    bp_activity_css_class();
    ?>
" id="activity-<?php 
    bp_activity_id();
    ?>
">
            <?php 
    if ($show_avatar == "yes") {
        ?>
                      <div class="swa-activity-avatar">
                            <a href="<?php 
        bp_activity_user_link();
        ?>
">
                                    <?php 
        bp_activity_avatar('type=thumb&width=50&height=50');
        ?>
                            </a>

                    </div>
           <?php 
    }
    ?>
          <div class="swa-activity-content">
		<div class="swa-activity-header">
			<?php 
    bp_activity_action();
    ?>
		</div>

		<?php 
    if (bp_activity_has_content()) {
        ?>
			<div class="swa-activity-inner">
				<?php 
        bp_activity_content_body();
        ?>
			</div>
		<?php 
    }
    ?>

	<?php 
    do_action('bp_activity_entry_content');
    ?>
	<div class="swa-activity-meta">
            <?php 
    if (is_user_logged_in() && bp_activity_can_comment()) {
        ?>
				<a href="<?php 
        bp_activity_comment_link();
        ?>
" class="acomment-reply" id="acomment-comment-<?php 
        bp_activity_id();
        ?>
"><?php 
        _e('Reply', 'buddypress');
        ?>
 (<span><?php 
        bp_activity_comment_count();
        ?>
</span>)</a>
			<?php 
    }
    ?>
            <?php 
    if (is_user_logged_in()) {
        ?>
		<?php 
        if (!bp_get_activity_is_favorite()) {
            ?>
                    <a href="<?php 
            bp_activity_favorite_link();
            ?>
" class="fav" title="<?php 
            _e('Mark as Favorite', 'swa');
            ?>
"><?php 
            _e('Favorite', 'swa');
            ?>
</a>
		<?php 
        } else {
            ?>
                    <a href="<?php 
            bp_activity_unfavorite_link();
            ?>
" class="unfav" title="<?php 
            _e('Remove Favorite', 'swa');
            ?>
"><?php 
            _e('Remove Favorite', 'swa');
            ?>
//.........这里部分代码省略.........
开发者ID:picassentviu,项目名称:AMMPro,代码行数:101,代码来源:bp-sitewide-activity.php

示例6: unpin_activity

    /**
     *
     */
    function unpin_activity()
    {
        global $wpdb;
        $nonce = isset($_REQUEST['nonces']) ? sanitize_text_field($_REQUEST['nonces']) : 0;
        if (!wp_verify_nonce($nonce, 'pin-activity-nonce')) {
            exit(__('Not permitted', RW_Sticky_Activity::$textdomain));
        }
        $activityID = isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) ? $_REQUEST['id'] : '';
        if ($activityID != '') {
            bp_activity_update_meta($activityID, 'rw_sticky_activity', 0);
        }
        $meta_query_args = array('relation' => 'AND', array('key' => 'rw_sticky_activity', 'value' => '1', 'compare' => '='));
        if (function_exists('bb_bp_activity_url_filter')) {
            // deactivate BuddyBoss Wall activity url preview
            remove_action('bp_get_activity_content_body', 'bb_bp_activity_url_filter');
        }
        add_filter('bp_activity_excerpt_length', function () {
            return 99999;
        });
        if (bp_has_activities(array('meta_query' => $meta_query_args))) {
            ?>
            <?php 
            while (bp_activities()) {
                bp_the_activity();
                ?>
                <div class="buddypress-sa">
                    <div id="factivity-stream">
                        <div class="activity-list">
                            <div class="activity-content" style="margin-left: 0px;">
                                <?php 
                $nonce = wp_create_nonce('pin-activity-nonce');
                $title = __('Unpin activity', RW_Sticky_Activity::$textdomain);
                $class = "sa-button-unpin  pinned";
                ?>
                                <a href="" class="fa fa-map-marker icon-button sa-button <?php 
                echo $class;
                ?>
" title="<?php 
                echo $title;
                ?>
" data-post-nonces="<?php 
                echo $nonce;
                ?>
" data-post-id="<?php 
                echo bp_get_activity_id();
                ?>
"></a>
                                <?php 
                if (bp_activity_has_content() && bp_get_activity_type() != 'bbp_topic_create' && bp_get_activity_type() != 'bbp_reply_create') {
                    ?>
                                    <div class="activity-inner">
                                        <?php 
                    bp_activity_content_body();
                    ?>
                                    </div>
                                <?php 
                }
                ?>
                                <?php 
                if (bp_get_activity_type() == 'bp_doc_edited') {
                    ?>
                                    <div class="activity-inner"><p>
                                            <?php 
                    $doc = get_post(url_to_postid(bp_get_activity_feed_item_link()));
                    echo __('Doc: ', RW_Sticky_Activity::$textdomain);
                    echo "<a href='" . get_permalink($doc->ID) . "'>";
                    echo $doc->post_title;
                    echo "</a>";
                    ?>
</p>
                                    </div>
                                    <?php 
                }
                // New forum topic created
                if (bp_get_activity_type() == 'bbp_topic_create') {
                    // url_to_postid fails on permalinks like http://gruppen.domain.tld/groups/frank-testgruppe/forum/topic/neues-thema/ !!!
                    ?>
                                    <div class="activity-inner"><p>
                                            <?php 
                    $link = bp_get_activity_feed_item_link();
                    $guid = substr($link, strpos($link, "/forum/topic") + 6);
                    $topicid = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE guid like '%%%s%%'", $guid));
                    $topic = get_post($topicid);
                    echo __('Forum new topic: ', RW_Sticky_Activity::$textdomain);
                    echo "<a href='" . get_permalink($topic->ID) . "'> ";
                    echo $topic->post_title;
                    echo "</a><br>";
                    ?>
</p>
                                    </div>
                                    <?php 
                }
                // New forum reply
                if (bp_get_activity_type() == 'bbp_reply_create') {
                    // url_to_postid fails on permalinks like http://gruppen.domain.tld/groups/frank-testgruppe/forum/topic/neues-thema/ !!!
                    ?>
                                    <div class="activity-inner"><p>
//.........这里部分代码省略.........
开发者ID:rpi-virtuell,项目名称:rw-sticky-activity,代码行数:101,代码来源:RW_Sticky_Activity_Core.php

示例7: bp_dtheme_new_activity_comment

function bp_dtheme_new_activity_comment() {
	global $bp;

	/* Check the nonce */
	check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );

	if ( !is_user_logged_in() ) {
		echo '-1';
		return false;
	}

	if ( empty( $_POST['content'] ) ) {
		echo '-1<div id="message" class="error"><p>' . __( 'Please do not leave the comment area blank.', 'buddypress' ) . '</p></div>';
		return false;
	}

	if ( empty( $_POST['form_id'] ) || empty( $_POST['comment_id'] ) || !is_numeric( $_POST['form_id'] ) || !is_numeric( $_POST['comment_id'] ) ) {
		echo '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>';
		return false;
	}

	$comment_id = bp_activity_new_comment( array(
		'content' => $_POST['content'],
		'activity_id' => $_POST['form_id'],
		'parent_id' => $_POST['comment_id']
	));

	if ( !$comment_id ) {
		echo '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>';
		return false;
	}

	if ( bp_has_activities ( 'include=' . $comment_id ) ) : ?>
		<?php while ( bp_activities() ) : bp_the_activity(); ?>
			<li id="acomment-<?php bp_activity_id() ?>">
				<div class="acomment-avatar">
					<?php bp_activity_avatar() ?>
				</div>

				<div class="acomment-meta">
					<?php echo bp_core_get_userlink( bp_get_activity_user_id() ) ?> &middot; <?php printf( __( '%s ago', 'buddypress' ), bp_core_time_since( bp_core_current_time() ) ) ?> &middot;
					<a class="acomment-reply" href="#acomment-<?php bp_activity_id() ?>" id="acomment-reply-<?php echo esc_attr( $_POST['form_id'] ) ?>"><?php _e( 'Reply', 'buddypress' ) ?></a>
					 &middot; <a href="<?php echo wp_nonce_url( $bp->root_domain . '/' . $bp->activity->slug . '/delete/' . bp_get_activity_id() . '?cid=' . $comment_id, 'bp_activity_delete_link' ) ?>" class="delete acomment-delete confirm"><?php _e( 'Delete', 'buddypress' ) ?></a>
				</div>

				<div class="acomment-content">
					<?php bp_activity_content_body() ?>
				</div>
			</li>
		<?php endwhile; ?>
	 <?php endif;
}
开发者ID:n-sane,项目名称:zaroka,代码行数:52,代码来源:ajax.php

示例8: widget

    function widget($args, $instance)
    {
        extract($args);
        echo $before_widget;
        echo $before_title . $widget_name . $after_title;
        if (empty($instance['max_posts']) || !$instance['max_posts']) {
            $instance['max_posts'] = 10;
        }
        ?>

		<?php 
        /* Override some of the contextually set parameters for bp_has_activities() */
        ?>
		<?php 
        if (bp_has_activities(array('action' => 'new_blog_post', 'max' => $instance['max_posts'], 'per_page' => $instance['max_posts'], 'user_id' => 0, 'scope' => false, 'object' => false, 'primary_id' => false))) {
            ?>

			<ul id="blog-post-list" class="activity-list item-list">

				<?php 
            while (bp_activities()) {
                bp_the_activity();
                ?>

					<li>
						<div class="activity-content" style="margin: 0">

							<div class="activity-header">
								<?php 
                bp_activity_action();
                ?>
							</div>

							<?php 
                if (bp_get_activity_content_body()) {
                    ?>
								<div class="activity-inner">
									<?php 
                    bp_activity_content_body();
                    ?>
								</div>
							<?php 
                }
                ?>

						</div>
					</li>

				<?php 
            }
            ?>

			</ul>

		<?php 
        } else {
            ?>
			<div id="message" class="info">
				<p><?php 
            _e('Sorry, there were no posts found. Why not write one?', 'buddypress');
            ?>
</p>
			</div>
		<?php 
        }
        ?>

		<?php 
        echo $after_widget;
        ?>
	<?php 
    }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:72,代码来源:bp-blogs-widgets.php

示例9: bp_activity_css_class

<li class="<?php bp_activity_css_class() ?>" id="activity-<?php bp_activity_id() ?>">
	<div class="activity-avatar">
		<a href="<?php bp_activity_user_link() ?>">
			<?php bp_activity_avatar( 'type=full&width=100&height=100' ) ?>
		</a>
	</div>

	<div class="activity-content">

		<div class="activity-header">
			<?php bp_activity_action() ?>
		</div>

		<?php if ( bp_activity_has_content() ) : ?>
			<div class="activity-inner">
				<?php bp_activity_content_body() ?>
			</div>
		<?php endif; ?>

		<?php do_action( 'bp_activity_entry_content' ) ?>

		<div class="activity-meta">
			<?php if ( is_user_logged_in() && bp_activity_can_comment() ) : ?>
				<a href="<?php bp_activity_comment_link() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Reply', 'buddypress' ) ?> (<span><?php bp_activity_comment_count() ?></span>)</a>
			<?php endif; ?>

			<?php if ( is_user_logged_in() ) : ?>
				<?php if ( !bp_get_activity_is_favorite() ) : ?>
					<a href="<?php bp_activity_favorite_link() ?>" class="fav" title="<?php _e( 'Mark as Favorite', 'buddypress' ) ?>"><?php _e( 'Favorite', 'buddypress' ) ?></a>
				<?php else : ?>
					<a href="<?php bp_activity_unfavorite_link() ?>" class="unfav" title="<?php _e( 'Remove Favorite', 'buddypress' ) ?>"><?php _e( 'Remove Favorite', 'buddypress' ) ?></a>
开发者ID:n-sane,项目名称:zaroka,代码行数:31,代码来源:entry.php

示例10: widget

    /**
     * Display the networkwide posts widget.
     *
     * @see WP_Widget::widget() for description of parameters.
     *
     * @param array $args Widget arguments.
     * @param array $instance Widget settings, as saved by the user.
     */
    function widget($args, $instance)
    {
        $title = !empty($instance['title']) ? esc_html($instance['title']) : __('Recent Networkwide Posts', 'buddypress');
        if (!empty($instance['link_title'])) {
            $title = '<a href="' . trailingslashit(bp_get_root_domain()) . trailingslashit(bp_get_blogs_root_slug()) . '">' . esc_html($title) . '</a>';
        }
        echo $args['before_widget'];
        echo $args['before_title'] . $title . $args['after_title'];
        if (empty($instance['max_posts']) || !$instance['max_posts']) {
            $instance['max_posts'] = 10;
        }
        ?>

		<?php 
        // Override some of the contextually set parameters for bp_has_activities()
        ?>
		<?php 
        if (bp_has_activities(array('action' => 'new_blog_post', 'max' => $instance['max_posts'], 'per_page' => $instance['max_posts'], 'user_id' => 0, 'scope' => false, 'object' => false, 'primary_id' => false))) {
            ?>

			<ul id="blog-post-list" class="activity-list item-list">

				<?php 
            while (bp_activities()) {
                bp_the_activity();
                ?>

					<li>
						<div class="activity-content" style="margin: 0">

							<div class="activity-header">
								<?php 
                bp_activity_action();
                ?>
							</div>

							<?php 
                if (bp_get_activity_content_body()) {
                    ?>
								<div class="activity-inner">
									<?php 
                    bp_activity_content_body();
                    ?>
								</div>
							<?php 
                }
                ?>

						</div>
					</li>

				<?php 
            }
            ?>

			</ul>

		<?php 
        } else {
            ?>
			<div id="message" class="info">
				<p><?php 
            _e('Sorry, there were no posts found. Why not write one?', 'buddypress');
            ?>
</p>
			</div>
		<?php 
        }
        ?>

		<?php 
        echo $args['after_widget'];
        ?>
	<?php 
    }
开发者ID:danielcoats,项目名称:schoolpress,代码行数:83,代码来源:bp-blogs-widgets.php

示例11: framework

        /**
         * Do widget framework.
         *
         * @param array $instance The settings for the particular instance of the widget.
         */
        public static function framework($instance)
        {
            global $gs_counter, $processed_activities;
            genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry'));
            $settings = get_option('widget_featured-content');
            if (!isset($settings[3]['buddypress-group']) || 1 != $settings[3]['buddypress-group']) {
                GS_Featured_Content::action('thememixfc_before_post_content', $instance);
                GS_Featured_Content::action('thememixfc_post_content', $instance);
                GS_Featured_Content::action('thememixfc_after_post_content', $instance);
            } else {
                if (!isset($processed_activities)) {
                    $processed_activities = array();
                }
                $group_id = $settings[3]['buddypress-group-group'];
                if (bp_has_activities(bp_ajax_querystring('activity') . '&primary_id=' . $group_id)) {
                    while (bp_activities()) {
                        bp_the_activity();
                        $url = trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/');
                        $fontawesome_position = $settings[3]['fontawesome-position'];
                        $activity_id = bp_get_activity_id();
                        if (!in_array($activity_id, $processed_activities) && !isset($done)) {
                            // Get image HTML
                            if (isset($settings[3]['show_image']) && 1 == $settings[3]['show_image']) {
                                $size = $settings[3]['image_size'];
                                $image_html = bp_get_activity_avatar('type=' . $size);
                                // Add image link to image HTML
                                if (isset($settings[3]['link_image']) && 1 == $settings[3]['link_image']) {
                                    $image_html = '<a href="' . esc_attr(bp_get_activity_user_link()) . '">' . $image_html . '</a>';
                                }
                            }
                            echo '
						<article itemscope="itemscope" itemtype="http://schema.org/Event">';
                            if (isset($settings[3]['image_position']) && 'before-title' == $settings[3]['image_position']) {
                                echo $image_html;
                            }
                            if ('before_title' == $fontawesome_position) {
                                echo thememixfc_span_fontawesome();
                            }
                            echo '
							<h2 class="entry-title">';
                            if ('inline_before_title' == $fontawesome_position) {
                                echo thememixfc_span_fontawesome();
                            }
                            echo '
								<a href="' . esc_url($url) . '" title="' . esc_attr($group->name) . '">' . esc_html($group->name) . '</a>';
                            if ('inline_after_title' == $fontawesome_position) {
                                echo thememixfc_span_fontawesome();
                            }
                            echo '
							</h2>';
                            if ('after_title' == $fontawesome_position) {
                                echo thememixfc_span_fontawesome();
                            }
                            if (isset($settings[3]['image_position']) && 'after-title' == $settings[3]['image_position']) {
                                echo $image_html;
                            }
                            if (bp_activity_has_content()) {
                                bp_activity_content_body();
                            }
                            if (isset($settings[3]['image_position']) && 'after-content' == $settings[3]['image_position']) {
                                echo $image_html;
                            }
                            echo '
						</article>';
                            $processed_activities[] = $activity_id;
                            $done = true;
                        }
                    }
                }
            }
            $gs_counter++;
            genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>'));
        }
开发者ID:ryanhellyer,项目名称:thememix-pro-genesis,代码行数:78,代码来源:widget.php

示例12: widget

    function widget($args, $instance)
    {
        global $bp;
        extract($args);
        $link_title = !empty($instance['link_title']);
        echo $before_widget;
        echo $before_title;
        if ($link_title) {
            $dir_link = trailingslashit(bp_get_root_domain()) . trailingslashit(bp_get_blogs_root_slug());
            $title = '<a href="' . $dir_link . '">' . $instance['title'] . '</a>';
        } else {
            $title = $instance['title'];
        }
        echo $title;
        echo $after_title;
        if (empty($instance['max_posts']) || !$instance['max_posts']) {
            $instance['max_posts'] = 10;
        }
        // Load more items that we need, because many will be filtered out by privacy
        $real_max = $instance['max_posts'] * 10;
        $counter = 0;
        $query_string = empty($instance['include_groupblog']) ? 'action=new_blog_post' : 'action=new_blog_post,new_groupblog_post';
        $query_string .= '&max=' . $real_max . '&per_page=' . $real_max;
        if (bp_has_activities($query_string)) {
            ?>

			<ul id="blog-post-list" class="activity-list item-list">

				<?php 
            while (bp_activities()) {
                bp_the_activity();
                ?>

					<?php 
                if ($counter >= $instance['max_posts']) {
                    break;
                }
                ?>

					<li>
						<div class="activity-content" style="margin: 0">
							<div class="activity-avatar">
								<?php 
                bp_activity_avatar();
                ?>
							</div>

							<div class="activity-header">
								<?php 
                bp_activity_action();
                ?>
							</div>

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

									<?php 
                    bp_activity_content_body();
                    ?>

							<?php 
                }
                ?>

						</div>
					</li>

					<?php 
                $counter++;
                ?>

				<?php 
            }
            ?>

			</ul>

		<p class="cac-more-link"><a href="<?php 
            bp_blogs_directory_permalink();
            ?>
">More Blogs</a></p>

		<?php 
        } else {
            ?>
			<div id="message" class="info">
				<p><?php 
            _e('Sorry, there were no blog posts found. Why not write one?', 'buddypress');
            ?>
</p>
			</div>
		<?php 
        }
        ?>

		<?php 
        echo $after_widget;
        ?>
	<?php 
//.........这里部分代码省略.........
开发者ID:shads196770,项目名称:cbox-theme,代码行数:101,代码来源:bp-widgets.php

示例13: themefix_buddypress_groups_widget

function themefix_buddypress_groups_widget($settings, $key, $group)
{
    global $gs_counter, $processed_activities;
    if (!isset($processed_activities)) {
        $processed_activities = array();
    }
    $group_id = $settings[$key]['buddypress-group-group'];
    $group = groups_get_group(array('group_id' => $group_id));
    if (bp_has_activities(bp_ajax_querystring('activity') . '&primary_id=' . $group_id)) {
        while (bp_activities()) {
            bp_the_activity();
            $url = trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/');
            $fontawesome_position = $settings[$key]['fontawesome-position'];
            $activity_id = bp_get_activity_id();
            if (!in_array($activity_id, $processed_activities) && !isset($done)) {
                // Get image HTML
                if (isset($settings[$key]['show_image']) && 1 == $settings[$key]['show_image']) {
                    $size = $settings[$key]['image_size'];
                    $image_html = bp_get_activity_avatar('type=' . $size);
                    // Add image link to image HTML
                    if (isset($settings[$key]['link_image']) && 1 == $settings[$key]['link_image']) {
                        if ('' == $settings[$key]['gravatar_alignment']) {
                            $alignment = 'alignnone';
                        } else {
                            $alignment = $settings[$key]['gravatar_alignment'];
                        }
                        $image_html = '<a href="' . esc_attr(bp_get_activity_user_link()) . '"><span class="' . esc_attr($alignment) . '">' . $image_html . '</span></a>';
                    }
                }
                echo '
				<article itemscope="itemscope" itemtype="http://schema.org/Event">';
                if (isset($settings[$key]['image_position']) && 'before-title' == $settings[$key]['image_position']) {
                    echo $image_html;
                }
                if ('before_title' == $fontawesome_position) {
                    thememix_featured_content_span_fontawesome($key);
                }
                echo '
					<h2 class="entry-title">';
                echo '
						<a href="' . esc_url($url) . '" title="' . esc_attr($group->name) . '">';
                if ('inline_before_title' == $fontawesome_position) {
                    thememix_featured_content_span_fontawesome($key, true);
                    echo ' ';
                }
                echo esc_html($group->name);
                if ('inline_after_title' == $fontawesome_position) {
                    echo ' ';
                    thememix_featured_content_span_fontawesome($key, true);
                }
                echo '</a>';
                echo '
					</h2>';
                if ('after_title' == $fontawesome_position) {
                    thememix_featured_content_span_fontawesome($key);
                }
                if (isset($settings[$key]['image_position']) && 'after-title' == $settings[$key]['image_position']) {
                    echo $image_html;
                }
                if (bp_activity_has_content()) {
                    bp_activity_content_body();
                }
                if (isset($settings[$key]['image_position']) && 'after-content' == $settings[$key]['image_position']) {
                    echo $image_html;
                }
                echo '
				</article>';
                $processed_activities[] = $activity_id;
                $done = true;
            }
        }
    }
}
开发者ID:ThemeMix,项目名称:thememix-pro-genesis,代码行数:73,代码来源:buddypress-groups.php


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