Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 151 through 175 (of 572 total)
  • @sbrajesh

    Participant

    do not add it to your bp-custom.php
    Add it to your theme’s functions.php for now, and It will work.

    @sbrajesh

    Participant

    I 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.

    @sbrajesh

    Participant

    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 Profile

    @sbrajesh

    Participant

    Hi,
    It is coming from members/single/profile-loop.php

    It 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.

    @sbrajesh

    Participant

    You 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 Profile

    @sbrajesh

    Participant

    Are you looking to show in memebrs profile top header ?
    if yes, look inside yourtheme/members/single/member-header.php

    In reply to: Avatar issues ???!!??

    @sbrajesh

    Participant

    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/4252

    @sbrajesh

    Participant

    Hi 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.

    @sbrajesh

    Participant

    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 🙂

    @sbrajesh

    Participant

    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?

    @sbrajesh

    Participant

    Hi Jeff,
    Thank you for the kind word.
    You are most welcome.
    I am glad I could help 🙂

    @sbrajesh

    Participant

    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.

    @sbrajesh

    Participant

    Hi James, Here is an example code

    http://pastebin.com/WA2rBjvH

    You are right about the url part 🙂

    @sbrajesh

    Participant

    You 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.

    @sbrajesh

    Participant

    Ok, 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.

    @sbrajesh

    Participant

    Are you referring to the to adminbar.
    You can put this in your functions.pjp

    
    add_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.

    @sbrajesh

    Participant

    Here 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.

    @sbrajesh

    Participant

    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.

    @sbrajesh

    Participant

    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.

    @sbrajesh

    Participant

    Hi 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.

    https://codex.wordpress.org/Create_A_Network

    @sbrajesh

    Participant

    Hi 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.

    @sbrajesh

    Participant

    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.

    @sbrajesh

    Participant

    Hi 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.

    @sbrajesh

    Participant

    Just 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+

    https://github.com/sbrajesh/bp-default-ajaxed-profile-tab

    @sbrajesh

    Participant

    Try this in css
    `
    .activity-content .activity-header img.avatar{display:none;}
    `

Viewing 25 replies - 151 through 175 (of 572 total)
Skip to toolbar