Forum Replies Created
-
In reply to: Filter members loop
Brajesh seems to have done most of the heavy lifting for what you want. He uses the
bp_ajax_querystringfilter, so lets borrow his idea and make our own function to exclude friends from the loop.function rosyteddy_exclude_users( $querystring = false, $object = false ) { // Only do this for the members loop. if ( $object != 'members' ) return $querystring; // Get an array of friend IDs for the logged-in user. $ids = friends_get_friend_user_ids( get_current_user_id() ); // Make the array a comma sep list. $ids = implode( ',', $ids ); $args = wp_parse_args( $querystring ); if ( ! empty( $args['exclude'] ) ) $args['exclude'] = $args['exclude'] . ',' . $ids; else $args['exclude'] = $ids; $querystring = build_query( $args ); return $querystring; } add_action( 'bp_ajax_querystring', 'rosyteddy_exclude_users', 20, 2 );Note: I haven’t tested.
In reply to: Filter members loopHi @rosyteddy
I haven’t tried it, but I think it’ll work if you put it in a page template. See here for more info.
Regarding the functionality you want, you’d need to do something like this:
$ids = '1, 2, 5, 33, 43';if ( bp_has_members( 'exclude=' . $ids ) ) :Where
$idsis a comma separated list of user IDs who are not friends.In reply to: Filter members loopHi @barodscheff
You can just copy the code from here and paste it in to your page template (say page-poodles.php). You can then go about filtering the returned members as you see fit.
Hi @pieter
Try this
function filter_private_message_email_body( $email_content, $sender_name, $subject, $content, $message_link, $settings_link, $ud ) { $content = substr( $content , 0, 140 ); $email_content = sprintf( __( '%1$s sent you a new message: Subject: %2$s "%3$s" To view and read your messages please log in and visit: %4$s --------------------- ', 'buddypress' ), $sender_name, $subject, $content, $message_link ); return $email_content; } add_filter( 'messages_notification_new_message_message', 'filter_private_message_email_body', 10, 7 );This will make the message 140 characters. Feel free to change the 140 to another number.
In reply to: Create an account refreshes without doing anythingFrom what you’ve described, you’ve done everything right. With the Twenty Thirteen theme installed, and no plugins activated, you shouldn’t be seeing this problem. My best guess is it’s something related to MAMP. I’m not a Mac user (I use LAMP) so can’t help you test this, but I know there will be lots of users on here that use MAMP so hopefully someone will see this and be able to offer some ideas.
In reply to: Bump Activity to top PluginHi @tse11
Looking at the plugin’s source, I can see the function
etivite_bp_activity_bump_time_since()filtersbp_activity_time_since. The bump date is updated by functionetivite_bp_activity_bump_comment_posted().I realise the plugin may be 2+ years old but have you tried contacting the plugin author to see if any support is available?
In reply to: Member CountHi @robjsinger
Can you try with Twenty Fifteen and no plugins activated (aside from BP) and let me know what you find? The problem could be theme-related or perhaps due to a plugin conflict.
In reply to: limited space per each profileIt isn’t possible ‘out-of-the-box’. There may be a plugin that does that for you but I haven’t seen one myself. I think your best bet is to search the Plugin Directory for some kind of media management plugin that works with BuddyPress and has options for limiting storage space.
In reply to: Users galleryHere you go: https://github.com/buddydev/mediapress/
In reply to: templates to blog and buddypressHi @numumar
You’ll need more than two templates. As an overview, you’d have a theme which would consist of a number of templates. Then you’d have your BuddyPress-specific templates.
Take a look at these articles to get started:
In reply to: limited space per each profileHey @morteza13055
Just wondering what you mean by “define a maximum total space for each profile”?
Are you referring to on screen space (real estate) or back-end storage space? etc
In reply to: BuddyPress and DiviHi @dorothykbiz
Which screenshots are you referring to?
Word Press is so advanced, its kind of complicated at times.
I agree it can be complicated at times, but if you consider what you’re trying to do, then you could also say that WordPress does a lot of the heavy lifting for us 😀
In reply to: If a number have same number get_avatarThe comparison operator you’re using
===checks if$entry[1]andxprofile_get_field_data(2, $user_id)are equal AND are of the same type. Even if they are ‘equal’, if one is typestringand one is typeintthen your comparison will befalse. If type isn’t important to you, then just use==.Just something I’d mention for you to keep in mind.
In reply to: Actifity feed, Note vs messageHi @whoaloic
What do you mean by “note”?
Messages can be either public or private. Private messages work kind of like chat, and can be seen only by the ‘thread’ participants. Public message are ‘front-end’. You can public message someone by prefixing their username with the @ symbol. Public messages are also known as mentions.
Regarding favourites, see this Trac ticket for how the feature will be improved over the next few versions.
Hope this information helps.
In reply to: Users galleryIn reply to: Email to admin when new user registerHi @sofijagb
That particular email’s message isn’t filterable but the function which sends the email is pluggable, which means you can write your own function. For more info on pluggable function in WordPress, check out:
https://codex.wordpress.org/Pluggable_Functions
The function you’ll need to override is
wp_new_user_notification()Hope this info helps!
In reply to: Google IndexingTo resolve this, you’ll need to look at the member pages which aren’t being indexed (look at their templates, URLs, sitemap entries) and work out what is different to the pages that are being indexed. I think you mentioned there could be an issue with the sitemap, so that’s another avenue to investigate. Perhaps try installing a different XML sitemap. Personally, I’ve used XML Sitemap which has always been reliable (and support from the author is very good as you’ll be able to see from the resolved tickets I’ve opened on that support forum). Then there is Google XML Sitemaps which has 1m+ active installs, so that looks popular
In reply to: Cookies and BuddyPressI wrote a reply to a similar question not long ago.
Ref: https://buddypress.org/support/topic/bp-default-cookie-usage/#post-186554
In reply to: Google Indexing@mugwumpman I just tried searching google for “independenthostels abernethybunkhouse” and can see that the member page for abernethybunkhouse is now being returned in the list of results.
In reply to: Google IndexingAre you using a sitemap at all? Google might need to be told about your member pages if their spider isn’t automatically picking them up. Alternatively, check if they are indexed but just have a very low rank. Or my last thought is your theme might have some crawler-blocking script on it. Usually Flash type stuff would be a culprit
In reply to: Best way to add custom posts to activity streamYes, your theme’s functions.php file is where it should go. Glad you got it to work.
In reply to: Google IndexingHi @independent
What does your robots.txt file look like?
In reply to: Best way to add custom posts to activity streamfunction leanneoleary_custom_post_types( $post_types ) { $post_types[] = 'files'; return $post_types; } add_filter ( 'bp_blogs_record_post_post_types', 'leanneoleary_custom_post_types' );If your custom post type is
files, then just try that? You’ll need to ensure the Site tracking component is enabled via WP admin.In reply to: Best way to add custom posts to activity streambp_blogs_record_post_post_typesfilters the post types to track. The function you posted is telling the Blogs component to track videos and pictures.bp_activity_add()simply adds items to the activity stream. See here for how it’s used.Now, I think posts of type videos and pictures will be automatically added to the stream due to
activity_publish_custom_post_types(). But, if they aren’t you’ll need to usebp_activity_add()as well.Does this help?