I want to convert my bbpress forum to wordpress type posts. There are older posts about plugins for this but seems like they are not working now.
So… I tried exporting the topics and (separately the) replies using the xml exporter. I did a search and replace on the whole file for types [topics] _topics_ and replaced with [post] and _post_
(well I think they were the replacements as afterwards I tried several others for the replies).
Anyway, this worked when importing the topics as posts into wordpress – I was very happy with that. Then I though it would be great if I could also get the topic replies converted to post comments. I tried several replacement tags (changing reply to comment, comments …) but the only one to get imported was changing [reply] to [post].
It imported but did not add as a thread of comments but each one as a new post “RE: Topic title”.
Is there any way I can use the export/import function to get my topics and replies over to a blog style post with comments?
Or a way of editing the xml file to import correctly and add the replies as comments to the original post?
I was almost there but fell at the last fence.
Andy
Hello,
I need 2 User Names which have the same capabilitys. I have try it with this:
add_filter( ‘bbp_get_dynamic_roles’, ‘ntwb_bbpress_custom_role_names’ );
function ntwb_bbpress_custom_role_names() {
return array(
// Participant
bbp_get_participant_role() => array(
‘name’ => ‘Standard User’,
‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() )
),
// Spectator
bbp_get_spectator_role() => array(
‘name’ => ‘–>Premium User<–‘,
‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() )
)
);
}
Now I can swith between “Standard User” and “Premium User” which is perfect, but he Premium User can not write any reply or other things. So they have not the same capaboility.
Have anybody an idea where the mistake is?
Which Member Plugin works good with WordPress and bbPress? All I try were not good 🙁
OK, I have tried it with this…
add_filter( ‘bbp_get_dynamic_roles’, ‘ntwb_bbpress_custom_role_names’ );
function ntwb_bbpress_custom_role_names() {
return array(
// Participant
bbp_get_participant_role() => array(
‘name’ => ‘Standard User’,
‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() )
),
// Spectator
bbp_get_spectator_role() => array(
‘name’ => ‘–>Premium User<–‘,
‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() )
)
);
}
I can now change every User to a “Standard User” or “Premium User”. That is what I want, BUT with the Premium User I can not write any replies or others. With the Standard User is everything ok.
Where is the mistake???
it may be a conflict ot it could be a theme or plugin issue
Plugins
Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.
Themes
If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.
Then come back
ok, this code allows participabts to
trash their own replies and
trash their own topics where there have been no replies, once a reply has been posted then they can no longer delete.
it does display slightly weirdly when you delete a topic, but it is the best you are going to get from me.
give it a try and see if you still have the admin problems
/*Customize the BBPress roles to allow Participants to trash topics*/
add_filter( 'bbp_get_caps_for_role', 'ST_add_role_caps_filter', 10, 2 );
function ST_add_role_caps_filter( $caps, $role ){
// Only filter for roles we are interested in!
if( $role == bbp_get_participant_role() ) {
$newcaps = array(
// Primary caps
'spectate' => true,
'participate' => true,
// Forum caps
'read_private_forums' => true,
// Topic caps
'publish_topics' => true,
'edit_topics' => true,
'delete_topics' => true,
'view_trash' => true,
// Reply caps
'publish_replies' => true,
'edit_replies' => true,
'delete_replies' => true,
// Topic tag caps
'assign_topic_tags' => true,
);
return $newcaps;
}
return $caps;
}
add_filter( 'bbp_map_reply_meta_caps', 'ST_tweak_trash_meta_caps', 11, 4 );
add_filter( 'bbp_map_topic_meta_caps', 'ST_tweak_trash_meta_caps', 11, 4 );
function ST_tweak_trash_meta_caps( $caps, $cap, $user_id, $args ){
// apply only to delete_reply and delete_topic
if ( $cap == "delete_reply" || $cap == "delete_topic" ){
// Get the post
$_post = get_post( $args[0] );
if ( !empty( $_post ) ) {
// Get caps for post type object
$post_type = $_post->post_type ;
// Add 'do_not_allow' cap if user is spam or deleted
if ( bbp_is_user_inactive( $user_id ) ) {
$caps[] = 'do_not_allow';
// Moderators can always edit forum content
} elseif ( user_can( $user_id, 'moderate' ) ) {
$caps[] = 'moderate';
// User is particiapte so allow delete
} elseif ( user_can( $user_id, 'participate' ) && ( (int) $user_id === (int) $_post->post_author ) ) {
//allow any reply to be deleted
if ($post_type == bbp_get_reply_post_type()) $caps = array('delete_replies') ;
//only allow topic delete if there are no replies
if ($post_type == bbp_get_topic_post_type()) {
$reply_count = bbp_get_topic_reply_count();
if ( $reply_count == 0) $caps = array('delete_topics') ;
}
// Unknown so do not allow
} else {
$caps[] = 'do_not_allow';
}
}
}
// return the capabilities
return $caps;
}
I have added it for now into my ‘bbP Toolkit’ plugin (v1.0.8) while waiting for https://bbpress.trac.wordpress.org/ticket/3046 to be implemented.
Pascal.
I think you have done so much on the current site that it is impossible to say what is wrong.
I think you need to create a totally fresh site, and start again with just a standard theme (say twentyfifteen) and bbpress.
Then build form there.
Hello… I have been trying many different ways to get into the forums page, but I not having any luck….
I have tried to remove the plugin and reinstall.. That didn’t work
I tried to remove all bbpress data with the forum reset option in tools… which didn’t work
I have had a look through the editable files of the plugin….bbpress/bbpress.php
It stated that if the plugin was installed more than once, it can create ‘Ghost’ versions of BBP which could be the issue?
Is there any way someone can help me fix this? I’m concerned that I wont be able to use this plugin…
Kind Regards
Chris
ok, whilst out I think I know what the issue is.
Firstly can you confirm that apart from redirecting you to home, the code at the top of this thread works? ie redirection to the wrong place is the only outstanding issue.
If so, the issue is that after you delete a topic, bbpress sends you to back to the topic, which as a moderator you are allowed to see trashed topics, but as a partyicipant you are not. This then will send you to a 404 page, which in your case I think just sends you to home.
So let me look at ways to get around this.
The theme is named “agama”. The bbpress related plugins are: https://gyazo.com/5fae44b6bac68ac591b7f4fdcdcb26a0
Hello everyone,
Sorry but I just came to discover this thread, I am the author of bbp-messages and there’s now a major update made and it now supports Multisite, the problem that Stewart was reporting.
Also Stewart, the link wordpress/members1/http:/localhost/wordpress/members1/ pretty much seems messed up, so it’s hard to tell whether it is bbP issue or configuration. I think you did not configure your testing environment quite well and also the bbPress link looks filtered by BuddyPress. Next time I’d suggest you edit your hosts file (c:\System32\drivers\etc\hosts with admin permissions using notepad) and add a new entry 127.0.0.1 bbpress.dev now bbpress.dev will act like a normal domain and you wouldn’t run into issues while testing or migrating (all you can do is replace .dev with .tld in the db SQL file). Also add the virtual host for Apache http://stackoverflow.com/a/25203499/3910932
Thank you Arutam and Robin you’re very helpful. I just wanted to point that this thread continues in wp-org plugin support forums https://wordpress.org/support/topic/messages-upgrade/
Best,
Samuel
Unfortunately I’m not on Facebook so I cannot see that conversation you had 🙁
Perhaps you could link to this topic in that conversation and have the WPseo plugin author join this conversation?
As to Yoast, I believe Yoast is compatible with bbPress, @joostdevalk wrote here last year “I’ll bump BBPress on to the list again, we’ve long had issues with that, we should just fix it”, I’ve no idea if anything was updated for bbPress or not, was it @joostdevalk ?
I myself don’t use any SEO plugins let alone any that you mention, we’re happy to work with any plugin author to help add support their plugin if we can.
I’m sure there are other bbPress users who do use various SEO plugins, maybe someone else here has some tips on using Yoast WordPress SEO, WPseo, or All in One SEO?
p.s. This topic is going to attract many a spammer, so if your reply doesn’t show up straight away that will be due to Akismet being proactive, if your reply doesn’t turn up straight away give it some time for the moderators to approve and move out of the spam queue.
@netweb thanks!
bbPress 2.6 Beta 2 is working good.
When will bbPress 2.6 be released?
ok, I’ve taken pity and kicked this round for an hour – I expect to be on your Christmas list !!!
This seems to work, although please do some testing for all roles, and check it out.
/*Customize the BBPress roles to allow Participants to trash topics*/
add_filter( 'bbp_get_caps_for_role', 'ST_add_role_caps_filter', 10, 2 );
function ST_add_role_caps_filter( $caps, $role ){
// Only filter for roles we are interested in!
if( $role == bbp_get_participant_role() ) {
$caps = array(
// Primary caps
'spectate' => true,
'participate' => true,
// Forum caps
'read_private_forums' => true,
// Topic caps
'publish_topics' => true,
'edit_topics' => true,
'delete_topics' => true,
// Reply caps
'publish_replies' => true,
'edit_replies' => true,
'delete_replies' => true,
// Topic tag caps
'assign_topic_tags' => true,
);
}
return $caps;
}
/*then only allow participants to trash their own topics*/
add_filter( 'bbp_map_reply_meta_caps', 'ST_tweak_trash_meta_caps', 11, 4 );
add_filter( 'bbp_map_topic_meta_caps', 'ST_tweak_trash_meta_caps', 11, 4 );
function ST_tweak_trash_meta_caps( $caps, $cap, $user_id, $args ){
// apply only to delete_reply and delete_topic
if ( $cap == "delete_reply" || $cap == "delete_topic" ){
// Get the post
$_post = get_post( $args[0] );
if ( !empty( $_post ) ) {
// Get caps for post type object
$post_type = get_post_type_object( $_post->post_type );
//$caps = array();
// Add 'do_not_allow' cap if user is spam or deleted
if ( bbp_is_user_inactive( $user_id ) ) {
$caps[] = 'do_not_allow';
// Moderators can always edit forum content
} elseif ( user_can( $user_id, 'moderate' ) ) {
$caps[] = 'moderate';
// User is author so allow edit if not in admin
} elseif ( user_can( $user_id, 'participate' ) && ( (int) $user_id === (int) $_post->post_author ) ) {
$caps = array();
//$caps[] = $post_type->cap->delete_posts;
// Unknown so do not allow
} else {
$caps[] = 'do_not_allow';
}
}
}
// return the capabilities
return $caps;
}
@airathalitov, as you’re running PHP 7.1 you’ll need to use bbPress 2.6, 2.6 beta-2 is available now, and beta-3 will be released in the next 24 hours, you can grab the download links from this post:
bbPress 2.6 Beta 2
the bbpress search widget does that – is there something particular that you want?
I can open https://airat.biz/forums/ after delete [] in /plugins/bbpress/includes/forums/functions.php on lines 1800, 1818, 1832
Old: $post_stati[]
New: $post_stati
And line 1854:
Old: $meta_query[]
New: $meta_query
Can you check it out?
I think this issue with php7 support
Now i have a warning:
[Thu Mar 02 20:46:15.572617 2017] [php7:warn] [pid 23849] [client ip] PHP Warning: array_unique() expects parameter 1 to be array, null given in /site_path/wp-content/plugins/bbpress/includes/forums/functions.php on line 1836
I have the same problem.
I can’t open page https://airat.biz/forums/ and https://airat.biz/wp-admin/edit.php?post_type=forum
Error 500
I saved Permalinks, reinstalled plugin, but pages still don’t working.
bbPress tools also don’t help
/wp-admin/tools.php?page=bbp-repair
Error log:
[Thu Mar 02 20:33:57.235075 2017] [php7:error] [pid 16265] [client ip] PHP Fatal error: Uncaught Error: [] operator not supported for strings in /site_path/wp-content/plugins/bbpress/includes/forums/functions.php:1800\nStack trace:\n#0 /site_path/wp-includes/class-wp-hook.php(298): bbp_pre_get_posts_normalize_forum_visibility(Object(WP_Query))\n#1 /site_path/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)\n#2 /site_path/wp-includes/plugin.php(515): WP_Hook->do_action(Array)\n#3 /site_path/wp-includes/class-wp-query.php(1681): do_action_ref_array('pre_get_posts', Array)\n#4 /site_path/wp-includes/class-wp-query.php(3238): WP_Query->get_posts()\n#5 /site_path/wp-includes/class-wp.php(617): WP_Query->query(Array)\n#6 /site_path/wp-includes/class-wp.php(735): WP->query_posts()\n#7 /site_path/wp-includes/functions.php(955): WP->main('')\n#8 /home/a in /site_path/wp-content/plugins/bbpress/includes/forums/functions.php on line 1800
bbPress 2.5.12
BuddyPress 2.8.1
WordPress 4.7.2
PHP 7.1.2-3+deb.sury.org~xenial+1
Is there a way to search across forums in bbPress? thank you!
In loop-replies.php, I want to change WP_Query.
But ‘bbp_repliesisbbpress()->reply_query->have_posts();` ,so I don’t know how to change some of WP_Query.
Please someone teach me how to.
Wordpress version 4.7.2
bbPress version 2.5.12
This theme uses the genesis framework, so I suspect you will need to add this plugin to make it all work
bbPress Genesis Extend
I want to show a description for a forum in the forums list. Is there a way to enable this with bbPress, or a plugin that does it?
use my style pack plugin
bbp style pack
once activated go to
dashboard>settings>bbp style pack>forum display and look at 6 & 7
The forum description is put in the content of the forum dashboard>forums
Thanks for the info. I just downloaded the plugin. Sounds like it’s the answer to my problem. As an alternative, I might deactivate the bbpress plugin temporarily since no one is using it right now. You have been very helpful and I really appreciate it.