From 2d4552e42d0c074b930f78309014085d96f6ba3b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 28 Nov 2003 23:11:22 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=2707 --- checkin_notes | 14 ++++++++++++++ db/boinc_db.C | 8 ++++++-- db/boinc_db.h | 1 + db/schema.sql | 9 ++++++++- html/user/edit_user_info_action.php | 3 ++- html/user/edit_user_info_form.php | 5 ++++- html/user/index.php | 15 ++++++++++++++- html/user/util.inc | 4 ++-- 8 files changed, 51 insertions(+), 8 deletions(-) diff --git a/checkin_notes b/checkin_notes index eb56c6ffda..dfabafcb50 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7916,3 +7916,17 @@ Karl 2003-11-28 client/ cs_cmdline.C + +David 28 Nov 2003 + - added "signature" field to user table; + when making forum postings, + users have the option of appending signature + + db/ + boinc_db.C,h + schema.sql + html_user/ + edit_user_info_action.php + edit_user_info_form.php + index.php + util.inc diff --git a/db/boinc_db.C b/db/boinc_db.C index 90cd3e6eee..8a6a208044 100644 --- a/db/boinc_db.C +++ b/db/boinc_db.C @@ -186,6 +186,7 @@ void DB_USER::db_print(char* buf){ escape_single_quotes(global_prefs); escape_single_quotes(project_prefs); escape_single_quotes(url); + escape_single_quotes(signature); sprintf(buf, "id=%d, create_time=%d, email_addr='%s', name='%s', " "authenticator='%s', " @@ -195,7 +196,7 @@ void DB_USER::db_print(char* buf){ "teamid=%d, venue='%s', url='%s', send_email=%d, show_hosts=%d, " "posts=%d, " "seti_id=%d, seti_nresults=%d, seti_last_result_time=%d, " - "seti_total_cpu=%.15e", + "seti_total_cpu=%.15e, signature='%s'", id, create_time, email_addr, @@ -217,7 +218,8 @@ void DB_USER::db_print(char* buf){ seti_id, seti_nresults, seti_last_result_time, - seti_total_cpu + seti_total_cpu, + signature ); unescape_single_quotes(email_addr); unescape_single_quotes(name); @@ -226,6 +228,7 @@ void DB_USER::db_print(char* buf){ unescape_single_quotes(global_prefs); unescape_single_quotes(project_prefs); unescape_single_quotes(url); + unescape_single_quotes(signature); } void DB_USER::db_parse(MYSQL_ROW &r) { @@ -253,6 +256,7 @@ void DB_USER::db_parse(MYSQL_ROW &r) { seti_nresults = safe_atoi(r[i++]); seti_last_result_time = safe_atoi(r[i++]); seti_total_cpu = safe_atof(r[i++]); + strcpy2(signature, r[i++]); } void DB_TEAM::db_print(char* buf){ diff --git a/db/boinc_db.h b/db/boinc_db.h index a444d86f02..9ec0edb427 100755 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -163,6 +163,7 @@ struct USER { int seti_nresults; // number of WUs completed int seti_last_result_time; // time of last result (UNIX) double seti_total_cpu; // number of CPU seconds + char signature[256]; void clear(); }; diff --git a/db/schema.sql b/db/schema.sql index d73f4e7ea1..e7e4224a9e 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -1,4 +1,10 @@ -/* If you add/change anything, update boinc_db.C,h */ +/* If you add/change anything, update + boinc_db.C,h + and if needed: + html_user/ + create_account_action.php + team_create_action.php +*/ /* Fields are documented in boinc_db.h */ /* Do not replace this with an automatically generated schema */ @@ -71,6 +77,7 @@ create table user ( seti_nresults integer not null, seti_last_result_time integer not null, seti_total_cpu double not null, + signature varchar(254), primary key (id) ); diff --git a/html/user/edit_user_info_action.php b/html/user/edit_user_info_action.php index 50bf623c48..7ded116f25 100644 --- a/html/user/edit_user_info_action.php +++ b/html/user/edit_user_info_action.php @@ -10,8 +10,9 @@ $url = $HTTP_POST_VARS["url"]; $country = $HTTP_POST_VARS["country"]; $postal_code = $HTTP_POST_VARS["postal_code"]; + $signature = $HTTP_POST_VARS["signature"]; - $result = mysql_query("update user set name='$name', url='$url', country='$country', postal_code='$postal_code' where id=$user->id"); + $result = mysql_query("update user set name='$name', url='$url', country='$country', postal_code='$postal_code' signature='$signature' where id=$user->id"); if ($result) { Header("Location: home.php"); } else { diff --git a/html/user/edit_user_info_form.php b/html/user/edit_user_info_form.php index 685e2d61d1..4ae6f2a59b 100644 --- a/html/user/edit_user_info_form.php +++ b/html/user/edit_user_info_form.php @@ -15,7 +15,7 @@ row2("Name", "" ); row2("URL", - "http://" + "http://" ); row2_init("Country", "\n"; row2("Postal (ZIP) code", "" ); + +$x = ""; +row2("Signature for message boards", $x); row2("", ""); end_table(); echo "\n"; diff --git a/html/user/index.php b/html/user/index.php index cc37dd5b66..f208cadecd 100644 --- a/html/user/index.php +++ b/html/user/index.php @@ -15,11 +15,14 @@ project_intro(); echo " +

+ + + +

Join ".PROJECT."

Returning participants

@@ -45,6 +48,16 @@
  • XML statistics data --> +
  • +
    +

    News

    +
    +"; +project_news(); +echo " +