Forum Replies Created
-
I really appreciate what you’ve done for me. Thank you!!!
Yes, I’d like to specify a reply to a topic and get the number of replies to it.
I am glad if there is a function like xxx below.
<?php $topic_id = 1 ; echo bbp_topic_reply_count( $topic_id ) ; // 3 ?> <?php xxx(100) ; // 2 ?> <?php xxx(101) ; // 0 ?> <?php xxx(102) ; // 0 ?>
Do you have any sugesstions?
It is a code that specifies the topic ID and obtains the number of replies.
What I want to know is a code that specifies the reply ID and obtains the reply number.
Thank you so much.
In reply to: How to set limits on the number of replies to topicsThank you for helping me:)
In reply to: How to set limits on the number of replies to topicsHi,
Unfortunately, it didn’t work out.add_action( 'bbp_new_reply_post_extras', 'rew_close_topic' ); function rew_close_topic ($reply_id) { // find out the topic_id $topic_id = bbp_get_reply_topic_id ($reply_id) ; $count = bbp_get_topic_reply_count ($topic_id) ; if ($count >9) bbp_close_topic( $topic_id ); }
If you have further information, please let me know.
Thanks.In reply to: How to set limits on the number of replies to topicsI changed that number from 100 to 10 and posted over 11 replies.
if ($count == 100) bbp_close_topic( $topic_id );
↓
if ($count == 10) bbp_close_topic( $topic_id );
However, it was not closed.
Thanks.
In reply to: How to set limits on the number of replies to topicsHi, Thanks for the reply.
But that code did not close.
So, I wrote the following code for now.
<p id="replies_count"><?php bbp_topic_reply_count(); ?></p> <script> (function($){ var replies_count = $('#replies_count').text(); if( replies_count >= 100 ){ $('.bbp-reply-to-link').css('display','none'); } })(jQuery); </script>
However, It’s incomplete just because it is hidden, so I would like to close it as well.
Please let me know again if there is another code.
Thanks.
By adding
'author' => bp_displayed_user_id(),
to this code, my purpose can be achieved.
https://www.daggerhart.com/bbpress-recent-replies-shortcode/But I would like to output with the same structure as BuddyPress activity.
Thanks a lot!!
sorry, I re-wrote that.
▼For example:
topic ID = 100
-first reply to topic ID 100 = post ID 105
--first reply to post ID 105 = post ID 106
-second reply to topic ID 100 = post ID 107
-third reply to topic ID 100 = post ID 108
--first reply to post ID 108 = post ID 109
---first reply to post ID 109 = post ID 110
---second reply to post ID 109 = post ID 111▼I expect the following get:
Get 0 using 105, 107, 108.
<?php echo bbp_get_form_reply_to(105); //Get 0 ?>
<?php echo bbp_get_form_reply_to(107); //Get 0 ?>
<?php echo bbp_get_form_reply_to(108); //Get 0 ?>
Get 105 using 106.
<?php echo bbp_get_form_reply_to(106); //Get 105 ?>
Get 108 using 109.
<?php echo bbp_get_form_reply_to(109); //Get 108 ?>
Get 109 using 110, 111.
<?php echo bbp_get_form_reply_to(110); //Get 109 ?>
<?php echo bbp_get_form_reply_to(111); //Get 109 ?>
I want to obtain the reply ID based on the post ID.
Thanks.
In reply to: Allow HTML tags in Post for All UsersWhat should I do if I do not want to allow div?
// Div 'div' => array( 'class' => false, 'style' => false, ),
This is not it, right?