Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,151 through 5,175 (of 32,518 total)
  • Author
    Search Results
  • imanicogic
    Participant

    Hello Support,

    http://www.imanicogic.com
    Wordpress Version:4.7.5
    BBPress Version: 2.5.12

    This was tried on other themes and our WordPress Developer encouraged us to submit this to you.
    ==========================
    We are trying to redirect Members, Groups, and Activity pages to a custom URL. We are using the following code:

    function church_bp_page_template_redirect()
    {

    if( ! is_user_logged_in() && ! bp_is_activation_page() && ! bp_is_register_page() && (bp_is_current_component(‘members’) bp_is_current_component(‘activity’) bp_is_current_component(‘groups’))) {
    wp_redirect( ‘/imani-secured-login/’ );
    exit();
    }
    }

    add_action( ‘template_redirect’, ‘church_bp_page_template_redirect’,10 );

    However, when BBPress is active, this will not work and will always redirecting to Homepage but if BBPress is activated, the custom code will work perfectly.

    Can you please check if there are any conflicts with Buddypress and BBPress in regards to template_redirect?

    Thanks!

    #184808
    mapofemergence
    Participant

    @tkserver, @casiepa glad to read you’re keeping up with the good work.

    I’m a bit swamped in these days, wrapping up my experience overseas and having to move back to the old continent next week.
    I’ll have a better look at the latest additions in Pascal’s repo and its fork by @tkserver.

    I’m looking forward to see how that all evolves and I’ll be more than happy to contribute, as soon as I’ll have some time.
    I’d just love to find some space to discuss about the design aspects of the API too, before diving too much into writing code and risk to bump into limitations late in the process.

    I keep reading you with great interest.
    Cheers,
    s t e

    #184798

    You could try bbp_get_all_child_ids(), though it does a direct database query, and has no limit on the results that get returned, so in cases where there are many topics to chug through, it can be a bit much.

    #184796
    Alex Stine
    Participant

    Hello @robin-w,

    I still need to get this straight. Maybe something like this would work?

    /*Remove all topics from Amazon CloudSearch if topic is in a private forum*/
    /*Private Forums are added as an integration through a plugin*/
    /*Amazon CloudSearch is added as integration through a plugin*/
    function exclude_topics_in_private_forum() {
    $forum_id = bbp_get_forum_id();
    $query = bbp_has_topics( array( 'post_parent' => $forum_id) );
    foreach($query as $q) {
    if(is_private_forum($forum_id) ) {
    update_post_meta($q, 'exclude', 1);
    } elseif(!is_private_forum($forum_id) ) {
    delete_post_meta($q, 'exclude');
    }
    }
    }
    add_action('bbp_new_forum', 'exclude_topics_in_private_forum' );
    add_action('bbp_edit_forum', 'exclude_topics_in_private_forum' );

    It is important to note that I am using custom plugins to pull off a lot of the private forum abilities that way I can control user access better. I think the code snippet above will do it. Thoughts?

    Thanks.

    #184730

    In reply to: Nothing is displayed

    ZuGon
    Participant

    I changed the memory limit but it did not improve. I changed templates and limited plugins to basic plugins only. Still it will not improve.

    I enabled the debug mode and clicked the forum list, the following error was displayed.
    Fatal error: Uncaught Error: [] operator not supported for strings in /home/users/MY-WORDPRESS/wp-content/plugins/bbpress/includes/forums/functions.php:1800 Stack trace: #0 /home/users/MY-WORDPRESS/wp-includes/class-wp-hook.php(298): bbp_pre_get_posts_normalize_forum_visibility(Object(WP_Query)) #1 /home/users/MY-WORDPRESS/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array) #2 /home/users/MY-WORDPRESS/wp-includes/plugin.php(515): WP_Hook->do_action(Array) #3 /home/users/MY-WORDPRESS/wp-includes/class-wp-query.php(1681): do_action_ref_array('pre_get_posts', Array) #4 /home/users/MY-WORDPRESS/wp-includes/class-wp-query.php(3238): WP_Query->get_posts() #5 /home/users/MY-WORDPRESS/wp-includes/class-wp.php(617): WP_Query->query(Array) in /home/users/MY-WORDPRESS/wp-content/plugins/bbpress/includes/forums/functions.php on line 1800

    I am using PHP 7.1, is not bbPress compatible with this?

    #184729
    jwill207
    Participant

    anybody know the “reset my password” selector code that I can use to link a popup. I can’t seem to get it because the box disappears whenever I’m logged it.

    Thanks

    #184727
    jwill207
    Participant

    Anybody know a css code to move the remember me checkbox further to the right of the sidebar? It’s not lining up right on my page and it’s above the words “remember me”.

    Thanks

    #184725
    jwill207
    Participant

    the css code worked for the sidebar, minus the keep me logged in button. For the other issue I’ll have to see if it’s the theme because I tried bbp style pack and didn’t seem to help. Thank you

    #184724
    nicknabors
    Participant

    On my page that the forum index shortcode is set, I created it in Elementor. Once I save it and view my page, the forum page displays the forum but in a topic in the forum, the bbpress index shortcode is pasted again making a forum within a forum. I couldn’t figure out how to fix this forumception so I’m appealing here.

    #184723
    scottm-ldg
    Participant

    Hi,
    I’m new to bbPress, I have a forum that is set up, and I’d like to display the first 50 topics. I’ve successfully used the shortcode “bbp-topic-index” to display the first 15 topics, but I was wondering if there was a way to increase the number of topics?

    Thanks in advance for your help

    #184722

    In reply to: Nothing is displayed

    Robin W
    Moderator
    Robin W
    Moderator
    #184720
    Robin W
    Moderator

    may be theme rather than plugin related, but try

    bbp style pack

    to do styling

    can’t see the forum (get no topics), but you can fix the sidebar with

    #sidebar .bbp-login-form label {
      width: 100%;
    }

    you can put this into the custom css part of your theme or in the custom css of the plugin above

    #184715
    UserCentrix
    Participant

    I am trying to integrate BBPress into a site created with Toolset – Layouts, Types and Views.

    The following BBPress shortcodes require an ID parameter:

    [bbp-single-forum id=$forum_id]
    [bbp-topic-form forum_id=$forum_id]
    [bbp-single-topic id=$topic_id]
    [bbp-single-reply id=$reply_id]

    Each of the IDs required above are aliases for the post_id, which Toolset privides a shortcode for. In order to get the templates to work for layouts applied to single Forums, Topics and Replies I need to include the current post ID. The simplest way I can imagine to do this would be as follows?

    [bbp-single-forum id='[wpv-post-id]’]
    [bbp-topic-form forum_id='[wpv-post-id]’]
    [bbp-single-topic id='[wpv-post-id]’]
    [bbp-single-reply id='[wpv-post-id]’]

    Unfortunately I get the following output at the front end?

    ‘]

    This makes clear to me that nested shortcodes are not supported in the BBPress. Is there a straightforward way of extending this functionality, perhaps through the functions.php file? This would create full compatibility with BBPress and Toolset. I couldn’t find any solutions to this shared on this support forum but it seems to me as something that may be a common problem and could have been tackled before.

    I hope you can assist.

    #184714
    lalitavalon
    Participant

    Hello,

    There are multiple topics under a forum. I want recent replies of such topics that are under a specific forum. Short code is available fr recent topics that gets the result from all over the topics that is x forum, or in Y forum.

    But I want the recent replies from all topics that are under X forum.

    Please suggest some solution for the same.

    #184713
    lalitavalon
    Participant

    please reply if short code not possible please let me know any alternative for the same. On other page I can give the forum id dynamically and get all related topics with related to that forum.
    Please respond as soon as possible.

    I am waiting for your reply.

    #184711
    lalitavalon
    Participant

    I am looking for a shortcode or code (so I can make my own shortcode) to add the latest x topics from a specific forum. Like the recent topic widgets does. But in this case I can’t use the widget – so I am looking for a code to get the output of that widget somewhere in the text. I hope that is possible. I looked at the shortcodes on the website, but none of them is useful in my case.
    It needs to say show x recent topics of forum with ID=… and then only give the titles with link

    #184708

    Topic: HTML in text

    in forum Troubleshooting
    BenM
    Participant

    Hi,

    Always the same problem, no solution. I tried all sort of things but nothing works.

    I always have HTML code in message :

    C’est juste la combinaison des articles du CPC…
    <p style= »text-align: center; »>Article 771 CPC</p>
    Lorsque la demande est présentée postérieurement à sa désignatio

    Any idea, any clue ?

    imanicogic
    Participant

    Hello Support,

    http://www.imanicogic.com
    Wordpress Version:4.7.5
    BBPress Version: 2.5.12

    This was tried on other themes and our WordPress Developer encouraged us to submit this to you.
    ==========================
    We are trying to redirect Members, Groups, and Activity pages to a custom URL. We are using the following code:

    function church_bp_page_template_redirect()
    {

    if( ! is_user_logged_in() && ! bp_is_activation_page() && ! bp_is_register_page() && (bp_is_current_component(‘members’) bp_is_current_component(‘activity’) bp_is_current_component(‘groups’))) {
    wp_redirect( ‘/imani-secured-login/’ );
    exit();
    }
    }

    add_action( ‘template_redirect’, ‘church_bp_page_template_redirect’,10 );

    However, when BBPress is active, this will not work and will always redirecting to Homepage but if BBPress is activated, the custom code will work perfectly.

    Can you please check if there are any conflicts with Buddypress and BBPress in regards to template_redirect?

    Thanks!

    #184680
    Robin W
    Moderator

    ok, so this is a search function – yes?

    If so, look at this code that I use with my private groups plugin to filter search results and see if you can make this work for you

    //this function filters to the bbp search function to allow only returns from allowed forums
    
    function pg_has_search_results( $args = '' ) {
    	
    	global $wp_rewrite;
    //start with code as per bbp search !
    	/** Defaults **************************************************************/
    
    	$default_post_type = array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() );
    
    	// Default query args
    	$default = array(
    		'post_type'           => $default_post_type,         // Forums, topics, and replies
    		'posts_per_page'      => bbp_get_replies_per_page(), // This many
    		'paged'               => bbp_get_paged(),            // On this page
    		'orderby'             => 'date',                     // Sorted by date
    		'order'               => 'DESC',                     // Most recent first
    		'ignore_sticky_posts' => true,                       // Stickies not supported
    		's'                   => bbp_get_search_terms(),     // This is a search
    	);
    
    	// What are the default allowed statuses (based on user caps)
    	if ( bbp_get_view_all() ) {
    
    		// Default view=all statuses
    		$post_statuses = array(
    			bbp_get_public_status_id(),
    			bbp_get_closed_status_id(),
    			bbp_get_spam_status_id(),
    			bbp_get_trash_status_id()
    		);
    
    		// Add support for private status
    		if ( current_user_can( 'read_private_topics' ) ) {
    			$post_statuses[] = bbp_get_private_status_id();
    		}
    
    		// Join post statuses together
    		$default['post_status'] = implode( ',', $post_statuses );
    
    	// Lean on the 'perm' query var value of 'readable' to provide statuses
    	} else {
    		$default['perm'] = 'readable';
    	}
    	
    	//PRIVATE GROUPS then loop to find allowable results
    	//bail from this part if there are no search terms, as otherwise it sorts the whole database and overflows memory
    	if (! bbp_get_search_terms() == '' ) {
    	//change page default to allow filter against all search results - otherwise allowed posts is only the first page of results ie whatever is in  bbp_get_replies_per_page()
    	$default['posts_per_page'] = -1;
    	$allowed_posts = private_groups_get_permitted_post_ids(new WP_Query( $default ));
    	// Then add allowed forum ids to the default query 
        $default['post__in'] = $allowed_posts;
    	if (empty ($allowed_posts )) $default['post__in'] = array(0) ;
    	//then set per page back (so that we get the correct pagination )
    	$default['posts_per_page'] = bbp_get_replies_per_page();
    	
    	}
    	
    	
    	
    	//then return to bbp search code
    	
    	/** Setup *****************************************************************/
    
    	// Parse arguments against default values
    	$r = bbp_parse_args( $args, $default, 'has_search_results' );
    
    	// Get bbPress
    	$bbp = bbpress();
    
    	// Call the query
    	if ( ! empty( $r['s'] ) ) {
    		$bbp->search_query = new WP_Query( $r );
    	}
    
    	// Add pagination values to query object
    	$bbp->search_query->posts_per_page = $r['posts_per_page'];
    	$bbp->search_query->paged          = $r['paged'];
    
    	// Never home, regardless of what parse_query says
    	$bbp->search_query->is_home        = false;
    
    	// Only add pagination is query returned results
    	if ( ! empty( $bbp->search_query->found_posts ) && ! empty( $bbp->search_query->posts_per_page ) ) {
    
    		// Array of arguments to add after pagination links
    		$add_args = array();
    
    		// If pretty permalinks are enabled, make our pagination pretty
    		if ( $wp_rewrite->using_permalinks() ) {
    
    			// Shortcode territory
    			if ( is_page() || is_single() ) {
    				$base = trailingslashit( get_permalink() );
    
    			// Default search location
    			} else {
    				$base = trailingslashit( bbp_get_search_results_url() );
    			}
    
    			// Add pagination base
    			$base = $base . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' );
    
    		// Unpretty permalinks
    		} else {
    			$base = add_query_arg( 'paged', '%#%' );
    		}
    
    		// Add args
    		if ( bbp_get_view_all() ) {
    			$add_args['view'] = 'all';
    		}
    
    		// Add pagination to query object
    		$bbp->search_query->pagination_links = paginate_links(
    			apply_filters( 'bbp_search_results_pagination', array(
    				'base'      => $base,
    				'format'    => '',
    				'total'     => ceil( (int) $bbp->search_query->found_posts / (int) $r['posts_per_page'] ),
    				'current'   => (int) $bbp->search_query->paged,
    				'prev_text' => is_rtl() ? '&rarr;' : '&larr;',
    				'next_text' => is_rtl() ? '&larr;' : '&rarr;',
    				'mid_size'  => 1,
    				'add_args'  => $add_args, 
    			) )
    		);
    
    		// Remove first page from pagination
    		if ( $wp_rewrite->using_permalinks() ) {
    			$bbp->search_query->pagination_links = str_replace( $wp_rewrite->pagination_base . '/1/', '', $bbp->search_query->pagination_links );
    		} else {
    			$bbp->search_query->pagination_links = str_replace( '&paged=1', '', $bbp->search_query->pagination_links );
    		}
    	}
    	//finally filter to return
    	// Return object
    	return apply_filters( 'pg_has_search_results', $bbp->search_query->have_posts(), $bbp->search_query );
    }
    
    add_filter ('bbp_has_search_results', 'pg_has_search_results') ; 
    #184674
    Alex Stine
    Participant

    Hello @robin-w,

    I’m not using a default bbPress function to hide the topics. I’m using a custom plugin to handle the hiding of topics so members who are participants have a choice if they want the topic to be public to all members or private to moderators and keymasters. As you can see with the code above, that excludes the custom private topics from search results. Now what I need to do is update the pagination counts.

    For example, there’s a topic named “Testing” and another topic named “test123”. Pagination will show 2 topics. If “testing” is now marked private, pagination will show 2 topics. I need to figure out a way to update the pagination so it only shows 1 topic since that’s all is showing to participants. However if a moderator comes along with the required permission to view a private topic, the pagination should still show 2 topics since the moderator has permission to see the private topic.

    I hope this helps explain my goal.

    Thanks.

    #184671
    Robin W
    Moderator

    Is there anyway I can get a list of topic IDs inside a forum ID?

    sorry missed this first time round.

    you’ll want bbp_has_topics which you’ll find in

    \includes\topics\template.php

    line 140

    function bbp_has_topics( $args = '' )

    you can call it with a forum id eg

    <?php $query = bbp_has_topics( array( 'post_parent' => '2579') ); ?>

    this will return an array of topics from forum ID 2579 which you can then work with

    #184665
    Alex Stine
    Participant

    Hello,

    Any ideas? Maybe something like this?

    <?php echo bbp_get_forum_id(bbp_get_topic_id()); ?>

    Thanks.

    #184651
    Stephen Edgar
    Keymaster

    You shouldn’t need to do any of the above, setting your WordPress install to use German as the default language should automatically download bbPress’ translations.

    p.s. If you’re using the method above for a different reason, uploading them to wp-content/languages/bbpress instead of wp-content/languages/buddypress would be the answer 😉

    #184628
    Stephen Edgar
    Keymaster

    If a user with a username myname already exists then that user will be imported as imported_myname so that data is not overwritten.

    When you go to the users wp-admin dashboard if you select to delete a user when you select the imported_myname to delete you will be prompted to attribute the content to another user, you can then select the myname user and everything will be sorted, hopefully 🙂

    You’ll want to check and verify both before and after that the correct topics and replies are attributed to the correct users bother before and after doing the above.

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