. // Change the status of a thread. // A thread can be either unsolved or solved (used in the Q&A part) require_once('../inc/forum.inc'); check_get_args(array("id", "action")); $threadid = get_int('id'); $thread = BoincThread::lookup_id($threadid); if (!$thread) error_page("no such thread"); $logged_in_user = get_logged_in_user(); BoincForumPrefs::lookup($logged_in_user); if (DISABLE_FORUMS && !is_admin($logged_in_user)) { error_page("Forums are disabled"); } $owner = BoincUser::lookup_id($thread->owner); if ($logged_in_user->id == $owner->id){ $action = get_str("action"); if ($action == "set") { $ret = $thread->update("status=1"); } else { $ret = $thread->update("status=0"); } if (!$ret){ error_page("Could not update the status of the thread: ".$thread->id); } } else { error_page("You must be the creator of the thread to update its status."); } // -------------- page_head(tra("Thread status updated")); echo "

".tra("The status has been updated.")."

"; echo "

id."\">".tra("Return to thread")."

"; page_tail(); ?>