Search Results for 'code'
-
AuthorSearch Results
-
August 3, 2017 at 4:38 pm #186038
Topic: tinyMCE has not selected tab for participants
in forum TroubleshootingJC
ParticipantHello all, I’m using WordPress 8.0 and bbPress2.5.13.
I have added this function to add the visual tab to the editor:
function enable_visual_editor( $args = array() ) { $args['tinymce'] = true; return $args; } add_filter( 'bbp_after_get_the_content_parse_args', 'enable_visual_editor' );When I signed in as admin is everything OK, the editor tab is selected by default and I can start to type. However, when I do as a participant no tabs are selected and I have to select one of them in order to start to type. This is not intuitive at all for participants that want to write a post in the forum and eventually they will leave.
Why is happening that? Can anyone give me support? Thank you in advance ๐
August 3, 2017 at 4:07 pm #186036Robin W
Moderatortry this in the additional css of the theme
dashboard>appearance>customise>additional css
.entry-header, .entry-content, .entry-summary, .entry-meta { max-width: 604px; }and amend max width to whatever you want
August 3, 2017 at 3:55 pm #186035In reply to: Forum Root Slug & Page Name Problems
Robin W
Moderatoryou need to get bbpress to use the correct theme template
see
item 8
August 3, 2017 at 1:00 pm #186027In reply to: group forum slug
Georgio
ParticipantIf you find a solution, i take ! I need similare slug
Just a workaround:
//This function changes the text wherever it is quoted
function change_translate_text( $translated_text ) { if ( $translated_text == 'x' ) { $translated_text = 'y'; } return $translated_text; } add_filter( 'gettext', 'change_translate_text', 20 );Give it a try only if you have slugs that are not ordinary words. Unfortunately I cannot use it for forum, since everytime a user writes “forum” it will be translated.
August 3, 2017 at 12:33 pm #186025In reply to: Threaded Replies not working
mrapino
ParticipantI’d say this is an appropriate article on how to properly enqueue jQuery:
Also, if you know what script is inserting itself above jQuery, and you have control over how it is enqueued, make sure you enqueue to the footer:
wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );Make sure your ‘$in_footer’ is TRUE:
wp_enqueue_script('script-handle', plugins_url('js/script.js' , __FILE__ ),'','1.0',true);August 3, 2017 at 12:10 pm #186023In reply to: Threaded Replies not working
mrapino
Participantdwinn,
I just checked your website, and you have an error in the console:
Uncaught ReferenceError: jQuery is not defined at (index):17jQuery not being define can have very negative effects on a website.
Hope this helps!
August 3, 2017 at 12:08 pm #186022In reply to: Threaded Replies not working
mrapino
ParticipantRobin,
As far as Release 2.6 Candidate 3, the line of code in reply.js on/near line 18 is still the same:
reply.parentNode.appendChild(respond);I changed it to:
reply.parentNode.appendChild(respond, reply);Which seemed to do the trick.
However, I am unsure what else would be affected by this change, as I am unfamiliar with the core code of this plugin.
Please submit any or all of my comments about this here. My issue is fixed, and I hope it helps others.
Cheers!
August 3, 2017 at 11:36 am #186018In reply to: Threaded Replies not working
Robin W
ModeratorI wish a plugin developer would chime in here, but that doesnโt seem likely.
I’m not sure how often they visit, but looks like you done some great stuff here.
I’ve made a note of this thread and I’ll post a trac ticket (bug report) shortly
Can you just confirm what version of bbpress you are using, and if not bbPress 2.6 Release Candidate 3, can you just check that the code is not improved in this – you’ll do this much faster than me.
August 3, 2017 at 3:53 am #186001In reply to: group forum slug
Robin W
Moderatorsilly question, but why not just change it in
Dashboard>settings>forums>etc.
and you are using a buddypress hook, not a bbpress one – bbpress is bbp_init and all your code refers to buddypress.
August 3, 2017 at 1:29 am #185998In reply to: Threaded Replies not working
mrapino
ParticipantActually, I figured out what line 18 does.
I made a change. Instead of commenting it out, I edited it to be:
reply.parentNode.insertBefore(respond, reply);I added “reply” as the second argument being called.
After I did this, the response box, where you put your comment now moves to right under the post where you click reply.
Check it out, and let me know if oyu get it working.
Cheers!
August 3, 2017 at 1:19 am #185997In reply to: Threaded Replies not working
mrapino
ParticipantHey there … I got mine working.
There is a file in the bbPress plugin folder
plugins > bbpress > templates > default > js > reply.js
On line 18, there is a line of code that is throwing a JavaScript error every time the “reply” link is clicked.
reply.parentNode.insertBefore(respond);I basically commented this line of code out, and threaded replies are working again.
I have no idea if this line is needed, but it got rid of the error, and there are no new errors to speak of.
I wish a plugin developer would chime in here, but that doesn’t seem likely.
I hope this helps you.
If anyone else reading this know what this line does, and why it was causing the error, please let us know.
August 2, 2017 at 8:08 pm #185993Topic: group forum slug
in forum TroubleshootingGeorgio
ParticipantHi,
I am trying to change the group forum slug. E.g.
from
‘mysite.com/groups/mygroup/forum’
to
‘mysite.com/groups/mygroup/discussion’I am using this code:
function gi_rename_group_slug() { global $bp; if (isset($bp->groups->current_group->slug) && $bp->groups->current_group->slug == $bp->current_item) { $bp->bp_options_nav[$bp->groups->current_group->slug]['forum']['slug'] = 'discussion'; } } add_action('bp_init', 'gi_rename_group_slug');Unfortunately, nothing happens. What is the error? Thanks in advance.
—-
WP 4.8
bbpress 2.5.12August 2, 2017 at 4:48 pm #185992In reply to: Forum category with subforum not displaying topics
Robin W
Moderatorit’s do-able but would require some code
in essence you need to hook to an action
‘bbp_template_after_topics_loop’
install bbp-style-pack
and then code to [bsp-display-topic-index show=’5′ forum =’10’] with a list of forum ID’s for each category.
I’m out of time to attempt this before my holidays, but above to remind me if you want to bump this topic in a few weeks time, I’ll see if I can fund some time to code
August 2, 2017 at 4:20 pm #185991In reply to: Adding Widgets and Sidebars to all forum pages
Robin W
ModeratorIt’s all tied up with the theme’s page code
This all gets very code oriented, hence suggestion to go to theme provider
however if you’re a bit into code try
August 2, 2017 at 3:19 pm #185989Topic: Forum category with subforum not displaying topics
in forum Troubleshootingsapstudent
ParticipantHi Team,
Here is my situation. I have bbpress installed in my site(sapstudent.com/community). I am displaying it under ‘Community’ page using following two short codes.
[bbp-forum-index]
[bbp-topic-index]Here SAP HANA, SAP Data Services & SAP BO Business Intelligence are categories, everything else are forums.
Now when I click on lets say ‘SAP HANA'(https://www.sapstudent.com/community/forum/sap-hana), it only displays forums under this category, however I would like to have recent topics below forums section as I have in ‘Community’ page.
The other issue I have is, if I use both [bbp-forum-index], [bbp-topic-index] shortcodes on my main forum page, I am getting two search boxes(one above forum list and other one above topics list). To avoid this, I have disabled ‘Allow forum wide search’.Ideally how can I disable seachbox for [bbp-topic-index] shortcode, so that I will have only one search box on my main page which is above forum list.
August 2, 2017 at 1:47 pm #185984In reply to: Adding Widgets and Sidebars to all forum pages
cobitts15
ParticipantOkay so I copied the code from my page.php and made a bbpress.php
<?php get_header(); ?> <div class="content"> <!-- Sidebar With Content Section--> <?php $ultimate_kickoff_wrapper = 'container'; $ultimate_kickoff_theme_option = get_option('ultimate_kickoff_admin_option', array()); if(isset($ultimate_kickoff_theme_option['enable-boxed-style']) && $ultimate_kickoff_theme_option['enable-boxed-style'] == 'wide-style'){ $ultimate_kickoff_wrapper = 'container-fluid'; }else{ $ultimate_kickoff_wrapper = 'container'; } if( !empty($ultimate_kickoff_content_raw) ){ echo '<div class="vc-wrapper '.esc_attr($ultimate_kickoff_wrapper).'">'; while ( have_posts() ){ the_post(); if( has_shortcode( get_the_content(), 'vc_row' ) ) { echo ultimate_kickoff_content_filter(get_the_content(), true); } } echo '</div>'; echo '<div class="pagebuilder-wrapper">'; ultimate_kickoff_show_page_builder($ultimate_kickoff_content_raw); echo '</div>'; }else{ echo '<div class="'.esc_attr($ultimate_kickoff_wrapper).'">'; $default['show-title'] = 'enable'; $default['show-content'] = 'enable'; echo ultimate_kickoff_get_default_content_item($default); echo '</div>'; } ?> </div><!-- content --> <?php get_footer(); ?>My theme options aren’t showing when I try to edit the forum.
August 2, 2017 at 12:31 pm #185981In reply to: Adding Widgets and Sidebars to all forum pages
Robin W
Moderatorok, you’ll need to be using the right template – see
item 8
August 2, 2017 at 12:19 pm #185980In reply to: Adding Widgets and Sidebars to all forum pages
cobitts15
ParticipantI tried using short code to call the forum and at first glance it works, but if you click on the test group and topics I made it goes back to full width.
Thanks for the reply
August 2, 2017 at 1:07 am #185957In reply to: Threaded Replies not working
mrapino
ParticipantHello … I opened the Chrome dev console, and hitting the reply link gives me a JavaScript error:
reply.js:18 Uncaught TypeError: Failed to execute 'insertBefore' on 'Node': 2 arguments required, but only 1 present. at Object.moveForm (reply.js:18) at HTMLAnchorElement.onclick ((index):242)โIs this a known bug?
August 1, 2017 at 9:11 pm #185952Topic: Adding Widgets and Sidebars to all forum pages
in forum Troubleshootingcobitts15
ParticipantI’m trying to make my forum look uniform to the rest of my site with a dual sidebar of widgets. I’ve tried to follow the documentation for a bbPress specific sidebar and can’t get that to work either https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#26-creating-a-bbpress-specific-sidebar. Any help would be greatly appreciated.
wwww.ultimatesportslounge.com
August 1, 2017 at 8:29 pm #185951akira010203
ParticipantI had the exact same issue with the creation of a new custom role.
My old customs roles worked and still work like a charm but with the new one..Impossible to set it and assgin it to a user.
The trick is simple, add your custom role with the usal way on your function.php like that :
function vip_add_custom_role( $bbp_roles ) { $bbp_roles['vip'] = array( 'name' => 'VIP', '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 );Then install “Members” Plugin from Justin Tadlock and create a new role with the exact same slug (name) as the one your created.
You can manage the capabilites too if you want, but the most important thing is that your new custom role will be fully usable.
August 1, 2017 at 4:53 pm #185947In reply to: Redirect after login doesn’t work
cassihl
ParticipantDoes anyone know if bbpress has some code in it that can block the redirect after login? Or if it has its own redirect code that is preventing the redirect plugins from working?
August 1, 2017 at 11:49 am #185941In reply to: avatars do not show after the update,.
kriskl
ParticipantOK. the problem was with this custom code, which stopped working it would seem..
//* Correct Gravatars function bp_remove_gravatar ($image, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir) { $default = get_stylesheet_directory_uri() .'/images/mystery-man.jpg'; if( $image && strpos( $image, "gravatar.com" ) ){ return '<img src="' . $default . '" alt="avatar" class="avatar" ' . $html_width . $html_height . ' />'; } else { return $image; } } add_filter('bp_core_fetch_avatar', 'bp_remove_gravatar', 1, 9 ); function remove_gravatar ($avatar, $id_or_email, $size, $default, $alt) { $default = get_stylesheet_directory_uri() .'/images/mystery-man.jpg'; return "<img alt='{$alt}' src='{$default}' class='avatar avatar-{$size} photo avatar-default' height='{$size}' width='{$size}' />"; } add_filter('get_avatar', 'remove_gravatar', 1, 5); function bp_remove_signup_gravatar ($image) { $default = get_stylesheet_directory_uri() .'/images/mystery-man.jpg'; if( $image && strpos( $image, "gravatar.com" ) ){ return '<img src="' . $default . '" alt="avatar" class="avatar" width="60" height="60" />'; } else { return $image; } } add_filter('bp_get_signup_avatar', 'bp_remove_signup_gravatar', 1, 1 );July 31, 2017 at 1:43 pm #185908In reply to: PHP 7.1 Fatal Error
Robin W
Moderatortry
in bbpress 2.5.12 change line 1800 from
if ( empty( $post_stati ) ) { $post_stati = (array) bbp_get_public_status_id();July 31, 2017 at 4:11 am #185899In reply to: PHP 7.1 Fatal Error
Niresh
ParticipantIm getting blank pages, the bug still exist
[31-Jul-2017 08:12:42 UTC] PHP Fatal error: Uncaught Error: [] operator not supported for strings in /home/user/public_html/wp-content/plugins/bbpress/includes/forums/functions.php:1800 Stack trace: #0 /home/user/public_html/wp-includes/class-wp-hook.php(298): bbp_pre_get_posts_normalize_forum_visibility(Object(WP_Query)) #1 /home/user/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array) #2 /home/user/public_html/wp-includes/plugin.php(515): WP_Hook->do_action(Array) #3 /home/user/public_html/wp-includes/class-wp-query.php(1683): do_action_ref_array('pre_get_posts', Array) #4 /home/user/public_html/wp-includes/class-wp-query.php(3248): WP_Query->get_posts() #5 /home/user/public_html/wp-includes/class-wp.php(617): WP_Query->query(Array) #6 /home/user/public_html/wp-includes/class-wp.php(735): WP->query_posts() #7 /home/user/public_html/wp-includes/functions.php(955): WP->main('') #8 /home/user/public_html/wp-blog-h in /home/user/public_html/wp-content/plugins/bbpress/includes/forums/functions.php on line 1800 -
AuthorSearch Results