BuddyPress Block Activity Stream Types plugin

Download from WordPress Plugin Repo: BuddyPress Block Activity Stream Types

This plugin is a simple way to block certain activity stream entries from being recorded to the database – this could be new member registrations, joining a group, friendship created and so forth. (previously an ugly hack to unset items from the activity stream)

You  may enter in certain activity types to be blocked. This will plugin will display a list of already used types but it may change if a new plugin utilizes the activity stream. Please read the FAQ – a few gotches as this may require editing a theme file depending on what types you block (ie Show New Members) or if a plugin registers the action bp_activity_filter_options

If you block an activity stream type – there is no reverting back. :-P

You may also hook into this plugin to allow more fine control over blocking activity stream entries. Please read this forum thread on an example to get started -> Quick Tip: Hooking Block Activity Stream Types Plugin on a Granular Level

Posted in Tech | Tagged , | 2 Comments

BuddyPress Activity Stream Bump to Top Plugin

Download from WordPress Plugin Repo: BuddyPress Activity Stream Bump to Top

This plugin is a simple way to keep certain activity types up top within the stream (like a forum topic). If a user replies to an activity record – this plugin will change the internal date_recorded to the same timestamp while retaining the original date_recorded in the activity_meta table.  (no adverse sql query performance)

You  may select certain activity types to exclude from bumping within the plugin’s admin page.  If you really hate it – you may revert all the dates back to the original prior to removing the plugin ;)

BuddyPress 1.2.4.1 and higher ONLY!!!
Does not support earlier versions due to a bug in BuddyPress. If you attempt to use this with earlier versions, very unpredictable results will occur with activity actions and types being overwritten.

Activity Stream Bump

Posted in Tech | Tagged , | 2 Comments

BuddyPress Member Profile Stats Plugin

Download from WordPress Plugin Repo: BuddyPress Member Profile Stats

Displays a simple statistical meta section underneath the profile

  • Member Since
  • Status Count
  • Forum Topic Count
  • Forum Post Count
  • Blog Comment Count

The wp-admin page includes an option to select which count function to display. Various filters/hooks and templatetags are available to customize the output (ie if a count is zero – add a filter to remove the text completely)

Also: No wp_cache set yet – performance may vary.

member-profile-stats

member-profile-stats

Please post up any issues or ideas (widget?) List of admin/moderated groups?

Posted in Tech | Tagged , | 1 Comment

FireNICO Extension no longer works on NICOclub Forums

NICOclub has finally transitioned away from ZeroForum to vB – thus FireNICO was built for ZeroForum and will no longer function properly. A new extension may be built for vB if/when VWvortex makes the same move.

- thanks for using the extension.

Posted in FireNICO | Tagged , , | Leave a comment

BuddyPress Activity Stream as Blog Comments plugin

Download from WordPress Plugin Repo: BuddyPress Activity Stream as Blog Comments

This plugin will replace the main BuddyPress blog (for what BP is activated on) comments section with the activity stream.

A few important notes:

  • WPMU and subblogs – no official support yet but i think it is possible
  • This is not for everyone (silly yes but if you love comment moderation and the wp-admin – then don’t use this)
  • Includes own theme files – you may copy the activitycomments theme folder to your default theme and override the layout
  • Existing Blog posts/comments – requires this plugin: BP Import Blog Activity
  • You must allow activity types: new_blog_post and new_blog_comment (this is only important if you hacked BP to disallow certain commenting – something i have covered previously)

How does it work?

When a blog post (new_blog_post) or comment (new_blog_comment) is made – an activity record is created corresponding to the post_ID or comment_ID. This plugin will cycle over the activity records for threaded comments made and display them in the same fashion as the BuddyPress activity stream (ability to reply and nested via the same ajax means)

Why would i want to do this?

The activity stream is a centralized commenting system in BuddyPress – the disconnect on the BP Blog portion may alienate user discussion on your site.

See it in action

(i may take a shot at using activity stream for the forums)

Posted in Tech | Tagged , | 5 Comments

5 BuddyPress Quick Tips plus a new demo site

Kicking off a new simple BuddyPress showcase site – (?) – for my plugins and hacks (best way to demo them – but a warning – on a shared host )

I came up with a few more quick tweaks:

Remove Change Avatar link under Profile if Avatar Upload is Disabled
Display the Group’s recent activity on Group Directory (groups-loop)
Display the Group’s Forum link on the Group Directory (groups-loop.php)
Auto-Add Group Admin when a new group is created
Disable Member Directory

Account registration is linked between etivite and etiviti (if you want to comment on this blog)

Posted in Tech | Tagged , | Leave a comment

BuddyPress Hack: Add signup email checks (valid, duplicate and domains) on profile settings page

When a member creates a new account on BuddyPress, several email checks take place:  is_email, limited_email_domains, email_exists). One small problem is after the account has been created/validated a user may change their email address without these checks.  On My Profile > Settings > General

The code below will add the same signup checks plus force the user to enter their current password before updating.

*warning*

1) less than favorable hack as i was unable to create a proper plugin (something with removing the nav item and re-adding as the screen_function would not call the new template)

2) this should be a core thing and also email re-validation is needed (or maybe reset the pw on email change) – submitted a trac ticket email check

*warning #2 this requires modifying core files – built on BP v1.2.3*

Replace following 2 functions in buddypress/bp-core/bp-core-settings.php


function bp_core_screen_general_settings() {
 global $current_user, $bp_settings_updated, $pass_error, $email_error, $pwd_error;

 $bp_settings_updated = false;
 $pass_error = false;
 $email_error = false;
 $pwd_error = false;

 if ( isset($_POST['submit']) ) {
 check_admin_referer('bp_settings_general');

 require_once( WPINC . '/registration.php' );

 // Form has been submitted and nonce checks out, lets do it.

 //we want to validate the user again for the current password when making a big change
 if ( !empty( $_POST['pwd'] ) && $_POST['pwd'] != '' && wp_check_password($_POST['pwd'], $current_user->user_pass, $current_user->ID) ) {

 //need to make sure changing an email address does not already exists
 if ( $_POST['email'] != '' ) {

 //what is missing from the profile page vs signup - lets double check the goodies
 $user_email = sanitize_email( wp_specialchars( trim( $_POST['email'] ) ) );

 if ( !is_email( $user_email ) )
 $email_error = true;

 $limited_email_domains = get_site_option( 'limited_email_domains', 'buddypress' );

 if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
 $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );

 if ( in_array( $emaildomain, (array)$limited_email_domains ) == false )
 $email_error = true;
 }

 if ( !$email_error && $current_user->user_email != $user_email  ) {

 //we don't want email dups in the system
 if ( email_exists( $user_email ) )
 $email_error = true;

 if (!$email_error)
 $current_user->user_email = $user_email;
 }
 }

 if ( $_POST['pass1'] != '' && $_POST['pass2'] != '' ) {

 if ( $_POST['pass1'] == $_POST['pass2'] && !strpos( " " . $_POST['pass1'], "\\" ) )
 $current_user->user_pass = $_POST['pass1'];
 else
 $pass_error = true;

 } else if ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) || !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) {
 $pass_error = true;
 } else {
 unset( $current_user->user_pass );
 }

 if ( !$email_error && !$pass_error && wp_update_user( get_object_vars( $current_user ) ) )
 $bp_settings_updated = true;

 } else {
 $pwd_error = true;
 }

 }

 add_action( 'bp_template_title', 'bp_core_screen_general_settings_title' );
 add_action( 'bp_template_content', 'bp_core_screen_general_settings_content' );

 bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}

2nd function to replace as we should display some feedback to the user:

function bp_core_screen_general_settings_content() {
 global $bp, $current_user, $bp_settings_updated, $pass_error, $pwd_error, $email_error; ?>

 <?php if ( $bp_settings_updated && !$pass_error ) { ?>
 <div id="message">
 <p><?php _e( 'Changes Saved.', 'buddypress' ) ?></p>
 </div>
 <?php } ?>

 <?php if ( $pass_error && !$bp_settings_updated ) { ?>
 <div id="message">
 <p><?php _e( 'Your passwords did not match', 'buddypress' ) ?></p>
 </div>
 <?php } ?>

 <?php if ( $pwd_error && !$bp_settings_updated ) { ?>
 <div id="message">
 <p><?php _e( 'Your password is incorrect', 'buddypress' ) ?></p>
 </div>
 <?php } ?>

 <?php
 if ( $email_error && !$bp_settings_updated ) { ?>
 <div id="message">
 <p><?php _e( 'Sorry, that email address is already used or is invalid', 'buddypress' ) ?></p>
 </div>
 <?php } ?>

 <form action="<?php echo $bp->loggedin_user->domain . BP_SETTINGS_SLUG . '/general' ?>" method="post" id="settings-form">

 <label for="pwd"><?php _e( 'Current Password <span>(required to update email or change current password)</span>', 'buddypress' ) ?></label>
 <input type="password" name="pwd" id="pwd" size="16" value="" /> &nbsp;<?php _e( 'Current Password', 'buddypress' ) ?><br />
 <a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a><br/>

 <label for="email"><?php _e( 'Account Email', 'buddypress' ) ?></label>
 <input type="text" name="email" id="email" value="<?php echo attribute_escape( $current_user->user_email ); ?>" />

 <label for="pass1"><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ) ?></label>

 <input type="password" name="pass1" id="pass1" size="16" value="" /> &nbsp;<?php _e( 'New Password', 'buddypress' ) ?><br />
 <input type="password" name="pass2" id="pass2" size="16" value="" /> &nbsp;<?php _e( 'Repeat New Password', 'buddypress' ) ?>

 <div>
 <input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?>" id="submit"/></p>
 </div>

 <?php wp_nonce_field('bp_settings_general') ?>
 </form>
<?php

}
Posted in Tech | Tagged , | Leave a comment

BuddyPress Hack: bbPress Forum tweaks using Group Forum Extras plugin

First, download the plugin (v0.1.8 is required)

The latest plugin update includes a few “extra” functions in order to display some classic bbPress features.

Link the freshness time_since to the last post anchor

edit /bp-default/forums/forums-loop.php

Change:

<td>
<?php bp_the_topic_time_since_last_post() ?>
</td>

To:

<td>
<a href="<?php echo bp_forum_extras_topic_last_post_link( 15  ); ?>"><?php bp_the_topic_time_since_last_post()  ?></a>
</td>

Add pagination next to topic title on Forum Page

edit /bp-default/forums/forums-loop.php

Add:

<?php bp_forum_extras_topic_page_links( 15 ) ?>

After the topic title. You may pass additional args and css maybe required – refer to paginate_links.

Please note: 15 is the default per_page for bp_has_forum_topic_posts loop – buddypress does not store page settings in a meta table like bbPress. So we have to fudge it a little.

Add Voices to Topic Page

edit /bp-default/groups/single/forum/topic.php

After:

<?php bp_the_topic_total_post_count() ?>

Add:

 , <?php bp_forum_extras_the_topic_voices_count(); ?>

Add Voices to Forum Page (does not require extras plugin)

edit /bp-default/forums/forums-loop.php

Add new columns

header:

<th id="th-voices"><?php _e( 'Voices', 'buddypress' ) ?></th>

and in the loop:

<td>
 <?php bb_topic_voices( bp_get_the_topic_id() ) ?>
 </td>

Add Author to Forum Page (does not require extras plugin)

edit /bp-default/forums/forums-loop.php

Add new columns

header:

<th id="th-author"><?php _e( 'Author', 'buddypress' ) ?></th>

and in the loop:

<td>
 <a href="<?php bp_the_topic_permalink() ?>"><?php bp_the_topic_poster_avatar( 'type=thumb&width=20&height=20' ) ?></a>
 <div><?php bp_the_topic_poster_name() ?></div>
 </td>
Posted in Tech | Tagged , | 1 Comment

BuddyPress Group Forum Extras plugin

Download from WordPress Plugin Repo: BuddyPress Group Forum Extras

This plugin is a collection of ported bbpress and new plugins for buddypress group forums.

  • BBCode Lite for BuddyPress Groups
  • Shortcodes (bbcode) for BuddyPress Groups
  • Ajax Post Quote
  • Signatures
  • Forum Index (includes a widget)
  • Tag Index (includes a widget)
  • RSS Feeds for Forums and Topics
  • jQuery Topic Preview (displays first post underneath topic title)
  • Display Activity Stream Comments on Forum Posts
  • Highlight Posts and Topics
  • Extra Functions for bbPress classic features (pagination next to title, last post link)

Theme Edit is Required for some subplugins

Activate the plugin and view the “Forum Extras” wp-admin page for details.

See Also:
BuddyPress Hack: bbPress Forum tweaks using Group Forum Extras plugin

Activity Comments for a Forum Post

Activity Comments for a Forum Post

Activity Comments for a Forum Post

Posted in Tech | Tagged , | 16 Comments

BuddyPress Restrict Group Creation plugin

Download from WordPress Plugin Repo: BuddyPress Restrict Group Creation

This plugin will restrict group creation and settings to certain WP Capabilities, and thresholds (friends, days registered, status updates, post counts) In addition, this plugin will auto-demote the group creator to group mod to ensure group settings may not be modified after creation. You may also define a group admin and mod that will be auto-assigned all new groups created.

Auto-assigning an admin and/or mod to new groups

In your wp-config.php file – set the following constants and check ‘Auto demote group creator to group mod‘ under the settings page.

define( 'BP_RESTRICTGROUP_AUTOADD_ADMIN_USER_ID', the_database_user_id );

and/or (admin inherits mod – no reason to define the same user_id twice)

define( 'BP_RESTRICTGROUP_AUTOADD_MOD_USER_ID', the_database_user_id );

Where the_database_user_id is the actual integer ID from the wp_users table.

Threshold Limits

You may also enable threshold limits for certain categories:
Days registered
Number of Friends
Number of Status updates
Number of Post counts

Helpful you want to allow more experience members of your community create groups at will.

CSS to remove Create Group button

You may now enter in custom css if you do not use the default theme – this will remove the create group button displayed (even though if a user clicks on it – group creation is closed – but better for UI experience)

Screenshots:

BuddyPress Restrict Group Plugin - Admin settings

Posted in Tech | Tagged , | 22 Comments