Skip to:
Content

#1915 closed defect (invalid)

Activity stream: Hide 'pending' forum topics and replies

Reported by: kraigg Owned by:
Milestone: Priority: high
Severity: major Version: 2.1.1
Component: Moderation Keywords: has-patch dev-feedback
Cc: jmdodd@…

Description

Good morning all

I have found a problem where pending/unpublished group forum topics and replies still appear in the Buddypress activity stream.

I'm using the latest Buddypress 1.6 and BBPress 2.1.1, and the bbPressModeration plugin (http://wordpress.org/extend/plugins/bbpressmoderation/) to moderate any newly created forums and forum topics. This plugin marks all new forums topics and replies as ‘pending’, until the administrator goes into the dashboard and marks them as ‘published’.

I’m using the code below for my custom Buddypress activity stream.

<?php

/* = Generate Custom Activity Stream
-----------------------------------------------
* Place this function anywhere you want to show your custom stream.
* Should accept any of these parameters:
* http://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-activity-stream-loop/
*/

my_activity_stream('per_page=4&page=1&action=new_forum_post,new_blog_comment,new_blog_post,new_forum_topic');

/* = Custom Activity Stream
-----------------------------------------------
* Place this function in bp-custom.php (in your plugins directory)
*/
function my_activity_stream($args ) {

  if ( bp_has_activities($args) ) : ?>

<div class="pagination">
<div class="pag-count"><?php bp_activity_pagination_count() ?></div>
<div class="pagination-links"><?php bp_activity_pagination_links() ?></div>
</div>

<ul id="activity-stream" class="activity-list item-list">

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

<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_get_activity_content_body() ) : ?>
<div class="activity-inner">
<?php bp_activity_content_body() ?>
</div>
<?php endif; ?>

<?php do_action( 'bp_activity_entry_content' ) ?>

</div>
</li>

<?php endwhile; ?>

</ul>

<?php else : ?>
<div id="message" class="info">
<p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ) ?></p>
</div>
<?php endif;

wp_reset_query();
}

}}}

}}}

Attachments (1)

bbpressmoderation.diff (1.3 KB) - added by jmdodd 19 months ago.

Download all attachments as: .zip

Change History (11)

comment:1 johnjamesjacoby21 months ago

  • Milestone changed from Awaiting Review to 2.2

Thanks for the report. Moving to 2.2, and someone will look into this soon.

comment:2 jmdodd19 months ago

  • Cc jmdodd@… added

comment:3 jmdodd19 months ago

  • Keywords has-patch needs-testing added

Solution proposed in #1753, which applies to both group and sitewide forums. Known issue: bbPress Moderation appends (Awaiting moderation) to title and content in the activity stream because it uses global $post. Patch for bbPress Moderation included.

jmdodd19 months ago

comment:4 johnjamesjacoby19 months ago

Notified the author of bbPress Moderation via email to come check out this awesome patch.

comment:5 johnjamesjacoby19 months ago

  • Keywords dev-feedback added; needs-testing removed
  • Milestone 2.2 deleted

Moving out of 2.2 milestone and switching keywords around, since it's related to #1915, and the proposed fix is in the bbPress Moderation plugin.

comment:6 ianhaycox18 months ago

I've updated the bbPress Moderation plugin to include the fix above.

New version is 1.3 http://wordpress.org/extend/plugins/bbpressmoderation/

Thanks to the contributors for finding and supplying the fix.

comment:7 kraigg18 months ago

Thanks so much to everyone involved who found a solution. It's very much appreciated!

I tested the updated plugin on my website, and it works much better. Unmoderated forum topics and replies no longer appear in the activity stream. The only issue is that once a pending forum topic or reply is approved by an administrator, they don't appear in the activity stream either.

Is there a flag that can be set for items in the activity stream, where unapproved topics and replies have flag=0, and once approved the flag=1? Then do a query to display all the activities that are either topic or reply and have flag=1?

comment:8 jmdodd18 months ago

The patch for #1753 deals with keeping the activity stream synced with topic and reply changes (including publishing).

comment:9 kraigg18 months ago

That's excellent, certainly good news, thank you jmdodd!

comment:10 netweb13 months ago

  • Resolution set to invalid
  • Status changed from new to closed

Closing as 'invalid' as this appears fixed in the 'bbPress Moderation' plugin.

Note: See TracTickets for help on using tickets.