Forum Replies Created
are you still there? If you have no time for write the code, could you please give me at least some suggestions?
Thank you very much for your reply!!!
What I want to do is to echo in the reply comment form textarea “@username” (where username is the username author of the comment I’m going to reply.
Add the “@username” for activity update relpy is very easy. I edited the file /plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/entry.php
<textarea id=”ac-input-<?php bp_activity_id(); ?>” class=”ac-input bp-suggestions” name=”ac_input_<?php bp_activity_id(); ?>”></textarea>
<?php $userid” = ‘@’ . bp_core_get_username(bp_get_activity_user_id()); ?>
<textarea id=”ac-input-<?php bp_activity_id(); ?>” class=”ac-input bp-suggestions” name=”ac_input_<?php bp_activity_id(); ?>”> <?php echo $userid; ?> </textarea>
and it work!
On the contrary, when I reply to an activity comment (acomment) I can get the author username by bp_core_get_username(bp_get_activity_comment_user_id()); editing the file: /plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/comment.php
but the button “reply” created by comment.php open the form created by edit.php and within this file I can get only the activity root user_id and I can’t get the comment user_id 🙁
I tried also with the GLOBALS variables but noway 🙁
So what I need is to pass bp_core_get_username(bp_get_activity_comment_user_id()) executed by comment.php to the file edit.php
If this is not possible or to difficult to perform there is a second possibility.
When I reply to a comment the post form is opened attached to the right comment. So it is enought to get the username from the <div class=”acomment-meta”> in the comment area itself. I tried to do that by a little js inside entry.php but I’m too basic to do that 🙁
If you need I can give you credentials to work on my test site. But it is a normal wordpress site with only buddypress plugin and the Minimal theme.
I hope to have been more clear now. If not, I can do another try 😉 but I think that images are not useful for a better explanation of the problem 🙁
It would be fantastic if you could help me as I can’t solve it by myself 🙁
Alternatively the comment username could be taken direcly from current displayed comment. But I don’t know how to do it. Probably with a little js script using closest find command. But I don’t know js 🙁 Any help, please?
Hi, perhaps I didn’t explain well… What I need is to pass the comment user id from the file comment.php (the file that creates the reply button) to the file entry.php (the file that creates the comment post form). Can someone help me please? Form me it’s too difficult to implement but for you should be very easy.
Thanks in advance!