Oh my! Many thanks uksentinel! That worked for taking away the search bar above the forum and keeping the sidebar.
Offtopic/sidenote: for every thing I do on my page I feel really proud of my self. Never knew I could even get a site up and running. Now I am doing code (however with extremely good guides from you guys ofc!) and I feel amazing 🙂 Thank you for helping out!
WP Version 5.6.1 – BBpress Version 2.6.6 – Site is currently private and in development.
I am trying to import a relatively small, private MyBB forum (200 Forums, 290 threads, 9000 posts, 50 users) however I keep running into an issue where the converter somehow gets a total count of 5703 threads which makes several duplicates of every thread. If it was a smaller circumstance I would just manually delete the duplicates however which such a huge number of duplicates I was hoping some skilled eyes might see or understand what has happened.
I have a bit of a background in coding so have been trying to troubleshoot through the code to understand when it is reading the thread table why it would end up with exponentially more thread rows than actually exist. In review the thread table I have confirmed that there are only 290 rows so I am not sure what the converter code is doing to create this circumstance.
I have read through the converter and converter class files, but can’t seem to pin point where in the Step Seven, Topic conversion that this error is being produced.
If anyone can provide any assistance with experience with this, or pointing me in the direction of the files of code that I should be trying to troubleshoot to ensure I am in the right direction, that would be greatly appreciated!
this turns comments on in bbpress
add_filter ('bbp_force_comment_status' , 'rew_set_comments_on') ;
function rew_set_comments_on () {
return true ;
}
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
I’m digging through php and can’t locate where the word “On” gets inserted.
bbpress/includes/replies/template/php
lines 660-680
function bbp_get_reply_post_date( $reply_id = 0, $humanize = false, $gmt = false ) {
$reply_id = bbp_get_reply_id( $reply_id );
// 4 days, 4 hours ago
if ( ! empty( $humanize ) ) {
$gmt_s = ! empty( $gmt ) ? 'G' : 'U';
$date = get_post_time( $gmt_s, $gmt, $reply_id );
$time = false; // For filter below
$result = bbp_get_time_since( $date );
// August 4, 2012 at 2:37 pm
} else {
$date = get_post_time( get_option( 'date_format' ), $gmt, $reply_id, true );
$time = get_post_time( get_option( 'time_format' ), $gmt, $reply_id, true );
$result = sprintf( _x( '%1$s at %2$s', 'date at time', 'bbpress' ), $date, $time );
}
// Filter & return
return apply_filters( 'bbp_get_reply_post_date', $result, $reply_id, $humanize, $gmt, $date, $time );
}
comment_status
is closed
in these pages, wish I knew of a way to enable them.
I got this from stackoverflow
function set_post_comment_status( $post_id, $status = 'open' ){
global $wpdb;
$wpdb->update( $wpdb->prefix . 'posts', [ 'comment_status' => $status ], [ 'ID' => $post_id ] );
}
and tried passing the topic id, it didn’t work
Someone may need it, so I’ll update it.
function hhj_bbp_random_topic() {
global $post;
$args = array('post_type' => 'topic','orderby' => 'rand','post_status'=>'publish','posts_per_page' => '10');
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br/>
<?php
endforeach;
wp_reset_postdata();
}
add_shortcode('hhj_bbp_random_topic', 'hhj_bbp_random_topic');
ref.
https://wordpress.stackexchange.com/questions/50761/when-to-use-wp-query-query-posts-and-pre-get-posts
Hi. This is not a CSS bit of code. it is for your functions PHP file.
@ajtruckle
I am having the same issue with participants not able to add images without moderation.
How can I add the remove moderation code to my theme’s additional css?
This line brings up an error
add_filter( ‘bbp_bypass_check_for_moderation’, ‘__return_true’ );
ok, still not sure why you want the ability for someone to comment on a forum page, or more strangely in a topic page??
but try setting up a page with the the same permalink as your forums root, and then put the shortcode
[bbp-forum-index]
in it
then set that page to have comments
it might work, it might not !
bbp style pack has buttons for subscribe
bbp style pack
once activated go to
dashboard>settings>bbp style pack>buttons
you can crack the code in includes/functions around line 336 if you want to look at code
Are there buttons or individual links for the subscription link? a substitute to this
<?php echo bbp_get_forum_subscription_link( array( 'before' => '', 'subscribe' => 'Subscribe', 'unsubscribe' => 'Unsubscribe' ) ); ?>
I tried modifying this but all I could change was the string and that wouldn’t work well also, I’d add icons to the strings and they’d disappear once the toggling starts.
I’d like to wrap two buttons in a an if statement once I get those individual subscription buttons, if there are any that is
Fatal error: Uncaught Error: Cannot use a scalar value as an array in ..\wp-content\plugins\bbpress-post-topics\index.php:924
Stack trace: #0 ..\wp-includes\class-wp-hook.php(287): bbppt_activate('')
#1 ..\wp-includes\class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
#2 ..\wp-includes\plugin.php(484): WP_Hook->do_action(Array)
#3 ..\wp-admin\plugins.php(193): do_action('activate_bbpres...')
#4 {main} thrown in ..\wp-content\plugins\bbpress-post-topics\index.php on line 924
Edit: formatted for readability
if so it is being caused by line 62 of et-divi-customizer-cpt-global-16127219190526.min which says
.et-db #et-boc .et-l .et_pb_section {
padding:54px 0;
}
ok,
so if I am understanding, you have bbpress template files in your child theme under a folder called bbpress
These are just templates which can be amended to get the look you want, which is obviously what tyhe multinews theme has done.
so if correct you have 3 choices
- stay with the new files and lose the presentation you had
- go back to the old files – if they work, they are just templates and should be fine
- work out which templates are causing the issue and look to update these to any new code (which would require you to understand some php)
If everything was working, then I’d suggest you go back to the old files.
sorry shoudl be != means not equal
$role = bbp_get_user_role( $user_id );
if ($role != 'bbp_blocked' && $post_count > 4)
Thanks again for the answer.
Your code check if user is blocked.
Should I write like if ($role == 'bbp_keymaster' || $role == 'bbp_moderator'|| $role == 'bbp_participant'|| $role == 'bbp_spectator' && $post_count > 4)
Or I can use ! as counter statement to blocked somewhere in your code?
$role = bbp_get_user_role( $user_id );
if ($role == 'bbp_blocked' && $post_count > 4)
I m using the Loco plugin for translation – there you can insert new words that are not in the 100%-translation list.
In this case, if these words are not important to you, prohibit through css display: none
Please check the red boxes are still not translated
I tried to change the main code for translation
https://drive.google.com/file/d/1FvUTGZoBl5etnrzeyjeDMTrM_zaSlIOK/view?usp=sharing
Hey @robin-w Tested but not working 🙁
What can be failing in your idea?
This doesn’t work either 🙁
Remove NoFollow from BBPress Posts
Will have to review the code and what’s going on with that filter nowadays
My env:
WooCommerce version: 4.9.0
WordPress version: 5.6
PHP version: 7.4.14
MySQL version: 5.7.31
Plugin:
bbp style pack: 4.7.2
bbPress: 2.6.6
Easy WP SMTP: 1.4.4
The feature “Notify me of follow-up replies via email” does not work on my site.
I tested: go to Settings->bbp-style-pack->Subscriptions Emails -> 9. Send test email, click on ‘Send test email(s)’, but it still does not work.
Pls guide me on this.
Oh! mistake
did not close the tag “< / a>”
$replacement = '<a href="$1" rel="prettyPhoto"><img src="$1"/>';
to
$replacement = '<a href="$1" rel="prettyPhoto"><img src="$1"/></a>';
Hi
i finally solved it with your idea, and i modified the function a little bit
function add_image_responsive_class($content) {
global $post;
$pattern ="/<img src=\"(.*?)\"(.*?)>/i";
$replacement = '<a href="$1" rel="prettyPhoto"><img src="$1"/>';
$content = preg_replace($pattern, $replacement, $content);
return $content;
}
add_filter ('bbp_get_reply_content', 'add_image_responsive_class');
add_filter ('bbp_get_topic_content', 'add_image_responsive_class');
thanks
Best Regards,
Hyunho
I can’t see to get
<?php comments_template(); ?>
to work, it only outputs the stringcomments are closed.
The plugin ‘bbPress Topics for Posts’ could’ve helped buy I’m getting an error when I activate it.Is there a way I could enable comments on/under forum or topic pages?