will the coming update overwrite the code i just changed without any issues?
Yes, it will automaticlly overwrite the changes you made
just a last quick question.
will the coming update overwrite the code i just changed without any issues?
thanks very much
I have a bbPress forum running that has been successfully running for a little over a month now on a WP blog. Average usage is about 20 posts a day.
In the last few days I noticed that the Visual tab is not available for replies, only the text tab. I have tried to switch to the visual tab, but it is not available. This would not be so annoying except all posts are emailed to all admins and the replies are full of HTML code. I understand what it is, but the other moderators do not understand it.
So the emails look like this:
“worked closely with one of the researchers on this paper <span style=”line-height: 1.428571429;”>(both did their Internal medicine specials together at vet university)</span><span style=”line-height: 1.428571429;”> &”
I hope someone is able to help. We are a busy forum helping very sick dogs and there probably have been 50 replies in the last few hours.
Thank you, Matoca
It looks like you have patched the file correctly.
Can you view the source and get the stylesheet path and paste it here:
eg.
A ‘failed’ example
<link rel="stylesheet" id="bbp-default-css" href="http://localhost/wordpress37/wp-content/C:devhtdocswordpress37wp-contentpluginsbbpress/templates/default/css/bbpress.css?ver=2.5-5199" type="text/css" media="screen">
A ‘working’ example:
<link rel='stylesheet' id='bbp-default-css' href='http://127.0.0.1/wp-content/plugins/bbpress/templates/default/css/bbpress.css?ver=2.5-5199' type='text/css' media='screen' />
Funny, exactly what I ended up doing. Okay, I afterwards garnished the visibility a bit more:
#subscription-toggle a {
font-weight: bold;
padding: 0 2px 0 2px;
border: 1px solid navy;
background-color: white;
}
Two mind, good idea – thanks for replying 😉
@focallocal Thanks, looking at your code now.
What software package and version are you using? eg. XAMPP 1.8.3
function bbp_enqueue_style( $handle = '', $file = '', $dependencies = array(), $version = false, $media = 'all' ) {
// No file found yet
$located = false;
// Trim off any slashes from the template name
$file = ltrim( $file, '/' );
// Make sure there is always a version
if ( empty( $version ) ) {
$version = bbp_get_version();
}
// Loop through template stack
foreach ( (array) bbp_get_template_stack() as $template_location ) {
// Continue if $template_location is empty
if ( empty( $template_location ) ) {
continue;
}
// Check child theme first
if ( file_exists( trailingslashit( $template_location ) . $file ) ) {
$located = trailingslashit( $template_location ) . $file;
break;
}
}
// Enqueue if located
if ( !empty( $located ) ) {
$content_dir = constant( 'WP_CONTENT_DIR' );
// IIS (Windows) here
// Replace back slashes with forward slash
if ( strpos( $located, '\\' ) !== false ) {
$located = str_replace( '\\', '/', $located );
$content_dir = str_replace( '\\', '/', $content_dir );
}
// Make path to file relative to site URL
$located = str_replace( $content_dir, WP_CONTENT_URL, $located );
// Enqueue the style
wp_enqueue_style( $handle, $located, $dependencies, $version, $media );
}
return $located;
}
/**
* Enqueue a script from the highest priority location in the template stack.
*
* Registers the style if file provided (does NOT overwrite) and enqueues.
*
* @since bbPress (r5180)
*
* @param string $handle Name of the script.
* @param string|bool $file Relative path to the script. Example: '/js/myscript.js'.
* @param array $deps An array of registered handles this script depends on. Default empty array.
* @param string|bool $ver Optional. String specifying the script version number, if it has one. This parameter
* is used to ensure that the correct version is sent to the client regardless of caching,
* and so should be included if a version number is available and makes sense for the script.
* @param bool $in_footer Optional. Whether to enqueue the script before </head> or before </body>.
* Default 'false'. Accepts 'false' or 'true'.
*
* @return string The script filename if one is located.
*/
function bbp_enqueue_script( $handle = '', $file = '', $dependencies = array(), $version = false, $in_footer = 'all' ) {
// No file found yet
$located = false;
// Trim off any slashes from the template name
$file = ltrim( $file, '/' );
// Make sure there is always a version
if ( empty( $version ) ) {
$version = bbp_get_version();
}
// Loop through template stack
foreach ( (array) bbp_get_template_stack() as $template_location ) {
// Continue if $template_location is empty
if ( empty( $template_location ) ) {
continue;
}
// Check child theme first
if ( file_exists( trailingslashit( $template_location ) . $file ) ) {
$located = trailingslashit( $template_location ) . $file;
break;
}
}
// Enqueue if located
if ( !empty( $located ) ) {
$content_dir = constant( 'WP_CONTENT_DIR' );
// IIS (Windows) here
// Replace back slashes with forward slash
if ( strpos( $located, '\\' ) !== false ) {
$located = str_replace( '\\', '/', $located );
$content_dir = str_replace( '\\', '/', $content_dir );
}
// Make path to file relative to site URL
$located = str_replace( $content_dir, WP_CONTENT_URL, $located );
// Enqueue the style
wp_enqueue_script( $handle, $located, $dependencies, $version, $in_footer );
}
return $located;
}
/**
* This is really cool. This function
i added the 2481.01.2.patch but bbpress still breaks my site when active (it was fine before the update)
and here’s screenshots of what’s happening on my site: http://imgur.com/a/4SNAC
sorry, i have learned from this to wait a few weeks before updating – but if anyone could help me to see what what i’ve done wrong here that’d be a huge help.
EDIT: As your issue is fixed I removed the huge code chunk you posted. Netweb 3rd Dec
Erm.. it should be custom BB Code. 😀
Yeah.. sometime, in custom BB code, we do use a ; ‘ : | } ] [ * , or any other character . As myself had little bit PHP knowledge, (always do wp theme code myself and for clients), those character might broke some code if there’s no escape clause like \ (backslash) before some character ie: :\’\ etc …. As your note = shouldn’t but could be.
I’ve tried Rows Limit to 50 and 20 .. but not yet to 1. I’ll try that later.
I want to try it on localhost / my own pc. But when I think about my 500mb forum database file .. yeah.. you know.. I feeling down.. lol.
thanks for the style sheet fix. any idea how long before its officially fixed in bbpress so i can decide whether to have a go at it myself or to wait?
i’m a little nervous about messing around with code as updates seem to break the things i change.. ironically in this case.
You might need to play a bit, and come back if this either works or doesn’t, I’ve only had a quick look, and suspect there’s a much better way…but
You main theme uses ‘Helvetica Neue’,sans-serif and the forum is using Arial
I’m still on 2.4.1 so can’t tell you which lines you need in version 2.5
So in the bbpress.css file you’ve correctly copied to theme’s folder, do a search for “font-size” and where you find it, add a line
font: ‘Helvetica Neue’,sans-serif;
That will take it in common with the main theme’s font.
for instance
#bbpress-forums div.bbp-forum-title h3,
#bbpress-forums div.bbp-topic-title h3,
#bbpress-forums div.bbp-reply-title h3 {
background: none;
border: none;
font-size: 16px;
line-height: 1em;
margin: 8px 0;
padding: 0;
text-transform: none;
you’d alter it to say
#bbpress-forums div.bbp-forum-title h3,
#bbpress-forums div.bbp-topic-title h3,
#bbpress-forums div.bbp-reply-title h3 {
background: none;
border: none;
font-size: 16px;
font: 'Helvetica Neue',sans-serif;
line-height: 1em;
margin: 8px 0;
padding: 0;
text-transform: none;
Hi,
This is definitely a bug in bbp 2.5 on Windows. 2.4.1 does not have this issue. You can reproduce it by reverting to 2.4.1 (works again) -> update to 2.5 (doesn’t work again).
<link rel="stylesheet" id="bbp-default-css" href="http://localhost/wordpress37/wp-content/C:devhtdocswordpress37wp-contentpluginsbbpress/templates/default/css/bbpress.css?ver=2.5-5199" type="text/css" media="screen">
Windows 7 x64, httpd+php+mysqld, latest stable WP, BP, BBP
Diggories,
Some great tips there.
mm, the upgrade will have overwritten the change – as per first post
Of course you’ll need to make a note of this change, as it is lost whenever you upgrade bbpress versions
I haven’t upgraded yet, let me know if putting it back fixes it !
oh if you want it to go directly to the edit profile section just add /edit at the end like this
<a href="http://yoursite.com/forums/users/[hana-code-insert name='BB Profile' /]/edit">My Profile</a>
I don’t know if this will help or not however I have found a simple way to do a text link in a page or post.
I use the below PHP to call the current user
<?php global $current_user;
get_currentuserinfo();
echo $current_user->user_login . "";
?>
And then surround it with a standard html link.
<a href="http://yoursite.com/forums/users/<?php global $current_user;
get_currentuserinfo();
echo $current_user->user_login . "";
?>">My Profile</a>
I use a plugin called Hana Code Insert to place it in posts and pages using the following steps:
1.) Take the php code
<?php global $current_user;
get_currentuserinfo();
echo $current_user->user_login . "";
?>
and place it in the “New Entry” box in the Hana Code Insert plugin and give it a name like “BB Profile” or what ever you want.
2.) Tick the “Evaluate as php code.” check box at the bottom of the “New Entry” field.
3.) Click “Create New Entry” and this will produce a shortcode something like this [hana-code-insert name='BB Profile' /]
4.) Then on the page or post you want to place the link just place the following <a href="http://yoursite.com/forums/users/[hana-code-insert name='BB Profile' /]">My Profile</a>
That’s it, hope it helps and I.m sure someone here can figure a way to use this in a menu link, I am still trying to figure that out.
Somehow, I just notice or suspecting that.. it might be related to either :
1 – post with custom BBtag.
2 – post/topic that has Poll option.
What is the custom ‘BBtAg’ is it ‘BBtag’, I can try to replicate this as we do use a 3rd party library to convert some BBCode and it could be a conflict there (shouldn’t be but could be)
I will also setup a ‘poll’ to try the import with.
Another thing I haven’t tried yet though this just came to me as an idea, when the conversion stops change the value of Rows Limit from 100 to 1 and click start again, causing it to go one row at a time.
This way when it stops and won’t go any further you should be able to look at _bbp_converter_startin thewp_optionsdatabase and add a1 to that number. This in affect will make the converter start again on the next row rather than the row it is failing on.
Once it gets past the problematic topic, you could click stop again, change it back to 100 and start again so the remainging 200k posts are not imported one by one.
Take a look at the Data Parameters of WP_Query https://codex.wordpress.org/Class_Reference/WP_Query#Date_Parameters
You can also create custom views in bbPress eg.
function ntwb_register_custom_views() {
bbp_register_view( 'popular-topics', __( 'Popular Topics' ), array( 'meta_key' => '_bbp_reply_count', 'orderby' => 'meta_value_num' ), false );
bbp_register_view( 'unpopular-topics', __( 'Unpopular Topics' ), array( 'meta_key' => '_bbp_reply_count', 'orderby' => 'meta_value_num', 'order' => 'asc' ), false );
bbp_register_view( 'random-topic', __( 'Random Topic' ), array( 'orderby' => 'rand' ), false );
bbp_register_view( 'closed', __( 'Recently Closed' ), array( 'post_status' => 'closed' ), false );
}
add_action( 'bbp_register_views', 'ntwbc_register_custom_views' );
yes topic subscriptions are ok.. it work fine..
I don’t have bbpress.php in my child theme folder…
Edit: Just read your reply on Trac
Also check if you have a bbpress.php file in your child theme folder.
I don’t have any custom bbpress-functions.php in my theme and i have copy entire user-subscriptions.php in my child theme. And it not work… I see only: You are not currently subscribed to any forums.
But i have subscribed three forums…
I am pretty sure you are looking for the widgets https://codex.bbpress.org/widgets/
https://bbpress.trac.wordpress.org/ticket/2480 has been updated with some more info.
Also if you have a custom bbpress-functions.php in your theme that also needs to be updated.
After I updated bbpress to version 2.5 the stylesheet for the default theme is not being linked correctly.
<link rel=’stylesheet’ id=’bbp-default-css’ href=’http://localhost/wordpress/almostaveragegamers/wp-content/C:xampphtdocswordpresswp-contentpluginsbbpress/templates/default/css/bbpress.css?ver=2.5-5199′ type=’text/css’ media=’screen’ />
This is the way that the link is showing up when I look at the source code for the site which I am designing on a local host server. When I click on the link to see what is displayed this is what it is showing me below.
https://www.dropbox.com/s/3as5djr6w0m2b0a/error-message.jpg
I’m trying to create a version of the Popular Topics widget that will only display posts that are less than a certain age.
I’ve been able to query popular posts with this:
$query = new WP_Query( array(
'posts_per_page' => 5,
'post_type' => 'topic',
'meta_key' => '_bbp_reply_count',
'orderby' => 'meta_value',
'order' => 'DESC'
);
But I would like to weed out any posts that are, let’s say, older than 1 week.
Is it possible to do this?
Can I somehow use an additional meta query and access each topic’s freshness?
Hi, is correct because you have closed topic and bbpress use ccc colors text for closed topics..
If you want to change it, open bbpress css at line 66 and find:
#bbpress-forums .status-closed, #bbpress-forums .status-closed a {
color: #CCCCCC;
}
change in #000000 or other colors…