diff --git a/checkin_notes b/checkin_notes index 6345165b95..b4a9ccba87 100755 --- a/checkin_notes +++ b/checkin_notes @@ -8520,3 +8520,26 @@ Walt 8 Aug 2006 AccountManagerInfoPage.cpp ProjectInfoPage.cpp WelcomePage.cpp + +David 8 Aug 2006 + - User web: add "banish" feature for message boards. + Moderators can banish users for 2 weeks, + during which time they can't post or rate. + + NOTE: this requires a database update. See html/ops/db_update.php + + html/ + inc/ + forum.inc + forum_email.inc + forum_moderators.inc + forum_user.inc + ops/ + db_update.inc + user/ + forum_moderate_post.php + forum_moderate_post_action.php + forum_post.php + forum_reply.php + forum_report_post.php + white.css diff --git a/db/schema.sql b/db/schema.sql index f90d6f02f0..28bcf79b7a 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -426,6 +426,7 @@ create table forum_preferences ( display_wrap_postcount INT DEFAULT 75 NOT NULL, ignorelist varchar(254) not null, ignore_sticky_posts tinyint(1) unsigned not null, + banished_until integer not null default 0, primary key (userid) ) type=MyISAM; diff --git a/doc/docutil.php b/doc/docutil.php index 2a15e546b3..984493d58c 100644 --- a/doc/docutil.php +++ b/doc/docutil.php @@ -55,7 +55,7 @@ function copyright() { "; } -function page_tail() { +function page_tail($translatable=false) { $datefile = $_SERVER["SCRIPT_FILENAME"]; $d = last_mod($datefile); echo " @@ -64,7 +64,15 @@ function page_tail() { Return to BOINC main page


- Last modified $d.
+ + "; + if ($translatable) { + echo " + This page is translatable.
+ "; + } + echo " + Last modified $d.
"; copyright(); echo " diff --git a/doc/download.php b/doc/download.php index ab9625bdec..e825b36638 100755 --- a/doc/download.php +++ b/doc/download.php @@ -146,6 +146,6 @@ if ($_GET['all_platforms']) { } else { show_download(null); } -page_tail(); +page_tail(true); ?> diff --git a/doc/poll.php b/doc/poll.php index 6910ead769..bdd02a19c2 100644 --- a/doc/poll.php +++ b/doc/poll.php @@ -46,5 +46,6 @@ list_end(); echo " "; +page_tail(true); ?> diff --git a/doc/poll_results.php b/doc/poll_results.php index 304ac9834a..74c3b75fde 100644 --- a/doc/poll_results.php +++ b/doc/poll_results.php @@ -172,7 +172,7 @@ list_item2( ); list_end(); -page_tail(); +page_tail(true); $f = fopen($cachefile, "w"); fwrite($f, ob_get_contents()); diff --git a/doc/release_notes.php b/doc/release_notes.php index fa854a9b37..6cd76c2043 100644 --- a/doc/release_notes.php +++ b/doc/release_notes.php @@ -105,5 +105,5 @@ run_manager "; -page_tail(); +page_tail(true); ?> diff --git a/doc/system_requirements.php b/doc/system_requirements.php index 6b04ad16cf..770e07d252 100644 --- a/doc/system_requirements.php +++ b/doc/system_requirements.php @@ -54,7 +54,7 @@ echo "


"; -page_tail(); +page_tail(true); ?> diff --git a/doc/translation.php b/doc/translation.php index 134eb4ff3b..5345b4ecb3 100644 --- a/doc/translation.php +++ b/doc/translation.php @@ -7,15 +7,46 @@ page_head("Web and GUI translations"); echo " BOINC has a mechanism for non-English translations of + +

Instructions for volunteer translators

-We encourage volunteers to do these translations. -If you're interested, please see the instructions at the bottom of this page. +Translations are done by volunteers. +If you're interested in helping: + +

Translation files

@@ -27,7 +58,7 @@ is described These have names like 'da.po' (Danish) and 'en.po' (English). It's very simple. For example: - +
en.po (English)
@@ -97,10 +128,8 @@ replaces the token with the corresponding translated text.
 
 
 

-In developing web pages, keep in mind that word -order differs between languages, -so you should avoid breaking a sentence up into -multiple translation units. +In developing web pages, keep in mind that word order differs between languages, +so you should avoid breaking a sentence up into multiple translation units. For example, use constructs like

 msgid \"ACTIVATE_OR_CREATE\"
@@ -137,45 +166,7 @@ Project-specific translation files override BOINC translation files.
 

BOINC Manager translations

Menu names and other text in the BOINC manager are stored in -a file called BOINC Manager.po. -The release uses American English. -Many other languages are available. -The BOINC distribution includes all current language files. - -

Instructions for volunteer translators

-

-If you are interested in doing translation for BOINC or -for a specific project: - -

    -
  • Email the translation manager. -For BOINC this is translate at boinc.berkeley.edu. -Use this address also for SETI@home translations. -For other projects, contact the project. -
  • -Obtain (typically via CVS) the 'authoritative' translation file. -Typically this is en.po. -The translation files for project web sites are -here. -
  • -Create a translation file for your language. -You can do this using a text editor or a specialized tool such as -poedit. -
  • -Send this to the translation manager, -who will then install it on the project's web site. -Check all relevant pages and fix as needed. -
  • -Subscribe to the -boinc_loc at ssl.berkeley.edu -email list, which is devoted to discussion of BOINC-related translation. - -
  • -Because web sites are dynamic, -you will have to periodically update your translation. -You can do this efficiently by looking at the CVS diffs -of the authoritative translation file. -
+files in boinc/locale/client/. "; diff --git a/html/inc/forum.inc b/html/inc/forum.inc index 5faf9bf911..e2bbf55a72 100644 --- a/html/inc/forum.inc +++ b/html/inc/forum.inc @@ -524,4 +524,13 @@ function post_warning() { "; } +function check_banished($user) { + $x = $user->getBanishedUntil(); + if ($x>time()) { + error_page( + "You may not post or rate messages until ".gmdate('M j, Y', $x) + ); + } +} + ?> diff --git a/html/inc/forum_email.inc b/html/inc/forum_email.inc index 0daa3f37bf..7e5187aa6b 100644 --- a/html/inc/forum_email.inc +++ b/html/inc/forum_email.inc @@ -138,4 +138,15 @@ For further information and assistance with ".PROJECT." go to $master_url"; return re_send_email($forum_post_reporting_admin, $subject, $body); } +function send_banish_email($user) { + $subject = PROJECT." posting privileges suspended"; + $forum_post_reporting_admin = newUser(FORUM_MODERATION_EMAIL_USER_ID); + $body = " +This email is to inform you that you will not be able to +post to the ".PROJECT." message boards for two weeks, +because your postings have not followed our guidelines. + "; + return re_send_email($forum_post_reporting_admin, $subject, $body); +} + ?> diff --git a/html/inc/forum_moderators.inc b/html/inc/forum_moderators.inc index 030e660f31..7766b54390 100644 --- a/html/inc/forum_moderators.inc +++ b/html/inc/forum_moderators.inc @@ -7,9 +7,10 @@ function post_moderation_links($post){ if ($post->isHidden()){ $x = " - getID()."\">[undelete post] - "; } else { - $x = " - getID()."\">[delete post] - "; + $x = " - getID()."\">[delete post] "; } - $x.= "getID()."\">[move post]"; + $x.= " - getID()."\">[move post]"; + $x .= " - getID()."&userid=".$post->getOwnerID().">[banish author]"; return $x; } @@ -24,4 +25,4 @@ function show_thread_moderation_links($thread){ echo "getID()."\">Make thread sticky
"; } } -?> \ No newline at end of file +?> diff --git a/html/inc/forum_user.inc b/html/inc/forum_user.inc index bc302fec05..e549d91bc3 100644 --- a/html/inc/forum_user.inc +++ b/html/inc/forum_user.inc @@ -104,6 +104,10 @@ class User { $this->ensurePrefsLoaded(); return $this->fprefObj->minimum_wrap_postcount; } + function getBanishedUntil() { + $this->ensurePrefsLoaded(); + return $this->fprefObj->banished_until; + } function setMinimumWrapPostCount($value){ $value = intval($value); if ($value<0) $value=0; @@ -379,4 +383,4 @@ function re_user_links($user) { return $x; } -?> \ No newline at end of file +?> diff --git a/html/ops/db_update.php b/html/ops/db_update.php index 2473145682..99f0b89275 100644 --- a/html/ops/db_update.php +++ b/html/ops/db_update.php @@ -327,6 +327,11 @@ function update_6_16_2006() { function update_7_11_2006() { do_query("alter table app add weight double not null"); } -//update_7_11_2006(); + +function update_8_8_2006() { + do_query("alter table forum_preferences add banished_until integer not null default 0"); +} + +//update_8_8_2006(); ?> diff --git a/html/user/forum_moderate_post.php b/html/user/forum_moderate_post.php index c9147d250c..a0dc0141f8 100644 --- a/html/user/forum_moderate_post.php +++ b/html/user/forum_moderate_post.php @@ -21,11 +21,10 @@ if (!$logged_in_user->isSpecialUser(S_MODERATOR)) { error_page("You are not authorized to moderate this post."); } -$post = new Post(get_int('id')); +$postid = get_int('id'); +$post = new Post($postid); $thread = $post->getThread(); - - page_head('Forum'); //start form @@ -49,6 +48,26 @@ if (get_str('action')=="hide") { echo ""; row2("Destination thread ID:", ""); //todo display where to move the post as a dropdown instead of having to get ID +} elseif (get_str('action')=="banish_user") { + $userid = get_int('userid'); + $user = newUser($userid); + if (!$user) { + error_page("no user"); + } + $x = $user->getBanishedUntil(); + if ($x>time()) { + echo "User is already banished"; + exit(); + } + echo "Are you sure you want to banish $user->name? + This will prevent $user->name from posting for 2 weeks. + It should be done only if $user->name + has consistently exhibited trollish behavior. +

+ Yes, banish $user->name + "; + page_tail(); + exit(); } else { error_page( "Unknown action"); } diff --git a/html/user/forum_moderate_post_action.php b/html/user/forum_moderate_post_action.php index 73156bb9a9..e867c6342e 100644 --- a/html/user/forum_moderate_post_action.php +++ b/html/user/forum_moderate_post_action.php @@ -41,6 +41,24 @@ if ($action=="hide"){ } elseif ($action=="move"){ $destination_thread = new Thread(post_int('threadid')); $result = $post->move($destination_thread); +} elseif ($action=="banish_user"){ + $userid = get_int('userid'); + $user = lookup_user_id($userid); + if (!$user) { + error_page("no user"); + } + $t = time() + 14*86400; // two weeks + $query = "update forum_preferences set banished_until=$t where userid=$userid"; + $result = mysql_query($query); + if ($result) { + echo "User $user->name has been banished for 2 weeks."; + send_banish_email($user); + } else { + echo "DB failure for $query"; + echo mysql_error(); + } + page_tail(); + exit(); } else { error_page("Unknown action "); } diff --git a/html/user/forum_post.php b/html/user/forum_post.php index e7e6c25325..f033603394 100644 --- a/html/user/forum_post.php +++ b/html/user/forum_post.php @@ -13,6 +13,8 @@ db_init(); $logged_in_user = re_get_logged_in_user(true); +check_banished($logged_in_user); + $forumid = get_int("id"); $forum = new Forum($forumid); diff --git a/html/user/forum_reply.php b/html/user/forum_reply.php index 5d82f3974b..d45c4d03e5 100644 --- a/html/user/forum_reply.php +++ b/html/user/forum_reply.php @@ -11,6 +11,7 @@ require_once('../inc/forum_std.inc'); db_init(); $logged_in_user = re_get_logged_in_user(true); +check_banished($logged_in_user); $thread = new Thread (get_int('thread')); $forum = $thread->getForum(); diff --git a/html/user/forum_report_post.php b/html/user/forum_report_post.php index cb987a68c0..0131bf15de 100644 --- a/html/user/forum_report_post.php +++ b/html/user/forum_report_post.php @@ -19,6 +19,7 @@ db_init(); $forum = $thread->getForum(); $user = re_get_logged_in_user(true); + 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) diff --git a/html/user/moderation.php b/html/user/moderation.php index 707ffa241e..d6d2d689e1 100644 --- a/html/user/moderation.php +++ b/html/user/moderation.php @@ -9,8 +9,9 @@ To maximize discussion and flow of information, our message boards are moderated. Message board postings are subject to the following posting rules: ".post_rules()." -Moderators may delete posts that violate any of these rules. -The authors of deleted posts will be notified via email. +Moderators may delete posts that violate any of these rules, +and may suspend the posting privileges of anyone +who repeatedly violates the rules.

If you think a post violates any of the posting rules, diff --git a/html/user/white.css b/html/user/white.css index 3f17ff1e10..e355a9c326 100644 --- a/html/user/white.css +++ b/html/user/white.css @@ -214,7 +214,7 @@ tr.postseperator td{ } td.threadline { - font-size:10pt; + font-size:9pt; text-align:left; }