*** empty log message ***

svn path=/trunk/boinc/; revision=10867
This commit is contained in:
David Anderson 2006-08-08 20:32:37 +00:00
parent b065423694
commit 0328bd2122
21 changed files with 161 additions and 65 deletions

View File

@ -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

View File

@ -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;

View File

@ -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() {
<a href=\"/\">Return to BOINC main page</a>
</center><p>
<br>
<font color=888888 size='2'>Last modified $d.<br>
<font color=888888 size='2'>
";
if ($translatable) {
echo "
This page is <a href=translation.php>translatable</a>.<br>
";
}
echo "
Last modified $d.<br>
";
copyright();
echo "

View File

@ -146,6 +146,6 @@ if ($_GET['all_platforms']) {
} else {
show_download(null);
}
page_tail();
page_tail(true);
?>

View File

@ -46,5 +46,6 @@ list_end();
echo "
</form>
";
page_tail(true);
?>

View File

@ -172,7 +172,7 @@ list_item2(
);
list_end();
page_tail();
page_tail(true);
$f = fopen($cachefile, "w");
fwrite($f, ob_get_contents());

View File

@ -105,5 +105,5 @@ run_manager
</ul>
";
page_tail();
page_tail(true);
?>

View File

@ -54,7 +54,7 @@ echo "
<hr>
";
page_tail();
page_tail(true);
?>

View File

@ -7,15 +7,46 @@ page_head("Web and GUI translations");
echo "
BOINC has a mechanism for non-English translations of
<ul>
<li> Parts of this site (the <a href=download.php>Download page</a>
and the <a href=poll.php>BOINC user survey</a>)
<li> Parts of this site (the <a href=download.php>Download</a>
and <a href=poll.php>BOINC user survey</a> pages,
and related pages)
<li> The BOINC Manager
<li> Parts of the BOINC-supplied portion of project web sites
<li> The project-specific parts of project web sites
</ul>
<h2>Instructions for volunteer translators</h2>
<p>
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:
<ul>
<li> Email the translation manager.
For BOINC this is <b>translate at boinc.berkeley.edu</b>.
Use this address also for SETI@home translations.
For other projects, contact the project.
<li>
Obtain (typically via CVS) the 'authoritative' translation file.
Usually this is en.po (English).
<li>
Create a translation file for your language.
You can do this using a text editor or a specialized tool such as
<a href=http://www.poedit.org/>poedit</a>.
<li>
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.
<li>
Subscribe to the
<a href=http://ssl.berkeley.edu/mailman/listinfo/boinc_loc>boinc_loc at ssl.berkeley.edu</a>
email list, which is for translation-related discussion and announcements.
<li>
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.
</ul>
<h2>Translation files</h2>
@ -27,7 +58,7 @@ is described
These have names like 'da.po' (Danish) and 'en.po' (English).
It's very simple.
For example:
<table>
<table width=100%>
<tr><th>en.po (English)</th></tr>
<tr><td>
<pre>
@ -97,10 +128,8 @@ replaces the token with the corresponding translated text.
</ul>
<p>
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
<pre>
msgid \"ACTIVATE_OR_CREATE\"
@ -137,45 +166,7 @@ Project-specific translation files override BOINC translation files.
<h2>BOINC Manager translations</h2>
<p>
Menu names and other text in the BOINC manager are stored in
a file called <b>BOINC Manager.po</b>.
The release uses American English.
Many other languages are available.
The BOINC distribution includes all current language files.
<h2>Instructions for volunteer translators</h2>
<p>
If you are interested in doing translation for BOINC or
for a specific project:
<ul>
<li> Email the translation manager.
For BOINC this is <b>translate at boinc.berkeley.edu</b>.
Use this address also for SETI@home translations.
For other projects, contact the project.
<li>
Obtain (typically via CVS) the 'authoritative' translation file.
Typically this is en.po.
The translation files for project web sites are
<a href=http://boinc.berkeley.edu/cgi-bin/cvsweb.cgi/boinc/html/languages/translations/>here</a>.
<li>
Create a translation file for your language.
You can do this using a text editor or a specialized tool such as
<a href=http://www.poedit.org/>poedit</a>.
<li>
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.
<li>
Subscribe to the
<a href=http://ssl.berkeley.edu/mailman/listinfo/boinc_loc>boinc_loc at ssl.berkeley.edu</a>
email list, which is devoted to discussion of BOINC-related translation.
<li>
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.
</ul>
files in <b>boinc/locale/client/</b>.
";

View File

@ -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)
);
}
}
?>

View File

@ -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);
}
?>

View File

@ -7,9 +7,10 @@ function post_moderation_links($post){
if ($post->isHidden()){
$x = " - <a href=\"forum_moderate_post_action.php?action=unhide&id=".$post->getID()."\">[undelete post]</a> - ";
} else {
$x = " - <a href=\"forum_moderate_post.php?action=hide&id=".$post->getID()."\">[delete post]</a> - ";
$x = " - <a href=\"forum_moderate_post.php?action=hide&id=".$post->getID()."\">[delete post]</a> ";
}
$x.= "<a href=\"forum_moderate_post.php?action=move&id=".$post->getID()."\">[move post]</a>";
$x.= " - <a href=\"forum_moderate_post.php?action=move&id=".$post->getID()."\">[move post]</a>";
$x .= " - <a href=forum_moderate_post.php?action=banish_user&id=".$post->getID()."&userid=".$post->getOwnerID().">[banish author]</a>";
return $x;
}
@ -24,4 +25,4 @@ function show_thread_moderation_links($thread){
echo "<a href=\"forum_moderate_thread_action.php?action=sticky&id=".$thread->getID()."\">Make thread sticky</a><br>";
}
}
?>
?>

View File

@ -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;
}
?>
?>

View File

@ -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();
?>

View File

@ -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 "<input type=hidden name=action value=move>";
row2("Destination thread ID:", "<input name=\"threadid\">");
//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.
<p>
<a href=forum_moderate_post_action.php?action=banish_user&id=$postid&userid=$userid&confirmed=yes>Yes, banish $user->name</a>
";
page_tail();
exit();
} else {
error_page( "Unknown action");
}

View File

@ -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 ");
}

View File

@ -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);

View File

@ -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();

View File

@ -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)

View File

@ -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.
<p>
If you think a post violates any of the posting rules,

View File

@ -214,7 +214,7 @@ tr.postseperator td{
}
td.threadline {
font-size:10pt;
font-size:9pt;
text-align:left;
}