Forum Replies Created
-
In reply to: [Resolved] Disabling BP Registration
do not add it to your bp-custom.php
Add it to your theme’s functions.php for now, and It will work.In reply to: Restrict friends on BuddypressI will suggest going via the user meta route. You can add a user meta to define type of user. that will give you a lot of flexibility in future while searching/listing users.
Most probably the code you are using is trying to access logged in user’s data before init action. Since the current user is set on ‘set_current_user’ hook’ which is just before init, any function trying to access current user data should be called on or after init action.
Hope that helps.
Reference: https://codex.wordpress.org/Plugin_API/Action_Reference
In reply to: Member ProfileHi,
It is coming from members/single/profile-loop.phpIt seems you don’t have the xprofile fields(or the user has not entered data) or you have some sort of privacy enabled on those fields which are preventing the fields to be visible. Otherwise, the xprofile fields should be visible there by default.
In reply to: Restrict friends on BuddypressYou can do that by easily filtering on this hook
`
bp_get_add_friend_button
`
If you can provide the code you are using to differentiate a user type(parents/student/professor), It will be super easy to put the complete code.In reply to: Member ProfileAre you looking to show in memebrs profile top header ?
if yes, look inside yourtheme/members/single/member-header.phpIn reply to: Avatar issues ???!!??It is a known issue and some of the temporary possible solutions are mentioned on the ticket here.
Please have a look
https://buddypress.trac.wordpress.org/ticket/4252In reply to: [Resolved] Installing Problems – permalinksHi Nicholas,
the most probable reason for the error is the space in the name of your installation directory.Avoid using a directory having space in the name try creating a new install with “SideProjects” instead of “Side Projects” and the error should go away.
In reply to: 404 errors with terms.asp?cat=Hi Miguel,
The problem is google is still looking for the old urls.
When moving a site from one platform to another, the best practice is to use 301 redirect for the old urls(if possible).Since you have changed the platform to WordPress, I will suggest submitting the google sitemap(there exists some plugin for creating sitemap), that should atleast help in indexing the pages.
I don’t have much experience with SEO, so I hope someone with better understanding of seo guides you here 🙂
In reply to: 404 errors with terms.asp?cat=The url does not seem to be a valid url from WordPress.
WordPress does not uses mDate in query string.btw, have you changed your permalink to look like .asp files?
Hi Jeff,
Thank you for the kind word.
You are most welcome.
I am glad I could help 🙂In reply to: Calling a php function which is in its own file.You can either put it in bp-custom.php or the functions.php of your theme.
The advantage of using bp-custom.php is the functions will be always available(even on multisite) and since this file is loaded before anything else in BuddyPress, you don’t have to worry about the availability of your functions.
If you put your code in any of these two files, you don’t need to reference/include these files. They are included automatically.
Hope that helps.
In reply to: Link to a private messageIn reply to: [Resolved] Stop Registration RedirectYou can either put this in your theme’s functions.php
remove_action( 'bp_init', 'bp_core_wpsignup_redirect' );or this in your bp-custom.php
add_action('bp_loaded','bp_custom_remove_register_redirect'); function bp_custom_remove_register_redirect(){ remove_action( 'bp_init', 'bp_core_wpsignup_redirect' ); }both will work.
Hope that helps.
In reply to: Link to a private messageOk, forum does not allow me to post the html code.
After including the above code, you can use this function bp_custom_get_send_private_message_link to get the appropriate url.
In reply to: [Resolved] Remove WP Menu from Main BP MenuAre you referring to the to adminbar.
You can put this in your functions.pjpadd_action('wp_loaded','custom_remove_adminbar_wpmenu'); function custom_remove_adminbar_wpmenu(){ remove_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 ); }That will do it.
In reply to: Link to a private messageHere is a simple solution. You will need to add following lines to your theme’s functions.php or bp-custom.php
`
/**
*
* @param int $to_id the user id to whom we plan to send the message
* @param string $subject : if you want to specifuy a predefined subject
* @param string $message: any predefined message
* @return string: link for sending message
*/
function bp_custom_get_send_private_message_link($to_id,$subject=false,$message=false) {//if user is not logged, do not prepare the link
if ( !is_user_logged_in() )
return false;$compose_url=bp_loggedin_user_domain() . bp_get_messages_slug() . ‘/compose/?’;
if($to_id)
$compose_url.=(‘r=’ . bp_core_get_username( $to_id ));
if($subject)
$compose_url.=(‘&subject=’.$subject);
if($message)
$compose_url.=(“&content=”.$message);return wp_nonce_url( $compose_url ) ;
}//for auto populating message content
add_filter(‘bp_get_messages_content_value’,’bp_custom_message_content_value’);
function bp_custom_message_content_value($content){if(!empty ($content))
return $content;
$content=$_REQUEST[‘content’];return $content;
}//for auto populating message subject
add_filter(‘bp_get_messages_subject_value’,’bp_custom_get_messages_subject_value’);
function bp_custom_get_messages_subject_value($subject){
if(!empty($subject))
return $subject;$subject=$_REQUEST[‘subject’];
return $subject;
}
`
and then, you can use following in your code to send the user with id:2 a message as
`
<a href="”>Send Message to xyz`
hope that helps.
Hi Jeff,
There are many ways to do it.
here is one way.
You can put the following code in your bp-custom.php`
add_filter(‘bp_groups_default_extension’,’my_custom_group_default_tab’);
function my_custom_group_default_tab($default_tab){$group=groups_get_current_group();//get the current group
if(empty($group))
return $default_tab;//otherwise, you may create a switch/if else to default to some other tab based on group slug of id what ever you prefer
//here I am testing agains slug
switch($group->slug){case ‘awesome-group’:
$default_tab=’forum’;
break;case ‘study-group’:
$default_tab=’members’;
break;default:
$default_tab=’home’;//
break;}
return $default_tab;
}
`You can modify it for anything you want. Hope that helps.
There was a bug with bp-default theme shipped with bp 1.6+ and any theme which is based on bp-default or copies functions from it has the same bug.
Here is a way to fix that.
First look for this code(or similar) in your themes functions.php
if ( !is_admin() ) { // Register buttons for the relevant component templates // Friends button if ( bp_is_active( 'friends' ) ) add_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 ); // Activity button if ( bp_is_active( 'activity' ) ) add_action( 'bp_member_header_actions', 'bp_send_public_message_button', 20 ); // Messages button if ( bp_is_active( 'messages' ) ) add_action( 'bp_member_header_actions', 'bp_send_private_message_button', 20 );and change this line
if(!is_admin()){to this
if ( !is_admin()||(is_admin()&&defined('DOING_AJAX')) ) {and it will work.
In reply to: Multisite InstallationsHi Shane,
by secondary blog I mean a sub blog that you create using the wordpress multisite.You don’t need to install multiple wordpress. Just install wordpress Multisite.
here are more details on enabling WordPress multisite.In reply to: Multisite InstallationsHi Shane
If you ask my personal choice, I will go with subdirectory. But it does not make much difference.Since you are just planning to install buddypress, you just need to follow the first 2 steps and not worry about the other steps in that guide.
I haven’t seen a better guide on thing thing though.
If the xprofile fields(custom profile fields) are not appearing, you may want to modify this in your code
``
to
``
That should make them appear.
In reply to: Multisite InstallationsHi Shane,
You can install buddypress on secondary blog and use it as private network.Here are some details on configuring BuddyPress on secondary network
https://codex.buddypress.org/users/getting-started/install-buddypress-on-a-secondary-blog/and you can use any of the wordpress privacy plugin to make this network private.
Hope that helps.In reply to: Member Profile – Tab Transitioning and SidebarsJust to mention here, I worked on the concept later on the suggestions of Bowe and built a child them which you can find here. It is compatible with bp 1.5+
Try this in css
`
.activity-content .activity-header img.avatar{display:none;}
`