$forum_hide_signatures = $user->prefs->hide_signatures ? "checked=\"checked\"" : ""; $forum_link_popup = $user->prefs->link_popup ? "checked=\"checked\"" : ""; $forum_image_as_link = $user->prefs->images_as_links ? "checked=\"checked\"" : ""; $forum_jump_to_unread = $user->prefs->jump_to_unread ? "checked=\"checked\"" : ""; $forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts ? "checked=\"checked\"" : ""; $forum_highlight_special = $user->prefs->highlight_special ? "checked=\"checked\"" : ""; $forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount); $forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount); row1(tra("Message display")); row2(tra("What to display"), "<input type=\"checkbox\" name=\"forum_hide_avatars\" " . $forum_hide_avatars . "> " . tra("Hide avatar images") . "<br>\n <input type=\"checkbox\" name=\"forum_hide_signatures\" " . $forum_hide_signatures . "> " . tra("Hide signatures") . "<br>\n <input type=\"checkbox\" name=\"forum_images_as_links\" " . $forum_image_as_link . "> " . tra("Show images as links") . "<br>\n <input type=\"checkbox\" name=\"forum_link_popup\" " . $forum_link_popup . "> " . tra("Open links in new window/tab") . "<br>\n <input type=\"checkbox\" name=\"forum_highlight_special\" " . $forum_highlight_special . "> " . tra("Highlight special users") . "<br>\n <input type=\"text\" name=\"forum_display_wrap_postcount\" size=3 value=\"" . $forum_display_wrap_postcount . "\"> " . tra("Display this many messages per page") . "<br />\n "); row2(tra("How to sort"), tra("Threads:") . " " . select_from_array("forum_sort", $forum_sort_styles, $user->prefs->forum_sorting) . "<br>" . tra("Posts:") . " " . select_from_array("thread_sort", $thread_sort_styles, $user->prefs->thread_sorting) . "<br>\n <input type=\"checkbox\" name=\"forum_jump_to_unread\" " . $forum_jump_to_unread . "> " . tra("Jump to first new post in thread automatically") . "<br>\n <input type=\"checkbox\" name=\"forum_ignore_sticky_posts\" " . $forum_ignore_sticky_posts . ">" . tra("Don't move sticky posts to top") . "<br>\n "); } // DISABLE_FORUMS // ------------ Message filtering ----------- row1(tra("Message filtering")); $filtered_userlist = get_ignored_list($user); $forum_filtered_userlist = ""; for ($i = 0; $i < sizeof($filtered_userlist); $i++) { $id = (int) $filtered_userlist[$i]; if ($id) { $filtered_user = BoincUser::lookup_id($id); if (!$filtered_user) { echo "Missing user {$id}"; continue; } $forum_filtered_userlist .= "<input class=\"btn btn-default\" type=\"submit\" name=\"remove" . $filtered_user->id . "\" value=\"" . tra("Remove") . "\"> " . $filtered_user->id . " - " . user_links($filtered_user) . "<br>"; } } row2(tra("Filtered users") . "<br><p class=\"text-muted\">" . tra("Ignore message board posts and private messages from these users.") . "</p>", "{$forum_filtered_userlist}\n <input type=\"text\" name=\"forum_filter_user\" size=12> " . tra("User ID (For instance: 123456789)") . "\n <br><input class=\"btn btn-default\" type=\"submit\" name=\"add_user_to_filter\" value=\"" . tra("Add user to filter") . "\">\n "); row1(tra("Update")); row2(tra("Click here to update preferences"), "<input class=\"btn btn-primary\" type=submit value=\"" . tra("Update") . "\">");
// DISABLE_FORUMS $add_user_to_filter = $_POST["add_user_to_filter"] != ""; if ($add_user_to_filter) { $user_to_add = trim($_POST["forum_filter_user"]); if ($user_to_add != "" and $user_to_add == strval(intval($user_to_add))) { $other_user = BoincUser::lookup_id($user_to_add); if (!$other_user) { echo tra("No such user:"******" " . $user_to_add; } else { add_ignored_user($user, $other_user); } } } // Or remove some from the ignore list // $ignored_users = get_ignored_list($user); for ($i = 0; $i < sizeof($ignored_users); $i++) { if ($_POST["remove" . trim($ignored_users[$i])] != "") { $other_user = BoincUser::lookup_id($ignored_users[$i]); if (!$other_user) { echo tra("No such user:"******" " . $ignored_users[$j]; } else { remove_ignored_user($user, $other_user); } } } if ($rpc == false) { // If we get down here everything went ok // redirect the user to the setup page again // Header("Location: edit_forum_preferences_form.php");