|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * @copyright 2009-2019 Vanilla Forums Inc. |
| 4 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
| 5 | + */ |
| 6 | + |
| 7 | +if (!defined('APPLICATION')) { |
| 8 | + exit(); |
| 9 | +} |
| 10 | +$UserPhotoFirst = c('Vanilla.Comment.UserPhotoFirst', true); |
| 11 | + |
| 12 | +$Discussion = $this->data('Discussion'); |
| 13 | +$Author = Gdn::userModel()->getID($Discussion->InsertUserID); // userBuilder($Discussion, 'Insert'); |
| 14 | + |
| 15 | +// Prep event args. |
| 16 | +$CssClass = cssClass($Discussion, false); |
| 17 | +$this->EventArguments['Discussion'] = &$Discussion; |
| 18 | +$this->EventArguments['Author'] = &$Author; |
| 19 | +$this->EventArguments['CssClass'] = &$CssClass; |
| 20 | + |
| 21 | +// DEPRECATED ARGUMENTS (as of 2.1) |
| 22 | +$this->EventArguments['Object'] = &$Discussion; |
| 23 | +$this->EventArguments['Type'] = 'Discussion'; |
| 24 | + |
| 25 | +// Discussion template event |
| 26 | +$this->fireEvent('BeforeDiscussionDisplay'); |
| 27 | +?> |
| 28 | +<div id="<?php echo 'Discussion_'.$Discussion->DiscussionID; ?>" class="<?php echo $CssClass; ?>"> |
| 29 | + <div class="Discussion"> |
| 30 | + <div class="Item-Header DiscussionHeader"> |
| 31 | + <div class="AuthorWrap"> |
| 32 | + <span class="Author"> |
| 33 | + <?php |
| 34 | + if ($UserPhotoFirst) { |
| 35 | + echo userPhoto($Author); |
| 36 | + echo userAnchor($Author, 'Username'); |
| 37 | + } else { |
| 38 | + echo userAnchor($Author, 'Username'); |
| 39 | + echo userPhoto($Author); |
| 40 | + } |
| 41 | + echo formatMeAction($Discussion); |
| 42 | +?> |
| 43 | + </span> |
| 44 | + <span class="AuthorInfo"> |
| 45 | + <?php |
| 46 | + echo wrapIf(htmlspecialchars(val('Title', $Author)), 'span', ['class' => 'MItem AuthorTitle']); |
| 47 | + echo wrapIf(htmlspecialchars(val('Location', $Author)), 'span', ['class' => 'MItem AuthorLocation']); |
| 48 | + $this->fireEvent('AuthorInfo'); |
| 49 | + ?> |
| 50 | + </span> |
| 51 | + </div> |
| 52 | + <div class="Meta DiscussionMeta"> |
| 53 | + <span class="MItem DateCreated"> |
| 54 | + <?php |
| 55 | + echo anchor(Gdn_Format::date($Discussion->DateInserted, 'html'), $Discussion->Url, 'Permalink', ['rel' => 'nofollow']); |
| 56 | + ?> |
| 57 | + </span> |
| 58 | + <?php |
| 59 | + echo dateUpdated($Discussion, ['<span class="MItem">', '</span>']); |
| 60 | + ?> |
| 61 | + <?php |
| 62 | + // Include source if one was set |
| 63 | + if ($Source = val('Source', $Discussion)) { |
| 64 | + echo ' '.wrap(sprintf(t('via %s'), t($Source.' Source', $Source)), 'span', ['class' => 'MItem MItem-Source']).' '; |
| 65 | + } |
| 66 | + // Category |
| 67 | + if (c('Vanilla.Categories.Use')) { |
| 68 | + echo ' <span class="MItem Category">'; |
| 69 | + echo ' '.t('in').' '; |
| 70 | + echo anchor(htmlspecialchars($this->data('Discussion.Category')), categoryUrl($this->data('Discussion.CategoryUrlCode'))); |
| 71 | + echo '</span> '; |
| 72 | + } |
| 73 | + |
| 74 | + $this->fireEvent('DiscussionInfo'); |
| 75 | + $this->fireEvent('AfterDiscussionMeta'); // DEPRECATED |
| 76 | + ?> |
| 77 | + </div> |
| 78 | + </div> |
| 79 | + <?php $this->fireEvent('BeforeDiscussionBody'); ?> |
| 80 | + <div class="Item-BodyWrap"> |
| 81 | + <div class="Item-Body"> |
| 82 | + <div class="Message userContent"> |
| 83 | + <?php |
| 84 | + echo formatBody($Discussion); |
| 85 | + ?> |
| 86 | + </div> |
| 87 | + <?php |
| 88 | + $this->fireEvent('AfterDiscussionBody'); |
| 89 | + writeReactions($Discussion); |
| 90 | + if (val('Attachments', $Discussion)) { |
| 91 | + writeAttachments($Discussion->Attachments); |
| 92 | + } |
| 93 | + ?> |
| 94 | + </div> |
| 95 | + </div> |
| 96 | + </div> |
| 97 | +</div> |
0 commit comments