Search Results for 'code'
-
AuthorSearch Results
-
August 3, 2017 at 12:33 pm #186025
In 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 1800July 30, 2017 at 11:45 am #185894Topic: Conversion problems
in forum Troubleshootingersatzpole
ParticipantHi,
I am trying to convert from phpBB but have come across a problem.
My reply subject and content is in a different table to the normal ‘posts’ table.
The standard code in the existing conversion file joins the topics table to the posts table like this:// Setup reply section table joins $this->field_map[] = array( 'from_tablename' => 'topics', 'from_fieldname' => 'topic_id', 'join_tablename' => 'posts', 'join_type' => 'LEFT', 'join_expression' => 'USING (topic_id) WHERE posts.post_id != topics.topic_first_post_id', 'to_type' => 'reply' );but I need to also join to the table with the subject and content, the ‘posts_text’ table.
Is this possible using the current conversion framework?
If so can anyone please help me with the syntax.Many thanks
July 27, 2017 at 4:17 pm #185870In reply to: Just a few bbPress Questions
Robin W
Moderator1.
I’m wanting to move the Edit/Move/Split/Post bar down
create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpresswhere %your-theme-name% is the name of your theme
find
wp-content/plugins/bbpress/templates/default/bbpress/loop-single-reply.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 thisthen around line 29
<?php do_action( 'bbp_theme_before_reply_admin_links' ); ?> <?php bbp_reply_admin_links(); ?> <?php do_action( 'bbp_theme_after_reply_admin_links' ); ?>this is the bit you are wanting to move.
2.
Is there a way to have the join date underneath their photo beside the post?
yes it can be done, but would need some coding.
Same template, around line 57 you’ll find
<?php do_action( 'bbp_theme_after_reply_author_details' ); ?>That’s where you want to add the join date, either as a hook to the action above, or as additional code.
I suspect you’ll want to pick up the date from the wp_posts table user_registered field.
using bbp_get_reply_author_id() should get you the user, and
https://codex.wordpress.org/Function_Reference/get_userdata
should give you how to use it, with say
<?php $user_info = get_userdata(bbp_get_reply_author_id() ); $registered = $user_info->user_registered; echo $registered?>probably being close to what you want, but you’ll probably need to do some date stuff to display how you want
https://www.w3schools.com/php/php_ref_date.asp but possibly a strtotime() function
Hopefully that’s enough to get you somewhere !!
July 27, 2017 at 9:30 am #185860In reply to: login goes to google home page
Robin W
Moderatoryour login requires an authorisation code, which if you get it wrong is taking you to google.
the logon is part of wrodpress, not bbpress, but I guess that you have a plugin that is doing this authorisation, and that’s where you need to look
July 26, 2017 at 11:47 am #185843In reply to: How to disable text editor?
Robin W
Moderatorpossibly
div#wp-bbp_reply_content-editor-tools { display: none; }in the custom CSS section of your theme
-
AuthorSearch Results