Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,026 through 5,050 (of 32,518 total)
  • Author
    Search Results
  • #186025
    mrapino
    Participant

    I’d say this is an appropriate article on how to properly enqueue jQuery:

    How to Properly Add jQuery Scripts to WordPress

    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);

    #186023
    mrapino
    Participant

    dwinn,

    I just checked your website, and you have an error in the console:

    Uncaught ReferenceError: jQuery is not defined
        at (index):17

    jQuery not being define can have very negative effects on a website.

    Hope this helps!

    #186022
    mrapino
    Participant

    Robin,

    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!

    #186018
    Robin W
    Moderator

    @mrapino

    I 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.

    #186001

    In reply to: group forum slug

    Robin W
    Moderator

    silly 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.

    #185998
    mrapino
    Participant

    Actually, 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!

    #185997
    mrapino
    Participant

    Hey 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.

    #185993
    Georgio
    Participant

    Hi,
    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.12

    #185992
    Robin W
    Moderator

    it’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

    #185991
    Robin W
    Moderator

    It’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

    Getting Started in Modifying the Main bbPress Template

    sapstudent
    Participant

    Hi 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.

    #185984
    cobitts15
    Participant

    Okay 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.

    #185981
    Robin W
    Moderator

    ok, you’ll need to be using the right template – see

    Step by step guide to setting up a bbPress forum – Part 1

    item 8

    #185980
    cobitts15
    Participant

    I 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

    #185957
    mrapino
    Participant

    Hello … 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?

    #185952
    cobitts15
    Participant

    I’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

    akira010203
    Participant

    I 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.

    #185947
    cassihl
    Participant

    Does 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?

    #185941
    kriskl
    Participant

    OK. 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 );
    #185908

    In reply to: PHP 7.1 Fatal Error

    Robin W
    Moderator

    try

    in bbpress 2.5.12 change line 1800 from

    if ( empty( $post_stati ) ) {
                $post_stati = (array) bbp_get_public_status_id();
    #185899

    In reply to: PHP 7.1 Fatal Error

    Niresh
    Participant

    Im 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
    
    #185894
    ersatzpole
    Participant

    Hi,
    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

    #185870
    Robin W
    Moderator

    1.

    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%/bbpress

    where %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 this

    then 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 !!

    #185860
    Robin W
    Moderator

    your 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

    #185843
    Robin W
    Moderator

    possibly

    div#wp-bbp_reply_content-editor-tools {
        display: none;
    }
    

    in the custom CSS section of your theme

Viewing 25 results - 5,026 through 5,050 (of 32,518 total)
Skip to toolbar