58 $this->table =
new DataListView(
$fora,
$id);
61 $this->table->column(
"Title", array($this,
formatTitle),
true,
"width: 40%")
62 ->column(
"Last Post", array($this,
formatLastPost),
true,
"width: 40%")
63 ->column(
"Topics",
"{topics}",
true,
"width: 10%;text-align: center")
64 ->column(
"Posts",
"{posts}",
true,
"width: 10%;text-align: center");
68 $this->table->enableDragReorder(
"/action/forum/reorder_forums");
73 $this->table->filter =
true;
76 $this->table->emptyMessage =
"No fora have been created";
81 $text = $item->format(
"<a href='{$this->forumLink}?forum_id={forum_id}'>{title|No Title}</a>");
84 $text .=
"<br/><span class='small'>{$item->teaser}</span>";
91 $lastPost = $item->LastPost();
92 if (!$lastPost)
return "<em>No posts</em>";
93 $user = $lastPost->Author();
96 $title = $lastPost->title ? $lastPost->title :
"No Title";
98 return "<a href='{$this->messageLink}?forum_id={$lastPost->forum_id}&topic_id={$lastPost->topic_id}'>{$title}</a><br/>".
99 "<span class='small'>by ".$userProfile.
" ({$lastPost->date_posted})</span>";
105 return $this->table->writeScript();
110 $this->table->drawView();
131 $this->topics = $this->forum->Topics(
"WHERE message_id not in (select message_id from {$msgTable->table} where deleted=true)");
132 $this->messages = indexedQuery(
ForumMessage,
"WHERE forum_id={$forum->forum_id} AND deleted=false AND parent_id=0",
"topic_id");
134 $this->table =
new DataListView($this->topics,
"topic_list");
135 $this->table->column(
"Title", array($this,
formatTitle),
true,
"width: 40%")
136 ->column(
"Last Post", array($this,
formatLastPost),
true,
"width: 40%")
137 ->column(
"Views",
"{views}",
true,
"width: 10%; text-align: center")
138 ->column(
"Replies",
"{countReplies()}",
true,
"width: 10%; text-align: center");
139 $this->table->emptyMessage =
"No topics have been started in this discussion forum";
140 $this->table->filter =
true;
143 $this->subscriptionView =
new ForumSubscriptionHelper($this->forum);
149 if (!array_key_exists(
$topic->topic_id, $this->messages))
return "";
157 return "<a href='{$this->topicLink}?forum_id={$topic->forum_id}&topic_id={$topic->topic_id}'>{$title}</a><br/><span class='small'>(Created by ".$userProfile.
")</span>";
162 $lastPost =
$topic->LastPost();
163 if (!$lastPost)
return "<em>No posts</em>";
164 $user = $lastPost->Author();
168 $title = $lastPost->title ? $lastPost->title :
"No Title";
170 return "<a href='{$this->topicLink}?forum_id={$lastPost->forum_id}&topic_id={$lastPost->topic_id}'>{$title}</a><br/>".
171 "<span class='small'>by ".$userProfile.
" ({$lastPost->date_posted})</span>";
176 $script = $this->table->writeScript();
177 $script .= $this->subscriptionView->writeScript();
184 echo
"<div style='width: {$this->width}'>";
186 <form method=
"get" action=
"forum_search_by_author">
187 <input type=
"hidden" name=
"forum_id" value=
"<?echo $this->forum->forum_id?>"/>
188 <label
for=
"author">Search by Author</label> <input type=
"text" name=
"author" style=
"width: 200px"> <input
class=
'button' type=
'submit' value=
"Search"/>
191 $this->subscriptionView->drawLink();
192 $this->table->drawView();
static usingFile()
Uses the specified framework file(s) from the framework directory.
ForumDetailsView($forum, $topicLink)
ForumListView($fora, $forumLink, $messageLink, $id="forum_list", $reorder=false)
static formatUserProfile($u)
static getValue($component, $name)
Retrieve the value of the specified Setting.