ok,
create a directory on your theme called ‘bbpress’
ie wp-content/%your-theme-name%/bbpress
find
wp-content/plugins/bbpress/templates/default/bbpress/content-single-forum.php
Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
wp-content/%your-theme-name%/bbpress/content-single-forum.php
bbPress will now use this template instead of the original
then change lines
<?php if ( !bbp_is_forum_category() && bbp_has_topics() ) : ?>
<?php bbp_get_template_part( 'pagination', 'topics' ); ?>
<?php bbp_get_template_part( 'loop', 'topics' ); ?>
<?php bbp_get_template_part( 'pagination', 'topics' ); ?>
<?php bbp_get_template_part( 'form', 'topic' ); ?>
<?php elseif ( !bbp_is_forum_category() ) : ?>
<?php bbp_get_template_part( 'feedback', 'no-topics' ); ?>
<?php bbp_get_template_part( 'form', 'topic' ); ?>
<?php endif; ?>
to
<?php if ( !bbp_is_forum_category() && bbp_has_topics() ) : ?>
<?php bbp_get_template_part( 'form', 'topic' ); ?>
<?php bbp_get_template_part( 'pagination', 'topics' ); ?>
<?php bbp_get_template_part( 'loop', 'topics' ); ?>
<?php bbp_get_template_part( 'pagination', 'topics' ); ?>
<?php elseif ( !bbp_is_forum_category() ) : ?>
<?php bbp_get_template_part( 'form', 'topic' ); ?>
<?php bbp_get_template_part( 'feedback', 'no-topics' ); ?>
<?php endif; ?>
and save
that should do it
ok, the following code removes the edit for bbpress, but leaves it for normal wordpress pages
function wpse_remove_edit_post_link( $link ) {
if (is_bbpress()) return '' ;
else return $link ;
}
add_filter('edit_post_link', 'wpse_remove_edit_post_link');
The users will still be able to edit their topics and replies via the in-box edit buttons
Wow. Crazy that nobody has ever tried to use that feature before!
Here’s the interesting thing though. WordPress.org’s support forum is (I’m 99% sure) built in bbPress and it does successfully allow you to edit topics that you’ve posted. The interface you are sent to when editing your topic does not reside inside the WordPress admin area. Rather it is right there on the publicly facing page.
I wonder how they are doing that?
Another interesting wrinkle in this whole thing is that according to the bbPress User Roles and Capabilities, participants should be able to edit their own topics.
I too had this issue and found countless other posts dated many years ago with no solution. I am using bbpress v2.5.4 and buddypress v2.1.1 on WordPress v4.1. I “resolved” this by editing my functions.php file within the bbpress plugin directory and replacing any character values with a blank. Good enough for me. This “solution” IS NOT RECOMMENDED as any update to bbpress is more than likely to overwrite it. Unless you don’t mind going back in and remembering to re-hack it after each update. No doubt it can be done better. The client just requested I get rid of the code values. Without further to do…
GoTo: yoursite\wp-content\plugins\bbpress\includes\common\functions.php
Between Lines 1090 and 1091 Add:
$search_bbpress_titles = array("&# 039;", "&am p;", "R 11;", "&qu ot;"); // ' & - "
$topic_title = str_replace($search_bbpress_titles, '', $topic_title);
Then add the same two lines further down between Lines 1233 and 1234.
NOTE: You will have to remove the spaces from the $search_bbpress_titles array line as I was unable to post without it parsing that line. Don’t know the coding on this form to post properly. Email me if you need the code.
Looking forward to any other helpful input. No need to remind me how better you are at coding. ๐
No, I didn’t actually put the words “the color you see.” I don’t have the code anymore because I deleted it, so I’m not sure of the exact color I used, but it’s the one that it is now because it won’t go back to the original color.
Nav bar is what I mean. It’s just the background color of the whole site. Underneath the black bar, it’s a light tan. Somewhat the same color as this site here. When you click on one of the links, that color gets darker. Here are 2 links to the different colors I’m talking about. Please don’t take the arrows as being rude. I just want to make sure you see what I mean.
http://thevrlife.com/wp-content/uploads/2015/02/color.png
http://thevrlife.com/wp-content/uploads/2015/02/color2.png
did you actually paste this line
background-color: โthe color you seeโ!Important;
ie the real words “the color you see”
This would be ignored as it’s not proper code
And if you put this into your child theme, and you’re no longer using your child theme, then it wouldn’t matter anyway.
And if you go to the forum, the background of the actual site under the top nah bar is a light tan. Then if you click on the test forum to go into it (though there arenโt any topics), you will notice it gets darker.
Not sure what ‘the top nah bar ‘ if you mean nav, then I can’t see any tan in my browser, or anything going darker?????
Put an image on photobucket or similar please
Sorry u might be confusing. There’s 2 different backgrounds. The one that I’m talking about now is the actual background of the tables. The even and odd of the forum. I changed it by putting this in my child theme:
#bbpress-forums div.odd,
#bbpress-forums ul.odd {
background-color: “the color you see”!Important;
}
#bbpress-forums div.even,
#bbpress-forums ul.even {
background-color:” the color you see”!important;
}
I then changed the parts that affect the actual theme through theme options. After doing this, I noticed stuff wasn’t changing back once I put it back to the default color. I then tried changing the code above and it didn’t work anymore. Then I even deleted the code, yet it still didn’t change back to normal.
The original background was dark I believe. Can’t remember for sure. But now it’s white and a tan, which I set with the code above, but I can’t change it back.
Thats awesome, you are right, I also needed to make
add_action( 'bb_init', 'view_twentyplus_posts_init' );
become
add_action( 'bbp_init', 'view_twentyplus_posts_init' );
Need to play a little more as its not showing what I was expecting, but at least it’s showing something ๐
just add a line
add_filter( 'bbp_get_topic_pagination_count', 'hide_topic_display' );
so you end up with
Function hide_topic_display ($retstr){
$retstr = '' ;
return $retstr ;
}
add_filter( 'bbp_get_forum_pagination_count', 'hide_topic_display' );
add_filter( 'bbp_get_topic_pagination_count', 'hide_topic_display' );
That should work !
Hi Guys,
I am trying to have a page in WordPress which shows two sections:
1) posts with 20 or more replies
2) posts with 19 or less replies
I have created a page with the following shortcodes:
[bbp-single-view id="twentyplus_posts"]
[bbp-single-view id="lesstwenty_posts"]
I have added the following into my themes functions.php file:
// Add Custom View - Forum Home
add_action( 'bb_init', 'view_twentyplus_posts_init' );
function view_twentyplus_posts_init()
{
$args = array( 'post_count' => '>19' );
bb_register_view( 'twentyplus_posts', __('Popular Posts', 'example'), $args, false );
}
add_action( 'bb_init', 'view_lesstwenty_posts_init' );
function view_lesstwenty_posts_init()
{
$args = array( 'post_count' => '<20' );
bb_register_view( 'lesstwenty_posts', __('Forum Posts', 'example'), $args, false );
}
However all I get in response is:
Oh bother! No topics were found here!
Oh bother! No topics were found here!
Any idea what I am doing wrong here?
For those who have been asking a new plugin which hopefully will help
https://wordpress.org/plugins/bbp-style-pack/
Changing style items – now in this plugin so no need to create child themes and post complicated code into style sheets
Changing how the forum looks, the most asked for items, such as vertical sub forums, hiding counts, adding ‘create new topic’ links, removing ‘private’ prefix, adding forum descriptions, changing breadcrumbs and more
Login – create simple menu items to help with logging in, registration and changing profiles
Shortcodes – 3 useful new shortcodes to help your display
Feedback both positive and ‘needs improvement’ welcomed !
Okay, I’m officially freaking out now. After hearing about it quite a bit, I finally learned how to create a child theme. I did so, and I began adding css related to bbpress with “!important” to change things. After changing a few things, I realized the text color wasn’t going to work, so I went into my theme options, and there is a way to change colors without having to go into code. Luckily, there is a default button, so I can just press that to go back to default. Basically, I changed each one and then refreshed the forum to see if that was it. I finally found it, but I didn’t like what it did to the rest of the site, so I went back to default. Now nothing is changing on the forum, even though everything else is going back to normal in the theme.
So I then started deleting the changes I made in my child theme .css, and it isn’t changing anything. I even went as far as to go back to my parent theme. This made the forum disappear, so I deactivated it and re-activated it. Well, now it is right back to the one after it was changed. How could it still be changed? I tried deleting it and re installing it, but it still won’t change. How could this have happened?
Sorry for panicking, but I simply don’t understand how this happened. Thank you for any answers.
I’m working on a site that HAS to have a “custom” button on TinyMCE to insert a custom string for users through the visual editor on BBPress. It works fine through the wp-admin, but it has to work on the actual forum pages. I located where the failure happens – does anyone know how or what I need to replace this with in order for it to work with BBpress? Or any other hacks I can try?? (It’s basically selecting all the text, then I do a search for a specific item and add their custom string to that item):
var content = tinyMCE.get(‘content’).getContent();
Looking at the code, I though maybe it should be:
var content = tinyMCE.get(‘bb_topic_content’).getContent();
but that didn’t work either….
ok the title comes form your theme, so I can’t help precisely with what to do but you should look in the page.php file or similar and find
<h1 class=”entry-title”><?php the_title(); ?></h1>
or something similar.
Come back with the lines and a few before and after and I’ll try and help further, but many themes are very complicated!
on the second issue, put the following in your functions file
Function hide_topic_display ($retstr){
$retstr = '' ;
return $retstr ;
}
add_filter( 'bbp_get_forum_pagination_count', 'hide_topic_display' );
Functions files and child themes – explained !
I’m also stopped recive the notifications by email after update… to 2.5.4 (not sure about version). This happens because new bbPress send one email to all subscribed people. I publish the solutions for another issue few weeks ago https://bbpress.org/forums/topic/hook-to-bbpress-notifications/#post-156426 but it also the solution for your issue.
In few words about my code:
- Disable default bbPress notifications (one email per all users).
- Add similar notifications but it sends one email per user and WordPress send it by using cron (not immediately).
P. S. I’m also using WP SMTP plugin to send email throw external SMTP server.
I agree, plugins tend to break WordPress every now and then, but I did hardcode certain plugins directly into my child theme, these can not update unless I update them myself.
In my first 12 months of WordPress studies/experiments there were a lot ofplugins binned due to conflicts or outright fails.
Thank you ๐ I’m just trying to use this repository like bower_component. I can’t find SVN URL endpoint to using it in bower. Few examples from Bower API (bower. io/docs/api/#install):
svn+ssh://package. googlecode. com/svn/
svn+https://package. googlecode. com/svn/
svn+http://package. googlecode. com/svn/
I try use svn+h t t p s : / / bbpress. svn. wordpress. org/ but it doesn’t work.
P. S. I use a lot of spaces because bbpress. org doesn’t allow publish replies with external links.
It looks like there are possibly 2 issues being reported here.
One issue reported by the OP is that emails are not working properly. Another being that people aren’t being notified due to the subscribe checkboxes not actually being checked by default causing people to become unsubscribed when they post replies to topics they were previously subscribed to.
The first issue with emails sounds like it could be conflicts with themes or plugins. However if it is actually an email issue it could also be that the emails from the server aren’t being properly sent or received which could be for a number of reasons such as bad DNS records or improper mail server configuration.
The second issue is that when posting topics or replies the subscription checkboxes are not checked by default. This is described above by Killerrabbit2 here in this post: https://bbpress.org/forums/topic/email-notifications-not-working-looking-for-help/#post-153189
I think if bbpress added an option to set the default state of the checkboxes to allow the subscription checkboxes to be checked or unchecked with the default being checked would be part of the solution for the second issue.
You can set the default setting to be checked by editing the bbpress template files /wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php and /wp-content/plugins/bbpress/templates/default/bbpress/form-reply.php and finding the subscription input checkboxes and adding checked to them seems to fix part of it.
<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe" checked tabindex="<?php bbp_tab_index(); ?>" />
Another issue seems to be that it doesn’t subscribe to topics within a forum when subscribing to an entire forum. So for example if you subscribe to a forum and a topic isn’t checked within that forum (which is how bbpress is currently set by default since it doesn’t subscribe to things by default) then it won’t notify you of new replies. Kind of defeats the purpose of subscribing to an entire forum I think. So if you subscribe or unsubscribe to an entire forum it should subscribe or unsubscribe all posts within that forum at that time. I haven’t tried adding code to fix this yet.
I suspect some bbpress templates could actually do this stuff for the second issue properly. Not sure if people even release new ones ever or not. It’s also possible that some themes could potentially already have their own bbpress templates which potentially could be broken or outdated causing issues.
Okay, I found these three bad boys:
<?php bbp_topic_tag_list(); ?>
<?php bbp_topic_subscription_link(); ?>
<?php bbp_user_favorites_link(); ?>
Now I’m just on the hunt for the others. Any hints appreciated!
This seems to work, just tested. Adjust after need.
Limit user upload by KB size:
add_filter('wp_handle_upload_prefilter', 'f711_image_size_prevent');
function f711_image_size_prevent($file) {
// get filesize of upload
$size = $file['size'];
$size = $size / 1024; // Calculate down to KB
// get imagetype of upload
$type = $file['type'];
$is_image = strpos($type, 'image');
// set sizelimit
$limit = 700; // Your Filesize in KB
// set imagelimit
$imagelimit = 7;
// set allowed imagetype
$imagetype = 'image/jpeg';
// query how many images the current user already uploaded
global $current_user;
$args = array(
'orderby' => 'post_date',
'order' => 'DESC',
'numberposts' => -1,
'post_type' => 'attachment',
'author' => $current_user->ID,
);
$attachmentsbyuser = get_posts( $args );
if ( ( $size > $limit ) && ($is_image !== false) ) { // check if the image is small enough
$file['error'] = 'Image files must be smaller than '.$limit.'KB';
} elseif ( $type != $imagetype ) { // check if image type is allowed
$file['error'] = 'Image must be ' . $imagetype . '.';
} elseif ( count( $attachmentsbyuser ) >= $imagelimit ) { // check if the user has exceeded the image limit
$file['error'] = 'Image limit of ' . $imagelimit . ' is exceeded for this user.';
}
return $file;
}
Set a maximum upload count for users on a specific user role
add_filter( 'wp_handle_upload_prefilter', 'limit_uploads_for_user_roles' );
function limit_uploads_for_user_roles( $file ) {
$user = wp_get_current_user();
// add the role you want to limit in the array
$limit_roles = array('contributor');
$filtered = apply_filters( 'limit_uploads_for_roles', $limit_roles, $user );
if ( array_intersect( $limit_roles, $user->roles ) ) {
$upload_count = get_user_meta( $user->ID, 'upload_count', true ) ? : 0;
$limit = apply_filters( 'limit_uploads_for_user_roles_limit', 10, $user,$upload_count, $file );
if ( ( $upload_count + 1 ) > $limit ) {
$file['error'] = __('Upload limit has been reached for this account!','yourtxtdomain');
} else {
update_user_meta( $user->ID, 'upload_count', $upload_count + 1 );
}
}
return $file;
}
This action will fire when user delete attachment
add_action('delete_attachment', 'decrease_limit_uploads_for_user');
function decrease_limit_uploads_for_user( $id ) {
$user = wp_get_current_user();
// add the role you want to limit in the array
$limit_roles = array('contributor');
$filtered = apply_filters( 'limit_uploads_for_roles', $limit_roles, $user );
if ( array_intersect( $limit_roles, $user->roles ) ) {
$post = get_post( $id);
if ( $post->post_author != $user->ID ) return;
$count = get_user_meta( $user->ID, 'upload_count', true ) ? : 0;
if ( $count ) update_user_meta( $user->ID, 'upload_count', $count - 1 );
}
}
I just write this on trac. Needs to be restricted for users to see other attachments, they did not uploaded.
function filter_my_attachments( $wp_query ) {
if (is_admin() && ($wp_query->query_vars['post_type'] == 'attachment')) {
if ( !current_user_can( 'activate_plugins' ) ) {
global $current_user;
$wp_query->set( 'author', $current_user->id );
}
}
}
add_filter('parse_query', 'filter_my_attachments' );
add_filter( 'bbp_after_get_the_content_parse_args', 'tp_bbpress_upload_media' );
function tp_bbpress_upload_media( $args ) {
$args['media_buttons'] = true;
return $args;
}
ok, sorry for delay – putting in ‘bumps’ tends to not get you help as many of us work on ‘topics with no replies’ and you have replies ๐
Put the following in your functions file
function rew_role_show () {
$displayed_user = bbp_get_reply_author_id() ;
$role = bbp_get_user_role( $displayed_user);
if ( bbp_is_user_keymaster($displayed_user) ||$role == 'bbp_moderator') {
echo '<li>' ;
echo 'I im in supporting group';
echo '</li>' ;
}
}
add_action ('bbp_theme_after_reply_author_details', 'rew_role_show') ;
Functions files and child themes – explained !
just tested and
add_filter( 'bbp_get_author_link', 'remove_author_links', 10, 2);
add_filter( 'bbp_get_reply_author_link', 'remove_author_links', 10, 2);
add_filter( 'bbp_get_topic_author_link', 'remove_author_links', 10, 2);
function remove_author_links($author_link, $args) {
$author_link = preg_replace(array('{<a[^>]*>}','{}'), array(" "), $author_link);
return $author_link;
}
add_filter ('bbp_before_get_author_link_parse_args' , 'rew_remove_avatar' ) ;
add_filter ('bbp_before_get_reply_author_link_parse_args' , 'rew_remove_avatar' ) ;
add_filter ('bbp_before_get_topic_author_link_parse_args' , 'rew_remove_avatar' ) ;
function rew_remove_avatar ($args) {
$args['type'] = 'name' ;
return $args ;
}
seems to do what is required