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?
Here it is: http://rugby-forum.ru/wp3/forums/
Looks like this code helps a little bit:
.bbpress .entry-content {
float: none !important;
width: auto !important;
}
Are there any better solutions? And why bbPress reserves this space?
Thank you!
I did it very nice with activated TinyMce for bbpress (simple one) and media upload button.
Then with one snippet limmited users to se only own uploads. It is easy to find on Google.
Now with Shortcode UI (Shortake) it is very easy to make plenty of visual shortcodes for forum. So play with it and use it for attachments.There is allways way to remove other media modal tab items.
I will play a bit with it in future. BBC codes as shortcodes, etc.
yes i am doing php code and what my point is :
let us suppose we have 5 forum categories i want 3 of them to be listed separately and 2 of them listed separately no intermixing can i do that using bbpress ?
codewise – start at
bbpress/templates/default/bbpress/content-archive-forum.php
That is the template that displays the forum list, and work forward from there
Hi I am getting the same error, has any one got fix for this?
Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /srv/wp-includes/functions.php on line 3792
Thanks
Hi
Thanks for the reply.
I have disabled all other plugs and switched to the default unmodified twentyfifteen theme – same problems.
My server has recently been upgraded to PHP 7 and I am seeing very slow performance on the forum pages in general and memory exhausted errors (despite whacking it up from 48MB which used to be fine to 256MB which still sometimes runs out of memory / exceeds processing time on some forum pages).
I tried downgrading PHP but still have the same issue now.
Any other suggestions where in the code I can start debugging?
Thanks
Hello!
I just placed bbPress to a page, using the shortcode ‘[bbp-single-forum id=xxx]‘. Here it is how it looks: http://goo.gl/nawXlP (this is a default Twenty Sixteen theme).
Now, if i click on a topic link, a giant left indentation is introduced: http://goo.gl/LxqQVf
Is there a way to disable this indentation? Forum is almost unusable in such a small width. I was trying something like:
.bbpress #primary {
margin: 0 auto;
max-width: 980px;
width: 100%;
}
But this does not works. Are there any ideas, how to eliminate this indentation?
Thank you!
I have tested your code. Well I can select in the admin panel âedit topicâ or ânew topicâ âfeatured imageâ, I select the pictureâŚwhen I turn back to the topic, no picture. It doesnât remain selected.
I use the latest WordPress: 4.30.
WordPress 4.3
bbPress 2.5.7
My forums have topics but no topics are showing. It is correctly showing:
“This forum contains 1 topic, and was last updated by…”
but also displays
“Oh bother! No topics were found here!”
an no topics are listed.
I checked /wp-admin/edit.php?post_type=topic and no topics are associated with any forums. However, I re-associated each topic with the correct Forum and these changes were persisted on /wp-admin/edit.php?post_type=topic but does not make any difference to the error above and no topics are listed within any forums.
Please advise where in the code I should start debugging?
Thanks
Example forum with 1 topic not showing:
http://www.trenerrycrescent.com/forums/forum/potential-electrical-fire-risk-bathroom-fan-timers/
Hi Everyone,
I finally upgraded my bbpress 1.x to bbpress 2.5.6 after running it for 7 years. The import process took almost a day with 0.5+ million posts.
Now I am facing issue with slow performance, despite running on physical server with 16 core CPU and 16 GB RAM. The upgrade ran fine for few hours has but been very slow from last 12 hours.
The wordpress and bbpress are both so slow that sometimes even the site fails to load. HTOP shows all CPU cores running mysql up to 90%.
I enabled slow query on mysql (mariadb) and it is giving the following output:
[root@server]# mysqldumpslow -t 5 -s at /var/log/mariadb/mysql-slow.log
Reading mysql slow query log from /var/log/mariadb/mysql-slow.log
Count: 7485 Time=25.48s (190747s) Lock=2.85s (21328s) Rows_sent=10.0 (74810), Rows_examined=1582056.1 (11841689862), user[database]@localhost
SELECT wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE N=N AND (
( wp_postmeta.meta_key = 'S' AND CAST(wp_postmeta.meta_value AS SIGNED) NOT IN ('S','S') )
) AND wp_posts.post_type = 'S' AND ((wp_posts.post_status = 'S' OR wp_posts.post_status = 'S')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT N, N
I tried disabling other plugins but it did not make any difference, however the CPU returns to low if I disable bbpress plugin.
Can anyone guide me on what could be the issue here?
Regards,
T
ok, so go into your dashboard and go to
dashboard>plugins>add new plugin and you’ll see near the top left a box that says ‘upload plugin’ ‘ click that and then navigate to were you saved the downloaded bbpress plugin zip file.
Click install and then activate
Then for further help go to
https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/