public function DiscussionController_AfterCommentBody_Handler(&$Sender) { $Session = Gdn::Session(); $Comment = $Sender->EventArguments['Comment']; if (is_object($Sender->CurrentReply) && $Sender->CurrentReply->ReplyCommentID == $Comment->CommentID) { echo '<ul class="Replies">'; while (is_object($Sender->CurrentReply) && $Sender->CurrentReply->ReplyCommentID == $Comment->CommentID) { VanillaCommentRepliesPlugin::WriteReply($Sender, $Session); $Sender->CurrentReply = $Sender->ReplyData->NextRow(); } } else { echo '<ul class="Replies Hidden">'; } if ($Session->IsValid() && $Sender->Discussion->Closed == '0') { echo '<li class="ReplyForm">'; echo Anchor(T('Write a reply'), '/vanilla/post/reply/' . $Comment->CommentID, 'ReplyLink Hidden'); $ReplyForm = Gdn::Factory('Form'); $ReplyForm->SetModel($this->ReplyModel); $ReplyForm->AddHidden('ReplyCommentID', $Comment->CommentID); echo $ReplyForm->Open(array('action' => Url('/vanilla/post/reply'), 'class' => 'Hidden')); echo $ReplyForm->TextBox('Body', array('MultiLine' => TRUE, 'value' => '')); echo $ReplyForm->Close('Reply'); echo '</li>'; } echo '</ul>'; }
<?php if (!defined('APPLICATION')) { exit; } $Session = Gdn::Session(); // Only prints individual replies foreach ($this->ReplyData->Result() as $CurrentReply) { VanillaCommentRepliesPlugin::WriteReply($this, $Session); }