Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)

  • newbie999
    Participant

    @newbie999

    Hello again. I posted this question on a new topic, no responses. I’ll try asking the question here since I have received responses on this thread. Thank you. Here goes:

    I added the code below in wp-content/plugins/buddypress/bp-themes/bp-default/members/members-loop.php, to display additional profile fields in the member directory and to display the member’s role (either ‘Subscriber’ or ‘Provider’). In the code below, I specifically checked for the user’s role to determine whether I need to display ‘Subscriber’ or ‘Provider’.

    Questions:

    – is there a way to check for the capability instead – i.e., if the user can ‘edit posts’ then I will display ‘Subscriber’, otherwise I will display ‘Provider’? If so, can you please let me know how to do that as I have not been able to figure it out.

    – is there a way to display a newline so that ‘Subscriber’ or ‘Provider’ will display on the next line, below the member’s title and company name. I tried to echo “n” but it’s not outputting a newline and I have no idea why.

    Thank you for the help.

    <?php

    /***

    * If you want to show specific profile fields here you can,

    * but it’ll add an extra query for each member in the loop

    * (only one regadless of the number of fields you show):

    *

    * bp_member_profile_data( ‘field=the field name’ );

    */

    if( bp_get_member_profile_data ( ‘field=Title’ ) )

    echo bp_member_profile_data( ‘field=Title’ ), ‘ (‘, bp_member_profile_data( ‘field=Company’ ), ‘)’, ‘ – ‘;

    $user = new WP_User( bp_get_member_user_id() );

    if ( $user->roles[0] == ‘subscriber’ )

    echo ‘Subscriber’;

    else

    echo ‘Provider’;

    ?>


    newbie999
    Participant

    @newbie999

    Hello again. I posted this question on a new topic, no responses. I’ll try asking the question here since I have received responses on this thread. Thank you. Here goes:

    I added the code below in wp-content/plugins/buddypress/bp-themes/bp-default/members/members-loop.php, to display additional profile fields in the member directory and to display the member’s role (either ‘Subscriber’ or ‘Provider’). In the code below, I specifically checked for the user’s role to determine whether I need to display ‘Subscriber’ or ‘Provider’.

    Questions:

    – is there a way to check for the capability instead – i.e., if the user can ‘edit posts’ then I will display ‘Subscriber’, otherwise I will display ‘Provider’? If so, can you please let me know how to do that as I have not been able to figure it out.

    – is there a way to display a newline so that ‘Subscriber’ or ‘Provider’ will display on the next line, below the member’s title and company name. I tried to echo “n” but it’s not outputting a newline and I have no idea why.

    Thank you for the help.

    <?php

    /***

    * If you want to show specific profile fields here you can,

    * but it’ll add an extra query for each member in the loop

    * (only one regadless of the number of fields you show):

    *

    * bp_member_profile_data( ‘field=the field name’ );

    */

    if( bp_get_member_profile_data ( ‘field=Title’ ) )

    echo bp_member_profile_data( ‘field=Title’ ), ‘ (‘, bp_member_profile_data( ‘field=Company’ ), ‘)’, ‘ – ‘;

    $user = new WP_User( bp_get_member_user_id() );

    if ( $user->roles[0] == ‘subscriber’ )

    echo ‘Subscriber’;

    else

    echo ‘Provider’;

    ?>


    newbie999
    Participant

    @newbie999

    Thank you much for the better, cleaner, shorter code and the link! I’m learning every day!


    newbie999
    Participant

    @newbie999

    Thank you. After searching the forums for how to check the current user’s role, I added below to function.php and it’s working. Since I’m new to this, I’m very open to suggestions if there’s a better way to write this function.

    function my_alter_bp_sidebar_login(){

    global $bp;

    $user = new WP_User( $bp->loggedin_user->id );

    if ( !empty( $user->roles ) && is_array( $user->roles ) ) {

    foreach ( $user->roles as $role )

    if ($role != ‘subscriber’) {

    echo ‘root_domain . ‘/wp-admin/”>Dashboard<p/>’;

    }

    }

    }

    add_action(‘bp_before_sidebar_me’,’my_alter_bp_sidebar_login’,1);


    newbie999
    Participant

    @newbie999

    I only need 1 blog – the main one. I disabled the blog tracking component and that worked, thank you. It disabled all the ‘Blog’ tabs.

    The only thing I need now is a way for the providers (those who can post to the main blog) a way to create/edit posts. Other than adding a meta widget to the sidebar, is there a better way I can provide authors, contributors, etc. a way to get to the dashboard so they can post/edit blog entries?


    newbie999
    Participant

    @newbie999

    Thank you for the response! I’m a total newbie at buddypress/wordpress mu/bbpress. Would you be able to provide some additional details as to how I can accomplish the 2 suggestions you provided, so I can head in the right direction? I’m not quite sure where to start. I’m using the bphome/bpmember themes.


    newbie999
    Participant

    @newbie999

    I’m looking for this functionality as well. Can anyone help? Please.


    newbie999
    Participant

    @newbie999

    Hello. I’m a newbie and just created a test site up with buddypress/wordpress/bbpress. Everything looks good. I installed this plugin and followed the directions. However, when I activate it, I get this error:

    Fatal error: Class ‘BP_Group_Extension’ not found in /home/ieconnec/public_html/isocal/wp-content/plugins/bp-groupblog/bp-groupblog-classes.php on line 105

    I’m running buddypress 1.0.3 and wordpress mu 2.8.4a. Any help you can provide will be much appreciated. I would like to be able to use this plugin.

Viewing 8 replies - 1 through 8 (of 8 total)
Skip to toolbar