I’ve got a simple “php if snippet” I’m trying to get into loop-single-reply.php.
Here is an example of my snippet (used for a seperate membership script):
<?php
require_once '/members/library/Am/Lite.php';
$user = Am_Lite::getInstance()->getUser();
?>
<?php
if (Am_Lite::getInstance()->haveSubscriptions(364))
{
?>
<span class='custom-user-donation-badge'>I've Donated!</span>
<?php
}
else {
// do the other thing
?>
<?php
}
?>
I need the code snippet to show only in the profile area of the reply author, if it applies to them.
In other words: “show this if it applies and only show if it applies to this specific reply author.”
I’ve used these before for something similar:
$reply_user_id = bbp_get_reply_author_id();
$reply_user = new WP_User( $reply_user_id )
I’m still leaning php and bbpress. Any suggestions on how I can wrap my code snippet with these bbpress statements? This way, my code snippet will only apply if it applies to the specific author.
Thanks for any suggestions.
Do you have author/avatar in replies too? Then there would be no need for users end point. Paging is huge. I’m using @mapofemergence API for paging currently.
I’ve now joined the #bbpress slack!
@coachhads, what version of bbPress/WordPress are you running ?
See this info –
bbp_topic_author_link
To display just the avatar linked to the member profile you would use:
<?php bbp_topic_author_link( array( 'sep' => '<br />', 'show_role' => false, 'type' => 'avatar' ) ); ?>
or for reply author’s:
<?php bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => false, 'type' => 'avatar' ) ); ?>
Hope that helps
1) Topic Type and Topic Status are only viewable to you/forum admins (aka keymasters), regular users do not see them
2) Wherever you add custom CSS (probably ‘Appearance > Customize’ in the admin menu’s), add this:
.bbp-forum-title {
font-size: 18px; /* make this size whatever you prefer */
}
3) This functionality isn’t built in to bbpress but you could add another plugin to make this happen. Here is an old topic that might provide some suggestions for you: https://bbpress.org/forums/topic/rating-and-sorting-plugin/
Hope that helps
Using latest BBpress, Buddypress and WP, and tested on a fresh install with WP default theme.
When viewing a member profile at http://localhost/mysitename/members/testuser/forums/replies/ there is no ‘in reply to:’ and link to the topic in the header of each reply. Just the date.
I thought perhaps it was theme related (I was using a child theme of the ‘Make’ theme) so have tested on fresh everthing, and it’s still happening.
I’ve created a new topic from the front end and the back end to see if that was related. I’ve used the forum tools to recalculate everything, I’ve ‘reset’ all forums and started again, still not there.
Can anyone else recreate this? Any suggestions? Am I misunderstanding something? Thanks
bbpress 2.6rc3
Importing vbulletin forum and running “Recalculate the position of each reply” give me a blank screen and this message in php.log
[25-Jun-2017 06:56:07 UTC] PHP Fatal error: Allowed memory size of 629145600 bytes exhausted (tried to allocate 126976 bytes) in /home/html/xxxx/public_html/testcms3/wp-includes/wp-db.php on line 1841
[25-Jun-2017 06:56:07 UTC] PHP Fatal error: Allowed memory size of 629145600 bytes exhausted (tried to allocate 65536 bytes) in /home/html/xxxxx/public_html/testcms3/wp-includes/functions.php on line 3720
[25-Jun-2017 06:56:07 UTC] PHP Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0
I increased memory from 300M to 6G but still not enough. I have restarted several times but still not finished.
Wow am I so brain dead that I created that users end point on my own branch of your version 1.0.2 and don’t even remember? (just read previous posts and yes, apparently I did!) All I’m getting from that service is name and avatar, but that was because those were not in the latest topics or replies. If both of those had author name and avatar, I might have no need for a users endpoint unless one wanted to list posts or replies by user.
I’m very close to releasing a read-only version of my app. A day or two likely.
I just joined the WP slack but that’s way too busy and focused on wp core. I think a separate channel for bbPress or the api would be good.
Seems as it is cooming soon. Here is a link to keep an eye on it:
bbPress Topics to WP Posts Converter
Not able to search for users after importing users and posts from Vbulletin 4.2 to bbpress 2.6RC3. I can go to the profile if I know the name.
Imported users have not been mapped to any forum roles or site roles.
Here is code for forum index, forum featured images, not topics:
/*
Plugin Name: bbPress - Forum Icons
Plugin URI: https://gist.github.com/ntwb/8277457
Description: bbPress - bbPress - Forum Icons
Version: 0.1
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
// Original Source: http://www.kristarella.com/2013/04/bbpress-forum-icons/
add_post_type_support('forum', array('thumbnail'));
function ks_forum_icons() {
if ( 'forum' == get_post_type() ) {
global $post;
if ( has_post_thumbnail($post->ID) )
echo get_the_post_thumbnail($post->ID,'thumbnail',array('class' => 'alignleft forum-icon'));
}
}
add_action('bbp_theme_before_forum_title','ks_forum_icons');
In theme functions.php or custom field with functions.php.
It gives featured image metaboxes in backend. Then you display featured image on front as any other post type featured. See how your theme is doing this and copy/paste whole code block.
As you need only fetaured image allowed for admins and moderators you can use this:
add_post_type_support('topic', array('thumbnail'));
add_post_type_support('forum', array('thumbnail'));
/*
Plugin Name: bbPress - Forum Icons
Plugin URI: https://gist.github.com/ntwb/8277457
Description: bbPress - bbPress - Forum Icons
Version: 0.1
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
// Original Source: http://www.kristarella.com/2013/04/bbpress-forum-icons/
add_post_type_support('forum', array('thumbnail'));
function ks_forum_icons() {
if ( 'topic' == get_post_type() ) {
global $post;
if ( has_post_thumbnail($post->ID) )
echo get_the_post_thumbnail($post->ID,'thumbnail',array('class' => 'alignleft forum-icon'));
}
}
add_action('bbp_theme_before_topic_title','ks_forum_icons');
I will see later what is the best way to allow all Users to set topic featured images.
But dont see much point in it. Thousands of forum topics, thousands of images on server x all WP image sizes. Big mess.
Hi. I’m new to WordPress. I’m creating a site and I wanted it to have a forum so I installed bbPress. There are 2 categories in the menu. Each of them contains forums. There’s 3 issues I have.
1) Under the text box for writing a comment, visitors to the site will see “Topic Type” and “Topic Status”, each with its own drop-down menu. I don’t want visitors to have access to those. I looked through all the forum settings and can’t find a way to get rid of them. How do I do it?
2) The font used for the menu is fine but the font used for the forum names is too small. Where do I increase the font size for forum names?
3) Is there something built in to the plugin that lets visitors rank or vote for posts? High-ranking posts would appear above other posts. Does the plugin have anything like this?
Thanks.
They are php templates inside bbPress. The default location in bbPress is /plugins/bbpress/templates/default/bbpress/ look for the ones labelled feedback-no-*****.php and alter/edit the ones you want changed and place them into your theme’s bbpress folder.
Easy peasy.
Chad
and words from the plugin author on moderators in 2.6
In bbPress 2.6, per-forum moderators will work like this:
* Users with the global Moderator role will be able to moderate all forums
* Users assigned as a moderator to a specific forum will act like a moderator in that forum
* This includes private & hidden forums, where the non-moderator (Participant role) user wouldn’t otherwise even be able to see them at all
There are weird situations that could come up, but you’d have to be working backwards in both directions to see them. For example, giving someone the “Blocked” user role, but then trying to make them a moderator in a forum, is weird. In these cases, the block wins.
ok, per forum moderation is something that is 2.6.
Suggest you download the release candidate 3 and try again to see if this is a bug that has been fixed
Download
which version of bbpress ?
Hi @tkserver
I will launch v1.0.3 today on https://wordpress.org/plugins/bbp-api/
Sources are still on https://github.com/ePascalC/bbp-API/
The routes have slightly changed to comply with standard bbPress settings, but when you get the specific forum, e.g. http://www.example.com/wp-json/bbp-api/v1/forums/forum/5914 it would give you the details of the forum and the list of the 20 recent topics with the title, reply_count, permalink, author and avatar.
I see you also wanted the date posted, so let me add that one too before I commit.
If you see other things to add, let me know. But no guarantee on my response time in these weeks 🙂
Pascal.
PS. are you on slack so we could discuss ?
Wordpress Version 4.7.5
We have a new forum and two of my mods are listed as moderators under users, however they can’t access forums listed as “private” for some reason.
Even if I edit the private forum and list them as mods there as well they still can’t access.
https://tko-hacks.com/forums/
Allowing untrusted users the ability to upload images to your site is one of those frequently requested but still pretty risky features we’ve so-far shied away from.
WordPress (and most server configs) don’t do the type of strict file/mime type checks you’d want before enabling this, so JPGs and GIFs can embed other weird stuff and most sites would have no idea.
There are some plugins out there to enable it, but it’s not something we’ll include with bbPress proper until WordPress (and most hosts) have a better setup under the hood.
This is because you’re actually using an old version of bbPress 2.6. bbPress 2.6-RC3 is published on the WP.org plugin repo (although it’s a bit hard to find with the new design), so WordFence is using those files as the comparison. These are legitimate file changes, and I would recommend updating to 2.6-RC3. Below is the official download link
https://downloads.wordpress.org/plugin/bbpress.2.6-rc-3.zip
@jwill207, Without seeing the page you’re trying to change, it’s hard to say what you need to do.
@5unnykum4r, This is a separate issue. Please start a new topic, and provide some extra details. Also, it appears that you’re not using bbPress, so it might be better to post your question here, https://wordpress.org/support/.
@karilistermanyahoocom
The default from email address for bbPress emails is noreply@(url).com. If you’re seeing wordpress@(url).com, it’s either not an email sent by bbPress, or you’re using a plugin that is changing the from address for all emails sent.
To change the bbPress email, you would use the filter bbp_get_do_not_reply_address. For most (if not all) emails sent by your WordPress install, you’d use the wp_mail_from filter.
You may want to try the latest 2.6 release candidate instead.
Download
Fatal error: Uncaught Error: [] operator not supported for strings in /opt/lampp/htdocs/MY_Theme/wp-content/plugins/bbpress/includes/forums/functions.php:1800 Stack trace: #0 /opt/lampp/htdocs/MY_Theme/wp-includes/class-wp-hook.php(298): bbp_pre_get_posts_normalize_forum_visibility(Object(WP_Query)) #1 /opt/lampp/htdocs/MY_Theme/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(”, Array) #2 /opt/lampp/htdocs/MY_Theme/wp-includes/plugin.php(515): WP_Hook->do_action(Array) #3 /opt/lampp/htdocs/MY_Theme/wp-includes/class-wp-query.php(1683): do_action_ref_array(‘pre_get_posts’, Array) #4 /opt/lampp/htdocs/MY_Theme/wp-includes/class-wp-query.php(3248): WP_Query->get_posts() #5 /opt/lampp/htdocs/MY_Theme/wp-includes/class-wp.php(617): WP_Query->query(Array) #6 /opt/lampp/htdocs/MY_Theme/wp-includes/class-wp.php(735): WP->query_posts() #7 /opt/lampp/htdocs/MY_Theme/wp-includes/functions.php(955): WP->main(Array) #8 /opt/lampp/htdocs/MY_Theme/wp-admin/includes/post.php(1072): wp(Array) #9 /opt/lampp/htdocs/MY_Theme/wp-a in /opt/lampp/htdocs/MY_Theme/wp-content/plugins/bbpress/includes/forums/functions.php on line 1800
I’m using 4.8 WordPress version.
I just installed bbPress plugin that error occurs.
Please help me to resolve it.
Thanks.