"; page_tail(); exit(); } // If the user has requested a reset of preferences; // preserve a few fields. // if (post_str("action", true)=="reset"){ $posts = $user->prefs->posts; $last_post = $user->prefs->last_post; $rated_posts = $user->prefs->rated_posts; $banished_until = $user->prefs->banished_until; $special_user = $user->prefs->special_user; $user->prefs->delete(); unset($user->prefs); BoincForumPrefs::lookup($user, true); $user->prefs->update("posts=$posts, last_post=$last_post, rated_posts='$rated_posts', banished_until=$banished_until, special_user='$special_user'"); Header("Location: edit_forum_preferences_form.php"); exit; } $avatar_type = post_int("avatar_select"); $newfile=IMAGE_PATH.$user->id."_avatar.jpg"; // Update the user avatar if ($avatar_type<0 or $avatar_type>3) $avatar_type=0; if ($avatar_type==0){ if (file_exists($newfile)){ // Delete the file on the server if the user // decides not to use an avatar // unlink($newfile); } $avatar_url=""; } elseif ($avatar_type == 1) { $avatar_url = "http://www.gravatar.com/avatar/".md5($user->email_addr)."?s=100&d=identicon"; } elseif ($avatar_type==2){ if (($rpc && (post_str("avatar_url", true) != null)) || ($_FILES['picture']['tmp_name']!="")) { if ($_FILES['picture']['tmp_name']!="") { $file = $_FILES['picture']['tmp_name']; } else { // Remote image. Download and store locally $file = post_str("avatar_url"); } $size = getImageSize($file); if ($size[2]!=2 and $size[2]!=3){ //Not the right kind of file error_page("Error: Not the right kind of file, only PNG and JPEG are supported."); } $width = $size[0]; $height = $size[1]; $image2 = intelligently_scale_image($file, 100, 100); ImageJPEG($image2, $newfile); } if (file_exists($newfile)){ $avatar_url=IMAGE_URL.$user->id."_avatar.jpg"; //$newfile; } else { //User didn't upload a compatible file or it went lost on the server $avatar_url=""; } } $images_as_links = ($_POST["forum_images_as_links"]!="")?1:0; $link_popup = ($_POST["forum_link_popup"]!="")?1:0; $hide_avatars = ($_POST["forum_hide_avatars"]!="")?1:0; $hide_signatures = ($_POST["forum_hide_signatures"]!="")?1:0; $jump_to_unread = ($_POST["forum_jump_to_unread"]!="")?1:0; $ignore_sticky_posts = ($_POST["forum_ignore_sticky_posts"]!="")?1:0; $no_signature_by_default = ($_POST["signature_by_default"]!="")?0:1; $pm_notification = post_int("pm_notification"); //$low_rating_threshold = post_int("forum_low_rating_threshold"); //$high_rating_threshold = post_int("forum_high_rating_threshold"); $signature = post_str("signature", true); if (strlen($signature)>250) { error_page( "Your signature was too long, please keep it less than 250 chars" ); } $forum_sort = post_int("forum_sort"); $thread_sort = post_int("thread_sort"); $minimum_wrap_postcount = post_int("forum_minimum_wrap_postcount"); $display_wrap_postcount = post_int("forum_display_wrap_postcount"); if ($minimum_wrap_postcount<0) $minimum_wrap_postcount=0; if ($display_wrap_postcount>$minimum_wrap_postcount) { $display_wrap_postcount=round($minimum_wrap_postcount/2); } if ($display_wrap_postcount<5) $display_wrap_postcount=5; $signature = BoincDb::escape_string($signature); $user->prefs->update("images_as_links=$images_as_links, link_popup=$link_popup, hide_avatars=$hide_avatars, hide_signatures=$hide_signatures, jump_to_unread=$jump_to_unread, ignore_sticky_posts=$ignore_sticky_posts, no_signature_by_default=$no_signature_by_default, pm_notification=$pm_notification, avatar='$avatar_url', signature='$signature', forum_sorting=$forum_sort, thread_sorting=$thread_sort, minimum_wrap_postcount=$minimum_wrap_postcount, display_wrap_postcount=$display_wrap_postcount"); $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 "No such user: $other_user"; } else { add_ignored_user($user, $other_user); } } } // Or remove some from the ignore list // $ignored_users = get_ignored_list($user); for ($i=0;$i\n"; echo " 1\n"; echo "\n"; } ?>