2006-06-16 23:53:56 +00:00
|
|
|
<?php
|
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
// Forum index
|
|
|
|
// shows the categories and the forums in each category
|
2006-06-16 23:53:56 +00:00
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
require_once('../inc/forum.inc');
|
|
|
|
require_once('../inc/pm.inc');
|
|
|
|
require_once('../inc/time.inc');
|
2007-07-18 15:48:07 +00:00
|
|
|
|
|
|
|
// Process request to mark all posts as read
|
2007-11-12 20:57:15 +00:00
|
|
|
// ???? uh, why is this here ????
|
|
|
|
|
|
|
|
$user = get_logged_in_user(false);
|
|
|
|
|
|
|
|
if ((get_int("read", true) == 1)) {
|
|
|
|
if ($user) {
|
|
|
|
check_tokens($user->authenticator);
|
|
|
|
BoincForumPrefs::lookup($user);
|
|
|
|
$now = time();
|
|
|
|
$user->prefs->update("mark_as_read_timestamp=$now");
|
|
|
|
Header("Location: ".get_str("return", true));
|
|
|
|
}
|
2007-07-18 15:48:07 +00:00
|
|
|
}
|
2007-04-29 14:22:28 +00:00
|
|
|
|
2007-11-16 01:14:55 +00:00
|
|
|
function show_forum_summary($forum) {
|
|
|
|
switch ($forum->parent_type) {
|
|
|
|
case 0:
|
|
|
|
$t = $forum->title;
|
|
|
|
$d = $forum->description;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
$team = BoincTeam::lookup_id($forum->category);
|
|
|
|
$t = $team->name;
|
|
|
|
$d = "Discussion among members of $team->name";
|
|
|
|
break;
|
|
|
|
}
|
2007-10-22 19:36:01 +00:00
|
|
|
echo "
|
|
|
|
<tr class=\"row1\">
|
2006-06-16 23:53:56 +00:00
|
|
|
<td>
|
|
|
|
<em>
|
2007-11-16 01:14:55 +00:00
|
|
|
<a href=\"forum_forum.php?id=$forum->id\">$t
|
2006-06-16 23:53:56 +00:00
|
|
|
</a></em>
|
2007-11-16 01:14:55 +00:00
|
|
|
<br><span class=\"smalltext\">$d</span>
|
2006-06-16 23:53:56 +00:00
|
|
|
</td>
|
2007-11-12 20:57:15 +00:00
|
|
|
<td>$forum->threads</td>
|
|
|
|
<td>$forum->posts</td>
|
|
|
|
<td>".time_diff_str($forum->timestamp, time())."</td>
|
2007-10-22 19:36:01 +00:00
|
|
|
</tr>";
|
2006-06-16 23:53:56 +00:00
|
|
|
}
|
|
|
|
|
2007-11-02 14:43:02 +00:00
|
|
|
page_head(tra("%1 Message boards", PROJECT));
|
2006-07-28 19:02:48 +00:00
|
|
|
|
|
|
|
echo "
|
|
|
|
<p>
|
|
|
|
If you have a question or problem, please use the
|
|
|
|
<a href=forum_help_desk.php>Questions & answers</a>
|
|
|
|
area instead of the Message boards.
|
2007-02-24 16:05:41 +00:00
|
|
|
</p>
|
2006-07-28 19:02:48 +00:00
|
|
|
";
|
|
|
|
|
2007-11-15 00:27:02 +00:00
|
|
|
show_forum_header($user);
|
2006-06-16 23:53:56 +00:00
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
$categories = BoincCategory::enum("is_helpdesk=0 order by orderID");
|
2007-11-15 00:27:02 +00:00
|
|
|
$first = true;
|
2007-11-12 20:57:15 +00:00
|
|
|
foreach ($categories as $category) {
|
2007-11-15 00:27:02 +00:00
|
|
|
if ($first) {
|
|
|
|
$first = false;
|
|
|
|
show_forum_title($category, NULL, NULL);
|
|
|
|
start_forum_table(
|
|
|
|
array(tra("Topic"), tra("Threads"), tra("Posts"), tra("Last post"))
|
|
|
|
);
|
|
|
|
}
|
|
|
|
if (strlen($category->name)) {
|
|
|
|
echo '
|
|
|
|
<tr class="subtitle">
|
2007-11-12 20:57:15 +00:00
|
|
|
<td class="category" colspan="4">'.$category->name.'</td>
|
2007-11-15 00:27:02 +00:00
|
|
|
</tr>
|
|
|
|
';
|
|
|
|
}
|
2007-11-12 20:57:15 +00:00
|
|
|
$forums = BoincForum::enum("parent_type=0 and category=$category->id order by orderID");
|
|
|
|
foreach ($forums as $forum) {
|
2007-11-16 01:14:55 +00:00
|
|
|
show_forum_summary($forum);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($user && $user->teamid) {
|
|
|
|
$forum = BoincForum::lookup("parent_type=1 and category=$user->teamid");
|
|
|
|
if ($forum) {
|
|
|
|
show_forum_summary($forum);
|
2006-06-16 23:53:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
end_table();
|
|
|
|
page_tail();
|
|
|
|
flush();
|
2007-11-12 20:57:15 +00:00
|
|
|
BoincForumLogging::cleanup();
|
|
|
|
|
|
|
|
$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit
|
2006-06-16 23:53:56 +00:00
|
|
|
?>
|