Hey guys.
I’ve tried searching about this but not really been able to find a definitive answer, especially for my own situation.
I currently have a live site, where users NEED to use WordPress default domain.com/author/username
Currently when you go to the profile of a poster in the bbPress forum it takes you to a different user page domain.com/user/username
I need this to direct to domain.com/author/username as the default WordPress profile contains information about the user (feedback ratings, post details + more – its a classified site).
Now I’m not 100% fussed on whether the domain.com/author/username page displays post details, as the ‘forum’ I’ve having is a single forum and more like a general chat area of the site. I’m not looking to setup a fully fledged forum.
However the most important thing is having their profiles direct to their author page instead of their bbPress user page.
If there is code I can place in the author.php file (WordPress one) that will check their bbPress details regarding their posts, that would be great. I’ve tried copying the code from bbPress user-profile.php but that didn’t work.
Can any one offer any assistance? I’d deeply appreciate it.
Thanks
bbPress: Version 2.5.8
WordPress: Version 4.4.2
Website: http://www.airsofttrader.co.nz (You can see the example of author pages, however bbPress is not installed on the live site – its installed locally.)
You can put any of these codes into your functions.php of your (child) theme.
Thanks Rob. I’m sorry, I’m quite ok with html/css but now close to nothing about php. Can you let me know where would I pace this code?
Thanks.
Elijah.
Yeah you do not need to run both plugins at the same time. I meant just use one instead of the other.
This php snippet will allow empty posts which is kind of not a good idea. Also I cannot seem to find the code in the bbPRess plugin responsibe for the no redirect to post after submit after using using this code.
function rkk_remove_content_error_check( $reply_content ) {
if ( !empty( $_POST['bbp_reply_content'] ) && empty( $_POST['bbp_reply_content'] ) )
$reply_content = $_POST['bbp_reply_content'];
}
add_filter( 'bbp_new_reply_pre_content', 'rkk_remove_content_error_check' );
@mimbelli Here is the list of plugins, these could be about 7 plugins in total if you want to do the free route, or 4 plugins in total if you only want to use BuddyPress and GD bbPress toolbox (paid plugin)
User signature, hot/new/sticky topics (labels/icons??), post count and join date, visual preview could be possible using a small piece of custom code and using bbPress hooks to display them.
I’ve got a header, screenshots, and icon in the assets folder. I made some minor changes to the code and readme text plus has the images in the assets folder and did this:
svn ci -m “Code cleanup and hopefully screen shots!”
The changed files made it through and the version number changed, but the files in assets did not transfer. Still not there. Also, strangely, in the screenshots tab of the plugin the plugin description is there.
Is there a way to just upload the assets folder?
Here is some CSS that could do the same thing. Add the css styles to your child theme style css or insert the code in a plugin that can hold custom css styles.
.bbpress .header-holder,
.page-template-bbpress .header-holder {
display: none;
}
Hello,
I am starting a new thread because all the searches I found come up 1-5 years old and I do not trust some of the code when I do not know how to read it very well.
I would like to allow participants to be able to trash (not delete) their replies and posts if they are still allowed to edit them based on the edit time provided in BBPress settings. Can you please give me some code to achieve this?
Thanks.
Stewart,
That’ll be in your header.php, and you’ll need to find the part that says
<div class="header-area">
through to
</div>
and wrap it in
<?php if (!=bbpress()) : ?>
<div class="header-area">
through to
</div>
<?php endif; ?>
so it will display if it is not a bbpress page
Thank you so much for your help!
Actually, I`m a bit “rusty” in this.
Are you able to help me with this?
I mean if it is possible to provide me the code and the location where I need to insert it.
Thanks in advance!
I have:
WP 4.4.2
bbPress 2.5.8
BuddyPress 2.4.3
Karma theme 3.0.3
Please see my forum home page here: http://www.cytoviva.com/userforum/
What I want to do is hide the “white area” with the logo and menu (products, gallery, etc.) ONLY on bbpress forum pages, not the rest of the non-forum pages. Here is the code for my bbPress.php page created from copying another template page and saving it in my child theme (as instructed).
Can anyone tell me what to edit/remove from this page to just remove the home menu, but LEAVE the main top menu (home, about us, client sites) in blue?
I have tried several things and can’t seem to get anywhere.
Thanks in advance!!!
<?php
/*
Template Name: bbPress
*/
?>
<?php get_header(); ?>
</div><!-- header-area -->
</div><!-- end rays -->
</div><!-- end header-holder -->
</div><!-- end header -->
<?php truethemes_before_main_hook();// action hook, see truethemes_framework/global/hooks.php ?>
<div id="main">
<?php get_template_part('theme-template-part-tools','childtheme'); ?>
<div class="main-holder">
<?php
//retrieve value for sub-nav checkbox
global $post;
$post_id = $post->ID;
$meta_value = get_post_meta($post_id,'truethemes_page_checkbox',true);
if(empty($meta_value)){
get_template_part('theme-template-part-subnav-horizontal','childtheme');
}
?>
<div id="content" class="content_left_sidebar">
<?php if(have_posts()) : while(have_posts()) : the_post(); the_content(); truethemes_link_pages(); endwhile; endif;
comments_template('/page-comments.php', true);
get_template_part('theme-template-part-inline-editing','childtheme'); ?>
</div><!-- end content -->
<div id="sidebar" class="left_sidebar">
<?php dynamic_sidebar('bbpress-custom-sidebar'); ?>
</div><!-- end sidebar -->
</div><!-- end main-holder -->
</div><!-- main-area -->
<?php get_footer(); ?>
Hello,
I did some customizing, here is the end result.
Code in functions.php
function rkk_add_notice_before_topic_form() {
?>
<div class="bbp-before-posting">
<p>
Before Posting
<br>
Please read these steps carefully, it helps staff and other members like you to have a nice and enjoyable time on our forum.
<br>
A: Please read the
<br>
<a href="http://yourtechadvisors.com/forum-rules">Forum Rules.</a>
<br>
B: Please explain your problem in detail so we can get a good understanding of your problem and how to help you.
<br>
C: If you need help with a TV, don't just write "I need help with a Samsung." Give us some more detail "I need help with a Samsung TV model L-55-22."
</p>
</div>
<?php
}
add_action( 'bbp_theme_before_topic_form_notices', 'rkk_add_notice_before_topic_form' );
CSS
.bbp-before-posting {
background-color: blue;
color: white;
font-size: 16px;
}
.bbp-before-posting a {
color: yellow;
}
Thanks.
Thanks @robkk, that worked.
I was aware of the shortcodes, I just did not know you could use that value there.
I’ve updated and sent a new pull request 🙂
https://github.com/damon18/dizkus-bbpress/pull/2
It pretty much covers everything, I removed most of the unused bits and pieces
• Removes unused anonymous/guest topic and reply importing
• Updated zk_dizkus_topics and zk_dizkus_posts table joining logic
• Removes unsupported topic favorites importing
• Removes zk_dizkus_users tables references, all usable user data is available in the zk_users table
• Removes unsupported user profile fields
• Renames all the phpBB things to dizkus
It appears dizkus supports topic subscription, forum subscription, and forum favorites. bbPress doesn’t support forum favorites so thats out, but topic and forum subscriptions should work fine
• zk_dizkus_forum_favorites – forum_id
• zk_dizkus_subscription – forum_id
• zk_dizkus_topic_subscription – topic_id
Lastly, the one broken thing 🙁 Based on the way bbPress’ importer currently works it needs to remain SQL compatible for ~25 different database schemea’s, this is really hard 😉 As such I couldn’t find a way to ignore the topic being imported a second time as a reply. So you will see after importing you will have a duplicate post, one is the original topic, and the other is a reply. I’m not sure if the database you shared with me is the complete dataset or not, if it is then manually deleting the duplicate after import would be my suggestion. If not, we can work on making a tweak/modification/hack to the original database to achieve this.
hey, thanks for your answer. the logout redirect works, but the login redirect doesn’t. can you maybe make the same code as the logout redirect for the login redirect?
thanks
As I said I’m a WP newbie trying to understand how everything works. These are my considerations so far. I do not want to hurt anybody.
After a couple of days of testing I’m really going insane trying to get a minimum acceptable installation.
While I understand that acceptable is a moot concept, I mean “similar classic feature of all free forum scripts out there” I’m not speaking about cutting edge features but really standard forum features since phpBB 2 hence:
- extended user profile
- private messaging
- user signature
- post count and join date below username
- post preview
- attachments with inline images
- quote replies
- report
- sticky, new, hot for topics
- view unread content
Now I understand that all of them can be obtained through 10 different plugins but I’m really scared to do so for these reasons:
- 10 different plugins and authors are very difficult to maintain. Chances something screw up are high, no matter how godd is the code.
- some of plugins implementing above features seems already nearly abandoned
- In one of my past life I was so naive to dope my Joomla installation with several third party mambot/plugins. When I had to upgrade I discovered that several of them where abandoned giving me a hege PITA to upgrade
- In a recent life I avoided to dope my IP Board installation with plugins but during a main upgrade I had the same problem with some mods I made by myself
Now I’m trying to bring everything to wordpress + bbpress but I see that it is a steep climb just to get what in 2016 is considered a forum with basic features. I’m not a developer otherwise I was already coding the missing pieces.
Please: less plugins – more core features
This issue is theme related, because bbPress is just inheriting the CSS styles from the themes stylesheet. Same thing with the other themes, there are just some styles that could affect some classes in the code that can make the layout look different.
In the theme compat code in bbPress, has it where you can use default WordPress conditionals like is_single() which should show up for each single forum and topic, and is_archive() for the forum archive (forum root page) and topic archive (usually at yoursite.com/topics or forum root).
So while you did create a single forum page using shortcodes as an easy to do workaround, as the code for the “indentation” is created by your themes CSS and only for single pages using ,while you created a simple page. When you enter the normal forum url in 2016 you will see the same “indentation” you see on topics.
You are on the money on what CSS to use to fix the issue, there is just some media queries that you need to add is all. There will be a slight margin to the right around 700px width when the sidebar goes under the content, but a page has that same margin in your theme and for consistency I just say leave it in.
This CSS should help your help solve your issue.
@media screen and (min-width: 61.5625em) {
.bbpress .entry-content {
float: none;
width: auto;
}
}
You can place this view shortcode into a page and just link to it anywhere.
[bbp-single-view id='no-replies']
More information on shortcodes.
https://codex.bbpress.org/features/shortcodes/
Use the hook <?php do_action( 'bbp_template_notices' ); ?> or even <?php do_action( 'bbp_theme_before_topic_form_notices' ); ?>
And here is an example for a custom notice. You can of course add a list, but you would need to style it with some CSS.
function rkk_add_notice_before_topic_form() {
?>
<div class="bbp-template-notice important">
<p>
<strong>IMPORTANT!:</strong> Make sure to read our site's <a href="http://yoursite.com/discussion-policy"> discussion policy</a> before you post.
</p>
</div>
<?php
}
add_action( 'bbp_theme_before_topic_form_notices', 'rkk_add_notice_before_topic_form' );
@pahkiller read the closing topics section in this guide. It is for closing topics from any new replies, you can also read the rest of the guide about closing forums which will make participants unable to create new topics and replies in a forum.
https://codex.bbpress.org/getting-started/forum-moderation/common-tasks/#closing-topics
Hello,
I would like to add a link to Unanswered topics. I have seen the widget page, but cannot use it because I need a link. Is there any shortcodes or other ways to do this?
Thanks.
I found this php script online, can anyone suggest if this is safe to empty the trash?
$strSql="SELECT ID FROM wp_posts WHERE post_status='trash'";
$con=mysqli_connect("localhost","my_wordpress_user","my_db_pass","my_wordpress_db_name") or die("Error connecting");
$result = mysqli_query($con, $strSql);
while($row = mysqli_fetch_array($result)){
printf($row['ID']."\n");
}
mysqli_close($con);
php findtrash.php > trash.txt
$con=mysqli_connect("localhost","my_wordpress_user","my_db_pass","my_wordpress_db_name") or die("Error connecting");
$file = fopen("trash.txt", "r") or exit("Unable to open file!");
while(!feof($file)){
$intId = fgets($file);
$result = mysqli_query($con, "DELETE FROM wp_posts WHERE ID=".$intId);
$result2 = mysqli_query($con, "DELETE FROM wp_postmeta WHERE post_id=".$intId);
if($result && $result2){
printf("Deleted id ".$intId);
}else{
printf("Results not positive".$result." ".$result2." for ".$intId." ");
}
}
fclose($file);
mysqli_close($con);
Thanks a lot for your response!
Do you have an idea about that code?
And another question (maybe you know). Is it possible to obtain all the IDs of created forums to a separate file?