Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbpress 2.0 plugin: Adding a log in/out link to the top of every forum page

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

  • hlwinkler
    Participant

    @hlwinkler

    Here is what I eventually figured out — it would be great if someone would let me know a) if there is an easier way to do this and b) if they see any security issues in here, since I am not a PHP programmer or frequently working with WP or bbpress. Thank you.

    This replaces the breadcrumbs block between the comments

    /** Current ***********************************************************/

    and

    /** Finish Up *********************************************************/

    in bbp-common-template.php in the neighborhood of lines 1421 to 1428:

    /** Current ***********************************************************/
    // Add current page to breadcrumb
    global $current_user;
    get_currentuserinfo();
    $bb2custom_user_is_logged_in = 'Welcome '.$current_user->user_login.'. You can log out <a href='.wp_logout_url( get_permalink() ).'>here</a>.';
    $bb2custom_user_is_logged_out = "You aren't logged in. <a href=".wp_login_url( get_permalink() ).">Log in here</a> or <a href='http://www.example.com/wp-login.php?action=register'>register</a> if you don't have an account.";
    if ( is_user_logged_in() ) {
    $bb2custom_loginoutregister = $bb2custom_user_is_logged_in;
    } else {
    $bb2custom_loginoutregister = $bb2custom_user_is_logged_out;
    }
    if ( !empty( $include_current ) || empty( $pre_current_text ) )
    $breadcrumbs[] = '<span class="bbp-breadcrumb-current">' . $current_text . '</span><p>' .$bb2custom_loginoutregister. '</p>';
    /** Finish Up *********************************************************/

    I just tried the above with the newest wordpress and bbpress available. It does not work 🙁

    Does anybody have a solution?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar