Forum Replies Created
-
Interesting thread.
This would be my approach:function bpfr_add_page_to_group() { if ( class_exists( 'BP_Group_Extension' ) ) : class Bongo_Group_Extension extends BP_Group_Extension { function __construct() { $args = array( 'slug' => 'bongo', 'parent_slug' => 'admin', 'nav_item_position' => 100, 'screens' => array( 'edit' => array( 'name' => 'Bongo', // the tab name ), ), ); parent::init( $args ); } function settings_screen( $group_id = NULL ) { // don't remove this function // = NULL is necessary to avoid Strict Standards warning } } // end of class bp_register_group_extension( 'Bongo_Group_Extension' ); endif; } add_filter('bp_groups_default_extension', 'bpfr_add_page_to_group' );Then, to avoid loading the form, create a template overload of
\buddypress\bp-templates\bp-legacy\buddypress\groups\single\admin.phpAnd add a conditional check of the action_variable.
Just before the form tag, add:<?php global $bp; if( $bp->action_variables[0] != 'bongo' ) : ?>Right after the form close tag, add:
<?php else : echo 'this is the bongo page'; endif; ?>Awkward, but seems to work.
The Group_Extension_API does need some work re making it easier to add tabs and tab counts.
I think the core devs are aware of this, but perhaps an enhancement ticket is in order?@danbp
>The 1st function let you add custom content on the tab.
afaik – that function adds the content on every page under ‘Admin’.In reply to: bplinks avatar wp 3.9.2You’ll have a better chance of getting an answer if you use the support forum for that plugin:
https://wordpress.org/support/plugin/buddypress-links> it seems as complicated as re-writing the bp_get_activities
It’s not even close to being that complicated.
This examples are re members, but should give you an idea of the general approach to a custom process:
If I was doing this, I would write a custom function(s) to gather the activity ids.
And that function would most likely contain one or more custom db queries.If you are unable to write such queries, you may want to consider hiring a developer.
No.
Create the activity ids string in a separate custom process – not bp_has_activities.
Then pass the string into bp_has_activities via the include parameter.Your avatars are the correct size.
Your theme is stretching the avatars.
Look at your theme css re item-header and item-header-avatarNo, do not use user_ids as a filter.
Use ‘include’ as the filter – ONCE – after you gather the activity ids in a separate process.
Try using the ‘include’ parameter.
Gather user_ids for bp_loggedin_user_id() + friend ids.
Use those ids to get activity ids.Then gather activity ids for groups you belong to.
Kick out dupes and pass them in via ‘include’ with scope=false.
Awkward?
Yes, but much less so than ‘remove everything but group posts by group member id’s that are not your friends.’>However, it doesn’t show activity from your groups that have members which are not your friends
>Again, bp_loggedin_user_id() + ids of their friends.
Of course, this will only show friends.
If you want friends & group members, then collect
bp_loggedin_user_id() + group member ids + friend ids,
kick out dupes and pass in a csv string of the ids.In reply to: Get E-mail addresses of users without Photos?Nice.
fwiw… The ‘wp’ approach would be to get rid of the global and use:
$ids = get_users( array( 'fields' => array( 'ID' ) ) );and access via:
$id->IDThen in your custom handler, adapt the code in bp_blogs_record_comment or write your own using bp_activity_add
Yes, sorry, I misread and have adjusted my comment.
I’ve provided a suggestion re a filter hook.Please use pastebin or gist to share large code blocks.
You could always use the filter hook to set $is_blog_public to false and then remove the filter ( add_filter, remove_filter ), as part of your custom comment handling.
$is_blog_public = apply_filters( 'bp_is_blog_public', (int)get_blog_option( $blog_id, 'blog_public' ) );It can be difficult to track that one down.
But it’s probably ok as is – it’s just a warning, not an error.
For more info:
Usevar_dump(debug_backtrace());to see how things were loaded.
Then comb thru the dump to see which plugin is generating the notice.In reply to: User avatar redirects to random page, not profileI don’t believe this is a BP issue.
On a test installation, I can create a post with a member’s name in the slug – and links to that member’s profile work as expected.The urls are correct:
http://www.indiachinainstitute.org/members/lo-sze-pingThe fact that they are being intercepted is, I suspect, due to some theme code or plugin code.
I would start with a review of the code that handles ‘ai1ec_event’.In reply to: Simple Way to Enable Image posting in ForumsBuddyPress uses the bbPress plugin for forums.
So you’re better off asking the question on https://bbpress.org/forums/What you want may be possible, to start, see:
In reply to: [Resolved] Query users based on xprofile dataAt the moment, a custom query to gather matching ids and then pass them into BP_User_Query is the only way to be precise.
That’s easy to do, as you’ve seen on the codex page (thanks for the edit).
It would make sense to add xprofile key / value parmeters.
Perhaps you could create an enhancement ticket?Did you try it or are you guessing ?
This works for me:
if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&user_id=1,2&scope=false') )logged in user id = 1
Members 1 & 2 are friends.
They both belong to groups – but not the same groups.The result shows activity for both members, including group activity.
Again, bp_loggedin_user_id() + ids of their friends.
Why wouldn’t it?
I’m suggesting ways to get around the current limitations of ‘scope’.
Set scope=false and then try either or both of my untested suggestions.‘include’ is for activity ids.
So you’d gather user_ids and use them to gather activity ids.
And then only pass in the activity ids via ‘include’.In both cases I suggest, scope needs to be ‘false’.
Examine the function bp_has_activities to get better understanding of the parameter possibilities.
try:
href="<?php echo bp_loggedin_user_domain() ?>wall/"I haven’t tried combining scopes.
You could try my suggestion re user_ids and set scope=false.
You could try gathering all the user_ids and then use them to gather all the activity ids and then pass them as a csv string to ‘include’ and set scope=false.
You could test either idea quickly by just using the logged in user id.
If you try, I’d be interested in hearing about any result.
Awkward, but you could gather all the ids of the members whose activities should be displayed.
So, bp_loggedin_user_id() + ids of their friends.
Then pass the ids in an array to the ‘$user_id’ parameter of bp_has_activities.You’re looking at a symptom, not the problem.
If users are marked as spammers, then activity comments will be marked as spam.
So that part is working properly.The real question is, why are users being marked as spammers?
To show comments regardless of spam flag, try this in the activity-loop.php template:
if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&spam=false' ) ) :Try this:
<?php /*** * If you want to show specific profile fields here you can, * but it'll add an extra query for each member in the loop * (only one regardless of the number of fields you show): * bp_member_profile_data( 'field=the field name' ); */ $data = bp_get_member_profile_data( 'field=Current Location' ); if( $data != false ) echo $data; ?>