Options

How to fetch Comment UserID

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

  • 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.