. // Some posts may contain material that is not suited for public // viewing. This file allows people to report such posts // For this file to work the project must have defined who // should receive such reports (in the configuration file) require_once('../inc/util.inc'); require_once('../inc/forum.inc'); require_once('../inc/forum_email.inc'); if (DISABLE_FORUMS) error_page("Forums are disabled"); check_get_args(array("post", "submit", "reason", "tnow", "ttok")); $postId = get_int('post'); $post = BoincPost::lookup_id($postId); $thread = BoincThread::lookup_id($post->thread); $forum = BoincForum::lookup_id($thread->forum); $user = get_logged_in_user(); BoincForumPrefs::lookup($user); check_banished($user); // Make sure the user has the forum's minimum amount of RAC and total credit // before allowing them to report a post. // Using the same rules as for rating (at least for now) // if ($user->total_credit<$forum->rate_min_total_credit || $user->expavg_credit<$forum->rate_min_expavg_credit) { error_page(tra("You need more average or total credit to report a post.")); } //__-------------- Action part $success_page=0; if (get_str("submit",true)){ check_tokens($user->authenticator); $reason = get_str("reason"); if (send_report_post_email($user, $forum, $thread, $post, $reason)){ $success_page=1; } else { echo "send email failed"; $success_page=-1; } } $no_forum_rating = parse_bool($config, "no_forum_rating"); //__--------------- Display part if ($success_page==1) { page_head(tra("Report Registered")); echo tra("Your report has been recorded. Thanks for your input.")."
" .tra("A moderator will now look at your report and decide what will happen - this may take a little while, so please be patient"); echo "
id&postid=$post->id\">".tra("Return to thread").""; } elseif ($success_page==0){ page_head(tra("Report a forum post")); if (!$no_forum_rating) { echo "
".tra("Before reporting this post, consider using the +/- rating system instead. If enough users rate a post negatively it will eventually be hidden.
You can find the rating system at the bottom of the post.")."
".tra("Your report could not be recorded. Please wait a while and try again.")."
".tra("If this is not a temporary error, please report it to the project developers.")."
"; echo "id&postid=$post->id\">".tra("Return to thread").""; } page_tail(); ?>