HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Requesting an event

edited August 2009 in Feedback
In the file helper_functions.php for vanilla in the function WriteDiscussion()
Can you include the event

$Sender->FireEvent('DiscussionMeta');
on line 94

<li class="Meta"> <?php echo '<span>'; echo sprintf(Plural($Discussion->CountComments, '%s comment', '%s comments'), $Discussion->CountComments); echo '</span>'; if ($CountUnreadComments > 0 && $Session->IsValid()) echo '<strong>',sprintf(Gdn::Translate('%s new'), $CountUnreadComments),'</strong>'; echo '<span>'; printf(Gdn::Translate('Most recent by %1$s %2$s'), UserAnchor($Discussion->LastName), Format::Date($Discussion->LastDate)); echo '</span>'; echo Anchor($Discussion->Category, '/categories/'.urlencode($Discussion->Category), 'Category'); $Sender->FireEvent('DiscussionMeta'); ?> </li>
Tagged:

Comments

  • Also i need the ability to add something above a thread. So below the General . Requesting and event header. I need to put something below it. It would seem an easy way to do this would be to allow a module to be placed here.

    Adding
    <?php $this->RenderAsset('DiscussionTop'); ?>
    on line 24 of Vanilla/views/discussion/index.php would be perfect. Call it what you like though.
  • MarkMark Vanilla Staff
    Can you show me more of where you placed it? Before the ul or after?
  • Before the UL.

    <?php echo $this->Pager->ToString('less'); ?> <?php $this->RenderAsset('DiscussionTop'); ?> <ul id="Discussion"> <?php echo $this->FetchView('comments'); ?> </ul>
  • MarkMark Vanilla Staff
    Just pushed these to master. I called the asset container "DiscussionBefore"
  • Thanks a lot just what i needed.
  • SS ✭✭
    edited September 2009
    In vanilla/views/post/discussion.php need something like AfterFormButtons

    47: echo $this->Form->Button('Save Draft'); 48: } 49: 50: echo $this->Form->Button('Preview'); 51: $this->FireEvent('AfterFormButtons'); // <<< it's here 52: 53: echo Anchor('Cancel', $CancelUrl, 'Cancel'); 54: echo $this->Form->Close(); 55: ?>

    And in vanilla/views/post/comment.php in same place.
  • MarkMark Vanilla Staff
    @S - added in development.
Sign In or Register to comment.