-
Henry Wright replied to the topic 2.0 top features – ideas in the forum Ideas 12 years, 1 month ago
Core performance is my number 1 wish. I’m not so bothered about new features with bells and whistles as these can be added easily via plugins.
-
Henry Wright replied to the topic Recommended Posts in the forum Creating & Extending 12 years, 1 month ago
Take a look at BuddyPress Like
It’s close to what you want. You can change the ‘like’ wording to ‘recommend’ easily via the WP dashboard.
-
Henry Wright replied to the topic Using get_post_meta() in activity stream in the forum Creating & Extending 12 years, 1 month ago
Try:
add_filter( 'bp_blogs_activity_new_post_content', 'record_post_activity_content', 1, 3 );function record_post_activity_content( $activity_content, $post, $post_permalink ){
if( $post->post_type == 'workout' ) {
$activity_content = get_post_meta( $post->ID, 'rute', TRUE );
}
return…[Read more] -
Henry Wright replied to the topic Using get_post_meta() in activity stream in the forum Creating & Extending 12 years, 1 month ago
get_post_meta($post->ID, 'key', true)won’t output, it just returns a string. You’ll need to echo it. -
Henry Wright replied to the topic Notification Management in the forum Creating & Extending 12 years, 1 month ago
That sounds like a better approach than mine. I just have a rather crude looking button which marks as read all unread notifications.
bp_notifications_mark_notifications_by_typeis the function I’m using to do the marking. For example:if ( bp_is_active( 'notifications' ) ) {[Read more]
bp_notifications_mark_notifications_by_type(… -
Henry Wright replied to the topic BuddyPress: “ass_digest_items” in usermeta table in the forum Miscellaneous 12 years, 1 month ago
Ah right. So it’s this plugin you’re using:
https://wordpress.org/plugins/buddypress-group-email-subscription/It’s very easy to update user meta in WordPress. See:
https://codex.wordpress.org/Function_Reference/update_user_metaBut the plugin uses the BP version of this function AND I see that there are conditions in place…[Read more]
-
Henry Wright replied to the topic BuddyPress: “ass_digest_items” in usermeta table in the forum Miscellaneous 12 years, 1 month ago
ass_digest_itemsisn’t a meta key BuddyPress uses (to my knowledge). Are you sure it doesn’t come from a plugin? -
Henry Wright replied to the topic Notification Management in the forum Creating & Extending 12 years, 1 month ago
I’m using a mark all as read button but it’s customised for my site markup so might not play well elsewhere. What part are you stuck with?
-
Henry Wright replied to the topic How to add a few more members-directory pages? in the forum How-to & Troubleshooting 12 years, 1 month ago
@landwire I see! That explains it.
Is that something that can be taken to core developers and asked if we can enhance the filter functionality
You could always ask? Trac is the best place to do that: https://buddypress.trac.wordpress.org/
-
Henry Wright replied to the topic How to add a few more members-directory pages? in the forum How-to & Troubleshooting 12 years, 1 month ago
Ah right. I see now. So you’ll need a separate page for each role.
Try this
function my_filter( $query = false, $object = false ) {
if ( is_page( 'office' ) ) {$users = get_users( 'role=office' );
$exclude = implode( ',', $users );
if ( $object != 'members' )
return $query;$args =…[Read more]
-
Henry Wright replied to the topic How to add a few more members-directory pages? in the forum How-to & Troubleshooting 12 years, 1 month ago
Regarding the 4 user roles you need to filter
office, supplier, student, professional
There is a nifty little function called
array_mergewhich you can use. You’d get your comma-sep list of users to exclude from the loop like this…$office = get_users( 'role=Office' );[Read more]
$supplier = get_users( 'role=Supplier' );
$student = get_users(… -
Henry Wright replied to the topic How to add a few more members-directory pages? in the forum How-to & Troubleshooting 12 years, 1 month ago
If you have links like this
example.com/members/usernamethen root profiles are disabled. If you have thisexample.com/usernamethen root profiles are enabled.Try this:
function my_filter( $query = false, $object = false ) {
if ( ! is_page( 'office' ) )
return $query;$users = get_users( 'role=YOUR-ROLE-TO-EXCLUDE' );…[Read more]
-
Henry Wright replied to the topic How to add a few more members-directory pages? in the forum How-to & Troubleshooting 12 years, 1 month ago
This is a slight issue with that.
is_pagedoesn’t work in BP 1.9.2 if root profiles are enabled. If you have root profiles disabled (the default) then you’re fine. -
Henry Wright replied to the topic How to add a few more members-directory pages? in the forum How-to & Troubleshooting 12 years, 1 month ago
I think you could most probably exclude members of a certain role when on the office page. You’d use the
bp_ajax_querystringfilter. For example:function my_filter( $query = false, $object = false ) {[Read more]
if ( is_page( 'office' ) ) {
// do some excluding
}
return $query;
}
add_filter( 'bp_ajax_querystring', 'my_filter', 20, 2… -
Henry Wright replied to the topic How to add a few more members-directory pages? in the forum How-to & Troubleshooting 12 years, 1 month ago
I think a shortcode is good way of doing it actually. You don’t need to create any new files that way.
Glad to see you got it working how you wanted it!
-
Henry Wright replied to the topic How to add a few more members-directory pages? in the forum How-to & Troubleshooting 12 years, 1 month ago
I think some of the visual differences could be due to CSS. Fundamentally each of these are different. Take the offices-index template for example. If you view the source you’ll see the body classes:
page page-id-1100 page-template-default masthead-fixed full-width singular no-jsWhere as if you view the source of the members directory you…[Read more]
-
Henry Wright replied to the topic How to add a few more members-directory pages? in the forum How-to & Troubleshooting 12 years, 1 month ago
You’ll need to add your BuddyPress header and footer to the page-office-loop.php file. For example:
<?php get_header( 'buddypress' ); ?><!-- bits and bobs here -->
<?php get_footer( 'buddypress' ); ?>
-
Henry Wright replied to the topic How to add a few more members-directory pages? in the forum How-to & Troubleshooting 12 years, 1 month ago
You could set up a new page via the WP dashboard, and make sure the slug is ‘offices-loop’. Then you’d just need to add a new file
page-offices-loop.phpto your theme’s directory. All your code can then go in that new file.The page would be accessible via the front-end using: example.com/offices-loop
-
Henry Wright replied to the topic Activation email not been received in the forum How-to & Troubleshooting 12 years, 1 month ago
however one did come through after about 24 hrs ( not good )
Could well be a problem with your host. I’d contact them to see if their mail server is working as it should be.
-
Henry Wright replied to the topic 3rd Sized Avatar in the forum Creating & Extending 12 years, 1 month ago
So, with the code I suggested in place. You can output the 3 sized avatars on your site like this:
Thumb size:
$type = 'thumb';
$width = 200;
$height = 200;
$user_fullname = bp_get_loggedin_user_fullname();
$user_id = bp_loggedin_user_id();echo bp_core_fetch_avatar( array( 'alt' => $user_fullname, 'class' => 'avatar', 'width' => $width,…[Read more]
- Load More
@henrywright
Active 2 years, 1 month ago