2005-02-12 09:50:13 +00:00
|
|
|
<?php
|
2007-11-15 22:51:05 +00:00
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
// Where the moderator decides what action to take on a thread. Sends
|
|
|
|
// its data to forum_moderate_thread_action.php for the actual action to
|
|
|
|
// take place.
|
2005-02-12 09:50:13 +00:00
|
|
|
|
|
|
|
require_once('../inc/forum.inc');
|
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
$logged_in_user = get_logged_in_user();
|
|
|
|
BoincForumPrefs::lookup($logged_in_user);
|
2005-02-12 09:50:13 +00:00
|
|
|
|
2005-02-17 11:43:49 +00:00
|
|
|
if (!get_str('action')) {
|
2006-06-16 23:53:56 +00:00
|
|
|
error_page("You must specify an action...");
|
2005-02-17 11:43:49 +00:00
|
|
|
}
|
2007-11-12 20:57:15 +00:00
|
|
|
$thread = BoincThread::lookup_id(get_int('thread'));
|
2007-11-15 22:51:05 +00:00
|
|
|
$forum = BoincForum::lookup_id($thread->forum);
|
2005-02-12 09:50:13 +00:00
|
|
|
|
2007-11-15 22:51:05 +00:00
|
|
|
if (!is_moderator($logged_in_user, $forum)) {
|
|
|
|
error_page("You are not authorized to moderate this post.");
|
2005-02-12 09:50:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
page_head('Forum');
|
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
echo "<form action=forum_moderate_thread_action.php?thread=$thread->id method=POST>\n";
|
|
|
|
echo form_tokens($logged_in_user->authenticator);
|
2005-02-12 09:50:13 +00:00
|
|
|
start_table();
|
|
|
|
row1("Moderate thread");
|
|
|
|
|
2005-02-17 11:43:49 +00:00
|
|
|
if (get_str('action')=="hide") {
|
2005-02-12 09:50:13 +00:00
|
|
|
//display input that selects reason
|
|
|
|
echo "<input type=hidden name=action value=hide>";
|
|
|
|
row2("",
|
2007-11-15 22:51:05 +00:00
|
|
|
"Select the reason category, or write a longer description of why you're hiding the thread; then press OK to hide it.");
|
2005-02-12 09:50:13 +00:00
|
|
|
row2("Category",
|
|
|
|
"<select name=\"category\">
|
2005-02-13 21:33:02 +00:00
|
|
|
<option value=\"1\">Obscene</option>
|
|
|
|
<option value=\"2\">Flame/Hate mail</option>
|
|
|
|
<option value=\"3\">Commercial spam</option>
|
2006-10-09 18:53:54 +00:00
|
|
|
<option value=\"4\">Other</option>
|
2005-02-12 09:50:13 +00:00
|
|
|
</select>");
|
2006-06-16 23:53:56 +00:00
|
|
|
} elseif (get_str('action')=="move") {
|
2007-11-15 22:51:05 +00:00
|
|
|
if ($forum->parent_type != 0) error_page("Nope");
|
2005-02-12 09:50:13 +00:00
|
|
|
echo "<input type=hidden name=action value=move>";
|
2007-05-18 14:49:10 +00:00
|
|
|
$selectbox = '<select name="forumid">';
|
2007-11-12 20:57:15 +00:00
|
|
|
$categories = BoincCategory::enum();
|
|
|
|
foreach ($categories as $category) {
|
|
|
|
$forums = BoincForum::enum("category=$category->id");
|
|
|
|
foreach ($forums as $forum) {
|
|
|
|
$selectbox .= '<option value="'.$forum->id.'">'.$forum->title.'</option>';
|
2007-05-18 14:49:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
$selectbox .= '</option>';
|
|
|
|
|
|
|
|
row2("Destination forum:", $selectbox);
|
2006-06-16 23:53:56 +00:00
|
|
|
} elseif (get_str('action')=="title") {
|
|
|
|
|
|
|
|
echo "<input type=hidden name=action value=title>";
|
2007-11-12 20:57:15 +00:00
|
|
|
row2("New title:", "<input name=\"newtitle\" value=\"".stripslashes(htmlspecialchars($thread->title))."\">");
|
2005-02-12 09:50:13 +00:00
|
|
|
} else {
|
2006-06-16 23:53:56 +00:00
|
|
|
error_page("Unknown action");
|
2005-02-12 09:50:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
row2("Reason<br>Mailed if nonempty",
|
2007-12-23 23:09:10 +00:00
|
|
|
"<textarea rows=10 cols=80 name=\"reason\"></textarea>");
|
2005-02-12 09:50:13 +00:00
|
|
|
|
|
|
|
row2(
|
|
|
|
"",
|
|
|
|
"<input type=\"submit\" name=\"submit\" value=\"OK\">"
|
|
|
|
);
|
|
|
|
|
|
|
|
end_table();
|
|
|
|
|
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
|
|
|
|
?>
|