Skip to:
Content
Pages
Categories
Search
Top
Bottom

Always login

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

  • so1o
    Participant

    @so1o

    i think you can do this by overridding the bb_cookie function and replacing it with

    function bb_cookie( $name, $value, $expires = 0 ) {

    if ( bb_get_option( ‘cookiedomain’ ) )

    setcookie( $name, $value, 0, bb_get_option( ‘cookiepath’ ), bb_get_option( ‘cookiedomain’ ) );

    else

    setcookie( $name, $value, 0, bb_get_option( ‘cookiepath’ ) );

    }

    Can this be used as a plugin? The real questions should be: Can you overide normal bbpress functions with a plugin? And if so, how would this plugin look like?

    And can a function like this be added:

    If user logged-in = false -> redirect to login.php (or register.php)

    I think bb_cookie is in pluggable.php, so yes. Just look for wordpress documentation on overwriting functions like this (achieveable through plugins).

    Also easy. :)

    add_action('bb_init', 'chuck_out_lusers');
    function chuck_out_lusers() {
    if( !bb_get_current_user() && bb_get_location != 'login-page' ) {
    header('Location: http://blah.example.com/bb-login.php');
    exit;
    }
    }

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