$postId = get_int('post'); $choice = post_str('submit', true); $rating = post_int('rating', true); if (!$choice) { $choice = get_str('choice', true); } if ($choice == SOLUTION or $choice == "p") { $rating = 1; } else { $rating = -1; } $user = get_logged_in_user(); if ($choice == null && ($rating == null || $rating > 2 || $rating < -2)) { show_result_page(false, NULL, NULL, $choice); } $post = BoincPost::lookup_id($postId); $thread = BoincThread::lookup_id($post->thread); $forum = BoincForum::lookup_id($thread->forum); // Make sure the user has the forum's minimum amount of RAC and total credit // before allowing them to rate a post. // 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 rate a post.")); } if (BoincPostRating::lookup($user->id, $post->id)) { error_page(tra("You have already rated this post.") . "<br /><br /><a href=\"forum_thread.php?nowrap=true&id=" . $thread->id . "#" . $post->id . "\">" . tra("Return to thread") . "</a>"); } else { $success = BoincPostRating::replace($user->id, $post->id, $rating); show_result_page($success, $post, $thread, $choice); } }
break; case 5: $c = "User Request"; break; default: $c = "Other"; break; } $x = "\nYour post was categorized as " . $c; $x .= mod_comment(); return $x; } $user = get_logged_in_user(); check_tokens($user->authenticator); BoincForumPrefs::lookup($user); $post = BoincPost::lookup_id(get_int('id')); if (!$post) { error_page("no such post"); } $thread = BoincThread::lookup_id($post->thread); $forum = BoincForum::lookup_id($thread->forum); if (!is_moderator($user, $forum)) { error_page(tra("You are not authorized to moderate this post.")); } // See if "action" is provided - either through post or get if (!post_str('action', true)) { if (!get_str('action', true)) { error_page(tra("You must specify an action...")); } else { $action = get_str('action'); }
require_once '../inc/forum_email.inc'; require_once '../inc/forum.inc'; require_once '../inc/akismet.inc'; $logged_in_user = get_logged_in_user(true); BoincForumPrefs::lookup($logged_in_user); check_banished($logged_in_user); $thread = BoincThread::lookup_id(get_int('thread')); $forum = BoincForum::lookup_id($thread->forum); $sort_style = get_str('sort', true); $filter = get_str('filter', true); $content = post_str('content', true); $preview = post_str("preview", true); $parent_post_id = get_int('post', true); $parent_post = null; if ($parent_post_id) { $parent_post = BoincPost::lookup_id($parent_post_id); if ($parent_post->thread != $thread->id) { error_page("wrong thread"); } } else { $parent_post_id = 0; } if ($filter != "false") { $filter = true; } else { $filter = false; } check_reply_access($logged_in_user, $forum, $thread); if (!$sort_style) { $sort_style = $logged_in_user->prefs->thread_sorting; } else {