Search Results for 'code'
-
Search Results
-
After a couple of weeks testing bbpress and several other forum solutions, we are really hesitating in running bbpress as our forum.
From what we see the bbpress plugin, while not as feature-rich as stand-alone bulletin boards like vbulletin, phpbb or xenForo, does one thing outstandingly well, which is the integration into wordpress.
For that reason alone, it would be worth giving it a try.
Unfortunately – and here comes our biggest issue – it looks like the bbpress plugin is currently not given full (or any) attention from WordPress.
My question is very simple:
How many developers / coders are writing code of the bbpress plugin currently ?
Is @johnjamesjacoby the only one?
Is there anybody else “officially assigned/paid by wordpress” to work on the bbpress plugin and documentation or/and support ?
John is doing an excellent job, on all his help he gives especially in the bbpress forum. But since the community is small and John is also working on the buddypress project, we are really worried to put our eggs in a “one-man-show plugin” basket.
Please tell me that I got this wrong and that there are at least several people currently working on the bbpress plugin and documentation.
Would be great if anybody could shed some light on this.
I am trying to locate the file to add code above my pagetitle on my forums in bbpress. I am not sure where the file is located. I am simply wanting to add a banner of adsense there.
Topic: Inefficient / heavy query
Hello,
We’ve got a really big bbPress forum running at http://realmadridcf.nl.
At some point though, the site crashed because of heavy query. After some inspection of the SQL slow query log, we found out that it was this query:
# Query_time: 2.798700 Lock_time: 0.000138 Rows_sent: 5 Rows_examined:
366600
SET timestamp=1321347478;
SELECT SQL_CALC_FOUND_ROWS wpecs_posts.* FROM wpecs_posts INNER JOIN
wpecs_postmeta ON (wpecs_posts.ID = wpecs_postmeta.post_id) WHERE 1=1
AND wpecs_posts.post_type IN ('topic', 'reply') AND
(wpecs_posts.post_status = 'publish' OR wpecs_posts.post_status =
'closed') AND ( (wpecs_postmeta.meta_key = '_bbp_forum_id' AND
CAST(wpecs_postmeta.meta_value AS CHAR) NOT IN
('8365804','8558913','8558914','8561009','8561010','187','8365804')) )
GROUP BY wpecs_posts.ID ORDER BY wpecs_posts.post_date DESC LIMIT 0, 5;
You can see that this query is obviously way too heavy: Rows_sent: 5 Rows_examined:
366600…
After some examination we found out that the query was made through bbp_forum_functions.php – line 923 – function bbp_pre_get_posts_exclude_forums.
Has this problem ever occurred before? Is there someone with a solution?
Regards,
Tommy
I just spent hours figuring this out so I thought I’d try and save others the bother by sharing it here.
The basic aim was to hide the contents of topics in a bbPress 2.0 forum from any users not logged in. This makes for a nice private forum.
I found suggestions about making forums hidden, private and so on but none of them really worked as they hid them for logged in users too.
My final solution was to make bbPress ‘dumb’ when it comes to logged out users. I.e., it could either be clever and say “there are topics, but you’re not allowed to see them until you login” or it could just say “there are no topics”.
The following code does the latter, dumb version by hooking into the forums, topics and replies loops.
Code:function pj_hla_logged_in_topics($have_posts){
if (!is_user_logged_in()){
$have_posts = null;
}
return $have_posts;
}
add_filter(‘bbp_has_topics’, ‘pj_hla_logged_in_topics’);
add_filter(‘bbp_has_forums’, ‘pj_hla_logged_in_topics’);
add_filter(‘bbp_has_replies’, ‘pj_hla_logged_in_topics’);I simply placed this within my theme’s functions.php but you could just as easily wrap this in a function.
Hope that helps someone!


