Forum Replies Created
-
In reply to: This is why we can’t have nice things
@jjj I’ve noticed 1 or 2 forum spam messages today actually. Topic subject lines were along the lines of aaaaaaaaa and the thread content was a similar kinda crap. Not sure if that was related? Anyhow, I spammed the messages when I came across them
In reply to: Deliver Custom Message via BuddyPress to new users@shanebp you beat me to it 🙂
In reply to: Deliver Custom Message via BuddyPress to new usersmessages_new_message()is the function that’s used to send messages in BP core, so you could utilise that? You’ll want to hook your function to thebp_core_activated_userhook. For example:function send_message_to_new_member( $user_id, $key, $user ) { $args = array( 'sender_id' => 1, 'thread_id' => false, 'recipients' => array( $user_id ), 'subject' => 'Hello new user', 'content' => 'Welcome to the site', 'date_sent' => bp_core_current_time() ); $result = messages_new_message( $args ); } add_action( 'bp_core_activated_user', 'send_message_to_new_member', 3 );Note:
$resultwill be either the ID of the new message thread if the message was sent successfully, or it’ll befalseon failure.In reply to: BudyPress Activation ?Hi @eustache44
Try a few things:
- Take a look in the spam folder to see if emails are going into that
- Check with your hosting company that emails are being sent by your mail server
- Deactivate all plugins (as you’ve said you’ve already done)
- Activate the Twenty Fourteen theme
In reply to: error when trying to upload group photoHave you installed a new firewall on your computer recently? This error is usually a result of a firewall rejecting communication. Can you try uploading from another computer?
It wouldn’t be BuddyPress documentation you’d need, rather, WordPress documentation. Take a look at the articles on user meta, specifically look at the
get_user_meta()andupdate_user_meta()functions.The general idea would be to increment a user’s share count each time something is shared by that user.
Refs:
https://codex.wordpress.org/Function_Reference/update_user_meta
https://codex.wordpress.org/Function_Reference/get_user_metaHi @lbpp
It’s definitely possible but will need some custom code (unless you can find a plugin in the Plugin Directory?)
@nielspilon I really do think
substr( strstr( u.display_name, ' ' ), 1 )is your answer. You say there’s definitely no members returned with that in place?why wouldn’t secondary and tertiary sorting be taken care of by
substr( strstr( u.display_name, ' ' ), 1 )?@shanebp Maybe just remove the first word from the string? i.e.
strstr( 'Robin van Persie', ' ' )which gives
van Persie. Then you just need remove the initial space:substr( ' van Persie', 1 )@nielspilon if the sorting is fine (van, de etc) then that is down to luck 🙂
@shanebp the only problem with
substring_index( substring_index( 'Robin van Persie', ' ', 2), ' ', -1 )is you lose anything after the 2nd delimiter. For example:substring_index( 'Robin van Persie', ' ', 2)would return Robin van
and then
substring_index( 'Robin van', ' ', -1)would return van
So in theory, the order returned could be
Denis Bergkamp
Stefan de Vrij
Barry van Galen
Robin van Persie
Ruud van Nistelrooy
Wesley SneijderAs you can see Robin van Persie and Ruud van Nistelrooy are in the wrong order.
Note though – this will only be a problem if you have many people with words like van or de in their name.
Did you replace this line:
$bp_user_query->uid_clauses['orderby'] = "ORDER BY substring_index(u.display_name, ' ', -1)";with this:
$bp_user_query->uid_clauses['orderby'] = "ORDER BY substr( strstr( u.display_name, ' ' ), 1 )";?
substring_index()doesn’t quite seem to do the job.How about something like:
substr( strstr( 'Robin van Persie', ' ' ), 1 )Which would give you van Persie
In reply to: Registration via BuddyPress won’t workIt’s interesting there has been two reports of this happening over the past week. The common ground seems to be localhost (you’re running Xampp and the second reporter is running mamp)
Ref: https://buddypress.org/support/topic/new-users-cant-register-5/
In reply to: oEmbed in BP Profile Field@myg0t I think the problem is with the hook I’ve used. How did you get on with @naijaping’s code?
In reply to: oEmbed in BP Profile FieldHi @myg0t,
Try doing this:
function my_oembed_function( $value ) { global $wp_embed; $value = $wp_embed->autoembed( $value ); return $value; } add_filter( 'bp_get_the_profile_field_value', 'my_oembed_function' );Please note I’ve not had a chance to test.
I’m assuming
bp_get_the_profile_field_valueis the right hook here. Grateful if someone could shout out if I’m wrong.In reply to: buddypress rtlHi @zemenik
Have you tried searching the WordPress Themes Directory? Perhaps search for something like “rtl language support” or just “rtl” and look through the results retuned for themes that are compatible with BuddyPress.
In reply to: move Bp scripts (js) to footerNot off the top of my head but try searching the BP codebase for
wp_enqueue_scriptusing either your code editor or the BP GitHub repo search form:https://github.com/buddypress/BuddyPress
That should throw up all the handles you need.
In reply to: Fan club?Hi @rsrmedia
The exact system you use depends on your exact requirements but in general, yeah, BuddyPress is great! 😀
In reply to: move Bp scripts (js) to footerYou’ll have to deregister them and then re-register them ensuring the fifth param of wp_register_script() is set to true
https://codex.wordpress.org/Function_Reference/wp_register_script
Note: Careful things don’t break as a result of moving scripts to the footer.
In reply to: Change Profile PhotoYou’ll need to provide a lot more info so that people can help diagnose and solve the problem. As much info as you can, about your set-up, and about the problem that you’re seeing.
In reply to: I can’t upload a profile photoHi @marcmiquel
Have you tried contacting the plugin author?
In reply to: Possible to upload Avatars for other User as Admin?Hi @janthiel
I might be wrong but I’m not sure you can upload an avatar via wp-admin (by default)? Are you using a plugin to do that? Something like Simple Local Avatars maybe?
In reply to: Error when accessing homepageHi @gatera
The debug notice is saying that a function called
bp_is_front_pageis being used somewhere when it’s been deprecated. You should do a search to find out where in your code it is used (perhaps a plugin or maybe your theme) and ask the theme or plugin author to useis_front_page()instead.The warning is likely the cause of your page not loading. It’s usually due to something trying to send output to the browser after headers have been sent. It’s a real pain to debug this one as many things could be causing it. try switching to the Twenty Fourteen theme and then deactivating all plugins one by one to find the culprit
In reply to: display member updated date?last_profile_update( $_GET['user_id'] )is only a bad thing if you don’t escape$user_idin the SQL statement provided by @shanebp. That’s because$_GET['user_id']could be tainted as it is received from the browser. In your case, you won’t be doing that. You’ll be providing the user ID yourself so using @shanebp’s SQL should be absolutely fine. If you were to accept the user ID from the browser, or from a user submission then that’s when you should use the prepare method (see my SQL above).Hope that helps?