-
Henry Wright replied to the topic Sorting by last name goes wrong when having multiple words as last name in the forum How-to & Troubleshooting 11 years, 2 months ago
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:ltrim( ' van Persie', ' ') -
Henry Wright replied to the topic Sorting by last name goes wrong when having multiple words as last name in the forum How-to & Troubleshooting 11 years, 2 months ago
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:ltrim( ' van Persie', ' '); -
Henry Wright replied to the topic Sorting by last name goes wrong when having multiple words as last name in the forum How-to & Troubleshooting 11 years, 2 months ago
@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…[Read more]
-
Henry Wright replied to the topic Sorting by last name goes wrong when having multiple words as last name in the forum How-to & Troubleshooting 11 years, 2 months ago
@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…[Read more]
-
Henry Wright replied to the topic Sorting by last name goes wrong when having multiple words as last name in the forum How-to & Troubleshooting 11 years, 2 months ago
@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…[Read more]
-
Henry Wright replied to the topic Sorting by last name goes wrong when having multiple words as last name in the forum How-to & Troubleshooting 11 years, 2 months ago
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 )";?
-
Henry Wright replied to the topic Sorting by last name goes wrong when having multiple words as last name in the forum How-to & Troubleshooting 11 years, 2 months ago
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 )”;
?
-
Henry Wright replied to the topic Sorting by last name goes wrong when having multiple words as last name in the forum How-to & Troubleshooting 11 years, 2 months ago
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
-
Henry Wright replied to the topic Registration via BuddyPress won't work in the forum How-to & Troubleshooting 11 years, 2 months ago
It’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/
-
Henry Wright replied to the topic Registration via BuddyPress won't work in the forum How-to & Troubleshooting 11 years, 2 months ago
It’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)
-
Henry Wright replied to the topic oEmbed in BP Profile Field in the forum How-to & Troubleshooting 11 years, 2 months ago
@myg0t I think the problem is with the hook I’ve used. How did you get on with @naijaping‘s code?
-
Henry Wright replied to the topic oEmbed in BP Profile Field in the forum How-to & Troubleshooting 11 years, 2 months ago
Hi @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.…[Read more] -
Henry Wright replied to the topic oEmbed in BP Profile Field in the forum How-to & Troubleshooting 11 years, 2 months ago
Hi @myg0t,
Try doing this:
function my_oembed_function( $value ) {
global $wp_embed;
$value = $wp_embed->autoembed( $value );
retrun $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…[Read more] -
Henry Wright's profile was updated 11 years, 2 months ago
-
Henry Wright replied to the topic buddypress rtl in the forum Installing BuddyPress 11 years, 2 months ago
Hi @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.
-
Henry Wright replied to the topic move Bp scripts (js) to footer in the forum How-to & Troubleshooting 11 years, 2 months ago
Not 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.
-
Henry Wright replied to the topic Fan club? in the forum Miscellaneous 11 years, 2 months ago
Hi @rsrmedia
The exact system you use depends on your exact requirements but in general, yeah, BuddyPress is great! 😀
-
Henry Wright replied to the topic move Bp scripts (js) to footer in the forum How-to & Troubleshooting 11 years, 2 months ago
You’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.
-
Henry Wright replied to the topic Change Profile Photo in the forum How-to & Troubleshooting 11 years, 2 months ago
You’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.
-
Henry Wright replied to the topic I can't upload a profile photo in the forum How-to & Troubleshooting 11 years, 2 months ago
Hi @marcmiquel
Have you tried contacting the plugin author?
- Load More
@henrywright
Active 1 year, 10 months ago