Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 7,926 through 7,950 (of 32,522 total)
  • Author
    Search Results
  • #166464
    timsilva_
    Participant

    I am migrating a forum database from the latest version of SMF to the latest version of bbPress. In SMF, many posts had multiple line-breaks in between sentences, paragraphs, images, videos, etc. It appears that WordPress, and bbPress, strip out multiple line breaks and limit them to a single line break (probably to prevent people from creating giant vertical gaps for no reason that other users have to scroll through). The way that bbPress deals with line-breaks from the SMF database migration was not very clean. It was mostly just random blocks of text and sentences without line breaks in between paragraphs that existed in SMF. There were PRE tags added in sometimes, and seemingly inconsistent P tags as well. BR tags appear to have been converted into empty TT tags. I was able to correct some of these formatting issues by tweaking lots of CSS (and a little JavaScript) in the default bbPress template. At the same time, I have also tested how line-breaks work separate from the migrated database and it appears that this maximum-of-one-line-break philosophy is on purpose. I see where that’s coming from, but I want to allow it anyways.

    I have read of methods where admins (and/or other users) can manually type in br tags as html with non-breaking spaces in between them as a hacky method of moving down three or four lines for whatever reason. I don’t want to have to train users how to do something that should be as simple as press enter like in any text editor.

    How can I simply achieve this in bbPress’s default comment forms? I don’t want users to have to type in…

    <br />&nbsp<br />

    …when they can simply just press enter twice in the textarea input.

    #166454
    Léo
    Participant

    I noticed something interesting, there is no problem when I log out using the BuddyPress widget.

    Do you have a multisite installation?
    No.

    Is WordPress installed in a sub-folder?
    No.

    What is the url you get when you try to logout?
    With the WordPress toolbar: http://original-beast.revhost.fr/wp-login.php?action=logout&_wpnonce=323d408059&redirect_to=http%3A%2F%2Foriginal-beast.revhost.fr%2F%3Floggedout%3Dtrue
    With the BuddyPress widget: http://original-beast.revhost.fr/wp-login.php?action=logout&redirect_to=http%3A%2F%2Foriginal-beast.revhost.fr%2F&_wpnonce=323d408059

    What areas did you try to logout from? The WordPress Toolbar, bbPress login widget, something else?
    WordPress toolbar.

    Did this issue occur when you immediately activated bbPress? Or did the issue occur after a certain upgrade?
    Only when bbPress is activated.

    Did you have any cache plugins activated? Have you tried flushing the cache? If it is deactivated reactivate the plugin and flush the cache.
    I don’t have any cache plugin.

    Anything that can cache activated on your site, server cache, cloudflare, object cache, opcode caching?
    I don’t have that.

    What hosting provider do you have?
    Revolta Hosting

    #166457

    In reply to: forum link in admin

    Robkk
    Moderator

    Try as much of the basic troubleshooting steps as you can, also try some of the additional solutions listed.

    Some users have a plugin issue with this, while others it may be a theme, or it could be resolved using the repair tools.

    THere is a guide linked in here about fixing some possible 404 errors too.

    Troubleshooting

    #166451
    Robkk
    Moderator

    Yes, it is PHP code mostly so that would go into a child themes functions.php file or into a plugin that can hold code snippets like functionality.

    For any CSS listed you put that into your child themes style.css file or any other custom css plugin you may have.

    Robkk
    Moderator

    The widget doesn’t really work by days. It displayed the recently published topics by default. If a topic is published twenty days ago and none were published until one was five minutes ago, those two topics are next to each other in the widget listing.

    You can change it to display topics that have been posted last though.

    To style the widget you can use the class .widget_display_topics

    THen you could do something like this.

    .widget_display_topics 
    .widget_display_topics li
    .widget_display_topics a

    or add whatever additional classes are in the source code.

    #166448
    AilyRoot
    Participant

    Hi

    which file shall I add those codex so future upgrade won;t cause any issues

    theme’s functions.php file?

    #166445
    Robkk
    Moderator

    Toward the bottom of #24 it mentions that icon fonts can work too.

    Layout and functionality – Examples you can use

    #166444
    Robkk
    Moderator

    Not my forum.

    I think your theme author pretty much just took this and fused it with their theme.

    https://github.com/syamilmj/Supportte

    This theme (supportte) is really intended to be used as a theme for Envato authors that want a support forum also for their product.

    The verification dialogue is there because the Aqua Verifier plugin is required for some instances of your bbPress forums. The plugin is to restrict access to only users who bought a product from you (best if you are an Envato theme author) and they need to input the purchase code of the product they purchased (from Envato) to have access to the forums.

    https://github.com/syamilmj/Aqua-Verifier

    There is no setting in bbPress that can modify this like I said, it is all in your theme and the Aqua Verifier plugin is required.

    Link your theme author to this topic if you need to.

    #166442

    In reply to: Moderation words

    Stefano Lissa
    Participant

    Hi, I’m unsing that patch in a couple of sites, and it seems to work. Where do you think there is a problem? In my blogs I’ve just added a filter which replaces the moderation key used by bbpress (the variable $blacklist in the code which initially contains the moderation keys of WordPress).

    Bye, Stefano.

    #166403
    Shmoo
    Participant

    Yes great find, thank you Robkk,

    Now you can also do this, ..and make the pagination an unordered list like it should be by the default. 🙂

    
    function ntwb_bbpress_custom_pagination( $args ) {
    
    	$args['type'] = 'list';
    	$args['prev_text'] = 'previous';
    	$args['next_text'] = 'next';
    
    	return $args;
    
    }
    add_filter( 'bbp_topic_pagination', 'ntwb_bbpress_custom_pagination' );
    

    WP Codex: all those args should probably work now.
    https://codex.wordpress.org/Function_Reference/paginate_links

    #166400
    demonboy
    Participant

    Wait, scrap that. I’d copied the code from the email alert, not the forum. Guess it picked up incorrect syntax this way. Copied from the forum and it works a treat.

    Thank you!

    #166399
    demonboy
    Participant

    Hi Rob,

    Thanks for this. Unfortunately if I add this to my functions.php Dreamweaver tells me there is a syntax error on lines 21 to 22 (which is the second and third lines in your code), and I don’t know php well enough to work out what’s wrong. My complete functions.php file, with your code, is this:

    <?php 
    
    add_action( 'wp_enqueue_scripts', 'load_dashicons_front_end' );
    function load_dashicons_front_end() {
    wp_enqueue_style( 'dashicons' );
    }
    
    function bp_keep_user_private( $user_login, $user ) {
    
    	global $wpdb;
    
    	if( 'demo' === $user->user_login ) {
    
    		$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->users SET user_status = 2 WHERE ID = %d", $user->ID ) );
    	}
    
    }
    add_action( 'wp_login', 'bp_keep_user_private', 10, 2 );
    
    add_filter('bbp_before_list_forums_parse_args', 'ntwb_bbpress_list_forums' );
    function ntwb_bbpress_list_forums() {
    	$args['show_topic_count'] = false;
    	$args['show_reply_count'] = false;
    	return $args;
    }
    #166395
    Robkk
    Moderator

    I think this should do it. If it does not change the word before in the filter to after.

    add_filter('bbp_before_list_forums_parse_args', 'ntwb_bbpress_list_forums' );
    function ntwb_bbpress_list_forums() {
    	$args['show_topic_count'] = false;
    	$args['show_reply_count'] = false;
    	return $args;
    }
    #166393
    Shmoo
    Participant

    This is strange..

    Why is my filter not working. When I look at my screenshot you can see that this array has an apply_filter() function before the variable/array goes through the paginate_links().
    This filter I should use, I expect if I want to make any changes to the array before it gets pulled into the paginate_links() function – right?

    topic forum pagination bbPress

    So I created this add_filter function to test if I can change the <– arrow –> symbols. But for some reason no success at all.

    
    function xx_my_stuff( $bbp_topic_pagination ) {
    
    	$bbp_topic_pagination = array(
    		'prev_text' => 'test',
    		'next_text' => 'test',
    	);
    	return $bbp_topic_pagination;
    
    }
    add_filter( 'bbp_topic_pagination', 'xx_my_stuff' );
    
    #166385
    Robkk
    Moderator

    use this code for a bbpress.php file if you already created one. It is basically the full width template already in your theme. .

    Getting Started in Modifying the Main bbPress Template

    <?php
    /**
     * The main template file for bbPress.
     *
     * @package Quark
     * @since Quark 1.0
     */
    
    get_header(); ?>
    
    	<div id="primary" class="site-content row" role="main">
    		<div class="col grid_12_of_12">
    
    			<?php if ( have_posts() ) : ?>
    
    				<?php while ( have_posts() ) : the_post(); ?>
    					<?php get_template_part( 'content', 'page' ); ?>
    					<?php comments_template( '', true ); ?>
    				<?php endwhile; // end of the loop. ?>
    
    			<?php endif; // end have_posts() check ?>
    
    		</div> <!-- /.col.grid_12_of_12 -->
    	</div><!-- /#primary.site-content.row -->
    
    <?php get_footer(); ?>
    #166381
    geog272
    Participant

    Thanks so much for responding and providing this code. It doesn’t quite do it in my case, as it allows users to choose to post to categories as well as forums, and I’d like to force them to choose a forum.

    #166369
    Robkk
    Moderator

    Yes, there is a filter.

    function bbp_get_forum_post_type_supports() {
    	return apply_filters( 'bbp_get_forum_post_type_supports', array(
    		'title',
    		'editor',
    		'revisions'
    	) );
    }
    #166365
    Robkk
    Moderator

    @themk850

    sorry for the late reply, but try this.

    add_filter('bbp_after_list_forums_parse_args', 'ntwb_bbpress_list_forums' );
    function ntwb_bbpress_list_forums() {
    	$args['separator']        = '';
    	return $args;
    }

    or I guess instead of using my CSS and the above function just use this instead.

    add_filter('bbp_after_list_forums_parse_args', 'ntwb_bbpress_list_forums' );
    function ntwb_bbpress_list_forums() {
    	$args['separator']        = '</br>';
    	return $args;
    }
    #166364
    Robkk
    Moderator

    Try this.

    add_filter('bbp_after_list_forums_parse_args', 'ntwb_bbpress_list_forums' );
    function ntwb_bbpress_list_forums() {
    	$args['separator']        = '';
    	return $args;
    }

    Don’t mess with template files.

    Robkk
    Moderator

    You can copy form-forum.php from the bbPress plugin templates into a folder called bbpress in your child theme and remove 'show_none' => __( '(No Parent)', 'bbpress' ), so that they have to choose a parent forum.

    Look for this in the file.

    <p>
    	<label for="bbp_forum_parent_id"><?php _e( 'Parent Forum:', 'bbpress' ); ?></label><br />
    
    		<?php
    			bbp_dropdown( array(
    				'select_id' => 'bbp_forum_parent_id',
    				'show_none' => __( '(No Parent)', 'bbpress' ),
    				'selected'  => bbp_get_form_forum_parent(),
    				'exclude'   => bbp_get_forum_id()
    			) );
    		?>
    </p>

    End up with something like this.

    <p>
    	<label for="bbp_forum_parent_id"><?php _e( 'Parent Forum:', 'bbpress' ); ?></label><br />
    
    		<?php
    			bbp_dropdown( array(
    				'select_id' => 'bbp_forum_parent_id',
    				'selected'  => bbp_get_form_forum_parent(),
    				'exclude'   => bbp_get_forum_id()
    			) );
    		?>
    </p>
    #166360
    Robkk
    Moderator

    See if this plugin helps/still works.

    bbp additional shortcodes

    Also Robin’s other plugin might have the same functionality somewhere in it.

    https://wordpress.org/plugins/bbp-style-pack/

    #166357
    Robkk
    Moderator

    I am just saying the auto suggest topics plugin’s script might make it into core if it was in forum search and extend that, then it could also be use for the new topic title too. It is just the way I see it.

    1. oembed in bbPress basically uses that same filter, but for each of the topics and replies content. The filter is just wrapped in a conditional if you did enable oembeds in bbPress.

    Here is the code for replies that is in the bbPress core.

    function bbp_reply_content_autoembed() {
    	global $wp_embed;
    	if ( bbp_use_autoembed() && is_a( $wp_embed, 'WP_Embed' ) ) {
    		add_filter( 'bbp_get_reply_content', array( $wp_embed, 'autoembed' ), 2 );
    	}
    }

    Maybe removing the shortcode helps, but I will keep an eye on that.

    I do not think the description needs that much of a drastic change. Because it might matter more to know the last who posted, when was the last post, how many users are in the topic, and how many posts, and also this information is pretty handy for regular forum users to know about. Plus bbpress has a way to see pending/spam replies in a topic by clicking the hidden posts link in the description.

    There needs to be information that tells google that this is a forum, and not a blog post for example.

    Published date is almost always going to get picked up by google.

    There might be other areas to add schematic microdata like what is listed in this.

    http://schema.org/DiscussionForumPosting

    The data might also be best to place around the actual post.

    #166355

    In reply to: Remove alert info

    Robkk
    Moderator

    Since I don’t want you to remove all the notices with CSS that have the bbp-template-notice class. Copy the form-topic.php and form-reply.php templates into a folder called bbpress in your child theme and look for something like this code below, then remove it.

    <?php if ( current_user_can( 'unfiltered_html' ) ) : ?>
    
    	<div class="bbp-template-notice">
    		<p><?php _e( 'Your account has the ability to post unrestricted HTML content.', 'bbpress' ); ?></p>
    	</div>
    
    <?php endif; ?>
    #166353
    Robkk
    Moderator

    @geog272

    For having a forum show up instead of the (No Forum), copy form-topic.php in your child theme.

    In the code toward line 109 you would see something like this.

    <?php if ( !bbp_is_single_forum() ) : ?>
    
     <?php do_action( 'bbp_theme_before_topic_form_forum' ); ?>
    
    	<p>
    		<label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
    			<?php
    				bbp_dropdown( array(
    				'show_none' => __( '(No Forum)', 'bbpress' ),
    				'selected'  => bbp_get_form_topic_forum()
    				) );
    			?>
    	</p>
    
    <?php do_action( 'bbp_theme_after_topic_form_forum' ); ?>
    
    <?php endif; ?>

    Remove 'show_none' => __( '(No Forum)', 'bbpress' ), so it would look like this.

    <?php if ( !bbp_is_single_forum() ) : ?>
    
     <?php do_action( 'bbp_theme_before_topic_form_forum' ); ?>
    
    	<p>
    		<label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
    			<?php
    				bbp_dropdown( array(
    				'selected'  => bbp_get_form_topic_forum()
    				) );
    			?>
    	</p>
    
    <?php do_action( 'bbp_theme_after_topic_form_forum' ); ?>
    
    <?php endif; ?>
    #166352
    Robkk
    Moderator

    For having a forum show up instead of the (No Forum), copy form-topic.php in your child theme.

    In the code toward line 109 you would see something like this.

    <?php if ( !bbp_is_single_forum() ) : ?>
    
     <?php do_action( 'bbp_theme_before_topic_form_forum' ); ?>
    
    	<p>
    		<label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
    			<?php
    				bbp_dropdown( array(
    				'show_none' => __( '(No Forum)', 'bbpress' ),
    				'selected'  => bbp_get_form_topic_forum()
    				) );
    			?>
    	</p>
    
    <?php do_action( 'bbp_theme_after_topic_form_forum' ); ?>
    
    <?php endif; ?>

    Remove 'show_none' => __( '(No Forum)', 'bbpress' ), so it would look like this.

    <?php if ( !bbp_is_single_forum() ) : ?>
    
     <?php do_action( 'bbp_theme_before_topic_form_forum' ); ?>
    
    	<p>
    		<label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
    			<?php
    				bbp_dropdown( array(
    				'selected'  => bbp_get_form_topic_forum()
    				) );
    			?>
    	</p>
    
    <?php do_action( 'bbp_theme_after_topic_form_forum' ); ?>
    
    <?php endif; ?>

    The default forum shown is whatever is first in the forum index page. It either is sorted by publish date first or the forum ordered first if you manually changed the forum order by editing the forum.

Viewing 25 results - 7,926 through 7,950 (of 32,522 total)
Skip to toolbar