Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.

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



<?php
echo '<span>';
echo sprintf(Plural($Discussion->CountComments, '%s comment', '%s comments'), $Discussion->CountComments);
echo '';
if ($CountUnreadComments > 0 && $Session->IsValid())
echo '',sprintf(Gdn::Translate('%s new'), $CountUnreadComments),''; echo ''; printf(Gdn::Translate('Most recent by %1$s %2$s'), UserAnchor($Discussion->LastName), Format::Date($Discussion->LastDate)); echo ''; echo Anchor($Discussion->Category, '/categories/'.urlencode($Discussion->Category), 'Category'); $Sender->FireEvent('DiscussionMeta'); ?>
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'); ?> <?php echo $this->FetchView('comments'); ?>
  • 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.