This question has been answered by [email protected]. See the first response.
<li class="[[+class]] group-fix" id="dis-post-[[+id]]" data-author="[[+author.username:htmlent]]" data-date="[[+createdon_raw]]" data-message="[[+content_raw]]">
[[+answer:neq=``:then=`
<div class="dis-post-answer-marker">
[[+answer_count:gt=`1`:then=`
<nav>
[[+answer_prev.link]]
[[+answer_next.link]]
</nav>
`:else=``]]
[[+url_mark_as_answer:eq=``:then=`
<span title="[[%discuss.answer]]">[[%discuss.answer]]</span>
`:else=`
<a href="[[+url_mark_as_answer]]">
<span title="[[%discuss.unflag_answer]]">[[%discuss.unflag_answer]]</span>
</a>
`]]
</div>
`:else=`
<div class="dis-post-answer-marker dis-post-notanswer">
[[+url_mark_as_answer:eq=``:then=``:else=`
<div class="dis-post-answer-marker dis-post-notanswer">
<p>[[%discuss.flag_answer]]</p>
<a href="[[+url_mark_as_answer]]">
<span>[[%discuss.flag_answer]]</span>
</a>
</div>
`]]
</div>
`]]
<!-- mark answer-->
<div class="dis-post-left">
<ul>
<li class="dis-usr-icon">
<a href="[[DiscussUrlMaker? &action=`user` ¶ms=`{"type":"username", "user":"[[+author.username]]"}`]]" class="auth-avatar" title="[[%discuss.view_author_profile]]">
[[+author.avatar]]
[[+author.title:notempty=`<span class="dis-usr-title">[[+author.title]]</span>`]]
</a>
</li>
<li class="dis-usr-post-count">[[+author.posts]] [[%discuss.posts]]</li>
<a href="[[DiscussUrlMaker? &action=`messages/new` ¶ms=`{"user":"[[+author.username]]"}`]]" class="dis-pm-btn">Send PM</a>
</ul>
</div>
<div class="dis-post-right">
<div class="title">
<strong>[[+author.username_link]]</strong> <a class="normal-type" href="[[+url]]" title="[[%discuss.post_link]]">Reply #[[+idx]], <span title="[[+createdon]]">[[+createdon:ago]]</span></a>
[[+action_modify:notempty=`<ul class="dis-content-actions">[[+action_modify]][[+action_remove]][[+action_spam]]</ul>`]]
</div>
<div class="dis-content">
[[+content]]
[[+discuss.user.shouldMarkAnAnswer:eq=`1`:then=`
[[+idx:eq=`1`:then=`
<div class="dis-info"><p>[[%discuss.mark_answer_instructions]] <a id="Show-answer-link" href="#">[[%discuss.mark_answer_link]]</a></p></div>
`:else=``]]
`:else=``]]
[[+idx:eq=`1`:then=`
[[+answer_count:neq=`0`:then=`
<div class="dis-info"><p>[[+jump_to_first_answer.explanation]] [[+jump_to_first_answer.link]]</p></div>
`:else=``]]
`:else=``]]
[[+attachments:notempty=`<div class="dis-post-attachments"><ul class="dis-attachments">[[+attachments]]</ul></div>`]]
[[+editedby:is=`0`:then=``:else=`<span class="dis-post-editedon">[[%discuss.editedon_post? &on=`[[+editedon:ago]]` &user=`[[+editedby.username]]`]]</span>`]]
</div>
<ul class="dis-action-btn">[[+report_link]][[+action_reply]]</ul>
</div>
[[+author.signature:notempty=`<div class="dis-signature">[[+author.signature]]</div>`]]
</li>
<div class="dis-content">
[[+content]]
[[+discuss.user.shouldMarkAnAnswer:eq=`1`:then=`
[[+idx:eq=`1`:then=`
<div class="dis-info"><p>[[%discuss.mark_answer_instructions]] <a id="Show-answer-link" href="#">[[%discuss.mark_answer_link]]</a></p></div>
`:else=``]]
`:else=``]]
[[+idx:eq=`1`:then=`
[[+answer_count:neq=`0`:then=`
<div class="dis-info"><p>[[+jump_to_first_answer.explanation]] [[+jump_to_first_answer.link]]</p></div>
`:else=``]]
`:else=``]]
[[+attachments:notempty=`<div class="dis-post-attachments"><ul class="dis-attachments">[[+attachments]]</ul></div>`]]
[[+editedby:is=`0`:then=``:else=`<span class="dis-post-editedon">[[%discuss.editedon_post? &on=`[[+editedon:ago]]` &user=`[[+editedby.username]]`]]</span>`]]
</div>
class DiscussAttachmentDownloadController extends DiscussController {
public function getPageTitle() {
}
public function getSessionPlace() {
return 'attachment/download:file='.$this->getProperty('file','');
}
public function process() {
$file = $this->getProperty('file',false);
/* get attachment */
/* setup basic settings/permissions */
$dateFormat = $modx->getOption('discuss.date_format',null,'%b %d, %Y, %H:%M %p');
$allowCustomTitles = $modx->getOption('discuss.allow_custom_titles',null,true);
$maxPostDepth = $modx->getOption('discuss.max_post_depth',null,3);
$canViewAttachments = $modx->hasPermission('discuss.view_attachments');
$canTrackIp = $discuss->user->isLoggedIn && $modx->hasPermission('discuss.track_ip');
$canViewEmails = $discuss->user->isLoggedIn && $modx->hasPermission('discuss.view_emails');
$canViewProfiles = $discuss->user->isLoggedIn && $modx->hasPermission('discuss.view_profiles');
$canReportPost = $discuss->user->isLoggedIn && $modx->hasPermission('discuss.thread_report');
$canMarkAsAnswer = $thread->get('class_key') == 'disThreadQuestion' && $thread->canMarkAsAnswer();