本文整理汇总了PHP中bp_has_activities函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_has_activities函数的具体用法?PHP bp_has_activities怎么用?PHP bp_has_activities使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_has_activities函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: mpp_gallery_has_activity
/**
* A wrapper for bp_has_activity
* checks if the gallery has associated activity
*
* @param type $args
* @return type
*/
function mpp_gallery_has_activity($args = null)
{
$default = array('gallery_id' => mpp_get_current_gallery_id());
$args = wp_parse_args($args, $default);
extract($args);
$args = array('meta_query' => array(array('key' => '_mpp_gallery_id', 'value' => $gallery_id), array('key' => '_mpp_context', 'value' => 'gallery', 'compare' => '=')), 'type' => 'mpp_media_upload');
return bp_has_activities($args);
}
开发者ID:enboig,项目名称:mediapress,代码行数:15,代码来源:mpp-gallery-activity.php
示例2: sp_get_bp_activity_author
function sp_get_bp_activity_author()
{
global $activities_template, $bp;
bp_has_activities();
// echo "AT: ";
// print_r_html( $activities_template );
foreach ($activities_template->activities as $activity) {
if ($activity->id == $bp->current_action) {
return $activity->display_name;
}
}
}
开发者ID:netconstructor,项目名称:SeoPress,代码行数:12,代码来源:functions.php
示例3: 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
示例4: swa_post_update
function swa_post_update()
{
global $bp;
/* Check the nonce */
check_admin_referer('swa_post_update', '_wpnonce_swa_post_update');
if (!is_user_logged_in()) {
echo '-1';
return false;
}
if (empty($_POST['content'])) {
echo '-1<div id="message" class="error"><p>' . __('Please enter some content to post.', 'swa') . '</p></div>';
return false;
}
if (empty($_POST['object']) && function_exists('bp_activity_post_update')) {
$activity_id = bp_activity_post_update(array('content' => $_POST['content']));
} elseif ($_POST['object'] == 'groups') {
if (!empty($_POST['item_id']) && function_exists('groups_post_update')) {
$activity_id = groups_post_update(array('content' => $_POST['content'], 'group_id' => $_POST['item_id']));
}
} else {
$activity_id = apply_filters('bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content']);
}
if (!$activity_id) {
echo '-1<div id="message" class="error"><p>' . __('There was a problem posting your update, please try again.', 'swa') . '</p></div>';
return false;
}
$show_avatar = $_POST["show_avatar"] ? $_POST["show_avatar"] : "no";
$show_content = $_POST["show_content"] ? $_POST["show_content"] : "no";
if (bp_has_activities('include=' . $activity_id)) {
?>
<?php
while (bp_activities()) {
bp_the_activity();
?>
<?php
swa_activity_entry('show_avatar=' . $show_avatar . '&show_activity_content=' . $show_content);
?>
<?php
}
?>
<?php
}
exit(0);
}
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:44,代码来源:ajax.php
示例5: test_follow_blog_and_groupblog
/**
* @group groupblog
*/
public function test_follow_blog_and_groupblog()
{
if (!is_multisite()) {
return;
}
// save the current user and override logged-in user
$old_user = get_current_user_id();
$u = $this->factory->user->create();
$this->set_current_user($u);
// create some blogs
$b = $this->factory->blog->create(array('title' => 'Groupblog', 'user_id' => $u));
$b2 = $this->factory->blog->create(array('title' => 'Test blog 1', 'user_id' => $u));
$b3 = $this->factory->blog->create(array('title' => 'Test blog 2', 'user_id' => $u));
// create a group and connect a blog
$g = $this->factory->group->create(array('creator_id' => $u));
groups_update_groupmeta($g, 'groupblog_blog_id', $b);
// follow the groupblog
$f = bp_follow_start_following(array('leader_id' => $b, 'follower_id' => $u, 'follow_type' => 'blogs'));
// follow a regular blog
$f2 = bp_follow_start_following(array('leader_id' => $b2, 'follower_id' => $u, 'follow_type' => 'blogs'));
// add some activity items
$a = $this->factory->activity->create(array('component' => buddypress()->groups->id, 'type' => 'new_groupblog_post', 'user_id' => $u, 'item_id' => $g, 'secondary_item_id' => 1));
$a2 = $this->factory->activity->create(array('component' => buddypress()->blogs->id, 'type' => 'new_blog_post', 'user_id' => $u, 'item_id' => $b3, 'secondary_item_id' => 1));
$a3 = $this->factory->activity->create(array('component' => buddypress()->blogs->id, 'type' => 'new_blog_post', 'user_id' => $u, 'item_id' => $b2, 'secondary_item_id' => 1));
// fake that we're on a user's "Activity > Followed Sites" page
add_filter('bp_ajax_querystring', array($this, 'add_activity_scope_filter'));
// fake that BP groupblog is installed so groupblog filter will kick in
if (!function_exists('bp_groupblog_init')) {
function bp_groupblog_init()
{
}
}
// run the activity loop
global $activities_template;
bp_has_activities(bp_ajax_querystring('activity'));
// grab the activity IDs from the loop
$ids = wp_list_pluck($activities_template->activities, 'id');
// assert!
$this->assertEquals(array($a, $a3), $ids);
// reset everything
$activities_template = null;
$this->set_current_user($old_user);
remove_filter('bp_ajax_querystring', array($this, 'add_activity_scope_filter'));
}
开发者ID:wesavetheworld,项目名称:buddypress-followers,代码行数:47,代码来源:blogs.php
示例6: get_activity
/**
* get_activity function.
*
* @access public
* @param mixed $filter
* @return void
*/
public function get_activity($filter)
{
$args = $filter;
if (bp_has_activities($args)) {
while (bp_activities()) {
bp_the_activity();
$activity = array('avatar' => bp_core_fetch_avatar(array('html' => false, 'item_id' => bp_get_activity_id())), 'action' => bp_get_activity_action(), 'content' => bp_get_activity_content_body(), 'activity_id' => bp_get_activity_id(), 'activity_username' => bp_core_get_username(bp_get_activity_user_id()), 'user_id' => bp_get_activity_user_id(), 'comment_count' => bp_activity_get_comment_count(), 'can_comment' => bp_activity_can_comment(), 'can_favorite' => bp_activity_can_favorite(), 'is_favorite' => bp_get_activity_is_favorite(), 'can_delete' => bp_activity_user_can_delete());
$activity = apply_filters('bp_json_prepare_activity', $activity);
$activities[] = $activity;
}
$data = array('activity' => $activities, 'has_more_items' => bp_activity_has_more_items());
$data = apply_filters('bp_json_prepare_activities', $data);
} else {
return new WP_Error('bp_json_activity', __('No Activity Found.', 'buddypress'), array('status' => 200));
}
$response = new WP_REST_Response();
$response->set_data($data);
$response = rest_ensure_response($response);
return $response;
}
开发者ID:Ritesh-patel,项目名称:BP-API,代码行数:27,代码来源:bp-api-activity.php
示例7: get_activity
function get_activity()
{
// Depends on both bbPress and BuddyPress
if (!class_exists('bbPress') | !class_exists('BuddyPress')) {
return false;
}
// Try to retrieve the widget from the cache
$widget = wp_cache_get('recent_discussion', 'apoc');
if ($widget) {
$this->html = $widget;
$this->cached = true;
} else {
// Declare valid actions
$actions = array('bbp_topic_create', 'bbp_reply_create', 'new_blog_comment');
// Setup query args
$args = array('max' => $this->number, 'action' => implode(',', $actions));
// If topics are found, build the HTML
if (bp_has_activities($args)) {
$this->html = $this->build_html();
// Store the new HTML in the cache with 1 minute expiration
wp_cache_set('recent_discussion', $this->html, 'apoc', 60);
}
}
}
开发者ID:tamriel-foundry,项目名称:apoc2,代码行数:24,代码来源:widgets.php
示例8: output
/**
* Output the RSS feed.
*/
protected function output()
{
$this->http_headers();
echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
<?php
/**
* Fires at the end of the opening RSS tag for feed output so plugins can add extra attributes.
*
* @since 1.8.0
*/
do_action('bp_activity_feed_rss_attributes');
?>
>
<channel>
<title><?php
echo $this->title;
?>
</title>
<link><?php
echo $this->link;
?>
</link>
<atom:link href="<?php
self_link();
?>
" rel="self" type="application/rss+xml" />
<description><?php
echo $this->description;
?>
</description>
<lastBuildDate><?php
echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false);
?>
</lastBuildDate>
<generator>https://buddypress.org/?v=<?php
bp_version();
?>
</generator>
<language><?php
bloginfo_rss('language');
?>
</language>
<ttl><?php
echo $this->ttl;
?>
</ttl>
<sy:updatePeriod><?php
echo $this->update_period;
?>
</sy:updatePeriod>
<sy:updateFrequency><?php
echo $this->update_frequency;
?>
</sy:updateFrequency>
<?php
/**
* Fires at the end of channel elements list in RSS feed so plugins can add extra channel elements.
*
* @since 1.8.0
*/
do_action('bp_activity_feed_channel_elements');
?>
<?php
if (bp_has_activities($this->activity_args)) {
?>
<?php
while (bp_activities()) {
bp_the_activity();
?>
<item>
<guid isPermaLink="false"><?php
bp_activity_feed_item_guid();
?>
</guid>
<title><?php
echo stripslashes(bp_get_activity_feed_item_title());
?>
</title>
<link><?php
bp_activity_thread_permalink();
?>
</link>
<pubDate><?php
echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false);
?>
</pubDate>
<?php
//.........这里部分代码省略.........
开发者ID:mawilliamson,项目名称:wordpress,代码行数:101,代码来源:class-bp-activity-feed.php
示例9: bebop_manage_oers
function bebop_manage_oers()
{
if (bp_is_current_component('bebop') && bp_is_current_action('bebop-manager')) {
if (isset($_POST['action'])) {
global $wpdb;
global $bp;
$oer_count = 0;
$success = false;
//Add OER's to the activity stream.
if ($_POST['action'] == 'verify') {
foreach (array_keys($_POST) as $oer) {
if ($oer != 'action') {
$data = bebop_tables::fetch_individual_oer_data($oer);
//go and fetch data from the activity buffer table.
if (!empty($data->id)) {
$should_users_verify_content = bebop_tables::get_option_value('bebop_' . $data->type . '_content_user_verification');
if ($should_users_verify_content != 'no') {
global $wpdb;
if (!bp_has_activities('action=bebop_oer_plugin&item_id=' . $data->id)) {
$new_activity_item = array('user_id' => $data->user_id, 'component' => 'bebop_oer_plugin', 'type' => $data->type, 'action' => $data->action, 'content' => $data->content, 'item_id' => $data->id, 'date_recorded' => $data->date_recorded, 'hide_sitewide' => $data->hide_sitewide);
if (bp_activity_add($new_activity_item)) {
bebop_tables::update_oer_data($data->id, 'status', 'verified');
bebop_tables::update_oer_data($data->id, 'activity_stream_id', $wpdb->insert_id);
$oer_count++;
} else {
bebop_tables::log_error(__('Activity Stream', 'bebop'), __('Could not update the content status.', 'bebop'));
}
} else {
bebop_tables::log_error(__('Activity Stream', 'bebop'), __('This content already exists in the activity stream.', 'bebop'));
}
}
//End if ( $should_users_verify_content != 'no' ) {
}
}
}
//End foreach ( array_keys($_POST) as $oer ) {
if ($oer_count > 1) {
$success = true;
$message = __('Resources verified.', 'bebop');
} else {
$success = true;
$message = __('Resource verified.', 'bebop');
}
} else {
if ($_POST['action'] == 'delete') {
foreach (array_keys($_POST) as $oer) {
if ($oer != 'action') {
$data = bebop_tables::fetch_individual_oer_data($oer);
//go and fetch data from the activity buffer table.
if (!empty($data->id)) {
//delete the activity, let the filter update the tables.
if (!empty($data->activity_stream_id)) {
$should_users_verify_content = bebop_tables::get_option_value('bebop_' . $data->type . '_content_user_verification');
if ($should_users_verify_content != 'no') {
bp_activity_delete(array('id' => $data->activity_stream_id));
}
}
bebop_tables::update_oer_data($data->id, 'status', 'deleted');
$oer_count++;
}
}
}
//End foreach ( array_keys( $_POST ) as $oer ) {
if ($oer_count > 1) {
$success = true;
$message = __('Resources deleted.', 'bebop');
} else {
$success = true;
$message = __('Resource deleted.', 'bebop');
}
} else {
if ($_POST['action'] == 'undelete') {
foreach (array_keys($_POST) as $oer) {
$exclude_array = array('action', 'submit');
if (!in_array($oer, $exclude_array)) {
$data = bebop_tables::fetch_individual_oer_data($oer);
//go and fetch data from the activity buffer table.
$should_users_verify_content = bebop_tables::get_option_value('bebop_' . $data->type . '_content_user_verification');
if ($should_users_verify_content != 'no') {
bebop_tables::update_oer_data($data->id, 'status', 'unverified');
$oer_count++;
}
}
}
if ($oer_count > 1) {
$success = true;
$message = __('Resources undeleted.', 'bebop');
} else {
$success = true;
$message = __('Resource undeleted.', 'bebop');
}
}
}
}
if ($success) {
bp_core_add_message($message);
} else {
bp_core_add_message(__('We couldnt do that for you. Please try again.', 'bebop'), __('error', 'bebop'));
}
bp_core_redirect($bp->loggedin_user->domain . bp_current_component() . '/' . bp_current_action());
//.........这里部分代码省略.........
开发者ID:adisonc,项目名称:MaineLearning,代码行数:101,代码来源:bebop-core.php
示例10: extract
* @subpackage K Elements
* @author SeventhQueen <[email protected]>
* @since K Elements 1.0
*/
extract(shortcode_atts(array('show' => false, 'number' => 6, 'show_button' => 'yes', 'button_link' => '/activity', 'button_label' => 'View All Activity', 'post_form' => ''), $atts));
if (function_exists('bp_is_active') && bp_is_active('activity')) {
$output = '';
$params = array('max' => $number, 'object' => $show);
$output .= '<div class="wpb_wrapper">';
$output .= '<div class="activity kleo-activity-streams">';
if (is_user_logged_in() && $post_form == 'yes') {
ob_start();
bp_get_template_part('activity/post-form');
$output .= ob_get_clean();
}
if (bp_has_activities($params)) {
$output .= '<ul id="activity-stream" class="activity-list item-list">';
while (bp_activities()) {
bp_the_activity();
$output .= '<li class="' . bp_get_activity_css_class() . '" id="activity-' . bp_get_activity_id() . '">';
$output .= '<div class="activity-avatar rounded">';
$output .= '<a class="kleo-activity-avatar" title="' . __('View Profile', 'kleo_framework') . '" href="' . bp_get_activity_user_link() . '">';
$output .= bp_get_activity_avatar();
$output .= '</a>';
$output .= '</div>';
// activity content
$output .= '<div class="activity-content">';
$output .= '<div class="activity-header">';
$output .= bp_get_activity_action();
$output .= '</div>';
$output .= '<div class="activity-inner">';
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:31,代码来源:kleo_bp_activity_stream.php
示例11: do_action
* @subpackage BuddyBoss
*/
?>
<?php
do_action('bp_before_activity_loop');
?>
<?php
$qs = bp_ajax_querystring('activity');
global $bp;
?>
<?php
if (bp_has_activities($qs)) {
?>
<?php
/* Show pagination if JS is not enabled, since the "Load More" link will do nothing */
?>
<noscript>
<div class="pagination">
<div class="pag-count"><?php
bp_activity_pagination_count();
?>
</div>
<div class="pagination-links"><?php
bp_activity_pagination_links();
?>
</div>
开发者ID:par-orillonsoft,项目名称:Wishmagnet,代码行数:31,代码来源:activity-loop.php
示例12: bp_dtheme_activity_loop
<?php /* Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_activity_loop() */ ?>
<?php do_action( 'bp_before_activity_loop' ) ?>
<?php global $bp;
if ( bp_is_active("activity")&&bp_has_activities( "action=gallery_new_comment&show_hidden=1&secondary_id=".$bp->gallery->current_gallery->id ) ) : ?>
<?php /* Show pagination if JS is not enabled, since the "Load More" link will do nothing */ ?>
<noscript>
<div class="pagination">
<div class="pag-count"><?php bp_activity_pagination_count() ?></div>
<div class="pagination-links"><?php bp_activity_pagination_links() ?></div>
</div>
</noscript>
<?php if ( is_user_logged_in() ) : ?>
<?php locate_template( array( 'gallery/single/media/post-form.php'), true ) ?>
<?php endif; ?>
<?php if ( empty( $_POST['page'] ) ) : ?>
<ul id="activity-stream" class="activity-list item-list">
<?php endif; ?>
<?php while ( bp_activities() ) : bp_the_activity(); ?>
<?php include( locate_template( array( 'activity/entry.php' ), false ) ) ?>
<?php endwhile; ?>
<?php if ( bp_get_activity_count() == bp_get_activity_per_page() ) : ?>
<li class="load-more">
<a href="#more"><?php _e( 'Load More', 'buddypress' ) ?></a> <span class="ajax-loader"></span>
开发者ID:r-chopra17,项目名称:p2bp,代码行数:31,代码来源:activity.php
示例13: get_option
<language><?php
echo get_option('rss_language');
?>
</language>
<?php
do_action('bp_activity_favorites_feed_head');
?>
<?php
$favs = bp_activity_get_user_favorites(bp_displayed_user_id());
$fav_ids = implode(',', (array) $favs);
?>
<?php
if (bp_has_activities('include=' . $fav_ids . '&max=50&display_comments=stream')) {
?>
<?php
while (bp_activities()) {
bp_the_activity();
?>
<item>
<guid><?php
bp_activity_thread_permalink();
?>
</guid>
<title><?php
bp_activity_feed_item_title();
?>
</title>
开发者ID:newington,项目名称:buddypress,代码行数:31,代码来源:bp-activity-favorites-feed.php
示例14: get_option
?>
</pubDate>
<generator>http://buddypress.org/?v=<?php
echo BP_VERSION;
?>
</generator>
<language><?php
echo get_option('rss_language');
?>
</language>
<?php
do_action('bp_activity_friends_feed_head');
?>
<?php
if (bp_has_activities('scope=friends&max=50&display_comments=stream')) {
?>
<?php
while (bp_activities()) {
bp_the_activity();
?>
<item>
<guid><?php
bp_activity_thread_permalink();
?>
</guid>
<title><?php
bp_activity_feed_item_title();
?>
</title>
<link><?php
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:31,代码来源:bp-activity-friends-feed.php
示例15: get_option
?>
</pubDate>
<generator>http://buddypress.org/?v=<?php
echo BP_VERSION;
?>
</generator>
<language><?php
echo get_option('rss_language');
?>
</language>
<?php
do_action('bp_activity_group_feed_head');
?>
<?php
if (bp_has_activities('object=' . $bp->groups->id . '&primary_id=' . $bp->groups->current_group->id . '&max=50&display_comments=threaded')) {
?>
<?php
while (bp_activities()) {
bp_the_activity();
?>
<item>
<guid><?php
bp_activity_thread_permalink();
?>
</guid>
<title><?php
bp_activity_feed_item_title();
?>
</title>
<link><?php
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:31,代码来源:bp-activity-group-feed.php
示例16: _e
<div class="activity single-group">
<h3><?php
_e('Blog Activity', 'groupblog');
?>
</h3>
<?php
if (bp_has_activities('per_page=5&object=blogs&primary_id=' . get_groupblog_blog_id(bp_get_group_id()))) {
?>
<div class="pagination">
<div class="pag-count"><?php
bp_activity_pagination_count();
?>
</div>
<div class="pagination-links"><?php
bp_activity_pagination_links();
?>
</div>
</div>
<?php
if (empty($_POST['page'])) {
?>
<ul id="activity-stream" class="activity-list item-list">
<?php
}
?>
<?php
开发者ID:adisonc,项目名称:MaineLearning,代码行数:31,代码来源:activity.php
示例17: test_bp_has_activities_with_date_query
/**
* Integration test for 'date_query' param
*
* @group date_query
* @requires PHP 5.3
*/
function test_bp_has_activities_with_date_query()
{
if (!class_exists('WP_Date_Query')) {
return;
}
$a1 = $this->factory->activity->create();
$a2 = $this->factory->activity->create(array('recorded_time' => '2001-01-01 12:00'));
$a3 = $this->factory->activity->create(array('recorded_time' => '2005-01-01 12:00'));
global $activities_template;
bp_has_activities(array('date_query' => array(array('after' => '1 day ago'))));
$ids = wp_list_pluck($activities_template->activities, 'id');
$this->assertEquals($ids, array($a1));
}
开发者ID:JeroenNouws,项目名称:BuddyPress,代码行数:19,代码来源:template.php
示例18: get_option
?>
</pubDate>
<generator>http://buddypress.org/?bp-activity-version=<?php
echo BP_ACTIVITY_VERSION;
?>
</generator>
<language><?php
echo get_option('rss_language');
?>
</language>
<?php
do_action('bp_activity_sitewide_feed_head');
?>
<?php
if (bp_has_activities('type=sitewide&max=50')) {
?>
<?php
while (bp_activities()) {
bp_the_activity();
?>
<item>
<title><![CDATA[<?php
bp_activity_feed_item_title();
?>
]]></title>
<link><?php
echo bp_activity_feed_item_link();
?>
</link>
<pubDate><?php
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:31,代码来源:bp-activity-sitewide-feed.php
示例19: output
/**
* Output the RSS feed.
*/
protected function output()
{
// set up some additional headers if not on a directory page
// this is done b/c BP uses pseudo-pages
if (!bp_is_directory()) {
global $wp_query;
$wp_query->is_404 = false;
status_header(200);
}
header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
<?php
do_action('bp_activity_feed_rss_attributes');
?>
>
<channel>
<title><?php
echo $this->title;
?>
</title>
<link><?php
echo $this->link;
?>
</link>
<atom:link href="<?php
self_link();
?>
" rel="self" type="application/rss+xml" />
<description><?php
echo $this->description;
?>
</description>
<lastBuildDate><?php
echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false);
?>
</lastBuildDate>
<generator>http://buddypress.org/?v=<?php
bp_version();
?>
</generator>
<language><?php
bloginfo_rss('language');
?>
</language>
<ttl><?php
echo $this->ttl;
?>
</ttl>
<sy:updatePeriod><?php
echo $this->update_period;
?>
</sy:updatePeriod>
<sy:updateFrequency><?php
echo $this->update_frequency;
?>
</sy:updateFrequency>
<?php
do_action('bp_activity_feed_channel_elements');
?>
<?php
if (bp_has_activities($this->activity_args)) {
?>
<?php
while (bp_activities()) {
bp_the_activity();
?>
<item>
<guid isPermaLink="false"><?php
bp_activity_feed_item_guid();
?>
</guid>
<title><?php
echo stripslashes(bp_get_activity_feed_item_title());
?>
</title>
<link><?php
bp_activity_thread_permalink();
?>
</link>
<pubDate><?php
echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false);
?>
</pubDate>
<?php
if (bp_get_activity_feed_item_description()) {
?>
<content:encoded><![CDATA[<?php
//.........这里部分代码省略.........
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:101,代码来源:bp-activity-classes.php
示例20: bp_legacy_theme_new_activity_comment
/**
* Posts new Activity comments received via a POST request.
*
* @global BP_Activity_Template $activities_template
* @return string HTML
* @since BuddyPress (1.2)
*/
function bp_legacy_theme_new_activity_comment()
{
global $activities_template;
$bp = buddypress();
// Bail if not a POST action
if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
return;
}
// Check the nonce
check_admin_referer('new_activity_comment', '_wpnonce_new_activity_comment');
if (!is_user_logged_in()) {
exit('-1');
}
$feedback = __('There was an error posting your reply. Please try again.', 'buddypress');
if (empty($_POST['content'])) {
exit('-1<div id="message" class="error bp-ajax-message"><p>' . esc_html__('Please do not leave the comment area blank.', 'buddypress') . '</p></div>');
}
if (empty($_POST['form_id']) || empty($_POST['comment_id']) || !is_numeric($_POST['form_id']) || !is_numeric($_POST['comment_id'])) {
exit('-1<div id="message" class="error bp-ajax-message"><p>' . esc_html($feedback) . '</p></div>');
}
$comment_id = bp_activity_new_comment(array('activity_id' => $_POST['form_id'], 'content' => $_POST['content'], 'parent_id' => $_POST['comment_id']));
if (!$comment_id) {
if (!empty($bp->activity->errors['new_comment']) && is_wp_error($bp->activity->errors['new_comment'])) {
$feedback = $bp->activity->errors['new_comment']->get_error_message();
unset($bp->activity->errors['new_comment']);
}
exit('-1<div id="message" class="error bp-ajax-message"><p>' . esc_html($feedback) . '</p></div>');
}
// Load the new activity item into the $activities_template global
bp_has_activities('display_comments=stream&hide_spam=false&show_hidden=true&include=' . $comment_id);
// Swap the current comment with the activity item we just loaded
if (isset($activities_template->activities[0])) {
$activities_template->activity = new stdClass();
$activities_template->activity->id = $activities_template->activities[0]->item_id;
$activities_template->activity->current_comment = $activities_template->activities[0];
// Because the whole tree has not been loaded, we manually
// determine depth
$depth = 1;
$parent_id = (int) $activities_template->activities[0]->secondary_item_id;
while ($parent_id !== (int) $activities_template->activities[0]->item_id) {
$depth++;
$p_obj = new BP_Activity_Activity($parent_id);
$parent_id = (int) $p_obj->secondary_item_id;
}
$activities_template->activity->current_comment->depth = $depth;
}
// get activity comment template part
bp_get_template_part('activity/comment');
unset($activities_template);
exit;
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:58,代码来源:buddypress-functions.php
注:本文中的bp_has_activities函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论