Search Results for 'code'
-
AuthorSearch Results
-
September 8, 2015 at 7:38 pm #166464
Topic: Allowing multiple line breaks in posts?
in forum Troubleshootingtimsilva_
ParticipantI 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 /> <br />…when they can simply just press enter twice in the textarea input.
September 8, 2015 at 1:10 pm #166454In reply to: Can’t logout from WordPress
Léo
ParticipantI 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=323d408059What 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 HostingSeptember 8, 2015 at 12:37 pm #166457In reply to: forum link in admin
Robkk
ModeratorTry 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.
September 8, 2015 at 11:04 am #166451In reply to: small icon for sticky post and others
Robkk
ModeratorYes, 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.
September 8, 2015 at 11:02 am #166450Robkk
ModeratorThe 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_topicsTHen you could do something like this.
.widget_display_topics .widget_display_topics li .widget_display_topics aor add whatever additional classes are in the source code.
September 8, 2015 at 10:55 am #166448In reply to: small icon for sticky post and others
AilyRoot
ParticipantHi
which file shall I add those codex so future upgrade won;t cause any issues
theme’s functions.php file?
September 8, 2015 at 10:46 am #166445In reply to: small icon for sticky post and others
Robkk
ModeratorToward the bottom of #24 it mentions that icon fonts can work too.
September 8, 2015 at 10:43 am #166444In reply to: Allow guest to view forum
Robkk
ModeratorNot 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.
September 8, 2015 at 10:23 am #166442In reply to: Moderation words
Stefano Lissa
ParticipantHi, 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.
September 8, 2015 at 7:11 am #166403In reply to: bbp_forum_pagination_links – alter the output?
Shmoo
ParticipantYes 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_linksSeptember 8, 2015 at 3:16 am #166400In reply to: How do I remove the (0,0)
demonboy
ParticipantWait, 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!
September 8, 2015 at 3:13 am #166399In reply to: How do I remove the (0,0)
demonboy
ParticipantHi 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; }September 7, 2015 at 8:43 pm #166395In reply to: How do I remove the (0,0)
Robkk
ModeratorI 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; }September 7, 2015 at 7:50 pm #166393In reply to: bbp_forum_pagination_links – alter the output?
Shmoo
ParticipantThis 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?
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' );September 7, 2015 at 11:35 am #166385In reply to: full-width-forum Quark theme
Robkk
Moderatoruse this code for a bbpress.php file if you already created one. It is basically the full width template already in your theme. .
<?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(); ?>September 7, 2015 at 9:29 am #166381In reply to: plugin Button to create new topic
geog272
ParticipantThanks 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.
September 7, 2015 at 4:07 am #166369Robkk
ModeratorYes, there is a filter.
function bbp_get_forum_post_type_supports() { return apply_filters( 'bbp_get_forum_post_type_supports', array( 'title', 'editor', 'revisions' ) ); }September 7, 2015 at 4:03 am #166365In reply to: Display forum as list not working
Robkk
Moderatorsorry 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; }September 7, 2015 at 4:01 am #166364In reply to: Remove comma’s from forum index
Robkk
ModeratorTry 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.
September 7, 2015 at 3:39 am #166363Robkk
ModeratorYou 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>September 7, 2015 at 3:26 am #166360In reply to: Help with Single Forum Shortcode
Robkk
ModeratorSee if this plugin helps/still works.
Also Robin’s other plugin might have the same functionality somewhere in it.
September 7, 2015 at 3:03 am #166357In reply to: My Ideas and Suggestions for BBPress
Robkk
ModeratorI 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.
September 7, 2015 at 1:46 am #166355In reply to: Remove alert info
Robkk
ModeratorSince I don’t want you to remove all the notices with CSS that have the bbp-template-notice class. Copy the
form-topic.phpandform-reply.phptemplates 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; ?>September 7, 2015 at 12:06 am #166353In reply to: plugin Button to create new topic
Robkk
ModeratorFor 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; ?>September 7, 2015 at 12:03 am #166352Robkk
ModeratorFor 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.
-
AuthorSearch Results