48 $this->forum =
$topic->Forum();
49 $this->messages = $this->topic->Messages(
"WHERE deleted=0 ORDER BY date_posted");
51 $this->subscriptionView =
new ForumSubscriptionHelper($this->forum, $this->topic);
56 return $this->subscriptionView->writeScript();
66 $this->subscriptionView->drawLink();
68 if (count($this->messages) > 0)
75 $class = $alt ?
"message alt" :
"message"
77 <a name=
"message<?echo $message->message_id?>"></a>
78 <div
id=
"message<?echo $message->message_id?>" class=
"<?echo $class?>">
84 <button
class=
"button" onclick=
"go('forum_message_form?forum_id=<?echo $this->topic->forum_id?>&topic_id=<? echo $this->topic->topic_id ?>&parent_id=<?echo $this->topic->message_id?>')"> Reply
to this topic </button>
88 <strong><?echo
$message->title?></strong><br/>
89 <span
class=
"small">Posted by <?echo $userProfile?> at <?echo
$message->date_posted?></span>
91 <div
class=
"message_content">
95 $attachments =
$message->Attachments();
99 $pk =
$u->getPrimaryKey();
101 if (count($attachments) > 0)
103 echo
"<h4 style='margin-bottom: 4px'>Attachments</h4>";
111 if ($author &&
$user && ($author->get(
$pk) ==
$user->get(
$pk)) || checkRole(
"admin,data"))
114 &
nbsp;&
nbsp;<a
style=
"font-size: 10px" href=
"/action/forum/attachment_delete?forum_id=<?echo $this->topic->forum_id?>&message_id=<?echo $message->message_id?>&attachment_id=<?echo $attachment->attachment_id?>" onclick=
"return confirm('Are you sure you want to delete <?echo $attachment->filename?>?');">Delete
this attachment</a>
124 if (
$user && $author->get(
$pk) ==
$user->get(
$pk) || checkRole(
"admin,data,moderator"))
126 $controls[] =
"<a href=\"forum_message_form?forum_id={$this->topic->forum_id}&topic_id={$this->topic->topic_id}&message_id={$message->message_id}\">Edit</a>";
129 if (
$user && $author->get(
$pk) ==
$user->get(
$pk) || checkRole(
"admin,data,moderator"))
131 $controls[] =
"<a href=\"/action/forum/message_delete?forum_id={$this->topic->forum_id}&topic_id={$this->topic->topic_id}&message_id={$message->message_id}\" onclick=\"return confirm('Are you sure you want to delete this message?');\">Delete</a>";
136 $controls[] =
"<a href=\"forum_message_form?forum_id={$this->topic->forum_id}&topic_id={$this->topic->topic_id}&parent_id={$message->message_id}\">Reply</a>";
140 <div
class=
"message_controls"><? echo implode(
" | ", $controls);?></div>
147 $this->topic->updateExplicit(
"SET views=views+1");
152 <p><em>No messages have been posted
for this topic.</em></p>
162 $link =
"<img src=\"{$icon}\" alt=\"Icon\" style=\"display:inline-block;vertical-align:middle\"/> ";
163 $link .=
"<a href='/action/attachment/download?attachment_id={$attachment->attachment_id}'>{$attachment->filename}
164 </a> ({$attachment->file_size})\n";
if(! $attachment_id) $attachment
static formatUserProfile($u)
ForumTopicView($topic, $id="topic_view")
formatAttachment($icon, $attachment)
Provides the interface to the user model for the application.