Пример #1
0
	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
	}
    function x_buddypress_activity_list_item_header()
    {
        ?>

    <div class="x-list-item-header">
      <div class="x-list-item-avatar-wrap activity-avatar">
        <a href="<?php 
        bp_activity_user_link();
        ?>
">
          <?php 
        bp_activity_avatar();
        ?>
        </a>
      </div>
      <div class="x-list-item-header-info">
        <?php 
        bp_activity_action();
        ?>
      </div>
    </div>

  <?php 
    }
Пример #3
0
        <div class="activity-avatar">
            <a href="<?php 
bp_activity_user_link();
?>
">
    
                <?php 
bp_activity_avatar();
?>
    
            </a>
        </div>
        <div class="activity-header">
    
            <?php 
bp_activity_action();
?>
    
        </div>
    
        <?php 
if ('activity_comment' == bp_get_activity_type()) {
    ?>
    
            <div class="activity-inreplyto">
                <strong><?php 
    _e('In reply to: ', 'firmasite');
    ?>
</strong><?php 
    bp_activity_parent_content();
    ?>
Пример #4
0
    /**
     * 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 
    }
Пример #5
0
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');
            ?>
</a>
		<?php 
        }
        ?>
            <?php 
    }
    ?>
            <?php 
    do_action('bp_activity_entry_meta');
    ?>
        </div>
	<div class="clear" ></div>
    </div>
    <?php 
    if ('activity_comment' == bp_get_activity_type()) {
        ?>
	<div class="swa-activity-inreplyto">
            <strong><?php 
        _e('In reply to', 'swa');
        ?>
</strong> - <?php 
        bp_activity_parent_content();
        ?>
 &middot;
            <a href="<?php 
        bp_activity_thread_permalink();
        ?>
" class="view" title="<?php 
        _e('View Thread / Permalink', 'swa');
        ?>
"><?php 
        _e('View', 'swa');
        ?>
</a>
	</div>
    <?php 
    }
    ?>
    <?php 
    if (bp_activity_can_comment()) {
        ?>
        <div class="swa-activity-comments">
        	<?php 
        bp_activity_comments();
        ?>
            <?php 
        if (is_user_logged_in()) {
            ?>
			<form action="<?php 
            bp_activity_comment_form_action();
            ?>
" method="post" id="swa-ac-form-<?php 
            bp_activity_id();
            ?>
" class="swa-ac-form"<?php 
            bp_activity_comment_form_nojs_display();
            ?>
>
				<div class="ac-reply-avatar"><?php 
            bp_loggedin_user_avatar('width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT);
            ?>
</div>
				<div class="ac-reply-content">
					<div class="ac-textarea">
						<textarea id="swa-ac-input-<?php 
            bp_activity_id();
            ?>
" class="ac-input" name="ac_input_<?php 
            bp_activity_id();
            ?>
"></textarea>
					</div>
					<input type="submit" name="swa_ac_form_submit" value="<?php 
            _e('Post', 'buddypress');
            ?>
 &rarr;" /> &nbsp; <?php 
            _e('or press esc to cancel.', 'buddypress');
            ?>
					<input type="hidden" name="comment_form_id" value="<?php 
            bp_activity_id();
            ?>
" />
				</div>
				<?php 
            wp_nonce_field('new_activity_comment', '_wpnonce_new_activity_comment');
            ?>
			</form>
			<?php 
        }
        ?>
	</div>
    <?php 
    }
    ?>
</li>
<?php 
    do_action('bp_after_swa_activity_entry');
    ?>

<?php 
}
Пример #6
0
<?php /* This template is used by activity-loop.php and AJAX functions to show each activity */ ?>

<?php do_action( 'bp_before_activity_entry' ) ?>

<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() ) : ?>
Пример #7
0
    /**
     * 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 
    }
bp_displayed_user_avatar('type=thumb&width=45&height=45');
?>
				</a>
			</div>

			<?php 
if (bp_activity_embed_has_activity(bp_current_action())) {
    ?>

				<?php 
    while (bp_activities()) {
        bp_the_activity();
        ?>
					<p class="bp-embed-activity-action">
						<?php 
        bp_activity_action(array('no_timestamp' => true));
        ?>
					</p>
				<?php 
    }
    ?>

			<?php 
}
?>

			<p class="bp-embed-header-meta">
				<?php 
if (bp_is_active('activity') && bp_activity_do_mentions()) {
    ?>
					<span class="bp-embed-mentionname">@<?php 
Пример #9
0
    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 
    }
Пример #10
-1
    function widget($args, $instance)
    {
        extract($args);
        echo $before_widget;
        echo $before_title . 'Posts' . $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>
						</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 
    }