ah yes, it should have been
bbp_get_reply_type()
to make it a function, but ‘reply’ is equally as good
Thanks, Robin works great, although the bbp_get_reply_type
and bbp_get_topic_type
caused an error so I replaced it with bbp_get_all_child_ids($topicID, 'reply');
and it seems to have done the trick!
or
$ids = bbp_get_all_child_ids($topicID , bbp_get_reply_type) ;
a quick look at that function would seem to be
$ids = bbp_get_all_child_ids($topicID , bbp_get_topic_type) ;
untested, but try
add_filter( 'bbp_get_view_query_args', 'rew_limit') ;
function rew_limit ($args) {
$args['posts_per_page'] = -1 ;
$args['posts_per_page'= 10 ;
return $args ;
}
not sure which 10 it will show!!
Is there a way to limit the number of topics shown when using the shortcode [bbp-single-view id=βpopularβ]
?
I would only like to show the top 10 most popular topics.
Thanks
Hi,
Your piece of code has an unwanted side effect. When looking at a subscriber as admin the created replies of this subscriber do not show anymore.
I reverted back to the original code (on top of this topic) and presto the replies of the subscriber show up again.
Hello
to clean up my pending and spam threads and answers, iam using two show SQL queries. Is there maybe any plugin or cron which can execute them?
DELETE FROM wp_posts WHERE post_status = "pending";
DELETE FROM wp_posts WHERE post_status = "spam";
Regards
Maxx
@traverser11 – great that you are posting the answers here – so many don’t π π π
can you summarise where you are at, so eg
use this plugin (are you still using the sort topic replies plugin?)
delete this code from it
add this code to this place
etc.
so it is all in one thread, I’ll then try to give to some switch on and off code
Oh here is an answer!
Wrong bbp_get_reply_url() when paging with reverse order
This snippet works – i’m just a bit confused how to turn it on when replies are descending and off when they are ascending…
add_filter('bbp_get_reply_position', 'lugpa_get_reply_position', 10, 3);
function lugpa_get_reply_position($reply_position, $reply_id, $topic_id){
if(empty($topic_id))
$topic_id = bbp_get_reply_topic_id ($reply_id);
$numReplies = bbp_get_topic_reply_count($topic_id);
return ($numReplies+1) - $reply_position; // plus one because of thread description
}
I gave it a go, and it kinda worked, lol…
But this reverses all the replies INCLUDING the original topic.
So the original topic goes to the bottom…
What I would ideally want is the Topic, THEN the replies in reverse order…
// Reverse reply order on News topic
add_filter('bbp_has_replies_query','bbp_reverse_reply_order');
function bbp_reverse_reply_order( $query = array() ) {
// Identify post type
$bbPress_post_id = get_the_ID();
$bbPress_post_type = get_post_type($bbPress_post_id);
if( $bbPress_post_type =='topic' ){
/** TOPIC **/
$query['order']='DESC';
return $query;
}
};
Checking in because I want this too… there was a plugin called ‘bbpress sort topic replies’, that no longer works, but I’m going to try to grab the code from that
Thanks again for taking a look is the code that appends the checkboxes to the bbpress topic forms… I guess $_POST is a global variable that bbpress topic form is also using?
Sorry this is obviously a bit beyond me. And obviously beyond a free solution! But yes if you or others in bbpress do paid work like thiset me know and I’ll be in touch!
// Add custom taxonomies to topic form
add_action ( 'bbp_theme_after_topic_form_content', 'bbp_extra_fields');
function bbp_extra_fields() {
$value = get_post_meta( bbp_get_topic_id(), 'issue', true);
echo '<div id="custom-meta">';
echo'<fieldset>
<legend>Issues</legend>';
$issues = get_terms('issue', array('hide_empty' => 0));
foreach ($issues as $issue) {
echo '<span><input type="checkbox" class="issue" for="issue" value="'.$issue->slug.'"></input><label>'.$issue->name.'</label></span>';
};
echo '</fieldset>';
$value = get_post_meta( bbp_get_topic_id(), 'region', true);
global $region;
$region = get_terms('region', array('hide_empty' => 0));
echo'<fieldset>
<legend>Region</legend>';
$regions = get_terms('region', array('hide_empty' => 0));
foreach ($regions as $region) {
echo '<span><input type="checkbox" class="issue" for="issue"value="'.$region->slug.'"><label>'.$region->name.'</label></span>';
};
echo '</fieldset></div>';
};
ok, beyond free help, but my code takes an array from $_POST – which presumably is what your form is creating?
maybe post your form code? and I’ll take one last look
Thank you for the plugin.
It worked well. There is a provision to allow only the moderator to reply. However, there doesn’t seem to be a provision to allow the topic creator to reply to his own topic.
If I set it to ‘create/edit/view OWN topics’, the user is unable to view other topics.
Is there a fix to this?
I found this topic – https://bbpress.org/forums/topic/how-to-make-only-post-author-and-moderators-can-reply/
It seems to address the problem, but the file is unavailable. And I’m not sure how to use the code in the last reply.
Hello,
I’ve question, I already read around the bbPress roles and capabilities
But, I still not sure do the user with Participant roles, can set the Topic Status to Closed when Create New Topic in the forum.
Thanks.
I installed bbpress and it is activated – when I go into users there is a forum users option for every other wordpress user other than me the administrator.I did not get a welcome page. I have no option to edit my role under my users – I can do this for all the other users on my site.
I use X-theme which is supposed to support this plugin. I have a feeling this has to do with the fact that I am not listed at the keymaster, but there seems to be no way to do this.
I am not good at coding or knowing where to put code, so if it involves any please be very specific – where it needs to go, what to type in etc…
Thanking everyone in advance
I have just found that it works perfectly if I disable Ultimate Member Plugin.
I don’t even require above code and all the user profile pics seems to be working properly.
so it works except widgets and shortcode? (and which shortcode?)
Hi,
Is this file still available?
Can you please tell me where I’m supposed to add the code?
so if you are allowing registration, how are users registering – what widget or shortcode or method are you using ?
I think your theme is adding another one in the bbpress templates
so in 2.6.x they are added in
\bbpress 2.6.6\templates\default\bbpress\form-reply.php
\bbpress 2.6.6\templates\default\bbpress\form-topic.php
so your have 2 choices
a. the better one
Look in each of the files you listed as being bbpress in your themes template and look for a line which says something like
bbp_get_template_part( 'form', 'user-login' );
and edit out this line
b. If you can’t find it there, then
find
wp-content/plugins/bbpress/templates/default/bbpress/form-reply.php
transfer this to your pc and edit
remove the line which says
<?php bbp_get_template_part( ‘form’, ‘user-login’ ); ?>
and save
create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpress
where %your-theme-name% is the name of your theme
Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/form-reply.php
bbPress will now use this template instead of the original
Repeat this for form-topic.php
could i just add a function in the functions.php
file with something like:
if user_is_logged_in –> don’t show loginbar
Still waiting to see if people using the Forums are having any issues using them.
not sure what this means π
I would like to change the font color against the maroon top bars, from black to yellow, or grey, but I am not finding the right tab to do so.
probably theme related, but link to an example on your site please.
Why are there tabs for setting up logins/logim failures, if logging in is accomplished at the WordPress level?
bbpress has some widgets and shortcodes that let users enter username and password. these details are passed to wordpress security to go through login.