Replies
- Milo on June 10, 2021 at 6:47 pm in reply to: [Resolved] Display Buddypress users by amount of Followers #39071
Hi Brajesh,
I tried to make my own shortcode with this but I must have done something wrong. When I run the following code it simply returns the word… Aray … on the page and nothing else.
I added this code to my functions file…
/** * returns n number of top followed users. * * @param int $count number of entries requested. * * @return array **/ function buddydev_get_top_followed_users( $count = 100 ) { global $wpdb; $bp = buddypress(); return $wpdb->get_col( $wpdb->prepare( "SELECT leader_id, COUNT( leader_id ) as follow_count FROM {$bp->follow->table_name} WHERE follow_type = %s GROUP BY leader_id ORDER BY follow_count DESC LIMIT 0, %d", '', $count ) ); } add_shortcode('top_followers', 'buddydev_get_top_followed_users');
I used this shortcode..
[top_followers]
- Milo on June 10, 2021 at 1:23 pm in reply to: [Resolved] Display Buddypress users by amount of Followers #39067
Wow thank you very much Brajesh you are awesome.
Sorry just one more thing I would like to see added is some kind of progress indicator like a spinning ball or something. Creating a sub domain site takes a little bit longer and I can see cases where users push the “Register” button a few times because they think nothing is happening.
Thanks
- This reply was modified 9 years, 2 months ago by Milo.
not your fault I should know better than that.
WORKS PERFECT! Redirects as expected on both Registration and Site Creation
Thanks
- This reply was modified 9 years, 2 months ago by Milo.
Yikes does something other than that code go in this file. ERRORS…….
add_filter( ‘bpajaxr_redirect_url’, ‘buddydev_redirect_to_profile_on_ajax_registration’, 10, 2 ); function buddydev_redirect_to_profile_on_ajax_registration( $url = ”, $user_id = 0 ) { if( ! $user_id ) { return $url ; } $url = bp_core_get_user_domain( $user_id ); return $url; }
Warning: session_start(): Cannot send session cache limiter – headers already sent (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-content/plugins/wordpress-social-login/wp-social-login.php on line 64Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 60
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-login.php on line 431
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-login.php on line 444
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 957
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 958
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 959
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 960
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 961
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 962
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 965
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 966
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 967
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 968
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 971
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 972
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 973
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 974
Warning: Cannot modify header information – headers already sent by (output started at /home/relativeu/public_html/wp-content/plugins/bp-custom.php:15) in /home/relativeu/public_html/wp-includes/pluggable.php on line 1207
ok but I dont seem to have this file
yeah I was just reading that (you read my mind 😉 where is that file I am having trouble locating it.
I have confirmed that I am using 1.1.9. I have cleared the cache (a few times) but this is still not working for me. Would you like to try again yourself? http://relativeu.com/
I have tried making both… just a user…. also a multisite. Each time I am just directed back to the main page after registration
Excellent Brajesh thanks. I am going to try it out in a few minutes here. I will report back. 🙂
Hi Brajesh,
I used your “BP Redirect To Profile” with this configuration and everything is working fine. I would just like it if they could go to their profile page after sign up as well. That is the only thing missing for me now. I really like this layout everything looks really cool on the sign up with this Ajax plugin… nice work.