get_userdata already returns you the WP_User object. This should do it:
`
$user = get_userdata( bbp_get_reply_author_id( bbp_get_reply_id() ) );
if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
echo $user->roles[0];
}
`
Putting this in your theme’s CSS will be a start, but you’ll likely need more CSS tweaks as you go to play nice with your theme.
#bbpress-forums li {
margin: 0;
list-style: none;
background: none;
padding: 0;
}
i tried @jaredatch by putting above code in my theme’s style.css. but still the list style appears..
need more help here please…
`
$user_id = get_userdata( bbp_get_reply_author_id( bbp_get_reply_id() ) ); // Return the get_userdata information
$user = new WP_User( $user_id );
if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
$roles = $user->roles;
echo $roles[0]; //echos only the first role index of 0 of array $roles;
/* Echos all roles
foreach ( $user->roles as $role )
echo $role.””; */
}
`
Accomplished Display the Replies author’s role with the Above ^. Seems like alot of code for such a simple thing but it works :D. Thanks.
Thanks again, ill look through the code some.
Replies are not comments.
`bbp_get_reply_author_id( bbp_get_reply_id() );` will give you what you need.
Let me recommend you to give a good look at the bbPress source code. It’s surprisingly well documented.
You need to make an exception for
wp-admin/admin-ajax.php
See https://codex.wordpress.org/AJAX_in_Plugins
My bad, sorry. Wrong filter.
Do this:
add_filter( 'bbp_pre_get_user_profile_url', 'my_custom_author_link' );
function my_custom_author_link( $user_id ) {
return get_author_posts_url( $user_id, '' );
}
You’re sending false instead of empty. Try this:
add_filter( 'bbp_get_user_profile_url', 'my_custom_author_link' );
function my_custom_author_link( $user_id ){
return get_author_posts_url( $user_id, '' );
}
add_filter( 'bbp_get_user_profile_url', 'my_custom_author_link' );
function my_custom_author_link( $user_id ){
$author_info = get_userdata( 1 );
$author_name = $author_info->user_nicename;
return get_author_posts_url( false, $author_name );
}
is working properly.
but when i change the input of
$author_info = get_userdata( 1 );
to
$author_info = get_userdata( $user_id );
I get:
Notice: Trying to get property of non-object in C:\xampp\htdocs\wordpress\wp-content\themes\WoW_Public_Vent_Theme\functions.php on line 274
and it does not work :(;
Soo close.
I Tried:
add_filter( 'bbp_get_user_profile_url', 'my_custom_author_link' );
function my_custom_author_link( $user_id ){
return get_author_posts_url(false, $user_id);
}
get_author_link(); appears to have been depreciated.
So using:
add_filter( 'bbp_get_user_profile_url', 'my_custom_author_link' );
function my_custom_author_link( $user_id ){
return get_author_posts_url( $user_id, false );
}
I am able to get to:
http://localhost/wordpress/author/
which is sooo close to what i need.
I need it to return http://localhost/wordpress/author/$user_name
Add this to your functions.php. Reload your site and then remove the code. It only needs to be executed once:
`
update_option( ‘_bbp_forums_per_page’, 100 );
`
You can use the bbp_get_user_profile_url filter. Something like:
add_filter( 'bbp_get_user_profile_url', 'my_custom_author_link' );
function my_custom_author_link( $user_id ){
return get_author_link(false, $user_id);
}
(Not tested, but should help you get on track)
WordPress V3.5.1
BuddyPress 1.6.5
bbPress 2.2.4
I have just moved my group forums from BuddyPress and added a sitewide forum as per these instructions http://codex.buddypress.org/user/buddypress-site-administration/migrating-from-old-forums-to-bbpress-2/
Everything is working except for 1 thing.
Any user with a forum role of Participant cannot see the opening topic post in any thread. They can see all replies. It doesn’t matter if they created it or another user did, they can’t see the opening post.
If I change their role to Moderator they can see the opening post. But, I don’t want everyone to have moderator rights.
I tried changing the capabilities of Participant (using capability manager plugin), but that didn’t work either.
Can someone please HELP!!!
thank you
Hi moebi
I came here from a google search regarding subforuns in bbpress.
Even before I install wp+bp+bbpress i´d love to know if you have news on this. For the kind of community i´m planning subforuns is a must 🙂
Also looking at your code, i´ve found in my group.php
` */
public function remove_forum( $forum_args = array() ) {
// Bail if no forum_id was passed
if ( empty( $forum_args[‘forum_id’] ) )
return;
` where public function is line 610 and so i´m a bit lost.
Any help would be appreciate.
Thanks
I am looking to display additional profile fields I created with s2member.
I opened user-profile.php.
I think I need to write more of these lines and edit them to call on the additional s2member profile fields:
“
<p class=”bbp-user-description”><?php bbp_displayed_user_field( ‘description’ ); ?></p>
<?php endif; ?>“
I have not yet located the s2member code to add to above code. If anyone has accomplished this, please let me know.
After digging into the source code of search, I found that it uses SQL’s LIKE for searching. So…no fulltext search.
I searched on the Web and it looks like Sphinx can give me a solution, though it requires extra setup and configuration. MySQL 5.6.4 will add supports of fulltext search for InnoDB as well.
I’m testing bbPress 2.3-rc1 with BuddyPress 1.7-rc1 on WP3.5.1 and may have encountered an issue with bbp_get_topic_id().
Can bbp_get_topic_id() be used to get the main topic id from a Buddypress group>forum>topic+replies page?
If yes, then how? (a quick code line example please)
If not then how else should this be done?
Thank you.
The ‘Private: …’ is added by WP in wp-includes/post-template.php inside of the function get_the_title(). bbpress uses this function in it’s own function bbp_get_forum_title() to generate the title -> ‘Private:’ is appended first time. When the theme now calls the_title() ‘Private:’ is appended again.
I adjusted bbp_get_forum_title() now: Add two filters, the first removes the ‘Private:’ from all Breadcrumbs and so on, the second appends ‘Private Forum:’ to the forum title.
function bbp_get_forum_title( $forum_id = 0 ) {
$forum_id = bbp_get_forum_id( $forum_id );
add_filter( 'private_title_format', function(){ return '%s'; } );
$title = get_the_title( $forum_id );
add_filter( 'private_title_format', function(){ return __( 'Private Forum: %s', 'bbpress' ); } );
return apply_filters( 'bbp_get_forum_title', $title, $forum_id );
}
Could one of the devs please take a look if this would be an option for you? I hardcoded it for now…
Hi everyone. I’m in the process of migrating my website from phpBB to bbPress. In modifying the template, I feel like I’m pretty limited to what I can change without getting into modifying core files.
Basically, this is what my phpBB forum looks like – 
And this is how my bbPress looks like right now – 
I want to retain the look of the former, but in the archive-forum.php template file, the only code that is being called in that area is “bbp_get_template_part( ‘content’, ‘archive-forum’ );”
It looks like bbp_get_template_part() is calling the entire thing, whereas I’m used to phpBB giving me individual tags – I guess their equivalent to what you’d call shortcodes? – for the category name, the forum name, number of posts etc to place them precisely where I want them in the template.
So what am I missing? What file can I modify, or what functions could I call, that would allow me that same level of control?
Hopefully this is coherent. I’m pretty new to using bbPress – and BuddyPress, and WordPress… – so I feel a bit mentally fatigued from learning these systems, lol. Any help would most certainly be appreciated. Let me know if anything needs clarification, and thanks in advance to anyone who reads this wall of text. Cheers.
make a new page and add the register shortcode to that page, then add the url for that page to the widget
`[bbp-register]`
more shortcodes here
https://codex.bbpress.org/shortcodes/
What’s the short code you used? I’m haveing a simular issue. I can see this page: http://mydomain.com/?post_type=forum and my individual forums. But not http://b1ker.com/forums
Okay, a little more information. It seems like there are 914 topics in the bb_topics table, and when i query for the last topic that was imported, I find it:
mysql> SELECT * FROM bb_topics WHERE topic_title like '%How get the original%' ORDER BY topic_start_time DESC;
+----------+---------------------------------------------+-------------------------------------------+--------------+-------------------+-------------------+------------------------+---------------------+---------------------+----------+--------------+------------+--------------------+--------------+-------------+-----------+
| topic_id | topic_title | topic_slug | topic_poster | topic_poster_name | topic_last_poster | topic_last_poster_name | topic_start_time | topic_time | forum_id | topic_status | topic_open | topic_last_post_id | topic_sticky | topic_posts | tag_count |
+----------+---------------------------------------------+-------------------------------------------+--------------+-------------------+-------------------+------------------------+---------------------+---------------------+----------+--------------+------------+--------------------+--------------+-------------+-----------+
| 914 | How get the original Request URI from JSF ? | how-get-the-original-request-uri-from-jsf | 650 | ceefour | 650 | ceefour | 2012-08-04 11:25:22 | 2012-08-04 19:27:20 | 1 | 0 | 1 | 3909 | 0 | 3 | 4 |
+----------+---------------------------------------------+-------------------------------------------+--------------+-------------------+-------------------+------------------------+---------------------+---------------------+----------+--------------+------------+--------------------+--------------+-------------+-----------+
1 row in set (0.00 sec)
However, when I query for something else that should exist. One of the newer posts that was not imported: (http://ocpsoft.org/support/topic/get-encoded-url-in-filter) I come up with nothing:
mysql> SELECT * FROM bb_topics WHERE topic_title like '%get encoded%' ORDER BY topic_start_time DESC;
Empty set (0.00 sec)
mysql>
How is it that this topic clearly exists and shows up on the website, but it would not exist in the bb_topics table? Answering this seems like it would lead to the root cause of this migration problem.
Thanks again for all of your help,
Lincoln
On an interesting side note, I added the short code for the index and it seems to work. Is this the proper way or did it just work because it was a shortcode.
(Worked for the default theme, not Canvas. Canvas just displays some non-formatted HTML)
I have the same problem- firefox only. On user profile pages Topics Started and Replies Created do not appear- only the title. I added this code from a bbPress forum (3 months, 3 weeks ago) to my WP style.css file:
.bbp-user-section {
overflow: auto;
}
and this code:
#bbpress-forums .bbp-user-section ul.bbp-topics {float: left !important;}
and both together and no change
I have spent time on the forums, but maybe there is a solution somewhere that I missed.
Thank You
WP 3.5.1
bbPress 2.2.4
Thematic Theme
You can use a widget in your sidebar https://codex.bbpress.org/widgets/
Or create a page with some shortcodes https://codex.bbpress.org/shortcodes/