Re: Best way to integrate with bbPress
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? )
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:
$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.)