Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbPress Login from WordPress

Viewing 16 replies - 1 through 16 (of 16 total)
  • @ganzua

    Member

    we solved this issue in a previous thread, just make a search :)

    @fel64

    Member

    Are your usertables integrated? If they are it shouldn’t matter what login form you use and your userdetails should be identical, a change in one system resulting in a change in the other. In that case you can simply but the WP login forms back and integrate cookies.

    If they are not integrated and you don’t want to do so, a solution could be to load bbPress when you load WP [edit: but again unless you’re integrated you’ll have function name collisions so that’s not an option] and use the login_form() I believe it is template tag.

    Or you could just look at what the bbP output login form is like, copy the HTML into wordpress and let users use that. No reason why that shouldn’t work. :)

    ganzua, that’s not all that helpful.

    @ganzua

    Member

    “ganzua, that’s not all that helpful.”

    Well, If undestood quite enough this quote;

    “What I’d like to have is that same bbPress login form show up in my WP page so that if users are logged in they get the welcome/view profile otherwise they can log in/register from anywhere on the site.”

    We solved this same thing here, ;

    https://bbpress.org/forums/topic/any-idea-to-integrate-wp-and-bb-login-forms?replies=24

    @fel64

    Member

    That may have been factually accurate, but telling him that it’s been solved and he should go search is not helpful. Linking him to a solution would be.

    @avatarx

    Member

    Thanks for both your replies. I’d read that thread previously and my impression was that it is overly complex for what I’m trying to accomplish and was hoping for a much simpler way. I’d rather avoid having to “hack core files” as described and I want to be able to upgrade both WP and bbPress easily with changes only in my template files. I also don’t need the complex behavior of conditionally showing admin links, etc. since I just bookmark the admin page. And finally, as I mentioned, my PHP skills are non-existant at this point so not the kind of thing I am comfortable taking on right now.

    fel64, currently I have my user tables and cookies integrated. I installed bbPress within the WP directory to get the easy integration described in the docs since I’m still pretty new to both. So far that seems to work great. I like your suggestion of just grabbing the HTML code for the WP login and making it look like the bbPress login. That would solve the login part of it. However, then I would need some conditional code to display different things if the user is logged in or not, similar to what the bbPress login form does. It displays the welcome and profile link if logged in, or login form if not. For new user registration I’d have to send them to the bbPress registration page because I want them to fill out profile info not available in the WP registration form since it only asks for username/pw. Then I think it would be kind of weird that the user clicks register from the home WP page and gets taken to the forums after they register. Probably have to do some special handling there to see where they came from and send them to the right place.

    So…. hope you don’t mind the thinking outloud but after all that I’m wondering if it’s all worth the trouble given how unfamiliar I am with these systems. Maybe I’ll postpone this until future versions of bbPress make login integration much easier or there are plug-ins written for WP that can help. My initial thought was, why can’t I just call the login form code from bbPress from WP? Is this something that requires a deeper level of integration than what I have? I’m curious about this in general as it would be something I’d like to be able to do in the future.

    Thanks!

    @fel64

    Member

    It does indeed require a deeper level of integration. You want to load bb when you load wp, so open wp’s wp-config.php and add the following line:

    require_once('./bbpress/bb-load.php');

    where /bbpress/ should be the subdirectory of wordpress that bb is in. If that works you should now be able to call any bb function from wp.

    @avatarx

    Member

    Thanks fel64, that did it, sort of… I inserted the line at the end of my wp-config.php file and that allows me to call the login_form() PHP function from bbPress from within WP. The page loads fine except I do get an error message at the bottom of my browser (using IE 7) that says, “Done, but with errors on page”. I think this means there’s a javascript error somewhere? No idea where to start looking for this. Any thoughts?

    Also, it doesn’t quite work as desired since when you do anything with the login form it redirects you to the forums which makes sense but not the behavior I want. I think I may forego any further modifications for now but I like the idea of the deeper integration between WP and bbPress. If I can figure out the error I may be able to dabble more later as I learn more PHP.

    Thanks!

    @fel64

    Member

    Can you link us to it?

    The login functions that logs you into bb redirect you to the forums. It may be possible to change that behaviour but I’m not immediately sure how – probably using an action or filter, possibly the action bb_user_login.

    @avatarx

    Member

    I just downloaded Firefox w/Firebug and looking at the message it appears to be related to another plug-in I am using. Otherwise I think it works fine, but it’s looking like more customization than I want to do right now for those behaviors I was talking about. I think I’ll just stick with what I have, but thanks to both for your help! I’ll provide a link to my site once it’s live, right now it’s kind of a mess. ;)

    @detective

    Member

    This is what i do in my sidebar (in WP and BB):

    <form action="<?php bloginfo('url') ?>/wp-login.php" method="post">
    <label for="log">Usuario<br /><input type="text" name="log" id="log" value="" size="22" /></label>
    <label for="pwd">Password<br /><input type="password" name="pwd" id="pwd" size="22" /></label>
    <input type="submit" name="submit" value="Ingresar" class="button" />
    <label for="rememberme"><small><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Recordarme</small></label><br />
    <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>"/>
    </form>

    @avatarx

    Member

    Hey Detective, thanks for the code snipet. I checked out your site and I see it on your sidebar in the forums but not on your main WP sidebar? BTW, nice looking site. :)

    @detective

    Member

    Hi!

    I don’t use BBPress in that site, i’m installing it on another site, and there the code i posted works :)

    @maryjane

    Member

    This is what i have for my wp login. I want my users to login/register from the wp side. So i have this snippet of code i gathered from various forum posts as well as some of it was in my current theme.

    It says Welcome guest when you arent logged in or registered and it gives the link to register. If your signed in or sign in it says Welcome username and shows the forum avatar you have set. Based on your user level it shows you different links for each thing you can do. Like make a post in WP or your profile and favorites in the forum.

    I have a redirect page setup that when you login from this form it just directs you back to the index page instead of going automatically to the dashboard as this confuses most people and the links are on there if your signed in to show you what you can do.

    ** I didnt write this i just gathered it up from various sources on the internet in different forum posts and edited it to suit my needs. Part of it was already wrote into the theme i bought for my wp. **

    pastebin url to it: http://pastebin.ca/651318

    The redirect part is a file i named redirect.php and placed in my wp main directory with a redirect link to the main page. You can see that bit here :

    http://pastebin.ca/651326

    If you have your bbpress intergrated well with wp you should be able to use the same form on your forum. That is what i use.

    @fel64

    Member

    If you’d be so kind as to take all that code out of your post and put it in http://pastebin.ca/ then link to it, that’d be nice. Also, bb doesn’t by default use bbCode. Code is delimited by ` backticks.

    @maryjane

    Member

    Yea after i tried posting it in there a few times i figured that out. Will do boss! ^_^

    @gymball88

    Participant

    try wordpresslogochange types of pluggin, it worked for me without coding. (I’m very much new to wordpress too)

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