How do I get bbPress to return to the same page when someone presses Favorite from within the Bbpress single topic shortcode?
I want to avoid the redirect to the topic page after pressing the Favorite link.
Hi All !!
I have upgraded phpBB 3.0.4 to 3.2.8 recently following steps on Upgrading from 3.0 to 3.2
When trying to import to bbpress 2.5.4 on a WP 5.2.3 I get this message:
Error en la base de datos de WordPress: [Unknown column 'forums.forum_topics' in 'field list']
SELECT convert(forums.forum_id USING "utf8mb4") AS forum_id,convert(forums.parent_id USING "utf8mb4") AS parent_id,convert(forums.forum_topics USING "utf8mb4") AS forum_topics,convert(forums.forum_posts USING "utf8mb4") AS forum_posts,convert(forums.forum_topics_real USING "utf8mb4") AS forum_topics_real,convert(forums.forum_name USING "utf8mb4") AS forum_name,convert(forums.forum_desc USING "utf8mb4") AS forum_desc,convert(forums.left_id USING "utf8mb4") AS left_id,convert(forums.forum_type USING "utf8mb4") AS forum_type,convert(forums.forum_status USING "utf8mb4") AS forum_status FROM phpbb_forums AS forums LIMIT 0, 100
No hay foros que convertir
No hay datos que limpiar
Effectively column forum_topics was on table forum in phpbb version 3.0.4 but it is not anymore on phpbb version 3.2.8.
Script to import from phpbb must have a bug or expect a different database structure for phpbb.
Any suggestions?
Thanks in advance
@casiepa yes I mean that… but the guy mentions that that code is not working π
Can someone else confirm that importing a post where the content contains brackets [] causes the custom importer to hang (get stuck actually)?
Related post
Hello all,
I am using BuddyPress with bbPress and I am noticing an issue when I have a forum topic with multiple pages. When I add a new reply it creates a BuddyPress activity that stores in the DB a primary_link of the type /forums/topic/topic-name/page/XX/#post-YYYY. For example /forums/topic/test-notification-for-reply/page/2/#post-3063
The problem is that if I delete some previous replies from page 1 and this reply moves to the first page from the second page it was previously, its activity permalink (primary_link) remains the same and the activity still points to page 2 of the topic (not page 1 that is its new page).
Is there any fix for this?
OK, I think I have solved this by following this thread, except I had to do one thing the other way around…
1. Scrap User Role Editor and install the Members plugin by Justin Tadlock
2. Don’t put anything in your functions file
3. In WordPress under Users/Roles, clone the Participant user role and give it a name and slug (in my case I am using ‘bosun’) and save the new role.
4. Add this code to your functions file:
function vip_add_custom_role( $bbp_roles ) {
$bbp_roles['bosun'] = array(
'name' => 'Bosun',
'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
);
return $bbp_roles;
}
add_filter( 'bbp_get_dynamic_roles', 'vip_add_custom_role', 1 );
… where bbp_roles and name is changed to your own name of the user role. This must be the same as the name/slug you inserted when cloning the participant user role.
5. Now any forum user assigned this user role will display the correct role, rather that ‘participant’ ‘subscriber’ or ‘spectator’.
The thing I had to do the other way around from the instructions in the other thread was to not put anything in the functions file and install the plugin first.
Phew. Took me two days to get there!
Hi,
I attempted to create some new bbp roles using the code in the codex to copy the ‘participant’ role. Unfortunately this did not work for me despite deactivating all plugins (seems quite a few other people had the same issue).
Instead I am using User Role Editor to create a new forum role, which I have called ‘bosun’. Upon sign-up a new user is correctly assigned this role and has the capabilities of a participant, which is great, but their forum role is still displaying as ‘spectator’.
I would like to display the user’s role under the avatar.
One thing I can do is display:none the div class bbp-author-role and then add in a new div to display the user_role, which I think is what URE plugin generates.
I appreciate that some of this has to do with the URE plugin and that it is not supported here. What I am trying to understand is what I need to change in order to hide the bbp-author-role div and add in a new div calling the URE role. I can only find references to bbp-author-role in templates.php which is a function:
function bbp_topic_author_role( $args = array() ) {
echo bbp_get_topic_author_role( $args );
}
/**
* Return the topic author role
*
* @since bbPress (r3860)
*
* @param array $args Optional.
* @uses bbp_get_topic_id() To get the topic id
* @uses bbp_get_user_display_role() To get the user display role
* @uses bbp_get_topic_author_id() To get the topic author id
* @uses apply_filters() Calls bbp_get_topic_author_role with the author
* role & args
* @return string topic author role
*/
function bbp_get_topic_author_role( $args = array() ) {
// Parse arguments against default values
$r = bbp_parse_args( $args, array(
'topic_id' => 0,
'class' => 'bbp-author-role',
'before' => '',
'after' => ''
), 'get_topic_author_role' );
$topic_id = bbp_get_topic_id( $r['topic_id'] );
$role = bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id ) );
$author_role = sprintf( '%1$s<div class="%2$s">%3$s</div>%4$s', $r['before'], $r['class'], $role, $r['after'] );
return apply_filters( 'bbp_get_topic_author_role', $author_role, $r );
}
Not using Buddy Press.
Here is a list of the bbPress related plugins that are installed currently:
– AccessAlly – bbPress Add-on
– bbP private groups
– bbPress – Mark as Read
– bbPress – Moderation Tools
– bbPress Notifications
– bbPress Notify (No-Spam)
– bbPress Profile Link Shortcode
– bbPress Search Widget
– bbPress Toolkit
– bbPress Unread Posts
Itβs like using the shortcode
, or is it using the shortcode [bbp-search] ??
And, for the record, I tried Robin’s code too. This time the user was originally a ‘participant’. When adding Robin’s code and trying to save as my new forum user role, it reverts back to ‘participant’. Caching is turned off.
Did anyone find a solution to this? I have am having the same issue and am using:
function add_custom_role( $bbp_roles ) {
$bbp_roles['my_custom_role'] = array(
'name' => 'Bosun',
'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // same capabilities as participants
);
return $bbp_roles;
}
add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );
Sorry, been away for a while.
It’s like using the shortcode
Thanks so much.
Hey Robin,
Thanks for getting back to me. I’ve just this moment found a simple solution. What do you think of this:
.logged-in #bbp-forum-40250 {
display: none;
}
If you just want to remove it from the list then you could amend loop-single-forum.php
create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpress
where %your-theme-name% is the name of your theme
find
wp-content/plugins/bbpress/templates/default/bbpress/loop-single-forum.php
Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/loop-single-forum.php
bbPress will now use this template instead of the original
and you can amend this
change it to (assuming 40250 is the fiorum id)
<?php
/**
* Forums Loop - Single Forum
*
* @package bbPress
* @subpackage Theme
*/
if ( !bbp_get_forum_id() == '40250')) {
?>
<ul id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class(); ?>>
<li class="bbp-forum-info">
<?php if ( bbp_is_user_home() && bbp_is_subscriptions() ) : ?>
<span class="bbp-row-actions">
<?php do_action( 'bbp_theme_before_forum_subscription_action' ); ?>
<?php bbp_forum_subscription_link( array( 'before' => '', 'subscribe' => '+', 'unsubscribe' => '×' ) ); ?>
<?php do_action( 'bbp_theme_after_forum_subscription_action' ); ?>
</span>
<?php endif; ?>
<?php do_action( 'bbp_theme_before_forum_title' ); ?>
<a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>"><?php bbp_forum_title(); ?></a>
<?php do_action( 'bbp_theme_after_forum_title' ); ?>
<?php do_action( 'bbp_theme_before_forum_description' ); ?>
<div class="bbp-forum-content"><?php bbp_forum_content(); ?></div>
<?php do_action( 'bbp_theme_after_forum_description' ); ?>
<?php do_action( 'bbp_theme_before_forum_sub_forums' ); ?>
<?php bbp_list_forums(); ?>
<?php do_action( 'bbp_theme_after_forum_sub_forums' ); ?>
<?php bbp_forum_row_actions(); ?>
</li>
<li class="bbp-forum-topic-count"><?php bbp_forum_topic_count(); ?></li>
<li class="bbp-forum-reply-count"><?php bbp_show_lead_topic() ? bbp_forum_reply_count() : bbp_forum_post_count(); ?></li>
<li class="bbp-forum-freshness">
<?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?>
<?php bbp_forum_freshness_link(); ?>
<?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>
<p class="bbp-topic-meta">
<?php do_action( 'bbp_theme_before_topic_author' ); ?>
<span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>
<?php do_action( 'bbp_theme_after_topic_author' ); ?>
</p>
</li>
</ul><!-- #bbp-forum-<?php bbp_forum_id(); ?> -->
<?php } ?>
Not tested but should work, if not then might be another bbpress plugin overwriting the template – come back
ok, the code does not allow for pagnination if you have nested replies allowed in the forum settings.
That is just the way the code is written, I am not an author of the code.
Posted this code in file functions and obsolyutno nothing to acquire not has changed: (as was 80 messages on page tube top so and remained, in all themes. Although the settings specified no more than 10.
Put this in your child theme’s function file – or use
Code Snippets
add_filter( 'bbp_get_replies_per_page', 'rew_replies');
function rew_replies () {
$replies = 5 ;
return $replies ;
}
Hi,
Strange request but I would like to hide a forum completely when the user is logged in. This is because I’m using this forum as an info page for new visitors. Once a user is registered and logged in, they don’t need to see the forum, so I’d like to remove the entire < ul >. I’m hoping this is a simple addition to my functions.php file, something along the lines of:
if ( bbp_is_user_logged_in() ) {
echo "<some css that did ul.bbp-forum-40250 {display:none;}
}
Except I know that’s probably not the best way to achieve this. What would be the best way to hide the forum to logged in users?
Thanks.
Hi,
I have a gallery I would like to add either within the forum description or within a topic but bbpress is not parsing the shortcode. It is not a bbpress shortcode, it comes from a gallery plugin.
How do I enable parsing of other shortcodes within bbpress?
Thanks!
Hi, tanks for your response. I already found this code on the internet, but it didn’t seem to do anything.
Hi. Can anyone please help me with the code to do this:
change this
[bbp-single-reply id=$reply_id]
to this
[bbp-single-reply id=$topic_id]
or anything that will basically do the same thing. Perhaps just the code to direct a reply form to a topic?
thanks in advance
Good Afternoon,
I am currently having an issue with getting my template overrides to work on bbpress pages, like forums and questions( indlucing shortcodes). I have the files located in /wp-content/themes/mytheme/bbpress/ but they are not working. Is there something I have done wrong? Or something I need to do? I am trying to edit loop-forums.php and others.
Many thanks in advance for any help or advice,
Kind regards,
Dave
there is a fuction
bbp_delete_topic function that you can substitute which I have not tested
this will close topics with no activity in the last 10 days
/*
Plugin Name: BBPress Close Old Posts
Description: Close BBPress 2.0+ posts that haven't been updated in X days.
Author: Raygun
Version: 0.1
Author URI: http://madebyraygun.com
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
register_activation_hook(__FILE__, 'bbpress_topic_scheduler');
add_action('bbpress_daily_event', 'bbpress_close_old_topics');
function bbpress_topic_scheduler() {
wp_schedule_event(time(), 'daily', 'bbpress_daily_event');
}
function bbpress_close_old_topics() {
// Auto close old topics
$topics_query = array(
'author' => 0,
'show_stickies' => false,
'parent_forum' => 'any',
'post_status' => 'publish',
'posts_per_page' => -1
);
if ( bbp_has_topics( $topics_query ) )
while( bbp_topics() ) {
bbp_the_topic();
$topic_id = bbp_get_topic_id();
$last_active = strtotime( get_post_meta( $topic_id, '_bbp_last_active_time', true ) );
if ($last_active < strtotime( '-10 days') )
bbp_close_topic( $topic_id );
}
}
?>
Robin, I’m closing the site again to try to restore some of what was deleted.
I think I found a solution. I simply created another page and used elementor and bsp shortcodes. Whichs seem to work fine. The Archives piece has disappeared and I can style with your shortcodes π
In the case of categories, having elementor settings post types checked for posts seems to take away any ability to do anything with categories. I suppose that could have been the case with the archives bit, as well. but that really doesn’t make sense sense WP was completely deleted, including elementor. Perhaps it’s in phpMyAdmin. idk.
Anyway, we’re all good here. Just one question. Do I now need to change the root slug?
Thank you!
Storm