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

kalloszkallosz New
edited November 2009 in Vanilla 2.0 - 2.8
I'm trying to write a plugin. I have the following problem ... How to extract the user id who wrote this post?
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?

Comments

  • kalloszkallosz New
    edited November 2009
    Ok. I found the cause.
    $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
Sign In or Register to comment.