Hi,
I am looking for a plugin/piece of code that i can apply to the main forum page so that users can subscribe to all topics and sub-topics in one go.
Can you help?
This is a classic question/problem, that has many-many possible answers.
Your first resource for improving anything should be what’s available on this codex page:
Improving Performance
Everything that’s on that page should be considered, implemented, and tuned. Most of that isn’t specific to bbPress (and is appropriate even just for most WordPress installs) but plugins like bbPress will show huge improvements with adequate caching available.
* Concurrent users
* Database slowness
* Page load times
* Excessive database queries
Improving each of those 4 things requires tweaking & tuning specific things for your specific hardware setup. And if you’re on shared hosting, you might not be able to change any of that configuration at all.
The “concurrent users” problem that BuddyPress & bbPress sites have is actually a good problem to have – it means people are using your site and participating in your community. Server configuration is critical here, as is having adequate hardware that will be ready to serve those requests to your users.
The reason most WordPress installations don’t have the same problem, is because there are fewer (if any) logged in users interacting with a traditional blog, news, or website without participation. Comments are the only database interaction, and most people disable them these days anyways.
There are companies (such as WeFoster) whose primary focus is on optimizing their hosting environments for active communities. They’ll offer all of the above and more to help you tune specific things.
In my experience, it’s easier to identify a specific performance concern, and improve that one thing until you’re happy enough to move onto the next concern.
I use last version. And I downloaded from here https://translate.wordpress.org/projects/wp-plugins/bbpress/stable/ru/default
But problem is: files shouldn’t be here /wp-content/languages/bbpress/ , files should be here /wp-content/languages/plugins/
Change instruction please https://codex.bbpress.org/getting-started/bbpress-in-your-language/
untested, but this should work
function hw_get_reply_admin_links($args) {
args['before'] = '<div class="list">' ;
args['after'] = '</div>' ;
return $args ;
}
add_filter('bbp_before_get_reply_admin_links_parse_args','hw_get_reply_admin_links');
We are running WordPress 4.7.3 with bbpress 2.5.12 at http://one-name.org. This mysql error started appearing last night when accessing any forum, topic or reply. I believe it relates to the ‘AND ((()))’ clause:
Apr 06, 13:03:46
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘))) AND ggx_posts.post_type IN (‘topic’, ‘reply’) AND (ggx_posts.post_status = ‘ at line 1 for query SELECT ggx_posts.* FROM ggx_posts FORCE INDEX (PRIMARY, post_parent) WHERE 1=1 AND (ggx_posts.ID = 29822 OR ggx_posts.post_parent = 29822) AND ((())) AND ggx_posts.post_type IN (‘topic’, ‘reply’) AND (ggx_posts.post_status = ‘publish’ OR ggx_posts.post_status = ‘closed’ OR ggx_posts.post_status = ‘retained’ OR ggx_posts.post_author = 5528 AND ggx_posts.post_status = ‘private’ OR ggx_posts.post_author = 5528 AND ggx_posts.post_status = ‘hidden’) ORDER BY ggx_posts.post_date ASC made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), apply_filters(‘template_include’), WP_Hook->apply_filters, call_user_func_array, bbp_template_include, apply_filters(‘bbp_template_include’), WP_Hook->apply_filters, call_user_func_array, bbp_template_include_theme_compat, BBP_Shortcodes->display_topic, bbp_get_template_part, bbp_locate_template, load_template, require(‘/plugins/bbpress/templates/default/bbpress/content-single-topic.php’), bbp_has_replies, WP_Query->__construct, WP_Query->query, WP_Query->get_posts
If you only want to change it on your local installation, you can read the codex on https://codex.bbpress.org/getting-started/bbpress-in-your-language/
Thank you! That’s what I need.
So it’s display only ? But the input of the topics and replies is happening somewhere in a ‘normal’ bbPress forum, right ?
I think you need to create a theme that only displays what you need. It will be easier then just displaying everything with the shortcodes.
Step-by-Step Guide to Creating a Custom bbPress Theme
$args is only the 3rd argument of the bbp_get_reply_admin_links function !
So if you want to deal with the args, it should be:
function hw_get_reply_admin_links ($retval, $r, $args) {
$args = array (
'before' => '<div class="list">',
'after' => '</div>',
);
return $retval;
}
add_filter ('bbp_get_reply_admin_links', 'hw_get_reply_admin_links', 10, 3 );
Hi,
It’s a bit difficult to understand where this is coming from (it might be part of your theme), so if the site is publically availalble, a link to it might be nice.
It might be that following point 3 of this codex page will help you: https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/
Thanks a lot, it works now! I’ve removed “class=”bbp-author-” and rest of the code doesn’t display so its suits perfectly for me.
Now I trying to change args of bbp_get_reply_admin_links (stored in bbpress/includes/replies/template.php)
Thats my hook
function hw_get_reply_admin_links ($args) {
$args = array (
'before' => '<div class="list">',
'after' => '</div>',
);
return $args;
}
add_filter ('bbp_get_reply_admin_links', 'hw_get_reply_admin_links' );
What’s wrong here?
I’m going to use bbPress but via shortcodes so that only topics and posts within the topics are displayed on pages. I don’t want the full Forum Root, Forums, Topics etc., displayed on a page. so I’m going to create individual pages for each topic assign the bbpress shortcode for the topic and posts. So is it really necessary to do page/slug assignments in bbpress setup and have the full thing displayed even though I’m not going to use the full bbpress forum display structure and I certainly don’t want to the public to see it.
or does anyone have any other suggestions on how to accomplish this?
The “forum” will the individual Page, the Topic will be the posts from users on the assigned page. there won’t be an actual “topic” for each forum since the forum is the topic.
Hi,
bbPress translation is centralized here: https://translate.wordpress.org/projects/wp-plugins/bbpress/stable/ru/default
If you want to propose a new translation so everybody in the world that uses it in Russian gets your update (when it gets approved), then you can do that using the above link.
If you only want to change it on your local installation, you can read the codex on https://codex.bbpress.org/getting-started/bbpress-in-your-language/
I’m trying to add a parent/child relationship between bbpress forums and a custom post type I’ve created. Is there a way to do that, currently I can only make forum a child of another forum?
I’ve tried adding a custom meta box that would allow that:
function my_add_meta_boxes() {
add_meta_box( 'lesson-parent', 'Module', 'lessons_attributes_meta_box', 'forum', 'side', 'high' );
}
add_action( 'add_meta_boxes', 'my_add_meta_boxes' );
function lessons_attributes_meta_box( $post ) {
$post_type_object = get_post_type_object( $post->post_type );
$pages = wp_dropdown_pages( array( 'post_type' => 'lesson', 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __( '(no parent)' ), 'sort_column'=> 'menu_order, post_title', 'echo' => 0 ) );
if ( ! empty( $pages ) ) {
echo $pages;
}
}
This shows the metabox and I can select the CPTs from a dropdown list, they are not saved. This should be because the forum post type has hierarchy=>true. So I’ve tried to disable it using the below code, but it doesn’t work:
add_action('registered_post_type', 'disable_hierarchical', 10, 2 );
// Runs after each post type is registered
function disable_hierarchical($post_type, $pto){
// Return, if not post type posts
if ($post_type != 'forum') return;
// access $wp_post_types global variable
global $wp_post_types;
$wp_post_types['forum']->hierarchical = false;
}
The above code works fine with the page post type, but not with the forum. What’s special about it that I’m missing?
I took the phpBB.php modification. I replaced the names of 3 tables in the database: from “xoops_bb_posts” to “posts”, from “xoops_bb_posts_text” to “posts_text”, from “xoops_bb_topics” to “topics”.
I am working on a converter, converting a forum category -> OK, the first error appears when it starts to convert topics:
Błąd bazy danych WordPressa: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN posts_text AS posts_text USING (topic_id) WHERE posts.post_id = topic' at line 1]
SELECT convert(topics.topic_id USING "mypass") AS topic_id,convert(topics.topic_replies USING "mypass") AS topic_replies,convert(topics.forum_id USING "mypass") AS forum_id,convert(topics.topic_poster USING "mypass") AS topic_poster,convert(topics.poster_name USING "mypass") AS poster_name,convert(posts.poster_ip USING "mypass") AS poster_ip,convert(posts_text.post_text USING "mypass") AS post_text,convert(topics.topic_title USING "mypass") AS topic_title,convert(topics.topic_status USING "mypass") AS topic_status,convert(topics.topic_type USING "mypass") AS topic_type,convert(topics.topic_time USING "mypass") AS topic_time,convert(topics.topic_last_post_time USING "mypass") AS topic_last_post_time FROM topics AS topics INNER JOIN posts AS posts USING (topic_id) WHERE posts.post_id = topics.topic_first_post_id INNER JOIN posts_text AS posts_text USING (topic_id) WHERE posts.post_id = topics.topic_first_post_id LIMIT 0, 100
It seems to me that the problem is because the “newbb” system uses two tables to display the response content: xoops_bb_posts and xoops_bb_posts_text. The structures are both here; http://www.kulturystyka.org.pl/newbb_table_structure.txt
Sharing this here in case anyone else has this issue. It’s a combination of using bbPress with either the bbPress Toolkit or the code snippet to use the TinyMCE editor in place of the standard editor.
When using the TinyMCE editor, clicking “Reply” to a thread (using nested threads) would move the reply box to be under the thread, but the box itself loses the text area so you can’t type anything in.
The workaround is to remove and reenable the TinyMCE instance. In the bbpress/templates/default/js/reply.js file, add these two lines to the “try” block (line 38):
tinymce.get(‘bbp_reply_content’).remove();
tinymce.execCommand(‘mceAddEditor’, false, ‘bbp_reply_content’);
I should add that I can see the “Reply E-mail body” in the settings. I see “Topic url: [reply -url]”
Is there another shortcode that would make this an active link?
I am totally at a loss with coding stuff myself, so if there is an answer to my main question, I hope it is a simple one.
Regards
Douglas
ping… anyone? the above post is correct. Both code options no longer work and second options generates a 500 error.
BBPress is redirecting my users to their profile when logged in. I want specific user roles to get redirected to a specific page in the site. I’ve tried the following function in the theme functions.php file that normally works but it is being ignored.
function my_login_redirect_employers() {
if ( current_user_can('employer') ){
return '/welcome-employers/';
}
}
add_filter('login_redirect', 'my_login_redirect_employers',10,3);
WP Version: 4.7.3
bb Version: 2.5.12
Theme: Uncode 1.4.2 – compatibility confirmed
bb Forum Root: “forums”
I’ve had some difficulty setting up and styling my bbPress forums root page, similar to this user: how-to-actually-partner-root-with-a-wp-page/
I have since figured out how to establish a custom WP page as a root for my forum. I had to match the slug declared in the forum settings, AND use the [bbp-forum-index] shortcode. I thought it was either/or. If I only matched the slug, I would just get an empty page. If I just used the shortcode, I would have inconsistencies in the bbPress breadcrumb.
Now that I have declared a custom root, I’m getting my styles ignored or rejected or something. I have my page options set to hide the page title, WP breadcrumb, and some “inline” CSS to hide the menu. (My client needs a custom menu.) These options and styles work on all pages except for the forums root. They just get ignored.
I tested with fresh pages built from scratch multiple times to see where the problem was. I can use the shortcode just fine, but then my custom page is no longer my root page. As soon as I set my custom page’s slug to match the slug in the forum settings, I lose my styles.
How can I get a custom forum root that also has custom styles?
What I want: (Visually at least)
http://kadpf.org/kadpf2017update/forums-ideal/
What I get:
http://kadpf.org/kadpf2017update/forums/
Thanks!
HWParticipant
Hi There,
My client had reported a strange issue that started recently. If I navigate to the forum page, then login to WP, the WP admin bar displays at the top as normal. When I navigate back to the forum page after logging in, the admin bar does not show up on this page only until I refresh the page. At first I thought it was a caching issue with a Autoptimize cache plugin but it still occurs after I deactivate.
There is an error logging for bbPress repeatedly:
[04-Apr-2017 17:56:26 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘))) AND hn09m16p3_posts.post_type IN (‘topic’, ‘reply’) AND (hn09m16p3_posts.po’ at line 1 for query SELECT hn09m16p3_posts.* FROM hn09m16p3_posts FORCE INDEX (PRIMARY, post_parent) WHERE 1=1 AND (hn09m16p3_posts.ID = 8481 OR hn09m16p3_posts.post_parent = 8481) AND ((())) AND hn09m16p3_posts.post_type IN (‘topic’, ‘reply’) AND (hn09m16p3_posts.post_status = ‘publish’ OR hn09m16p3_posts.post_status = ‘closed’ OR hn09m16p3_posts.post_status = ‘reported’ OR hn09m16p3_posts.post_status = ‘acf-disabled’ OR hn09m16p3_posts.post_author = 217 AND hn09m16p3_posts.post_status = ‘private’ OR hn09m16p3_posts.post_author = 217 AND hn09m16p3_posts.post_status = ‘hidden’) ORDER BY hn09m16p3_posts.post_date ASC made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), apply_filters(‘template_include’), WP_Hook->apply_filters, call_user_func_array, bbp_template_include, apply_filters(‘bbp_template_include’), WP_Hook->apply_filters, call_user_func_array, bbp_template_include_theme_compat, BBP_Shortcodes->display_topic, bbp_get_template_part, bbp_locate_template, load_template, require(‘/plugins/bbpress/templates/default/bbpress/content-single-topic.php’), bbp_has_replies, WP_Query->__construct, WP_Query->query, WP_Query->get_posts
I used the repair forums tools one by one and now all the forums/topic/replies content is not displaying but the count is correct for each forum/topic, when I go into any of the forums/topics it says “Oh bother! No topics found here”.
I’m currently setting up a test site to strip it down and see if I can find the cause but I wanted to post this to make sure it isn’t a general bbPress issue with the SQL statement. Any help would be appreciated.
Wordpress version: 4.7.3
bbPress version: 2.5.12
Thanks!
When I use this code it also hides the name and emailaddress?
Hi @fastk9dad
I must have missed your original request, but it should be sufficient in your case to have added the string you want just in front of the subscribe. Just add this to your functions.php:
function casiepa_add_before_forum_subscribe ($args = array() ) {
$args['before'] = ' | ';
return $args;
}
add_filter ('bbp_before_get_forum_subscribe_link_parse_args','casiepa_add_before_forum_subscribe');
cc @kalico
Ok I find a way but I am not happy about that but it works….
You can see live here : http://sakifo.gamers.re/forums/
If someone have a better solution, I put that there :
<?php
/**
* Forums Loop
*
* @package bbPress
* @subpackage Theme
*/
?>
<?php do_action('bbp_template_before_forums_loop'); ?>
<?php
if(bbp_get_forum_id()){
?>
<ul id="forums-list-<?php bbp_forum_id(); ?>" class="bbp-forums">
<li class="bbp-header">
<ul class="forum-titles">
<li class="bbp-forum-info"><?php echo bbp_forum_title(); ?></li>
<li class="bbp-forum-topic-count"><?php _e( 'Topics', 'bbpress' ); ?></li>
<li class="bbp-forum-reply-count"><?php bbp_show_lead_topic() ? _e( 'Replies', 'bbpress' ) : _e( 'Posts', 'bbpress' ); ?></li>
<li class="bbp-forum-freshness"><?php _e( 'Freshness', 'bbpress' ); ?></li>
</ul>
</li><!-- .bbp-header -->
<li class="bbp-body">
<?php while ( bbp_forums() ) : bbp_the_forum(); ?>
<?php bbp_get_template_part( 'loop', 'single-forum' ); ?>
<?php endwhile; ?>
</li><!-- .bbp-body -->
<li class="bbp-footer">
<div class="tr">
<p class="td colspan4"> </p>
</div><!-- .tr -->
</li><!-- .bbp-footer -->
</ul><!-- .forums-directory -->
<?php
}
else {
?>
<?php while ( bbp_forums() ) : bbp_the_forum();?>
<?php
/* We print the header only if we want to show a category or if it's the first item of a no-parent forum list */
if (bbp_is_forum_category() OR ! $bbp_forums_noheader) {
?>
<ul id="forums-list-<?php bbp_forum_id(); ?>" class="bbp-forums">
<li class="bbp-header">
<ul class="forum-titles">
<li class="bbp-forum-info">
<?php if (bbp_is_forum_category()) { ?>
<a class="bbp-forum-title" href="<?php bbp_forum_permalink(bbp_get_forum_parent_id()); ?>">
<?php bbp_forum_title(bbp_get_forum_parent_id()); ?>
</a>
<?php } else {
_e('Forum', 'bbpress');
} ?>
</li>
<li class="bbp-forum-topic-count"><?php _e('Topics', 'bbpress'); ?></li>
<li class="bbp-forum-reply-count"><?php bbp_show_lead_topic() ? _e('Replies', 'bbpress') : _e('Posts', 'bbpress'); ?></li>
<li class="bbp-forum-freshness"><?php _e('Freshness', 'bbpress'); ?></li>
<li class="bbp-forum-freshness-avatar"></li>
</ul>
</li><!-- .bbp-header -->
<?php } ?>
<li class="bbp-body">
<?php
/* If the forum is a category, we're gonna make another loop to show its subforums and sub-subforums as if those were forums */
if (bbp_is_forum_category()) {
$temp_query = clone bbpress()->forum_query;
bbp_has_forums('post_parent=' . bbp_get_forum_id());
while (bbp_forums()) : bbp_the_forum();
bbp_get_template_part('loop', 'single-forum');
endwhile;
bbpress()->forum_query = clone $temp_query;
}
else /* Otherwise, we print the forums the normal way */ {
bbp_get_template_part('loop', 'single-forum');
$bbp_forums_noheader = 1; /* This prevents the header part to be printed again on next post in the loop */
}
?>
</li><!-- .bbp-body -->
<?php
/* Prints the footer only if :
- it's a category
- or if it's the last forum of a no-parent forum list
- or if the next forum in the loop is a category */
if (bbp_is_forum_category()
OR ( bbpress()->forum_query->current_post + 1) == bbpress()->forum_query->post_count
OR bbp_is_forum_category(bbpress()->forum_query->posts[bbpress()->forum_query->current_post + 1]->ID)) {
?>
<li class="bbp-footer">
<div class="tr">
<p class="td colspan4"> </p>
</div><!-- .tr -->
</li><!-- .bbp-footer -->
</ul><!-- .forums-directory -->
<?php unset($bbp_forums_noheader); /* Needed if we have 2+ no-parent forums with at least 1 category between them */
}
?>
<?php endwhile; }?>
<?php do_action('bbp_template_after_forums_loop'); ?>
Hi,
I tried to add a custom css style to roles label, and it looks cool, but It doesn’t look right in mobile devices. I tested several codes without success.
May anybody help about it?
1.- Right now looks like this:

2.- I would like to have something like this:

Code:
{text-align: center;
margin: 0 0 5px 0;
padding: 1px;
font-style: normal;
border: 3px double #050505;
background-color: #fff;
color: #070707;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;}
Thanks,