Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to fetch Comment UserID
kallosz
New
I'm trying to write a plugin. I have the following problem ... How to extract the user id who wrote this post?
It works but only if the file
but this code is not added by default
any ideas?
public function DiscussionController_CommentOptions_Handler(&$Sender) {
$Sender->Options .= '<li><a href="/'.$Sender->UserID.'/">'.Gdn::Translate('test').'</a></li>';
}
It works but only if the file
/discussion/helper_functions.php
have$Sender->UserID = $Comment->InsertUserID;
but this code is not added by default
any ideas?
0
Comments
$Sender->EventArguments['Comment'] = &$Comment;
it seems to me that this code should be the beginning of the file and not the end.
Change put on GitHub