Skip to:
Content
Pages
Categories
Search
Top
Bottom

Create Group button like Create Account


  • belogical
    Participant

    @belogical

    I would like to add a button to the home widget that has a create group button if the user is logged in. I want to encourage group creation and think this would be the easiest way. I’m not sure where to start on this one. Can someone point me in the right direction?

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

  • belogical
    Participant

    @belogical

    never mind, that was easier than I thought. had to do a hack in bp-core-widgets.php

    add this under the function: (function bp_core_widget_welcome)

    global $current_user;
    $username = $current_user->user_login;

    add this under the Create Account button: (line #49)

    <?php if ( is_user_logged_in() ) { ?>
    <div class="create-account"><div class="visit generic-button"><a hre f='/members/<?php echo $username; ?>/groups/create' title="<?php _e('Create a New Group', 'buddypress') ?>"><?php _e('Create a New Group', 'buddypress') ?></a></div></div>
    <?php } ?>

    how can i avoid a core hack on this one?

    EDIT: Had to put a space in the href in order to get the code to display somewhat normal in the forum. Make sure to remove that if you use this.


    nicolagreco
    Participant

    @nicolagreco

    create a new widget that does the same :)


    belogical
    Participant

    @belogical

    Nicola, that’s above my pay grade!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Create Group button like Create Account’ is closed to new replies.
Skip to toolbar