While this looks ugly, they’re just PHP warnings. PHP error messages and warnings should not be visible on a production webserver anyway. They are there because of a problem with the bbPress code and the way it is interacting with your server, but they are not preventing you from going further. If you suppress the PHP warnings (maybe you have access to your .htaccess file) you will be blissfully unaware of the warnings.
https://bbpress.org/forums/topic/php-error-messages?replies=16#post-13128
I’m seeing some interesting behavior. Though I am a php rookie it seems like what I am trying to do should work.
I include some code in the header that parses cookies and sets variables appropriately. I use the exact same code and approach in WordPress and it works perfectly.
This is at the top of my bbpress header.php:
<?php
global $research_subscriber; // '1' if user is research subscriber
global $forums_subscriber; // '1' if user is forums subscriber
if (condition) $nyquist_research_subscriber=1;
if (condition) $nyquist_forums_subscriber=1;
?>
Just to make sure, I echo’ed out the variables afterward within header.php and they are all being set as expected.
Later on, in files that include header.php (topic.php or front-page.php) by invoking bb_get_header(), I attempt to access these global variables and they are all null.
Why are these variables not being passed? Why does this work in WordPress but not BBpress? What am I missing (bangs head against wall)?
Sam, I noticed that may have changed in/after 0.8.3.1
After some tinkering I also had to add:
$bb->sitecookiepath = '/';
(there is also a related minor issue in that I can’t seem to affect the cookie domain to be undotted in the newest builds)
I have now put together some basic code which successfully interacts with OpenID servers.
Unlike other solutions it doesn’t requires any other libraries or special languages/features on the server other than CURL support (with SSL) which is fairly common.
Unfortunately during this time OpenID has upgraded to 2.0 and certain providers like Yahoo will only accept 2.0 queries and not 1.1 which is all the code can handle.
But if there is any serious interest, I could get bbPress to accept openid from wordpress.com/livejournal/aol/etc. which continue to allow 1.1
If your site is at:
http://www.example.com/
And bbPress is at:
http://www.example.com/forums/
Then you will need to add this line to your config.php file…
$bb->cookiepath = ‘/’;
That way your code in the base directory that is trying to read the cookies will be able to do so.
bb-load essentially loads the entire bbpress framework
It just doesn’t generate any template output
It’s how RSS feeds, etc. are done
You can indeed evaluate the user login via loading the entire framework. But you can also write a very small subset of code to check the cookie and then read the database directly too.
However note that if your bbpress cookies are locked to a path (ie. /forums/) as they are by default, they will not be valid outside of the path and no user will be detected. So you have to change the cookiepath in config.php
Otherwise neither method will work.
Thank you rmccue! bb-load.php was the only file required to make those functions work. I guess that was the source of the chain of includes. Thanks a bunch
It sounds like just including the bbPress function files and using those functions would be the easiest. I couldn’t figure out which files needed to be included for the login functions to work though.
I tried doing if (bb_is_user_logged_in())
, which required /bb-includes/pluggable.php and /bb-includes/functions.php, but after I included both those files I was left with the following error:
Fatal error: Call to a member function get_row() on a non-object in /bb-includes/functions.php on line 1228
Am I missing some other file, or is it just not possible to use this function outside of the actual bbPress build?
Without going through the bbpress functions or mimicing the login authentication system (look in pluggable.php) you could never tell if a user is actually logged in, or being spoofed.
However the bbpress/wp cookie will persist and if the cookie path is set to the website root (instead of locked to “/forums/” – you’d have to change the default cookiepath) you could read the cookie and see if the visitor has a bbpress username. But if several people used the same computer there possibly could be several cookies.
In theory you could force sessions to always be on via a plugin for bbpress and watch it that way too. But note that sessions slow down server performance if it’s an active site.
Best bet is to change the cookiepath and decode the cookie with a smaller subset of code.
That topic header sounds dumb but I’m wanting to have it on my bbpress forum that each topic has only one page, with say 30 posts shown. When there are more than 30 posts, the page divides in two and in between the two sections (each with 15 posts) there is a button or something that says ‘View Posts 15-74’ and when you click on that it loads up the rest of the comments in its place.
Pretty much you can have a thread where you only have 30 posts shown, the first bunch and the most recent bunch and if you want to read all the other posts in between you just click on the divider bit in the middle.
Example? Exactly like the topics on this forum: http://www.messandnoise.com/discussions/
Hopefully someone else thinks that this is a great idea and would consider making a plugin or something. I’ve got no idea how hard it would be but I’d really, really like to see it and I would have no chance in coding it myself
Hi,
I decide to give it a shot to bbPress and i like it. 
See my theme in http://klr20mg.com/foro/ is a spanish blog/forum
see ya.
Another fix for another caching bug:
The query below is never cached – hence if the avatar is for a user other than the current one and is shown multiple times on a page, it causes a query each time since it does not pass through the bbpress caching mechanism.
(around line 117)
$bb_query = "SELECT meta_value FROM $bbdb->usermeta WHERE meta_key='avatar_file' AND user_id='$id' LIMIT 1";
if ( $avatar = $bbdb->get_results($bb_query) ) {
replace with this code to properly cache and radically reduce queries on a busy topic:
if ( $avatar = bb_get_usermeta( $id, "avatar_file")) {
$a = explode("|", $avatar);
note that $avatar[0]->meta_value
is then simply replaced with $avatar
This may require newer versions of bbpress (build 904+) but that was seven months ago as of my post now.
I think I am going to whip up a little “import gravatar” feature for this.
I guess I don’t understand the reason for both #thread1 and #thread in the CSS. Why is that? Is your intention that the CSS for #thread also applies to #thread1? (it doesn’t since they are both distinctly named ids.)
If you want the max width of the images in both #thread1 and #thread to be 600px, you would have to edit the CSS for both those ids.
You should probably also validate your CSS here: http://jigsaw.w3.org/css-validator/
Don’t give up on it, I suspect it’s a simple thing you’re overlooking that makes it not work. Maybe it’s as simple as a cached stylesheet so that after you make a change, it still doesn’t appear to limit the width of the image, even thought it would if the new stylesheet was actually used. I find Firefox does that sometimes even after a CTRL-SHIFT-R. View the stylesheet being used to see if it actually has the changes you made in it. If you load the stylesheet URL directly and the changes are not there, CTRL-SHIFT-R that page and usually it loads the stylesheet again, then go back to your webpage and the stylesheet with your changes should be in use.
Off topic: I wish there were a place one could go to check your site for all the CSS classes, ids and just plain markup you use in the HTML and PHP (web pages), then show you the extra CSS in your stylesheet that is not used in the code at all. That way you could clean the cruft out of your stylesheet and it also might point out things that are not working the way you thought they were.
Only if they choose to redistribute it. If they just run it as a service where the code is never sold to it’s customers – either as source or compiled – then they are under no obligation to release the source. I doubt it serves their interests to release the theme and in my opinion that’s fair enough and in the spirit of the GPL.
Besides this, it is arguable whether they would be bound by the GPL or not. As a theme strictly speaking isn’t a modification of bbPress (it’s just separate code that is compatible with the theme architecture) and the idea of “linking” as stated in the GPL is pretty vague when it comes to PHP applications. It was originally devised to cover more traditional application models where linking to libraries is more clearly defined.
Correct me if I am wrong but technically under the GPL if they modified an existing template and other plugins to make it work, they are required to make the code available
But we’ll just admire it from afar I guess…
Gotta love kiwis, looks great!
I doubt bbpress will ever have native image support (you mean inline right?) That’s just too much “heavily lifting” which is always deferred to plugins.
ps. “Tiny”MCE is such a misnomer. It’s 125k of code!
It isn’t available and I doubt they would release it (for branding purposes). It is pretty wicked though 
Trent
Never mind, I think I just figured it out.
<?php echo $_SERVER['REQUEST_URI']; ?>
Hi:
I’m integrating bbpress with Amember and am embedding a login form in the forum pages. I am looking for the bb_option that returns the current url. This way, after a login, I can redirect the user back to the original page.
It appears the bbpress login code is smart enough to parse the referring page. The amember code needs to be fed this information when the login form is called.
edwinfoo: it looks like there’s a problem with the CSS on your site. The #thread li referenced above by fel64 won’t work for you because it looks like you have renamed it to #thread1 (maybe just a typo in your theme.) So, the CSS for #thread won’t apply to #thread1. If you add CSS for #thread1 or remove the 1 from the end of the <ol id=”#thread” in your theme, it works fine (I just tried it.)
This <ol id="thread1" start="1">
needs to look more like <ol id="thread" start="1">
.
If you need numbers there for each unique thread, you’re going to have to do it differently, not appending a thread number to the end of the id “thread”: that changes the id from #thread to #thread-(whatever number).
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.
Mine is a integrated 0.8.2.1 installation and I’ve tried all the tips on this page and none have worked thus far 
The design can only bear a 600 pixel width limit.
It means that your bb and wp aren’t integrated properly to use one set of functions. You need to put require('path/to/wp')
into your bb config file.
Sure this “upgrade” is not for current functionality. To make this function clear it would be useful to have a working example in the default template 
there are so many unused functions in the include map, why is this unused function included in the default template (makes no sense to me)
@fel64, believe me I know the bbpress files maybe a little too much, hehe…
Hey Chris,
I owe you a huge apology…I wasted your time.
So, after trying all the various combinations you suggested, I remembered that when I first tried you original suggestion:
<table class=”forumlist” id=”forumlist-<?php forum_id(); ?>”>
that I had put it on two lines. So, the “id” line started with a black (rather than light green) “id.” I thought, “Oh, that needs to be green,” so I went ahead and added < to begin the line.
Obviously I’m learning this stuff as I go. Anyway, I went back, used you original method all on one line without adding the extra < and, guess what? It all validated.
I’m an idiot. Sorry for waisting your time and thanks for making it work.
Oh, also, I didn’t want the “Hot Tags” so I justed cut that entire Div out. Everything still seems to work and still validates, but I worry that I shouldn’t have done that. What do you think?
I signed up for adsense and I’m thinking of putting ad code where hot tags was