well done michael! it looks like you did it! but i think there is a more simple way to do so(lets say another way instead of an easy way because your way is not difficult also!). when you install bbpress you can go to yoursite/topics and see list of all topics. in this page you can see similarities with items that you really need:
http://dl.dropbox.com/u/65583116/topics1.JPG
the only thing you need to do is find out what file in bbpress do this job. the file is:
loop-single-topic.php
and here is the codes related to what we want:enter link description here
and finally the last thing is having a summary of topic content. that’s i dont know it yet! 😀
I am using BBPress and in the header I have created an login/logout section for when a guest or user is logged in. I’m currently trying to create a “My Profile” link when a user is logged in but I’m unsure of the functions to achieve this (or if I am using the right functions currently). My code for this currently is:
if(is_user_logged_in()) {
global $current_user;
get_currentuserinfo(); $text .= 'Hi '.$current_user->display_name.'!';
echo $text;
echo "#"'>My Profile | Logout"; }
else{echo "You are currently not logged in!";
echo "Register |
Log in"; }
-
This topic was modified 13 years, 8 months ago by
mighty_fox.
-
This topic was modified 13 years, 8 months ago by
mighty_fox.
I’ve checked the documentation of FORCE INDEX, forget the “solution” I’ve posted above. Actually speaking this snippet (maybe) work:
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts FORCE INDEX (PRIMARY, post_parent) JOIN wp_icl_translations t ON wp_posts.ID = t.element_id AND t.element_type IN ('post_topic') JOIN wp_icl_languages l ON t.language_code=l.code AND l.active=1 WHERE 1=1 AND (wp_posts.ID = 647 OR wp_posts.post_parent = 647) AND wp_posts.post_type IN ('topic', 'reply') AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'closed') AND t.language_code='en' ORDER BY wp_posts.post_date ASC LIMIT 0, 15
Notice the positioning of the FORCE INDEX. Unfortunately we can’t change that part of the query from ‘_bbp_has_replies_where’. We must use the ‘posts_join’ filter, check if WPML have injected its stuff and add the FORCE INDEX.
Another update:
Switching the page.php template with the code of the page-front-forums.php doesn’t work either..
It will output all forums twice.
I really hope @JJJ or somebody else would comment on this because i can’t believe this is default bbPress and WordPress stuff.
It has to be a bug.
Hi Tom,
Well i don’t know much about Artisteer because WordPress is not like iWeb or RappidWeaver where you can drag&drop to make your lay-out, If you would like to build or customize your lay-out you need some understanding of HTML , CSS and a bit PHP.
I’ve helped lots of people at the Dutch WordPress forums and most of them often had trouble with Artisteer because the software often didn’t supported some simple WordPress Codex.
https://nl.forums.wordpress.org/profile/macpresss
zaerl,
Thank you for your help. Unfortunately, I now get a different but similar error (notice the addition of the ‘FOR’:
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FORCE INDEX FOR JOIN (PRIMARY, post_parent) WHERE 1=1 AND (wp_posts.ID = 647 OR ' at line 2]
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts JOIN wp_icl_translations t ON wp_posts.ID = t.element_id AND t.element_type IN ('post_topic') JOIN wp_icl_languages l ON t.language_code=l.code AND l.active=1 FORCE INDEX FOR JOIN (PRIMARY, post_parent) WHERE 1=1 AND (wp_posts.ID = 647 OR wp_posts.post_parent = 647) AND wp_posts.post_type IN ('topic', 'reply') AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'closed') AND t.language_code='en' ORDER BY wp_posts.post_date ASC LIMIT 0, 15
I am still learning programming in WP and my SQL skills are pretty much non-existent.
It looks like the editor munged my code, so here’s a pointer to the code (in a .txt file): http://www.dalluva.com/temp/topic-excerpt.txt
Cheers.
Michael
Okay, I’ve made some progress with this, though it’s not quite where I want it to be. I’ve been playing around with the function calls in bbp-topic-template.php, and been able to create a block of code that creates excerpts of topics (though not replies to topics…yet).
Here’s the resulting output: http://www.dalluva.com/temp/example-excerpt-block-getting-there.JPG
And here’s the code block (so far):
$max_shown = 3;
$parent_forum = 'any';
$excerpt_length = 200;
$avatar_size = 60;
$topics_query = array(
'author' => 0,
'post_type' => bbp_get_topic_post_type(),
'post_parent' => $parent_forum,
'posts_per_page' => $max_shown,
'post_status' => join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ),
'show_stickes' => false,
'meta_key' => '_bbp_last_active_time',
'orderby' => 'meta_value',
'order' => 'DESC',
'meta_query' => array( bbp_exclude_forum_ids( 'meta_query' ) )
);
$topic_query = new WP_Query( $topics_query );
if ( $topic_query->have_posts() ) :
$first_time = 1;
?>
have_posts() ) :
if ( $first_time == 1 ) : $first_time = 0;
else : echo "" ;
endif;
$topic_query->the_post();
$topic_id = bbp_get_topic_id( $topic_query->post->ID ); ?>
<a class="home-topics-a" href="" title="">
In Forum ""
By , Posted about
<a class="home-topics-more more" title="Join the Conversation" href=""> READ MORE
<?php
endif;
I'm going to keep working this and I'll post my final results in the coming days. Any comments/input are appreciated. Cheers. Michael
Checking the function code in bbp_topic_template.php, the call bbp_topic_excerpt() already accepts a $length argument; the default is 100, but it can be changed. Doh! It can be used as-is.
Michael
Just curious, i’ve worked with bbPress before but it looks like the WordPress Hierarchy is broken by bbPress.
http://codex.wordpress.org/images/1/18/Template_Hierarchy.png
Normally i could make a page template and call it page-forums.php to make sure WP would use this page template for a new page created by the slug forums
But for some strange reason this doesn’t work anymore with bbPress 2.2.1 and WP 3.5 Beta and Twenty Twelve.
How can i make sure WP or bbPress uses a different page template then page.php for showing the forums and category -index on the forums slug?
I’ve tried everything, Copy/Paste the page-front-forums.php from the Extra’s folder to my Theme’s Root -> Created a new page inside my Dashboard and called it Forums… Nope doesn’t work.. Even when i use the Shortcode [bbp-forum-index] on that last created page.. It keeps using the page.php by default..
Anybody who can help ?
Because this it totally not very cool 🙂
Hi,
Great forum plugin!
I am however experiencing some annoying theme compatibility issues…
My forum page (with [bbp-forum-index] shortcode) was wrongly picking up my theme’s css, instead of the bbpress css.
Resulting in an unusable forum layout.
I have applied the theme compatibility actions by copying the necessary bbp-theme-compat directory/files to my theme root.
By setting the correct bbpress page template via its page attributes, the main forum page (now without shortcode) seems to pick up the bbpress css. But shortcodes are still picking up the wrong css via the default theme page template..
Any suggestions to make shortcodes work with the bbpress css instead of the theme’s css?
Are there any additional css styles available that work with the bbpress theme-compat templates?
I am using wp 3.4.2, bbpress 2.1.2 and my theme is generated with Artisteer 4.
Regard,Tom
Somewhere in your bbPress theme file there is an unneeded comma sitting between two quotation mark characters.
Remove ", " …and you should be good.
As for features; it really depends on what you’re looking for. GD bbPress Toolkit has some cool features; like attachments, signatures, custom views etc.
bbPress is a WordPress plugin. It doesn’t operate independently; so you will need to either create a second install of WordPress on the subdomain or create a WordPress network.
> This is intended to be a site-wide forum and not group specific.
If you do not intend to use the internal BuddyPress Group Forums, then go to Settings > BuddyPress > Components panel and uncheck Discussion Forums component. https://codex.buddypress.org/getting-started/configure-buddypress-components/
I solved this with some CSS. First, in WP-Admin > Appearance > Menus, i added a custom CSS class to my tabs (at least my Forum tab and News tab). If you don’t see the CSS-classes field, toggle it on in the Screen-Options. For my Forums tab, i set a CSS class of “nav1-forum” and my News tab got “nav1-news”.
Then in my CSS file (style.css), i added this to my Active-tab styles
.bbPress #main-menu #menu-main-menu li.nav1-forums a,
which makes the Forum tab highlighted whenever bbPress is “on” (based on the body class “.bbPress”.
And I added this to my Inactive-tab styles:
.bbPress #main-menu #menu-main-menu li.nav1-news a,
which forces my News tab (which is for my normal “posts” post-type, the blog area of my site), to appear as Inactive, even though its element actually does incorrectly have the class “current_page_parent”.
Of course you may need to adjust the IDs in the css, to match your html.
Has a solution been found for this yet? When viewing any page of my Forum, my Menu (from wp_nav_menu) actually shows my NEWS tab (the LI element) (the normal “posts” post-type, for the blog section) with the “current_page_parent” class. So my forum looks as if it’s in the News section. I do have a Forum tab in my menu, but it is the Forum index page (using a shortcode). I suppose i can just use CSS to fix all this, but i would think bbPress would be able to avoid incorrectly triggering the “current_page_parent” class on the wrong element.
Wordpress and bbPress are up to date. This is part of a WordPress multisite install.
http://anabaptistworship.com/category/community-music/
I am using a custom child theme and there is no error when I switch to twentyeleven.
I recently started getting this error, even on pages that aren’t part of bbpress on my site. I’m not sure when it started–maybe with a recent update?
Error:
Warning: Missing argument 2 for _bbp_has_replies_where() in /hermes/waloraweb048/b1387/as.rethink/wp-content/plugins/bbpress/bbp-includes/bbp-reply-functions.php on line 1381
Fatal error: Call to a member function get() on a non-object in /hermes/waloraweb048/b1387/as.rethink/wp-content/plugins/bbpress/bbp-includes/bbp-reply-functions.php on line 1384
Lines 1381-1385 of the file it mentions:
function _bbp_has_replies_where( $where, $query ) {
// Bail if no post_parent to replace
if ( ! is_numeric( $query->get( 'post_parent' ) ) )
return $where;
Any suggestions? Thanks!
Hi,
I am unable to view the topic or reply content. With debug on I receive the following error
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘FORCE INDEX (PRIMARY, post\_parent) WHERE 1=1 AND (wp\_posts.ID = 647 OR wp\_posts.’ at line 2] SELECT SQL\_CALC\_FOUND\_ROWS wp\_posts.* FROM wp\_posts JOIN wp\_icl\_translations t ON wp\_posts.ID = t.element\_id AND t.element\_type IN (‘post\_topic’) JOIN wp\_icl\_languages l ON t.language\_code=l.code AND l.active=1 FORCE INDEX (PRIMARY, post\_parent) WHERE 1=1 AND (wp\_posts.ID = 647 OR wp\_posts.post\_parent = 647) AND wp\_posts.post\_type IN (‘topic’, ‘reply’) AND (wp\_posts.post\_status = ‘publish’ OR wp\_posts.post\_status = ‘closed’) AND t.language\_code=’en’ ORDER BY wp\_posts.post\_date ASC LIMIT 0, 15
I have had this error since I installed this plugin over a month ago and have not been able to fix it. At that time I found this ticket1 which lead me to this 2 line change2. I decided to add these two lines but that did not help either.
I have switched themes to Twenty Ten bbPress, Twenty Eleven, and the standard Twenty Eleven. I have also disabled almost all plugins (not WPML because I’ve had bad experiences with disabling and re-enabling it). None of this troubleshooting actions have helped. I then sat around waiting for an update, but unfortunately one has not come yet.
Since we are reaching the launch date I would like any help from anyone who has encountered this issue and successfully fixed it.
Thank you so much! Tamara
-
This topic was modified 13 years, 8 months ago by
tamarazuk.
The class is “status-closed”. You can change the title of a topic in this way:
add_filter('the_title', 'custom_the_title', 10, 2);
public function custom_the_title($title, $post_id) {
if(get_post_type($post_id) === bbp_get_topic_post_type() &&
bbp_is_topic_closed($post_id)) {
return '[Resolved] ' . $title;
}
return $title;
}
-
This reply was modified 13 years, 8 months ago by
zaerl.
-
This reply was modified 13 years, 8 months ago by
zaerl.
bbp_get_user_profile_url( $user_id = 0, $user_nicename = '' )
is the function for retrieving the user profile URL. If you don’t pass an ID it takes that current user ID.
\wp-content\plugins\bbpress\bbp-theme-compat\bbpress\user-details.php
\wp-content\plugins\bbpress\bbp-theme-compat\bbpress\user-favorites.php
\wp-content\plugins\bbpress\bbp-theme-compat\bbpress\user-subscriptions.php
\wp-content\plugins\bbpress\bbp-theme-compat\bbpress\user-topics-created.php
are the template files that you can override in your own template.
Hi,
I have created a custom registration which works and has custom fields. In my header I have added code which checks if the user is logged in. When logged in I want to have a link to ‘My Profile’ for the user. I would like to know where I can find out this information and where it is generated.
Also I would like to know what files create the user profile page, as I would like to customize it.
Thanks for your help in advance.
yep currently i have no reason to use BBpress. The above reply or elese where on the forum is that it is only 500 lines of code. Okay thanks no thanks.
Im here to download and use this program as how the demo look, not how it looks minus 500 lines of code. You could write Download BBPress minus 500 lines of code see how many download.
Like I said Im willing to pay for theme. I dont see logic of withholding it. All it does is make me forget about bbpress. Not everyone installing these scripts is a programmer / designer. 500 lines might as well be 1 million to me and others.
I thank the guys who created this for their great effor, it looks nice.