3
* This is the forum index
4
* It shows the categories available and each of the forums that are
5
* contained in those categories
4
// shows the categories and the forums in each category
8
6
require_once('../inc/forum.inc');
9
require_once('../inc/forum_std.inc');
12
get_logged_in_user(false);
14
function forum_summary($forum) {
7
require_once('../inc/pm.inc');
8
require_once('../inc/time.inc');
11
$user = get_logged_in_user(false);
13
// Process request to mark all posts as read
15
if ((get_int("read", true) == 1)) {
17
check_tokens($user->authenticator);
18
BoincForumPrefs::lookup($user);
20
$user->prefs->update("mark_as_read_timestamp=$now");
21
Header("Location: ".get_str("return", true));
25
function show_forum_summary($forum) {
26
switch ($forum->parent_type) {
29
$d = $forum->description;
32
$team = BoincTeam::lookup_id($forum->category);
34
if (!strlen($t)) $t = $team->name;
35
$d = $forum->description;
36
if (!strlen($d)) $d = "Discussion among members of $team->name";
19
<a href="forum_forum.php?id='.$forum->getID().'">'.$forum->getTitle().'
43
<a href=\"forum_forum.php?id=$forum->id\">$t
21
<br><font size="-2">'.$forum->getDescription().'
45
<br><span class=\"smalltext\">$d</span>
23
<td>'.$forum->getThreadCount().'</td>
24
<td>'.$forum->getPostCount().'</td>
25
<td>'.time_diff_str($forum->getLastTimestamp(), time()).'</td>
47
<td>$forum->threads</td>
48
<td>$forum->posts</td>
49
<td>".time_diff_str($forum->timestamp, time())."</td>
29
page_head(tr(FORUM_TITLE));
53
page_head(tra("%1 Message boards", PROJECT));
39
show_forum_title(NULL, NULL);
40
start_forum_table(array(tr(FORUM_TOPIC), tr(FORUM_THREADS), tr(FORUM_POSTS), tr(FORUM_LAST_POST)));
63
show_forum_header($user);
42
$categories = $mainFactory->getCategories();
44
while ($categories[$i]){
45
if (!$categories[$i]->getType()) {
65
$categories = BoincCategory::enum("is_helpdesk=0 order by orderID");
67
foreach ($categories as $category) {
70
show_forum_title($category, NULL, NULL);
71
show_mark_as_read_button($user);
74
array(tra("Topic"), tra("Threads"), tra("Posts"), tra("Last post"))
77
if (strlen($category->name)) {
47
79
<tr class="subtitle">
48
<td class="category" colspan="4">'.$categories[$i]->getName().'</td>
80
<td class="category" colspan="4">'.$category->name.'</td>
51
$forums = $categories[$i]->getForums();
53
// Show a summary of each of the forums
55
echo forum_summary($forums[$ii]);
84
$forums = BoincForum::enum("parent_type=0 and category=$category->id order by orderID");
85
foreach ($forums as $forum) {
86
show_forum_summary($forum);
90
if ($user && $user->teamid) {
91
$forum = BoincForum::lookup("parent_type=1 and category=$user->teamid");
93
show_forum_summary($forum);
99
$subs = BoincSubscription::enum("userid=$user->id");
101
echo "<h3>Subscribed threads</h2>";
102
show_thread_and_context_header();
103
foreach ($subs as $sub) {
104
$thread = BoincThread::lookup_id($sub->threadid);
106
BoincSubscription::delete($user->id, $sub->threadid);
109
if ($thread->hidden) continue;
110
show_thread_and_context($thread, $user);
118
BoincForumLogging::cleanup();
120
$cvs_version_tracker[]="\$Id: forum_index.php 15070 2008-04-21 14:04:01Z boincadm $"; //Generated automatically - do not edit