$category = BoincCategory::lookup_id($forum->category); show_forum_title($category, $forum, $thread); break; case 1: show_team_forum_title($forum, $thread); break; } echo "<p>"; if ($preview == tra("Preview")) { $options = new output_options(); echo "<div id=\"preview\">\n"; echo "<div class=\"header\">" . tra("Preview") . "</div>\n"; echo output_transform($content, $options); echo "</div>\n"; } start_forum_table(array(tra("Author"), tra("Message"))); show_message_row($thread, $parent_post); show_posts($thread, $forum, $sort_style, $filter, $logged_in_user, true); end_table(); page_tail(); function show_message_row($thread, $parent_post) { global $g_logged_in_user; global $content; global $preview; $x1 = "Message:" . html_info() . post_warning(); $x2 = ""; if ($parent_post) { $x2 .= " reply to <a href=#" . $parent_post->id . ">Message ID " . $parent_post->id . "</a>:"; } $x2 .= "<form action=forum_reply.php?thread=" . $thread->id;
function show_forum($forum, $start, $sort_style, $user) { $gotoStr = ""; $nav = show_page_nav($forum, $start); if ($nav) { $gotoStr = "<div align=\"right\">{$nav}</div><br />"; } echo $gotoStr; // Display the navbar start_forum_table(array("", tra("Threads"), tra("Posts"), tra("Author"), tra("Views"), "<nobr>" . tra("Last post") . "</nobr>")); $sticky_first = !$user || !$user->prefs->ignore_sticky_posts; // Show hidden threads if logged in user is a moderator // $show_hidden = is_moderator($user, $forum); $threads = get_forum_threads($forum->id, $start, THREADS_PER_PAGE, $sort_style, $show_hidden, $sticky_first); if ($user) { $subs = BoincSubscription::enum("userid={$user->id}"); } // Run through the list of threads, displaying each of them $n = 0; $i = 0; foreach ($threads as $thread) { $owner = BoincUser::lookup_id($thread->owner); $unread = thread_is_unread($user, $thread); //if ($thread->status==1){ // This is an answered helpdesk thread if ($user && is_subscribed($thread, $subs)) { echo '<tr class="row_hd' . $n . '">'; } else { echo '<tr class="row' . $n . '">'; } echo '<td width="1%"><nobr>'; if ($user && $thread->rating() > $user->prefs->high_rating_threshold) { show_image(EMPHASIZE_IMAGE, "This message has a high average rating", "Highly rated"); } if ($user && $thread->rating() < $user->prefs->low_rating_threshold) { show_image(FILTER_IMAGE, "This message has a low average rating", "Low rated"); } if ($thread->hidden) { echo "[hidden]"; } if ($unread) { if ($thread->sticky) { if ($thread->locked) { show_image(NEW_IMAGE_STICKY_LOCKED, "This thread is sticky and locked, and you haven't read it yet", "sticky/locked/unread"); } else { show_image(NEW_IMAGE_STICKY, "This thread is sticky and you haven't read it yet", "sticky/unread"); } } else { if ($thread->locked) { show_image(NEW_IMAGE_LOCKED, "You haven't read this thread yet, and it's locked", "unread/locked"); } else { show_image(NEW_IMAGE, "You haven't read this thread yet", "unread"); } } } else { if ($thread->sticky) { if ($thread->locked) { show_image(IMAGE_STICKY_LOCKED, "This thread is sticky and locked", "sticky/locked"); } else { show_image(IMAGE_STICKY, "This thread is sticky", "sticky"); } } else { if ($thread->locked) { show_image(IMAGE_LOCKED, "This thread is locked", "locked"); } } } echo "</nobr></td>"; $titlelength = 48; $title = $thread->title; if (strlen($title) > $titlelength) { $title = substr($title, 0, $titlelength) . "..."; } $title = cleanup_title($title); echo '<td class="threadline"> <a href="forum_thread.php?id=' . $thread->id . '"><strong>' . $title . '</strong></a> <br /></td>'; $n = ($n + 1) % 2; echo '<td class="numbers leftborder">' . ($thread->replies + 1) . '</td> <td class="author leftborder">' . user_links($owner) . '</td> <td class="numbers leftborder">' . $thread->views . '</td> <td class="lastpost leftborder">' . time_diff_str($thread->timestamp, time()) . '</td> </tr>'; flush(); } end_table(); echo "<br />{$gotoStr}"; // show page links }
show_forum_header($user); if (FORUM_QA_MERGED_MODE === true) { $categories = BoincCategory::enum("true order by orderID"); } else { echo "<p>" . tra("If you have a question or problem, please use the %1Questions & Answers%2 section of the message boards.", "<a href=\"forum_help_desk.php\">", "</a>") . "</p>"; $categories = BoincCategory::enum("is_helpdesk=0 order by orderID"); } $first = true; foreach ($categories as $category) { if ($first) { $first = false; echo "<p>"; show_forum_title($category, NULL, NULL); echo "<p>"; show_mark_as_read_button($user); start_forum_table(array(tra("Topic"), tra("Threads"), tra("Posts"), tra("Last post"))); } if (strlen($category->name)) { echo ' <tr class="subtitle"> <td class="category" colspan="4">' . $category->name . '</td> </tr> '; } $forums = BoincForum::enum("parent_type=0 and category={$category->id} order by orderID"); $i = 0; foreach ($forums as $forum) { show_forum_summary($forum, $i++); } } if ($user && $user->teamid) {
error_page("Forums are disabled"); } check_get_args(array()); $user = get_logged_in_user(false); page_head(tra("Questions and answers")); echo "<p>" . tra("Talk live via Skype with a volunteer, in any of several languages. Go to %1BOINC Online Help%2.", "<a href=\"http://boinc.berkeley.edu/help.php\">", "</a>") . "</p>"; show_forum_header($user); $categories = BoincCategory::enum("is_helpdesk=1 order by orderID"); $first = true; foreach ($categories as $category) { if ($first) { $first = false; show_forum_title($category, null, null); echo "<p>"; show_mark_as_read_button($user); start_forum_table(array(tra("Topic"), tra("Questions"), tra("Last post"))); } if (strlen($category->name)) { echo "\n <tr class=\"subtitle\">\n <td class=\"category\" colspan=\"4\">", $category->name, "</td>\n </tr>\n "; } $forums = BoincForum::enum("parent_type=0 and category={$category->id} order by orderID"); $i = 1; foreach ($forums as $forum) { $j = $i % 2; $i++; echo "\n <tr class=\"row{$j}\">\n <td>\n <a href=\"forum_forum.php?id={$forum->id}\">{$forum->title}</a>\n <br><small>", $forum->description, "</small>\n </td>\n <td class=\"numbers\">", $forum->threads, "</td>\n <td class=\"lastpost\">", time_diff_str($forum->timestamp, time()), "</td>\n </tr>\n "; } } echo "\n </table>\n</p>\n"; page_tail(); $cvs_version_tracker[] = "\$Id\$";
// // This file was modified by contributors of "BOINC Web Tweak" project. require_once '../inc/forum.inc'; require_once '../inc/util.inc'; require_once '../inc/time.inc'; $user = get_logged_in_user(false); page_head("Questions and answers"); echo "<p>\r\n\tTalk live via Skype with a volunteer, in any of several languages.\r\n\tGo to\r\n\t<a href=\"http://boinc.berkeley.edu/help.php\">BOINC Online Help</a>.</p>\r\n"; show_forum_header($user); $categories = BoincCategory::enum("is_helpdesk=1 order by orderID"); $first = true; foreach ($categories as $category) { if ($first) { $first = false; show_forum_title($category, null, null); echo "<p>"; show_mark_as_read_button($user); start_forum_table(array("Topic", "# Questions", "Last post")); } if (strlen($category->name)) { echo "\r\n\t\t\t<tr class=\"subtitle\">\r\n\t\t\t<td class=\"category\" colspan=\"4\">", $category->name, "</td>\r\n\t\t\t</tr>\r\n\t\t"; } $forums = BoincForum::enum("parent_type=0 and category={$category->id} order by orderID"); foreach ($forums as $forum) { echo "\r\n\t\t<tr class=\"row1\">\r\n\t\t<td>\r\n\t\t\t<b><a href=\"forum_forum.php?id={$forum->id}\">{$forum->title}</a></b>\r\n\t\t\t<br>", $forum->description, "\r\n\t\t</td>\r\n\t\t<td>", $forum->threads, "</td>\r\n\t\t<td>", time_diff_str($forum->timestamp, time()), "</td>\r\n\t</tr>\r\n\t\t"; } } echo "\r\n\t</table>\r\n</p>\r\n"; page_tail(); $cvs_version_tracker[] = "\$Id: forum_help_desk.php 16079 2008-09-27 10:33:43Z jbk \$"; //Generated automatically - do not edit
function show_forum($forum, $start, $sort_style, $user) { $page_nav = page_links("forum_forum.php?id={$forum->id}&sort={$sort_style}", $forum->threads, THREADS_PER_PAGE, $start); echo $page_nav; start_forum_table(array("", tra("Threads"), tra("Posts"), tra("Author"), tra("Views"), "<nobr>" . tra("Last post") . "</nobr>")); $sticky_first = !$user || !$user->prefs->ignore_sticky_posts; // Show hidden threads if logged in user is a moderator // $show_hidden = is_moderator($user, $forum); $threads = get_forum_threads($forum->id, $start, THREADS_PER_PAGE, $sort_style, $show_hidden, $sticky_first); if ($user) { $subs = BoincSubscription::enum("userid={$user->id}"); } // Run through the list of threads, displaying each of them // $n = 0; $i = 0; foreach ($threads as $thread) { $owner = BoincUser::lookup_id($thread->owner); if (!$owner) { continue; } $unread = thread_is_unread($user, $thread); //if ($thread->status==1){ // This is an answered helpdesk thread if ($user && is_subscribed($thread, $subs)) { echo '<tr class="row_hd' . $n . '">'; } else { // Just a standard thread. echo '<tr class="row' . $n . '">'; } echo "<td width=\"1%\" class=\"threadicon\"><nobr>"; if ($thread->hidden) { show_image(IMAGE_HIDDEN, tra("This thread is hidden"), tra("hidden")); } else { if ($unread) { if ($thread->sticky) { if ($thread->locked) { show_image(NEW_IMAGE_STICKY_LOCKED, tra("This thread is sticky and locked, and you haven't read it yet"), tra("sticky/locked/unread")); } else { show_image(NEW_IMAGE_STICKY, tra("This thread is sticky and you haven't read it yet"), tra("sticky/unread")); } } else { if ($thread->locked) { show_image(NEW_IMAGE_LOCKED, tra("You haven't read this thread yet, and it's locked"), tra("unread/locked")); } else { show_image(NEW_IMAGE, tra("You haven't read this thread yet"), tra("unread")); } } } else { if ($thread->sticky) { if ($thread->locked) { show_image(IMAGE_STICKY_LOCKED, tra("This thread is sticky and locked"), tra("sticky/locked")); } else { show_image(IMAGE_STICKY, tra("This thread is sticky"), tra("sticky")); } } else { if ($thread->locked) { show_image(IMAGE_LOCKED, tra("This thread is locked"), tra("locked")); } else { show_image(IMAGE_POST, tra("You read this thread"), tra("read")); } } } } echo "</nobr></td>"; $title = cleanup_title($thread->title); //$titlelength = 9999; //if (strlen($title) > $titlelength) { // $title = substr($title, 0, $titlelength)."..."; //} echo "<td class=\"threadline\"><a href=\"forum_thread.php?id={$thread->id}\"><b>{$title}</b></a><br></td>"; $n = ($n + 1) % 2; echo ' <td class="numbers">' . ($thread->replies + 1) . '</td> <td>' . user_links($owner, BADGE_HEIGHT_SMALL) . '</td> <td class="numbers">' . $thread->views . '</td> <td class="lastpost">' . time_diff_str($thread->timestamp, time()) . '</td> </tr> '; flush(); } end_table(); echo "<br>{$page_nav}"; // show page links }
show_actionlist_button("forum_moderate_thread.php?action=lock&thread=" . $thread->id . "{$tokens}", tra("Lock"), tra("Lock this thread")); } if ($forum->parent_type == 0) { show_actionlist_button("forum_moderate_thread.php?action=move&thread=" . $thread->id . "{$tokens}", tra("Move"), tra("Move this thread to a different forum")); } show_actionlist_button("forum_moderate_thread.php?action=title&thread=" . $thread->id . "{$tokens}", tra("Edit title"), tra("Edit thread title")); } echo "</ul>"; //End of action list // Display a box that allows the user to select sorting of the posts echo "</td><td align=\"right\">\r\n\t<input type=\"hidden\" name=\"id\" value=\"", $thread->id, "\">" . tra("Sort"); echo select_from_array("sort", $thread_sort_styles, $sort_style); echo "<input type=\"submit\" value=\"Sort\">\r\n\t</td></tr></table></form>\r\n"; // Here is where the actual thread begins. $headings = array(array(tra("Author"), "authorcol"), array(tra("Message"), "")); start_forum_table($headings, "id=\"thread\" width=100%"); show_posts($thread, $forum, $sort_style, $filter, $logged_in_user, true); end_table(); if ($reply_url) { show_button($reply_url, tra("Post to thread"), tra("Add a new message to this thread")); } echo "<p>"; switch ($forum->parent_type) { case 0: show_forum_title($category, $forum, $thread); break; case 1: show_team_forum_title($forum, $thread); break; } $thread->update("views=views+1");