Forum Replies Created
-
In reply to: Filtering E-mail Message Content
Yes, the above is a rather awkward solution.
Just occurred to me that you could extract the info you need from the $settings_link arg passed by the $email_content filter hook to further query the database and/or rebuild $email_content – and so avoid filtering wp_mail
I think it would be a reasonable request that the
$email_content filter hook in messages_notification_new_message include $ud.It’s a simple change, so please submit an enhancement ticket:
https://buddypress.trac.wordpress.org/[ We may find out that there is an existing and simple solution ! ]
In reply to: Filtering E-mail Message Content>adding the two on the end is useless
You can’t add new args to an apply_filters call.
You might try using the first filter in wp_mail()
https://core.trac.wordpress.org/browser/tags/3.9.1/src/wp-includes/pluggable.php#L225And then use the ‘to’ value to query the database directly to retrieve the recip’s username.
Look at https://codex.wordpress.org/Class_Reference/wpdb, in particular $wpdb->get_varThen you can rebuild ‘message’.
Of course the add_filter function needs a conditional check so that you don’t mess with other wp-mail calls.
I do something like:
-use one of the filters in function messages_notification_new_message to add a keyword
-check for that keyword in your filter function for wp_mail()btw- wp_mail is pluggable, so you can overload it with your own function, but that shouldn’t be necessary.
In reply to: Programmatically assigning avatars to groups?Group avatars are stored in /wp-content/uploads/group-avatars/[group_id]
So to ‘set’ each one, you have to mkdir, create file names, upload a full and & thumb version for each group. I’ve done it; it’s a pita.
Given that you’re always using the same avatar, filtering the function is easier and would be my choice.
In reply to: Remove tabs and pages from BuddyPress profileIn reply to: BuddyPress theme – Looking for ideasNice.
There is definitely a need for BP Themes aka Template Packages.
When the upper right mobile-mode nav is clicked, the layout is rather awkward.
Please keep these forums informed of your progress.
This will be a premium theme?
There are some good testers here that might be willing to take a look: hnla, mercimeIn reply to: [Resolved] Mobile BillingUse init?
Maybe, I’m not sure when is_user_logged_in() first becomes available.In reply to: [Resolved] Mobile Billingminor point: why wait until template_redirect?
I believe that is called after all the content has been queried.
So maybe do it sooner?
I usually hook on ‘wp’ or ‘wp_loaded’.You may be interested in this premium plugin which allows you to select which profile fields appear in the listing for members in a group:
In reply to: Rename "Groups" label on profile menuTry this in bp-custom.php or your theme functions.php:
function jeff_change_buddypress_profile_tabs( $translated, $original_text, $domain ) { if ( 'buddypress' !== $domain ) { return $translated; } switch ( $original_text ) { case 'Groups <span>%d</span>': return 'Bongos <span>%d</span>'; case 'Groups': return 'Bongos'; default: return $translated; } } add_filter( 'gettext', 'jeff_change_buddypress_profile_tabs', 10, 3 );In reply to: Creating xProfiles using functions.phpAre you sure group_id is being set?
Take another look at :
function xprofile_insert_field() in bp-xprofile\bp-xprofile-functions.phpTry passing an array to $args for xprofile_insert_field
Like you did with xprofile_insert_field_group$args = your array;
xprofile_insert_field( $args );
In reply to: Creating xProfiles using functions.phpYes.
Start by taking a look at :function xprofile_insert_field() in bp-xprofile\bp-xprofile-functions.php
In reply to: How can one member block another member?@henrywright Thank you.
Make sure the code is in bp-custom.php and between the php tags
In reply to: Buddypress 1.6.1 to 2.0> Should I remove all BuddyPress files in the theme template?
Try that.
We don’t know anything about your theme.
BP treats all themes the same, premium or free.
But since BP 1.7 (?), theme handling has changed.Rather than try to ‘fix’ all those issues, imo. your time would be better spent switching to a new theme. It’s an opportunity 🙂 And will probably take less time that puzzling out all those issues.
But I’m not a theme expert; perhaps one of those folks will provide a more informed suggestion.
In reply to: Need Buddypress Code to display info on outside siteSo there are 2 different databases, yes?
How time sensitive is the data?
For example, if you only need it every 24 hours, I would set up a wp-cron job on the BP site and write the total members value to a file.
Then call that file value into the non-BP site.In reply to: How can one member block another member?older downloads:
https://wordpress.org/plugins/buddypress/developers/open a ticket:
https://buddypress.trac.wordpress.org/In reply to: BP 2.0 | Fatal Error, Profile UpdatesPlease see the ticket that r-a-y referenced.
You can patch the file using the changeset:
https://buddypress.trac.wordpress.org/changeset/8305Or wait for the release of BP.2.0.1
try:
<a href="<?php echo bp_loggedin_user_domain() ?>profile/change-avatar">Avatar</a>In reply to: Buddypress "bp-core.php" fatal errorYou’re probably going to get a series of fatal errors.
If they are all similar – as these 2 were – remove the ampersand &
So for the latest error:
&$paged_users will be $paged_usersIn reply to: Buddypress "bp-core.php" fatal errorThat is an old version of BP.
You could try changing the apply_filters to
return apply_filters( 'bp_core_get_users', BP_Core_User::get_users( $type, $per_page, $page, $user_id, $include, $search_terms, $populate_extras ), $params );That might get you past the fatal error.
You should update BP, but you cannot jump all the way to BP 2.0.
You’ll have to step up thru each version.
You can get older versions here:
https://wordpress.org/plugins/buddypress/developers/In reply to: @reply suggestions in post windowsI don’t know of a plugin that does that.
The problem is that usernames are unique, but display names are not.
Nice – and obvious 🙂
Querying the db directly should be avoided if possible – [laziness and bad habit].
untested, goes in bp-custom.php
function oc_filter_ajax_querystring( $querystring = '', $object = '' ) { if( $object != 'group_members' ) return $querystring; $querystring['exclude'] = '1'; // change '1' to your user_id return $querystring; } add_filter( 'bp_ajax_querystring', 'oc_filter_ajax_querystring', 20, 2 );More info:
Add custom filters to loops and enjoy them within your plugin
In reply to: It would be posible to put off budypress register?>it would be possible to make friends, groups, posts, etc in a full interactive way without a registration?
No.
Everything is dependent on knowing who the person is, iow. their id
Assignment of an id is done during registration.