Skip to:
Content
Pages
Categories
Search
Top
Bottom

Best way to integrate with bbPress

  • Currently I have a website, let’s say mydomain.com which is currently a WordPress site (for now, more on that in a sec). I have successfully installed and been running bbPress at a subdomain: forums.mydomain.com. So far everything is hunky dory. Except that now I want to dump the WP part of the site and replace it with something homegrown (I no longer have a need for a blog-based website). The website is going to be for a streaming radio station. What I would like to be able to do is integrate bbPress to leverage the users/logins, so that those who are registered can login and make requests.

    Building the PHP/templates for the site isn’t the problem, but what would be the best way to get to the necessary bbPress objects/database/”stuff” so that I can 1) tell if the user is logged in and 2) who they are (so that I can track for request reasons). If I was integrating with WP, I’d use one the WP-integration options, but since I’m not, I’m not sure how to go about performing this. Actually that’s not entirely true… I guess what I really want to ask is, if my bbPress is in one folder linked to a subdomain, what do I need to include from another folder to get to bbPress user info from the main domain.

    I hope this made sense.

    -tg

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

  • John James Jacoby
    Keymaster

    @johnjamesjacoby

    If they are sharing a database, then the problem is inheriting the logins and cookies in my opinion. Getting the user info could be as easy as a query to the DB once you know what user_id to retrieve.

    YEaaah….. two different databases… in fact the databases will be on different servers… in two different parts of the country… both behind firewalls…. not a long story, but that’s the setup.

    Maybe if I explain a little more, it’ll put it into context – the web site is for a radio station. The main part of the web site will be used for initial announcements, browsing albums and making requests.

    What I want to be able to do from the website is three things:

    1) include the login from as needed (or greet the user if logged in)

    2) allow the user to make requests – if they are logged in. If they aren’t then I want to redirect them

    3) store the username with the request when made (if I can get to the user name, then I can store it in the other database – there’s a place for it already.)

    Other than that, there’s nothing I need directly from the bbPress database. I don’t need to access the database, just need to get their UserID/UserName if they are logged in (presumably if the UserName is set, they are logged in, or is that too easy? :P )

    I’d like to note that I’ve been using bbPress off and on for the last couple of years, WP for even longer and I am a programmer by trade… so don’t be afraid to the lay the technology on me, I can take it. I’m decent in PHP, but by no means an expert, and I don’t have trouble figuring out the stuff I don’t know… especially if I’m just pointed in the right direction.

    If I include the following at the top of the pages where I need it… will it give me what I need to do this:

    <?php

    require('./bb-load.php');

    $bb_db_override = false;
    do_action( 'bb_index.php_pre_db', '' );

    ?>

    I know I would need at least the first require for bb-load.php (naturally changing the path to the correct location). But would I also need the other two lines? (I will be searching the documentation for those two settings to see what I can find.)

    -tg


    Sam Bauers
    Participant

    @sambauers

    It’s hard to tell what you are trying to do from the description.

    There are a couple of ways you can check a users auth credentials against a remote install of bbPress. Sharing cookies is another problem altogether if you want single sign-on to both sites.

    What are you after? Just the ability to auth against the bbPress user database or single sign-on across the sites.

    both…. sort of….

    let me see if I can storybook it for you….

    * User goes to main website http://tannagh.com

    * This main page lists what’s playing, what jsut played and what’s coming up

    * From this page are links to browse the online catalog, tune in, and the forums (which are at http://forums.tannagh.com ).

    * I would, at this point to also be able to include the login form… which would be tied to the bbPress database. It would have the same effect as if they had clicked the link to the forums and logged in there

    * Once the user has logged in (either through the front page or through the forums) I’d like the login form to be replaced by a greeting. In addition, if they then make a request (by going through the online catalog and hitting the Request button), I want to capture their user name (how? I’m not sure I care, all I need is the info) so that I can store it in the music database for display on the front page with their request.

    Would I be better off moving my forums out of a subdomain, and putting it under a folder in the main part of the site (so it would be http://tannagh.com/forums ) instead? Then at least I shouldn’t have any cookie issues… since it would then be from the same domain…. technically even with a subdomain it *should* be from the same domain, but cookies don’t always see themselves that way.

    Dang, why do I feel like this is harder than it should be? People integrate with WP all the time w/o (many) issues…. I think this should be easier, at least in theory.

    -tg

    Finally figured it out… I was going about it all the wrong way… What I was trying to do was take the forums in location A and integrate them with a website at location B… after tanking my local copy of my website, I finally had a realization that I was going about all the wrong way. Instead of trying to take what was essentially two websites and linking them, I should have just scrapped both sites, re-installed bbPress on the main site, and then created the radio station as plugins around bbPress. So that’s what I am now doing. And it’s going much more smoothly than it was before. Sometimes the easiest answers are the hardest to see.

    -tg


    Sam Bauers
    Participant

    @sambauers

    @TechGnome

    Good luck, be sure to report back when it’s done and please share anything you can.

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