Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,201 through 4,225 (of 32,481 total)
  • Author
    Search Results
  • #194191
    robineero
    Participant

    I am thinking of soving this idea by creating new page for every forum page with shortcodes and by using redirection plugin to redirect original forum link to customised one.

    Does it make sense?

    #194176

    Topic: TinyMCE Error

    in forum Troubleshooting
    ross445
    Participant

    I’m trying to enable Visual Editor for my forum.
    I’m using this code – https://codex.bbpress.org/enable-visual-editor/

    However, it doesn’t work for me and i see this errors:

    jquery.js?ver=1.12.4:2 Uncaught Error: no such method 'instance' for autocomplete widget instance
    ...
    tinymce.min.js?ver=4711-20180425:2 Uncaught TypeError: Cannot read property 'refreshContentEditable' of undefined

    My bbPress version is 2.5.14
    Wordpress – 4.9.7

    Tried to disable all plugins, didn’t help..

    #194074
    Robin W
    Moderator

    I have a page with my topics on and the slug is ‘discussion.

    are you using a shortcode on this page?

    #194057
    Robin W
    Moderator

    ok, so this works on my test site

    in discussions-replies

    
    <?php add_filter ('bbp_before_has_replies_parse_args' , 'rew_filter_for_user' ) ?>
    <?php if ( bbp_get_user_replies_created( $user_id = bp_loggedin_user_id() ) ) : ?>
        <?php bbp_get_template_part( 'pagination', 'replies' ); ?>
        <?php bbp_get_template_part( 'loop', 'replies' ); ?>
        <?php bbp_get_template_part( 'pagination', 'replies' ); ?>
    <?php else : ?>
        <p><?php _e( 'You have not replied to any topics.', 'bbpress' ); ?></p>
    <?php endif; ?>	

    and in functions

    function rew_filter_for_user ($args) {
     $uid = bbp_get_current_user_id();
     $args['author'] = $uid ;
     return $args ;
    }

    let me know if it works on yours

    #194055
    quigley05
    Participant

    1. I created a new template file titled discussions-replies and discussions-subscriptions under my WordPress child theme.

    2. I placed within discussions-replies the following code:

    <?php
    /*
    Template Name: Discussions Replies Created
    */
    get_header();
    
    // Page options
    $header = ghostpool_option( 'page_header' ) == 'default' ? ghostpool_option( 'page_page_header' ) : ghostpool_option( 'page_header' );
    $height = ghostpool_option( 'page_header_height', 'padding-bottom' ) != '' ? ghostpool_option( 'page_header_height', 'padding-bottom' ) : ghostpool_option( 'page_page_header_height', 'height' );
    $format = ghostpool_option( 'blog_format' );
    $style = ghostpool_option( 'blog_style' );
    $alignment = ghostpool_option( 'blog_alignment' );
    $cats = ghostpool_option( 'blog_cats' ) ? implode( ',', ghostpool_option( 'blog_cats' ) ) : '';
    $post_types = ghostpool_option( 'blog_post_types' ) ? implode( ',', ghostpool_option( 'blog_post_types' ) ) : ghostpool_option( 'blog_post_types' );
    $orderby = ghostpool_option( 'blog_orderby' );
    $per_page = ghostpool_option( 'blog_per_page' );
    $offset = ghostpool_option( 'blog_offset' );
    $image_size = ghostpool_option( 'blog_image_size' );
    $content_display = ghostpool_option( 'blog_content_display' );	
    $excerpt_length = ghostpool_option( 'blog_excerpt_length' );
    $meta_author = ghostpool_option( 'blog_meta', 'author' );
    $meta_date = ghostpool_option( 'blog_meta', 'date' );
    $meta_comment_count = ghostpool_option( 'blog_meta', 'comment_count' );
    $meta_views = ghostpool_option( 'blog_meta', 'views' );
    $meta_likes = ghostpool_option( 'blog_meta', 'likes' );
    $meta_cats = ghostpool_option( 'blog_meta', 'cats' );
    $meta_tags = ghostpool_option( 'blog_meta', 'tags' );
    $read_more_link = ghostpool_option( 'blog_read_more_link' );
    $pagination = 'page-numbers';
    
    ?>
    
    <div class="sub-nav-container">
    	<div class="sub-nav-pagetitle">
    		<h1><?php the_title(); ?></h1>
    	</div>
    	<div class="sub-nav-about-menu">
    		<?php wp_nav_menu( array( 'theme_location' => 'sub-nav-discuss-menu', 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'sub-nav-discuss-menu', 'fallback_cb' => 'null', 'walker' => new Ghostpool_Custom_Menu ) ); ?>
    	</div>
    	<div class="sub-nav-extramenu">
    	</div>
    </div>
    
    <div id="gp-content-wrapper" class="gp-container">
    
    	<?php do_action( 'ghostpool_begin_content_wrapper' ); ?>
    			
    	<div id="gp-inner-container">
    		
    		<div id="gp-content">
    
    			<div class="gp-entry-content">
    				
    				
    <div id="bbpress-forums">
    	<?php do_action( 'bbp_template_before_user_replies' ); ?>
    
    	<div id="bbp-user-replies-created" class="bbp-user-replies-created">
    		<div class="bbp-user-section">
    
    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_replies_created( $user_id = bp_loggedin_user_id() ) ) : ?>
        <?php bbp_get_template_part( 'pagination', 'replies' ); ?>
        <?php bbp_get_template_part( 'loop', 'replies' ); ?>
        <?php bbp_get_template_part( 'pagination', 'replies' ); ?>
    <?php else : ?>
        <p><?php _e( 'You have not replied to any topics.', 'bbpress' ); ?></p>
    <?php endif; ?>	
    
    		</div>
    	</div>
    </div>				
    				
    			</div>
    			
    		</div>
    			
    		<?php get_sidebar( 'left' ); ?>
    
    		<?php get_sidebar( 'right' ); ?>
    
    	</div>
    	
    	<?php do_action( 'ghostpool_end_content_wrapper' ); ?>
    				
    	<div class="gp-clear"></div>
    	
    </div>
    
    <?php get_footer(); ?>

    In discussions-subscriptions template I inserted the following code:

    <?php
    /*
    Template Name: Discussions Subscriptions
    */
    get_header();
    
    // Page options
    $header = ghostpool_option( 'page_header' ) == 'default' ? ghostpool_option( 'page_page_header' ) : ghostpool_option( 'page_header' );
    $height = ghostpool_option( 'page_header_height', 'padding-bottom' ) != '' ? ghostpool_option( 'page_header_height', 'padding-bottom' ) : ghostpool_option( 'page_page_header_height', 'height' );
    $format = ghostpool_option( 'blog_format' );
    $style = ghostpool_option( 'blog_style' );
    $alignment = ghostpool_option( 'blog_alignment' );
    $cats = ghostpool_option( 'blog_cats' ) ? implode( ',', ghostpool_option( 'blog_cats' ) ) : '';
    $post_types = ghostpool_option( 'blog_post_types' ) ? implode( ',', ghostpool_option( 'blog_post_types' ) ) : ghostpool_option( 'blog_post_types' );
    $orderby = ghostpool_option( 'blog_orderby' );
    $per_page = ghostpool_option( 'blog_per_page' );
    $offset = ghostpool_option( 'blog_offset' );
    $image_size = ghostpool_option( 'blog_image_size' );
    $content_display = ghostpool_option( 'blog_content_display' );	
    $excerpt_length = ghostpool_option( 'blog_excerpt_length' );
    $meta_author = ghostpool_option( 'blog_meta', 'author' );
    $meta_date = ghostpool_option( 'blog_meta', 'date' );
    $meta_comment_count = ghostpool_option( 'blog_meta', 'comment_count' );
    $meta_views = ghostpool_option( 'blog_meta', 'views' );
    $meta_likes = ghostpool_option( 'blog_meta', 'likes' );
    $meta_cats = ghostpool_option( 'blog_meta', 'cats' );
    $meta_tags = ghostpool_option( 'blog_meta', 'tags' );
    $read_more_link = ghostpool_option( 'blog_read_more_link' );
    $pagination = 'page-numbers';
    
    ?>
    
    <div class="sub-nav-container">
    	<div class="sub-nav-pagetitle">
    		<h1><?php the_title(); ?></h1>
    	</div>
    	<div class="sub-nav-about-menu">
    		<?php wp_nav_menu( array( 'theme_location' => 'sub-nav-discuss-menu', 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'sub-nav-discuss-menu', 'fallback_cb' => 'null', 'walker' => new Ghostpool_Custom_Menu ) ); ?>
    	</div>
    	<div class="sub-nav-extramenu">
    	</div>
    </div>
    
    <div id="gp-content-wrapper" class="gp-container">
    
    	<?php do_action( 'ghostpool_begin_content_wrapper' ); ?>
    			
    	<div id="gp-inner-container">
    		
    		<div id="gp-content">
    
    			<div class="gp-entry-content">
    				
    <div id="bbpress-forums">				
    <div id="bbp-user-subscriptions" class="bbp-user-subscriptions">				
    				
    <h2>Subscribed Forums</h2>				
    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_forum_subscriptions( $uid ) ) : ?>
        <?php bbp_get_template_part( 'pagination', 'forums' ); ?>
        <?php bbp_get_template_part( 'loop', 'forums' ); ?>
        <?php bbp_get_template_part( 'pagination', 'forums' ); ?>
    <?php else : ?>
        <p><?php _e( 'You are not currently subscribed to any forums.', 'bbpress' ); ?></p>
    <?php endif; ?>
    				
    <br><br>	
    				
    <h2>Subscribed Topics</h2>				
    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_topic_subscriptions( $uid ) ) : ?>
        <?php bbp_get_template_part( 'pagination', 'topics' ); ?>
        <?php bbp_get_template_part( 'loop', 'topics' ); ?>
        <?php bbp_get_template_part( 'pagination', 'topics' ); ?>
    <?php else : ?>
        <p><?php _e( 'You are not currently subscribed to any topics.', 'bbpress' ); ?></p>
    <?php endif; ?>
    
    </div>
    </div>				
    				
    				
    				
    			</div>
    			
    		</div>
    			
    		<?php get_sidebar( 'left' ); ?>
    
    		<?php get_sidebar( 'right' ); ?>
    
    	</div>
    	
    	<?php do_action( 'ghostpool_end_content_wrapper' ); ?>
    				
    	<div class="gp-clear"></div>
    	
    </div>
    
    <?php get_footer(); ?>

    3. I then created two new pages with WordPress under their parent named “Discussions”, one page titled Replies and the other Subscriptions. I then assigned each page to their proper template that I just had created.

    4. Now when I load the pages, the code is asking for a current user, however it ignores and shows on Replies all replies made by all users; on Subscriptions it shows that the user has made NO subscriptions, even though they have.

    #194053
    quigley05
    Participant

    Hi Robin,

    Not quite sure I understand the question. The template names are mentioned within the code I provided and they are located in a page I’ve created in the WordPress backend, not one that is already provided within Buddypress or BBpress.

    Would it be at all helpful to receive access to my backend? Hope this was helpful.

    #194051
    quigley05
    Participant

    Hi Robin,

    I’m pasting what I’ve wrote in earlier messages as the issue hasn’t changed. Feel free to access these pages through the login as I think that will help clarify things.

    The ‘Replies Created’ template is replacing the one originally within the buddypress profile section. It currently displays a list of all global replies within the forum, versus just the current user’s replies.
    (https://obeii.com/discussions/replies/) (testuser / test1234)

    <?php
    /*
    Template Name: Discussions Replies Created
    */
    get_header();
    ?>
    
    <div class="sub-nav-container">
    	<div class="sub-nav-pagetitle">
    		<h1><?php the_title(); ?></h1>
    	</div>
    	<div class="sub-nav-about-menu">
    		<?php wp_nav_menu( array( 'theme_location' => 'sub-nav-discuss-menu', 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'sub-nav-discuss-menu', 'fallback_cb' => 'null', 'walker' => new Ghostpool_Custom_Menu ) ); ?>
    	</div>
    	<div class="sub-nav-extramenu">
    	</div>
    </div>
    
    <div id="gp-content-wrapper" class="gp-container">
    
    	<?php do_action( 'ghostpool_begin_content_wrapper' ); ?>
    			
    	<div id="gp-inner-container">
    		
    		<div id="gp-content">
    
    			<div class="gp-entry-content">
    				
    				
    <div id="bbpress-forums">
    	<?php do_action( 'bbp_template_before_user_replies' ); ?>
    
    	<div id="bbp-user-replies-created" class="bbp-user-replies-created">
    		<div class="bbp-user-section">
    
    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_replies_created( $user_id = bp_loggedin_user_id() ) ) : ?>
        <?php bbp_get_template_part( 'pagination', 'replies' ); ?>
        <?php bbp_get_template_part( 'loop', 'replies' ); ?>
        <?php bbp_get_template_part( 'pagination', 'replies' ); ?>
    <?php else : ?>
        <p><?php _e( 'You have not replied to any topics.', 'bbpress' ); ?></p>
    <?php endif; ?>	
    
    		</div>
    	</div>
    </div>				
    				
    			</div>
    			
    		</div>
    			
    		<?php get_sidebar( 'left' ); ?>
    
    		<?php get_sidebar( 'right' ); ?>
    
    	</div>
    	
    	<?php do_action( 'ghostpool_end_content_wrapper' ); ?>
    				
    	<div class="gp-clear"></div>
    	
    </div>
    
    <?php get_footer(); ?>

    The ‘Subscribed Forums’ template is also replacing the one originally within the Buddypress profile section. It currently ignores the current user and claims they have no content even though they do. The page also contains ‘Subscribed Topics’ using similar code, which that sections works as expected with no known issues.
    (https://obeii.com/discussions/subscriptions/) (testuser / test1234)

    <?php
    /*
    Template Name: Discussions Subscriptions
    */
    get_header();
    ?>
    
    <div class="sub-nav-container">
    	<div class="sub-nav-pagetitle">
    		<h1><?php the_title(); ?></h1>
    	</div>
    	<div class="sub-nav-about-menu">
    		<?php wp_nav_menu( array( 'theme_location' => 'sub-nav-discuss-menu', 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'sub-nav-discuss-menu', 'fallback_cb' => 'null', 'walker' => new Ghostpool_Custom_Menu ) ); ?>
    	</div>
    	<div class="sub-nav-extramenu">
    	</div>
    </div>
    
    <div id="gp-content-wrapper" class="gp-container">
    
    	<?php do_action( 'ghostpool_begin_content_wrapper' ); ?>
    			
    	<div id="gp-inner-container">
    		
    		<div id="gp-content">
    
    			<div class="gp-entry-content">
    				
    <div id="bbpress-forums">				
    <div id="bbp-user-subscriptions" class="bbp-user-subscriptions">				
    				
    <h2>Subscribed Forums</h2>				
    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_forum_subscriptions( $uid ) ) : ?>
        <?php bbp_get_template_part( 'pagination', 'forums' ); ?>
        <?php bbp_get_template_part( 'loop', 'forums' ); ?>
        <?php bbp_get_template_part( 'pagination', 'forums' ); ?>
    <?php else : ?>
        <p><?php _e( 'You are not currently subscribed to any forums.', 'bbpress' ); ?></p>
    <?php endif; ?>
    				
    <br><br>	
    				
    <h2>Subscribed Topics</h2>				
    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_topic_subscriptions( $uid ) ) : ?>
        <?php bbp_get_template_part( 'pagination', 'topics' ); ?>
        <?php bbp_get_template_part( 'loop', 'topics' ); ?>
        <?php bbp_get_template_part( 'pagination', 'topics' ); ?>
    <?php else : ?>
        <p><?php _e( 'You are not currently subscribed to any topics.', 'bbpress' ); ?></p>
    <?php endif; ?>
    
    </div>
    </div>				
    				
    				
    				
    			</div>
    			
    		</div>
    			
    		<?php get_sidebar( 'left' ); ?>
    
    		<?php get_sidebar( 'right' ); ?>
    
    	</div>
    	
    	<?php do_action( 'ghostpool_end_content_wrapper' ); ?>
    				
    	<div class="gp-clear"></div>
    	
    </div>
    
    <?php get_footer(); ?>
    #194020
    Robin W
    Moderator

    If you know how to use ftp, then

    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

    Then on your pc create a text file called content-single-forum.php and put the following contents into it

    <?php
    
    /**
     * Single Forum Content Part
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    ?>
    
    <div id="bbpress-forums">
    
    	<?php bbp_breadcrumb(); ?>
    
    	<?php bbp_forum_subscription_link(); ?>
    
    	<?php do_action( 'bbp_template_before_single_forum' ); ?>
    
    	<?php if ( post_password_required() ) : ?>
    
    		<?php bbp_get_template_part( 'form', 'protected' ); ?>
    
    	<?php else : ?>
    
    		
    		<?php if ( bbp_has_forums() ) : ?>
    
    			<?php bbp_get_template_part( 'loop', 'forums' ); ?>
    
    		<?php endif; ?>
    
    		<?php if ( !bbp_is_forum_category() && bbp_has_topics() ) : ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'loop',       'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    			
    			<?php bbp_single_forum_description(); ?>
    
    			<?php bbp_get_template_part( 'form',       'topic'     ); ?>
    
    		<?php elseif ( !bbp_is_forum_category() ) : ?>
    
    			<?php bbp_get_template_part( 'feedback',   'no-topics' ); ?>
    
    			<?php bbp_get_template_part( 'form',       'topic'     ); ?>
    
    		<?php endif; ?>
    		
    	
    
    	<?php endif; ?>
    
    	<?php do_action( 'bbp_template_after_single_forum' ); ?>
    
    </div>

    FTP this file to the directory you created above, so you end up with

    wp-content/themes/%your-theme-name%/bbpress/content-single-forum.php

    bbpress will then use this file.

    #194011
    Indrekkor
    Participant

    Hello,

    Been optimizing my bbPress install, have managed to make it blazing fast with switching to MariaDB and configuring indexes.

    Now i got rid of the usual slow-queries from my slow-query.log now something appeared that i haven’t seen before.

    https://pastebin.com/rhUz90gf

    Is this a core bbPress query?

    
    SELECT   wp_posts.ID FROM wp_posts  INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1  AND wp_posts.post_parent IN (LONG LIST OF IDs)
    AND (
      ( wp_postmeta.meta_key = '_bbp_forum_id' AND CAST(wp_postmeta.meta_value AS SIGNED) NOT IN ('11212874','22','1778309','2273738') )
    ) AND wp_posts.post_type = 'reply' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC, wp_posts.ID DESC LIMIT 0, 1;
    #193998
    quigley05
    Participant

    Thanks @nashraf. What exactly in the code did you change? It seems to cross check the same and deliver the same results unfortunately..

    Thanks again Robin and @nashraf for all the support on this.

    #193994
    dinsl
    Participant

    Hello there!

    Is it possible to migrate from IPB 4 to bbpress? From the importer i see only the option IPB 3 and doesn´t work as the IPB 4 database is different.

    I saw also one thread https://codex.bbpress.org/getting-started/importing-data/import-forums/invision/ but not for the IPB 4x version. Can somebody help me please?

    Thanks in advance

    #193974

    In reply to: New Topic Button ?

    Robin W
    Moderator

    sorry, best I can do – you could always crack the plugin open and work out where the code is that does this

    #193966
    jameshogan03
    Participant

    Autosuggest has never worked in my buddypress/bbpress group forums. Anyone with tips could really help me out. There is an old bit of code floating around which doesn’t seem to work anymore. Help appreciated!

    #193921
    jonasgeschke
    Participant

    Hi,
    in order to better use the single-forum shortcode, is it possible not to display the forum path (“Login => Forums =>”)?
    Thanks for your help and best regards,
    Jonas

    #193919
    Robin W
    Moderator

    ok, the best I can suggest is that you create a test site where you can try a different theme to eliminate

    Creating a Test Site

    #193918
    hislordshipuk
    Participant

    Ok I removed the added code as detailed above. It made no difference. All buttons and free text are no operable in the ‘Add new’ of Forums.

    #193917
    quigley05
    Participant

    Hi Robin,

    The ‘Replies Created’ template is replacing the one originally within the buddypress profile section.
    (https://obeii.com/discussions-replies-created/) (testuser / test1234)

    <?php
    /*
    Template Name: Discussions Replies Created
    */
    get_header();
    ?>
    
    <div class="sub-nav-container">
    	<div class="sub-nav-pagetitle">
    		<h1><?php the_title(); ?></h1>
    	</div>
    	<div class="sub-nav-about-menu">
    		<?php wp_nav_menu( array( 'theme_location' => 'sub-nav-discuss-menu', 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'sub-nav-discuss-menu', 'fallback_cb' => 'null', 'walker' => new Ghostpool_Custom_Menu ) ); ?>
    	</div>
    	<div class="sub-nav-extramenu">
    	</div>
    </div>
    
    <div id="gp-content-wrapper" class="gp-container">
    
    	<?php do_action( 'ghostpool_begin_content_wrapper' ); ?>
    			
    	<div id="gp-inner-container">
    		
    		<div id="gp-content">
    
    			<div class="gp-entry-content">
    				
    				
    <div id="bbpress-forums">
    	<?php do_action( 'bbp_template_before_user_replies' ); ?>
    
    	<div id="bbp-user-replies-created" class="bbp-user-replies-created">
    		<div class="bbp-user-section">
    
    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_replies_created( $user_id = bp_loggedin_user_id() ) ) : ?>
        <?php bbp_get_template_part( 'pagination', 'replies' ); ?>
        <?php bbp_get_template_part( 'loop', 'replies' ); ?>
        <?php bbp_get_template_part( 'pagination', 'replies' ); ?>
    <?php else : ?>
        <p><?php _e( 'You have not replied to any topics.', 'bbpress' ); ?></p>
    <?php endif; ?>	
    
    		</div>
    	</div>
    </div>				
    				
    			</div>
    			
    		</div>
    			
    		<?php get_sidebar( 'left' ); ?>
    
    		<?php get_sidebar( 'right' ); ?>
    
    	</div>
    	
    	<?php do_action( 'ghostpool_end_content_wrapper' ); ?>
    				
    	<div class="gp-clear"></div>
    	
    </div>
    
    <?php get_footer(); ?>

    The ‘Subscribed Forums’ template is also replacing the one originally within the buddypress profile section. It also contains ‘Subscribed Topics’ using similar code and that sections works as expected.
    (https://obeii.com/discussions-subscriptions/) (testuser / test1234)

    <?php
    /*
    Template Name: Discussions Subscriptions
    */
    get_header();
    ?>
    
    <div class="sub-nav-container">
    	<div class="sub-nav-pagetitle">
    		<h1><?php the_title(); ?></h1>
    	</div>
    	<div class="sub-nav-about-menu">
    		<?php wp_nav_menu( array( 'theme_location' => 'sub-nav-discuss-menu', 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'sub-nav-discuss-menu', 'fallback_cb' => 'null', 'walker' => new Ghostpool_Custom_Menu ) ); ?>
    	</div>
    	<div class="sub-nav-extramenu">
    	</div>
    </div>
    
    <div id="gp-content-wrapper" class="gp-container">
    
    	<?php do_action( 'ghostpool_begin_content_wrapper' ); ?>
    			
    	<div id="gp-inner-container">
    		
    		<div id="gp-content">
    
    			<div class="gp-entry-content">
    				
    <div id="bbpress-forums">				
    <div id="bbp-user-subscriptions" class="bbp-user-subscriptions">				
    				
    <h2>Subscribed Forums</h2>				
    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_forum_subscriptions( $uid ) ) : ?>
        <?php bbp_get_template_part( 'pagination', 'forums' ); ?>
        <?php bbp_get_template_part( 'loop', 'forums' ); ?>
        <?php bbp_get_template_part( 'pagination', 'forums' ); ?>
    <?php else : ?>
        <p><?php _e( 'You are not currently subscribed to any forums.', 'bbpress' ); ?></p>
    <?php endif; ?>
    				
    <br><br>	
    				
    <h2>Subscribed Topics</h2>				
    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_topic_subscriptions( $uid ) ) : ?>
        <?php bbp_get_template_part( 'pagination', 'topics' ); ?>
        <?php bbp_get_template_part( 'loop', 'topics' ); ?>
        <?php bbp_get_template_part( 'pagination', 'topics' ); ?>
    <?php else : ?>
        <p><?php _e( 'You are not currently subscribed to any topics.', 'bbpress' ); ?></p>
    <?php endif; ?>
    
    </div>
    </div>				
    				
    				
    				
    			</div>
    			
    		</div>
    			
    		<?php get_sidebar( 'left' ); ?>
    
    		<?php get_sidebar( 'right' ); ?>
    
    	</div>
    	
    	<?php do_action( 'ghostpool_end_content_wrapper' ); ?>
    				
    	<div class="gp-clear"></div>
    	
    </div>
    
    <?php get_footer(); ?>
    #193916
    hislordshipuk
    Participant

    I have gone through the plug-in checks and still found all buttons are disabled. As for changing themes, I don’t wish to do this as when I revert back to my current theme the formatting will be completely messed up which will take hours of work to put right.

    One thought – I did add a piece of code to the theme to have the forum response placed in a sensible order. Could this be the culprit? It was added the Themes funcion.php.

    function my_custom_display_topic_index_query () {
    $args[‘orderby’] = ‘date’;
    $args[‘order’] = ‘DESC’;

    return $args;
    }
    add_filter(‘bbp_before_has_topics_parse_args’, ‘my_custom_display_topic_index_query’ );

    #193912
    quigley05
    Participant

    Hi Robin,

    I’ve placed the following code into my page template:

    <?php add_filter ('bbp_before_has_replies_parse_args' , 'rew_filter_for_user' ) ; ?>
        <?php bbp_get_template_part( 'pagination', 'replies' ); ?>
        <?php bbp_get_template_part( 'loop', 'replies' ); ?>
        <?php bbp_get_template_part( 'pagination', 'replies' ); ?>

    I also placed the revised code into my theme functions:

    function rew_filter_for_user ($args) {
     //not sure if the next two lines are needed, so have commented out
     //global $current_user;
     //get_currentuserinfo();
     $uid = bbp_get_current_user_id();
     $args[‘author’] = $uid ;
     return $args ;
    }

    However, doing this results in a blank page for the user.

    #193910
    Robin W
    Moderator

    ok, quick debug of the function, so this won’t error (and will hopefully work!)

    function rew_filter_for_user ($args) {
     //not sure if the next two lines are needed, so have commented out
     //global $current_user;
     //get_currentuserinfo();
     $uid = bbp_get_current_user_id();
     $args[‘author’] = $uid ;
     return $args ;
    }
    
    #193903
    Robin W
    Moderator

    untested but try

    <?php add_filter ('bbp_before_has_replies_parse_args' , 'rew_filter_for_user' ) ; ?>
        <?php bbp_get_template_part( 'pagination', 'replies' ); ?>
        <?php bbp_get_template_part( 'loop', 'replies' ); ?>
        <?php bbp_get_template_part( 'pagination', 'replies' ); ?>

    and in your functions file put

    function rew_filter_for_user ($args) {
    //not sure if the next two lines are needed, so have commented out
    //global $current_user;
    //get_currentuserinfo();
    $uid = bbp_get_current_user_id();
    $args[‘author’] => $uid ;
    return $args

    }

    loop-replies from memory has the ‘no relies’ part in it, so you shouldn’t need the ‘if’ statement
    I’m really pushed at the moment hence no time to test, but if it doesn’t work come back, and if I get time I’ll load it to my test site and debug

    #193900
    quigley05
    Participant

    Any ideas? I keep scratching my head on this one. The code couldn’t be more clear to pull all data from the current user but it seems to ignore it..

    Any help at all would be greatly appreciated. Thanks!

    #193881
    Robin W
    Moderator

    add this to your functions file

    add_filter ('bbp_before_has_forums_parse_args', 'rew_number_of_forums') ;
    
    function rew_number_of_forums ($args) {
    	$args['posts_per_page'] = 50 ;
    return $args ;
    }

    I’ll add it to my style pack plugin shortly if you don’t know how to do that

    #193873
    codenameita
    Participant

    I have solved the problem.
    This line of code resets the post_parent entry of the array args to the current forum id.
    $r['post_parent'] = bbp_get_forum_id( $r['post_parent'] );
    Creating a new function with that line commented solved the problem.

    #193872
    codenameita
    Participant

    Hi there,
    I’m trying to write some advanced search functions for BBpress. One of these should let people search only in the forum or subforum they currenty are in. I followed several examples posted on the net and tried to refine them myself.
    Unfortunately, I am experiencing a problem with the bbp_forum_get_subforums fuction.
    The fuction I am writing should be able to get the list of subforums present in a category type forum when the search is fired from a category type forum.
    The code is as follows:

    //If the forum is a category, then search in all the subforums
     if( bbp_is_forum_category($forum_id)){
            $sub_forums = bbp_forum_get_subforums($forum_id);
            $subforum_id = array_column($sub_forums,'ID');
    	$min_subforums = min($subforum_id);
    	$max_subforums = max($subforum_id);
    	$r['meta_query'] = array(
        	    array(
       	        'key' => '_bbp_forum_id',
           		'value' => array($min_subforums,$max_subforums),
    	   	'compare' => 'BETWEEN',
    	    )
        	);
     }

    Unfortunately, bbp_forum_get_subforums($forum_id) gives a false result.
    Strangely enough, if I try to put the same code in a fuction and add it with “add_action” to a forum page, it gives me the corret list of subforums if the current forum is a category.
    Can someone please help me addressing this problem? I am using the latest version of WP and BBpress.

Viewing 25 results - 4,201 through 4,225 (of 32,481 total)
Skip to toolbar