Skip to:
Content
Pages
Categories
Search
Top
Bottom

WordPress access to bbPress Functions

  • @pwdrskier4

    Member

    I have added:

    require_once(‘path/to/wp-blog-header.php’);

    to my bbPress config file to allow bbPress to have access to wordpress functions. Now I want to do the reverse and add access to bbPress functions in WordPress. Is there a similar easy way to do this?

Viewing 25 replies - 1 through 25 (of 28 total)
  • @fel64

    Member

    Yup.

    require_once('path/to/bb-load.php');

    in your wp config file.

    @austink

    Member

    Does this have any effect on the speed wp pages are loaded? When I include this line the pages take about four times as long to load. When I remove it, they go back to normal. Anyway to avoid this drastic slowdown?

    @schmitt

    Member

    I just completed a WP/BB integration and have noticed a speed decrease.

    According to Firebug, most of the delay is in the downloading of the .js ajax components.

    The other thing I noticed is gmt_offset no longer seems to work- the time displayed is always GMT.

    @_ck_

    Participant

    You should always evaluate the “need” to run WP with BB at the same time. I don’t mean shared login and common cookies which is simple integration, but instead having bbpress load all of wordpress for every page page. That’s a HUGE number of files and mysql calls being generated for every page, multiplied by the number of plugins you have with their own mysql stored settings.

    Many times there are ways around loading both at the same time with a few tricks and plugins. If you are on a shared/vps host that’s giving you limited resources you may find streamlining absolutely necessary to deal with any bursts in traffic.

    @schmitt

    Member

    I have reverted to straight BBpress. Topic page loads went from 4-6s back to 200ms. The js components, for reasons I do not understand, load much more slowly with a full wp include.

    @_ck_

    Participant

    It sounds vaguely to me like a timeout issue, where something in the ajax is waiting for a response from the server.

    It would probably take more debugging time that it’s worth, you’d have to watch requests in realtime either from your side through a firewall or from the server side logs (ie. tail).

    I haven’t kept up with the ajax changes in wordpress since 2.1 so I have no idea what’s going on there – wish I could be more help. Ajax is usually the first thing I gut out of wordpress (and bbpress).

    @schmitt

    Member

    I can live without integration but it would be nice to have shared header and sidebar code. I just wanted to log my observation in case someone else had the same problem.

    I imagine with all the new focus on forum software these issues will eventually get mowed down.

    Hi – I’m also trying to add access to bbpress functions inside WordPress. I took the advice above and added

    require_once(‘path/to/bb-load.php’);

    to my wp config file.

    Now I get the following error:

    Fatal error: Cannot redeclare _http_build_query() (previously declared in /path_to_bbpress/bb-includes/wp-functions.php:768) in /path_to_wordpress/wp-includes/compat.php on line 45

    Any ideas on why I’m seeing this and how to fix?

    @chrishajer

    Participant

    Did you add that to wp-config.php as the first line, right after the <?php?

    The error cannot redeclare means something has already been included that it’s trying to include again.

    http://www.google.com/search?q=Cannot+redeclare+_http_build_query()

    https://bbpress.org/forums/topic/having-trouble-integrating-wp-functions

    @swaymedia

    Member

    im getting the same error, but the reference above (chrishajer’s) doesnt help.

    @plop

    Member

    I think you have to add it at the bottom of your wp-config file.

    @leggo-my-eggo

    Member

    Well, OK, this is pretty strange. I’ve added require_once(ABSPATH . 'forums/bb-load.php'); to the bottom of my wp-config.php file, and it all seems to work fine. Except, my admin interface for WordPress has lost all its colors and images. I have run a diff on the two resulting wp-admin interface’s code, and it looks like the act of loading bbPress is taking over the loading of styles at the top of the WordPress admin interface, which doesn’t really make much sense to me. Anybody understand what’s going on here? I’m using bbPress 1.0-rc-3 and WordPress 2.8.

    @sambauers

    Participant

    WordPress is not designed to play nice with bbPress loaded inside it in this fashion. It will probably break things (not just visual things). I won’t be writing support for this into bbPress at all, even if someone patches it to work. I gotta draw the line on integration somewhere. Try the bbPress Live plugin for WordPress and see if it doesn’t give you what you need.

    @berberama

    Member

    If you’re not coding bbPress to work nicely with WordPress, then it’s not going to become a well known and widely used platform. The statement “…I won’t be writing support for this into bbPress at all, even if someone patches it to work. I gotta draw the line on integration somewhere…” come across as hostile and petty – Potentially giving bbPress bad PR.

    I’ve had nothing but hell trying to get this to work properly and when talking to PHP coders, every single one of them has told me not to use it (these are guys that code for a living). They’ve given me alternatives, when I asked why, they said there’s not a lot of support (that there should be more) and the fact that it does not play well with WordPress (when they suggest, given the origins of bbPress, it should).

    This is unfortunate; and sad.

    @leggo-my-eggo

    Member

    Gotta say, that was not the answer I was expecting, since there are so many posts on these forums advising exactly that solution. I also am a little confused about why you would intentionally limit the interaction between these two–obviously intended to work together–apps, but I’m sure there are complexities here that I don’t understand, and I certainly understand needing to draw the line somewhere, especially at this early stage of development.

    As for using bbPress Live, that’s what I initially tried to do, but it hasn’t been updated since October of last year, and doesn’t work with WordPress 2.8, so that’s not really an option. If it did work with 2.8 I would be more than happy to use it instead of including bbPress in WordPress, as it apparently provides all the functionality I would need. Any chance an update is on its way soon?

    All I really need is the ability to pull the latest discussions list and the forums list into my WordPress home page. Any other suggestions are welcome.

    @johnhiler

    Member

    Hey guys – there are different levels of integration between WordPress and bbPress (these definitions are from Sam):

    * User database integration – Sharing of user data tables with WordPress

    * Cookie integration – Sharing of login cookies with WordPress

    * Deep integration – Including the WordPress codebase (PHP) inside bbPress to allow use of WordPress functions inside bbPress

    bbPress supports all of these (although cookie integration between some versions wasn’t supported until user plugins were created fairly recently).

    I think what was asked was reverse deep integration, so to speak? Where instead of normal deep integration (allowing you to call WordPress from inside of bbPress), it would work the other way around (where you could call bbPress from inside of WordPress).

    I think that’s where Sam is drawing the line re: integration, although I could be misunderstanding. He’s definitely said recently that he’s supporting normal deep integration (allowing users to call WordPress functions from inside of bbPress), so all deep integration isn’t off the table. My guess would be that it’s easier for Sam to program bbPress to support WordPress… than to demand that WordPress engineers program in full deep integration for bbPress.

    Incidentally, I pull bbPress discussions onto my WordPress using the Latest Discussion plugins and it works great!

    https://bbpress.org/plugins/topic/bbpress-latest-discussion-for-wp/

    @leggo-my-eggo

    Member

    Yeah, that makes some sense. However, there’s a conceptual problem here, right? Because the recommended structure is to install WordPress and then install bbPress as a subdirectory (say, /forums). Which works great, but then I’ve got a home page created by WordPress, and since the deep integration only works the other way around, no way to use any bbPress content on that home page.

    I also tried using the Latest Discussion plugin, but I have a modification that I need to filter some of the output supplied by whatever functions output the discussion and forum lists, and that plugin does not include a filter which allows me to do what I need to do, so I was trying to find a way to use bbPress functions on my WordPress home page.

    For “deep integration” to be really relevant, I have to have a way to include bbPress content within my WordPress pages, right? Or am I really thinking of this the wrong way?

    @sambauers

    Participant

    johnhiler nailed it and there’s nothing particularly hardline about my statement. It’s a matter of prioritising the features that bbPress supports and in turn the features that I support as the main developer of the software and the various community members support on this forum and in any future docs.

    We could make bbPress do lots of things, some would stray not far from the expected feature set, like this. I’m just drawing the line, that’s all I’m saying.

    @johnhiler

    Member

    legg-my-eggo – I totally agree that basic functionality should be easier to call between the two platforms! Pulling content back and forth between WordPress and bbPress… sharing header/footer/sidebar templates… that stuff should be a lot more seamless, and hopefully it will be over time.

    Deep integration does have its own set of problems. _ck_ mentions two of them here:

    Two huge strengths for stand-alone (simple) integration over deep integration are:

    1. your forums can be still running even if your blog is temporarily down (or visa versa)

    2. speed/performance – deep integration will crush a shared server if you get a surge in visitors

    https://bbpress.org/forums/topic/display-bbpress-on-wordpress-page-inside-the-blog#post-25353

    Anyway my personal sense is that if you can avoid deep integration, you’re probably better off that way. But if you absolutely need it, it’s possible… but only in one direction. It’s up to WordPress to decide if they want to offer deep integration of bbPress – I guess some of us could post over at the WordPress forums and ask them for it?

    What kind of filters are you looking to run on the Latest Discussion plugin? Maybe we can find a way to mod the plugin to be more flexible… and remove your need for deep integration!

    @leggo-my-eggo

    Member

    @sambauers – Yep, I get that, thanks. I think where I’m coming from is that I am a long-time WordPress developer, and I have just had the need to create a forum, so I (almost automatically) chose bbPress, thinking that all the talk about integration would allow me to do some cross-platform things that I had in mind. I didn’t read far enough into the forums to discover that the “deep integration” only went one direction (bbPress->Wordpress), and now I’m way too far down the the path of developing this site to turn around, and I’m not sure I could get the interaction I wanted with anything else anyway. Any chance you’re updating the bbPress Live plugin for 2.8?

    @johnhiler – Agreed about avoiding deep integration. Given what I now understand about how it works, I would prefer to avoid it entirely, merely pulling content between platforms. I actually can mod the Latest Discussion plugin, and that’s probably what I’ll end up doing. I kind of hate doing that because I forget later what I changed when I want to upgrade. Basically all I really need is a way to limit one of my forum’s topics and counts to those topics begun today (I have a “Today Only” forum to talk about topics for a single day). I have this working fine within bbPress, and what I wanted to do was simply filter the output of the Latest Discussion plugin like that from within my own plugin.

    @atsutane

    Member

    @leggo-my-eggo

    Sorry i should have update the plugin here in, but if you are download from the plugin from wordpress.org there are 3 filter support release on 22-6-2009 :) More info can be found here.

    http://www.atsutane.net/2009/06/update-bbpress-latest-discussion-v1-5.html

    @immelody

    Member

    bbPress Live works fine with 2.8 unless you’re doing deep integration. As for with deep integration, I’m not sure if the error is with my files or with the plugin itself. I have discussed it with Sam. But unless you’re doing deep integration, Live works with 2.8.

    I was using it until I decided to change the look of my website. When I went to PixoPoint’s Theme Generator, it called for having deep integration. And since I’m far too busy right now (I’m not a coder or anything like that for a living.. I’m a mother), I didn’t feel like doing all the work arounds to get the same functionality as I had previously. But if you have a bbPress that doesn’t need deep integration, I highly recommend bbPress Live.

    @leggo-my-eggo

    Member

    bbPress Live claims on its download page to only be compatible up to 2.6.2. I tried it anyway, and it did not work. The widgets did not function at all, and the template functions did not pull any forum data.

    @sambauers

    Participant

    I won’t be able to get to bbPress Live until after 1.0 is released. Hopefully that’s in a couple of days.

    @leggo-my-eggo

    Member

    Great, thank you. I hope that will solve my problem.

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