Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Any idea to integrate wp and bb login forms?

@ganzua

Member

Hey fel64! thanks for the answer;

“If you’re not comfortable writing a plugin I’d be worried about hacking core files.”

-> I’m not skilled enough, I’m learning like you, through wordpress, but it is too much for just half month and I’d like to upload the new web by the end of next week.

Regarding the code, I asked this same question in wp forums and user whooami told me that;

“youre doing that assbackwards. The smart way to do what you want to do is to use an if/else statement inside your theme.”

:)

The original code is like this;

function wp_register( $before = '<li>', $after = '</li>' ) {

if ( ! is_user_logged_in() ) {
if ( get_option('users_can_register') )
$link = $before . '<a href="' . get_option('siteurl') . '/wp-login.php?action=register">' . __('Register') . '</a>' . $after;
else
$link = '';
} else {
$link = $before . '<a href="' . get_option('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;
}

echo apply_filters('register', $link);
}

so bearing in mind the code you provided and guessing that I need to generate both links in the same way;

function wp_register( $before = '<li>', $after = '</li>' ) {

if ( ! is_user_logged_in() ) {
if ( get_option('users_can_register') )
$link = $before . '<a href="' . get_option('siteurl') . '/wp-login.php?action=register">' . __('Register') . '</a>' . $after;
else
$link = '';
} else { if( current_user_can('administrate') ) {
$link = $before . '<a href="' . get_option('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;}
else { $redirect_to = $bb_profile_link;
}
}

echo apply_filters('register', $link);
}

or replacing that $redirect_to = $bb_profile_link; for;

$link = $before . '<a href="' . get_option('siteurl') . '/bbpress/profile.php<!--call id user here --> ">' . __('Profile') . '</a>' . $after;

What I don’t know is how to add the id user to the link ??? Since it is the same id user than in wordpress the must be a way

Skip to toolbar