Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,151 through 5,175 (of 32,505 total)
  • Author
    Search Results
  • #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.

    #184610
    Robin W
    Moderator
    #184609
    mapofemergence
    Participant

    @tkserver please do keep me/us posted about your progress.

    I’m not familiar with Angular JS, at all, but I’ve invested quite some thoughts on the frontend too; my implementation is a basic and quite old-school combo of PHP and AJAX jQuery but, still, that doesn’t mean I’m not aiming at a smart and fresh UX 🙂

    I’m very interested in hearing other people’s thoughts, both with regards to usage philosophy and in terms of code implementation. I firmly believe that’s the best (possibly the only) way to make the right choices, early in the development, for the backend to be generalized and robust enough to serve everybody’s requirements.

    #184608
    ilovemetrics
    Participant

    Hi,

    Thanks for the response. I’m not following how this would solve the problem, though. From what I can see of that filter, I need to pass in the topic title into this function, but I can’t get the topic title in functions.php early enough.

    Here’s the function (in functions.php) I’ve created to modify the title in other ways needed (replace “Forum” with “Investment Groups” and replace mdash; with a hyphen as the main separator). This is where I’d want to incorporate the logic:

    function theme_mod_title() {
        	add_filter('document_title_separator', function() {
            	return '$%';
        	});
        	remove_filter('pre_get_document_title', 'theme_mod_title');
        	$find = array(
    			'/ \$% /', 
    			'/^Forums/'
    		);
        	$replace = array(
    			' - ', 
    			'Investment Groups'
    		);
        	$title = wp_get_document_title();
    
    	// filter the title    
        	$ftitle = preg_replace($find, $replace, $title);
    
            NOT SURE HOW TO ACCOMPLISH THIS, BUT LOGIC NEEDED IS
    	//if (on bbpress topic page){
    		$ftitle = bbpress topic title . ' - ' . $ftitle;
    	//}
    
    	return $ftitle;
    }
    add_filter('pre_get_document_title', 'theme_mod_title');

    The bbPress part is where I’m stuck. I’m not sure how to actually get the topic title early enough to pass it into the document title. This seems to be the only place I can actually set any new meta title tag logic, but I can’t tap into anything bbPress this early in the process.

    Thanks again

    #184607
    Stephen Edgar
    Keymaster

    Have you seen bbp_new_topic_pre_title() in includes/topics/functions.php ?

    (There’s also bbp_new_forum_pre_title() in includes/forums/functions.php)

    #184605
    scrawny
    Participant

    Same problem.

    Site is running certified SSL and have had no issues with other plugins or wordpress itself.

    Running PHP 7.1, latest version of bbPress

    Problem exists in Firefox and Opera. Don’t use IE or Chrome.

    Site is closed to public while in developement. Doesn’t seem to stop people accessing forum.

    When clicking on Forums in Dashboard the url result is

    https://mysimpleknitting.com/wp-admin/edit.php?post_type=forum

    Message on page is:

    The mysimpleknitting.com page isn’t working

    mysimpleknitting.com.com is currently unable to handle this request.

    When I attempt to access forums from url directly:

    When I type in https://mysimpleknitting.com/forums/

    The result is the same error.

    Clicking on Forums in the Settngs brings up the proper bbPress page.

    #184600
    Robin W
    Moderator

    ok, you need to get this code into your site.

    @media screen and (max-width: 400px) {
    .list-view .site-content .cat-links, .list-view .site-content .entry-content, .list-view .site-content .entry-summary, .list-view .site-content footer.entry-meta {
        display: initial !important;
    }
    
    }

    There are many ways to do this.

    If you theme has a custom css area, you can put it in there

    Otherwise you can look for a css plugin and add that

    or you could install and activate my style pack plugin

    bbp style pack

    and go to

    dashboard>settings>bbp style pack>custom css and put the code in there

    #184589
    Robin W
    Moderator

    line 2930 of your custom css file changes this for


    @media
    screen and (max-width: 400px)

    using

    .list-view .site-content .cat-links, .list-view .site-content .entry-content, .list-view .site-content .entry-summary, .list-view .site-content footer.entry-meta {
        display: none;
    }

    you need to add some custom css for instance

    @media screen and (max-width: 400px) {
    .list-view .site-content .cat-links, .list-view .site-content .entry-content, .list-view .site-content .entry-summary, .list-view .site-content footer.entry-meta {
        display: initial !important;
    }
    
    }
    #184550

    In reply to: Forum width

    Robin W
    Moderator

    ok that’s firmly theme related, but I’ll give you a starter and let you play

    Put this in your theme’s custom css area, presuming it has one

    .section-inner {
      width: 1200px;
    }
    
    .content {
      width: 65%;
    }
    
    .sidebar {
      width: 27.5%;
    }

    and then just play with the numbers to get what you want

    #184543
    core12dev
    Participant

    One of the first things I attempted. Renaming does the same as “deactivating” the plugin. There are no other bbPress related plugins.

    It is acting like a script issue where the Admin functions aren’t finding the proper variables. But I’m not a pro coder… just a logic guy.

    #184528
    mapofemergence
    Participant

    Hi @TKServer, I’m glad you revamped this topic.
    Although since my last post I didn’t work further on the code, I’m still very much interested in the discussion.
    Originally, I was going in the same direction that you just suggested but, ultimately, I thought that a separate API would be desirable for a variety of reasons.

    I can name the ones I thought of, but I’m sure others might have even stronger (and more educated) motivations:

    • the most general and obvious: a separate API makes you less dependant on certain builtin constraints of WP API and let you take design decision which are more tightly connected with bbPress specifically; even though bbPress leverages WP’s custom post types and tags, there’s a higher layer of abtraction (read: forum functionality) which implies a whole set of requests for which the existing endpoints’ structure is not ideal
    • depending on what info you want to get with a single request, the default WP API queries might not serve the scope well (ie. they could force the user to make multiple queries where just one would be desirable and sufficient; also, where multiple database calls are required, it might not provide those in the best performing way)
    • from a user standpoint, I believe it is better to offer schemas (and filters) which reflect more the semantics of a forum, than the ones of a blog; I believe you can still build those custom terms in the existing API, but it might become confusing soon, and in my opinion you’d loose the advantage of staying with a single API, anyway
    • additionally (and actually the main reason for me personally), I see bbPress as part of an ecosystem, with WP and BuddyPress. Since BuddyPress already went for a separate API, I thought it would make sense to do the same with bbPress, keeping things clean and separate. Utlimately, the ideal would be to have the bbPress API live with the bbPress plugin itself, so that the development of the two can progress together (and therefore be more efficient and optimised, both ways)
    • finally, speaking of bbPress BuddyPress, there’s an area where the two plugins overlap (bb forums in BP groups); I believe it is already a non-trivial problem to solve in a separate API and it would likely be even more complicated to try and stay within the WP limits; I was mentioning this in another post too, which I believe is still awaiting approval from moderators (please pardon me if I dare poking them here, once more) 🙂

    Again, this is just my opinion; there are probably pros and cons in both options and I’d be more than happy to hear from anyone who’s more bbPress-savvy than I am.

    Cheers,
    s t e

    #184475
    srjmukherjee2
    Participant

    No it didn’t work.
    More Information :
    My htaccess looks like this : (Do I need to make any changes here?)

    php_value max_execution_time 500
    php_value upload_max_filesize 64M
    php_value post_max_size 80M
    php_value memory_limit 128M
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterPost Off
    </IfModule>

    And in my bbpress forum user settings the forum root is set to
    <b>forums</b>

    #184440
    Robin W
    Moderator

    happy to do this one last one

    .post-content table, .comment-content table {
      clear: none;
      max-width: 70%;
    }
    #184434
    wci
    Participant

    Hi support team,

    I was trying to use your translatetion instructions but unfortunately it has not worked on my case.

    1. I downloaded files mo./po. (Go to https://translate.wordpress.org/projects/wp-plugins/bbpress)
    2. renamed them accordingly “bbpress-de_DE”
    3. uploaded to my server folder “wp-content/languages/buddypress”

    But still are not working. Any ideas?
    Screen shot – https://www.screencast.com/t/Ke8sEFj5

    Looking forward to your help.

    BR, Alex

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