. // Forum index // shows the categories and the forums in each category require_once('../inc/forum.inc'); require_once('../inc/pm.inc'); require_once('../inc/time.inc'); check_get_args(array("read", "return", "tnow", "ttok")); $user = get_logged_in_user(false); BoincForumPrefs::lookup($user); if (DISABLE_FORUMS && !is_admin($user)) { error_page("Forums are disabled"); } // Process request to mark all posts as read // if ((get_int("read", true) == 1)) { if ($user) { check_tokens($user->authenticator); $now = time(); $user->prefs->update("mark_as_read_timestamp=$now"); Header("Location: ".get_str("return", true)); } } 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 = $forum->title; if (!strlen($t)) $t = $team->name; $d = $forum->description; if (!strlen($d)) $d = tra("Discussion among members of %1", $team->name); break; } echo " id\">$t
$d $forum->threads $forum->posts ".time_diff_str($forum->timestamp, time())." "; } page_head(tra("Message boards")); show_forum_header($user); if (defined('FORUM_QA_MERGED_MODE') && FORUM_QA_MERGED_MODE){ $categories = BoincCategory::enum("true order by orderID"); } else { echo "

" .tra("If you have a question or problem, please use the %1Questions & Answers%2 section of the message boards.", "", "") ."

" ; $categories = BoincCategory::enum("is_helpdesk=0 order by orderID"); } $first = true; foreach ($categories as $category) { if ($first) { $first = false; echo "

"; show_forum_title($category, NULL, NULL); echo "

"; show_mark_as_read_button($user); start_table('table-striped'); row_heading_array(array( tra("Topic"), tra("Threads"), tra("Posts"), tra("Last post") )); } if (strlen($category->name)) { echo ' '.$category->name.' '; } $forums = BoincForum::enum("parent_type=0 and category=$category->id order by orderID"); foreach ($forums as $forum) { show_forum_summary($forum); } } if ($user && $user->teamid) { $forum = BoincForum::lookup("parent_type=1 and category=$user->teamid"); if ($forum) { show_forum_summary($forum); } } end_table(); if ($user) { $subs = BoincSubscription::enum("userid=$user->id"); if (count($subs)) { echo "

".tra("Subscribed threads")."

"; show_thread_and_context_header(); foreach ($subs as $sub) { $thread = BoincThread::lookup_id($sub->threadid); if (!$thread) { BoincSubscription::delete($user->id, $sub->threadid); continue; } if ($thread->hidden) continue; show_thread_and_context($thread, $user); } end_table(); } } page_tail(); BoincForumLogging::cleanup(); $cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit ?>