- When updating forum preferences the avatar will now be preserved if set.

- Use the new forum backend
- Deleted remains of old external-URL avatar feature, we will not need this ever (lack of avatar control)
- Added CVS auto tracker
- Improved the layout of the page by using row1 and row2 to seperate the different categories.

svn path=/trunk/boinc/; revision=10963
This commit is contained in:
Janus B. Kristensen 2006-08-22 09:25:30 +00:00
parent f87bb18959
commit 9e5763268f
1 changed files with 52 additions and 47 deletions

View File

@ -1,13 +1,17 @@
<?php
/**
* This provides the form from which the user can edit his or her
* forum preferences. It relies upon edit_forum_preferences_action.php
* to do anything.
**/
require_once("../inc/db.inc");
$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit
require_once("../inc/forum.inc");
require_once("../inc/forum_std.inc");
require_once("../inc/util.inc");
require_once("../inc/std.php");
db_init();
$user = get_logged_in_user();
$user = getForumPreferences($user);
$user = re_get_logged_in_user();
page_head("Edit message board preferences");
echo "<script type=\"text/javascript\">
@ -26,51 +30,48 @@ countfield.value = maxlimit - field.value.length // the number of the remaining
</script>";
start_table();
row2("Reset preferences<br><font size=-2>Use this button to reset preferences to the defaults</font>",
"<form method=\"post\" action=\"edit_forum_preferences_action.php\"><input type=\"submit\" value=\"Reset preferences\"></form>");
row1("Reset preferences");
row2("<font size=-2>Use this button to reset preferences to the defaults</font>",
"<form method=\"post\" action=\"edit_forum_preferences_action.php\"><input type=\"submit\" value=\"Reset preferences\"><input type=\"hidden\" name=\"action\" value=\"reset\"></form>");
echo "<form method=\"post\" action=\"edit_forum_preferences_action.php\" enctype=\"multipart/form-data\">";
if ($user->avatar_type==0){
$zero_select="checked=\"checked\"";
} elseif($user->avatar_type==1){
$one_select="checked=\"checked\"";
$avatar_url=$user->avatar;
} elseif($user->avatar_type==2){
$two_select="checked=true";
if ($user->hasAvatar()){
$two_select="checked=\"true\"";
} else {
$zero_select="checked=\"true\"";
}
row2("Avatar<br><font size=-2>The virtual representation of you on the message boards<br/>Note: Forced size of 100x100 pixels<br>format: jpg/png - size: at most 4k</font>",
row1("Avatar");
row2("<font size=-2>The virtual representation of you on the message boards<br/>Note: Forced size of 100x100 pixels<br>format: jpg/png - size: at most 42k</font>",
"
<table>
<tr><td><input type=\"radio\" name=\"avatar_select\" value=\"0\" ".$zero_select.">Don't use an avatar</td><td></td></tr>
<!--<tr><td><input type=\"radio\" name=\"avatar_select\" value=\"1\" ".$one_select.">Use external avatar:</td><td><input name=\"avatar_url\" size=30 value=\"".$avatar_url."\"'></td></tr>-->
<tr><td><input type=\"radio\" name=\"avatar_select\" value=\"2\" ".$two_select.">Use this uploaded avatar: <input type=\"file\" name=\"picture\"></td><td></td></tr>
</table>
"
);
if ($user->avatar!=""){
if ($user->hasAvatar()){
row2("Avatar preview<br><font size=-2>This is how your avatar will look</font>",
"<img src=\"".$user->avatar."\" width=\"100\" height=\"100\">");
"<img src=\"".$user->getAvatar()."\" width=\"100\" height=\"100\">");
}
row2("Sort styles<br><font size=-2>How to sort the replies in the message board and Q&amp;A areas</font>",
row1("Sort styles");
row2("<font size=-2>How to sort the replies in the message board and Q&amp;A areas</font>",
"
<table>
<tr><td>Message threadlist:</td><td>".select_from_array("forum_sort", $forum_sort_styles, getSortStyle($user,"forum"))."</td></tr>
<tr><td>Message posts:</td><td>".select_from_array("thread_sort", $thread_sort_styles, getSortStyle($user,"thread"))."</td></tr>
<tr><td>Q&amp;A questionlist:</td><td>".select_from_array("faq_sort", $faq_sort_styles, getSortStyle($user,"faq"))."</td></tr>
<tr><td>Q&amp;A questions:</td><td>".select_from_array("answer_sort", $answer_sort_styles, getSortStyle($user,"answer"))."</td></tr>
<tr><td>Message threadlist:</td><td>".select_from_array("forum_sort", $forum_sort_styles, $user->getForumSortStyle())."</td></tr>
<tr><td>Message posts:</td><td>".select_from_array("thread_sort", $thread_sort_styles, $user->getThreadSortStyle())."</td></tr>
</table>"
);
if ($user->link_popup==1){$forum_link_externally="checked=\"checked\"";} else {$forum_link_externally="";}
if ($user->images_as_links==1){$forum_image_as_link="checked=\"checked\"";} else {$forum_image_as_link="";}
if ($user->jump_to_unread==1){$forum_jump_to_unread="checked=\"checked\"";} else {$forum_jump_to_unread="";}
if ($user->ignore_sticky_posts==1){$forum_ignore_sticky_posts="checked=\"checked\"";} else {$forum_ignore_sticky_posts="";}
if ($user->hasLinkPopup()){$forum_link_externally="checked=\"checked\"";} else {$forum_link_externally="";}
if ($user->hasImagesAsLinks()){$forum_image_as_link="checked=\"checked\"";} else {$forum_image_as_link="";}
if ($user->hasJumpToUnread()){$forum_jump_to_unread="checked=\"checked\"";} else {$forum_jump_to_unread="";}
if ($user->hasIgnoreStickyPosts()){$forum_ignore_sticky_posts="checked=\"checked\"";} else {$forum_ignore_sticky_posts="";}
$forum_minimum_wrap_postcount = intval($user->minimum_wrap_postcount);
$forum_display_wrap_postcount = intval($user->display_wrap_postcount);
$forum_minimum_wrap_postcount = intval($user->getMinimumWrapPostcount());
$forum_display_wrap_postcount = intval($user->getDisplayWrapPostcount());
row2("Display and Behavior".
row1("Display and Behavior");
row2(
"<br><font size=-2>How to treat links and images in the forum<br>and how to act on unread posts</font>",
"<table><tr><td>
<input type=\"checkbox\" name=\"forum_images_as_links\" ".$forum_image_as_link."> Show images as links<br>
@ -84,11 +85,13 @@ row2("Display and Behavior".
</td></tr></table>"
);
if ($user->hide_avatars==1){$forum_hide_avatars="checked=\"checked\"";} else {$forum_hide_avatars="";}
if ($user->hide_signatures==1){$forum_hide_signatures="checked=\"checked\"";} else {$forum_hide_signatures="";}
$forum_low_rating_threshold= $user->low_rating_threshold;
$forum_high_rating_threshold= $user->high_rating_threshold;
row2("Filtering".
if ($user->hasHideAvatars()){$forum_hide_avatars="checked=\"checked\"";} else {$forum_hide_avatars="";}
if ($user->hasHideSignatures()){$forum_hide_signatures="checked=\"checked\"";} else {$forum_hide_signatures="";}
$forum_low_rating_threshold= $user->getLowRatingThreshold();
$forum_high_rating_threshold= $user->getHighRatingThreshold();
row1("Filtering");
row2(
"<br><font size=-2>What to display<br>If you set both your high and low thresholds to 0 or<br>empty they will reset to the default values</font>",
"<table><tr><td>
<input type=\"checkbox\" name=\"forum_hide_avatars\" ".$forum_hide_avatars."> Hide avatar images<br>
@ -104,10 +107,12 @@ row2("Filtering".
"
);
$filtered_userlist=explode("|",$user->ignorelist);
for ($i=1;$i<sizeof($filtered_userlist);$i++){
$filtered_user = lookup_user_id($filtered_userlist[$i]);
$forum_filtered_userlist.="<input type =\"submit\" name=\"remove".trim($filtered_userlist[$i])."\" value=\"Remove\"> ".$filtered_userlist[$i]." - ".user_links($filtered_user,URL_BASE)."<br>";
$filtered_userlist=$user->getIgnorelist();
for ($i=0;$i<sizeof($filtered_userlist);$i++){
if ($filtered_userlist[$i]!=""){
$filtered_user = newUser($filtered_userlist[$i]);
$forum_filtered_userlist.="<input type =\"submit\" name=\"remove".$filtered_user->getID()."\" value=\"Remove\"> ".$filtered_user->getID()." - ".re_user_links($filtered_user,URL_BASE)."<br>";
}
}
row2("Filtered users".
"<br><font size=-2>Ignore specific users<br>You can define a list of users to ignore.<br>These users will have to write posts with very high<br> rating in order to not be filtered.</font>",
@ -124,12 +129,11 @@ row2("Filtered users".
"
);
if ($user->no_signature_by_default==0){$enable_signature="checked=\"checked\"";} else {$enable_signature="";}
$signature=stripslashes($user->signature);
if ($user->hasSignatureByDefault()){$enable_signature="checked=\"checked\"";} else {$enable_signature="";}
$signature=stripslashes($user->getSignature());
$maxlen=250;
row2("Signature for message boards".html_info().
row1("Signature");
row2(html_info().
"<font size=-2><br>Max length (including newlines) is $maxlen chars.</font>",
"<table><tr><td>
<textarea name=\"signature\" rows=4 cols=50 id=\"signature\" onkeydown=\"textCounter(this.form.signature, this.form.remLen,$maxlen);\"
@ -137,12 +141,13 @@ row2("Signature for message boards".html_info().
<br><input name=\"remLen\" type=\"text\" id=\"remLen\" value=\"".($maxlen-strlen($signature))."\" size=\"3\" maxlength=\"3\" readonly> chars remaining
<br><input type=\"checkbox\" name=\"signature_enable\" ".$enable_signature."> Attach signature by default
</td></tr></table>");
if ($user->signature!=""){
if ($user->getSignature()!=""){
row2("Signature preview".
"<br><font size=-2>This is how your signature will look in the forums</font>",
output_transform($user->signature)
output_transform($user->getSignature())
);
}
row1("&nbsp;");
row2("", "<input type=submit value='Update info'>");
echo "</form>\n";
end_table();