From 2272891035c3f2772d589a65f103107fd25c6c76 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 2 Oct 2007 03:19:03 +0000 Subject: [PATCH] - user web: add "team search" page, which does a multi-criteria search (keywords, country, type). Have the new-user scenario route the user through this page. Also, link to it rather than team.php for existing users. - user web: use cookies rather than URLs to identify new users, and show "Welcome to X" when they reach their user page. - user web: don't show user intermediate page for join/quit team. Just take them to their user page. svn path=/trunk/boinc/; revision=13731 --- checkin_notes | 30 +++++ doc/links.php | 2 +- html/inc/team.inc | 6 +- html/inc/team_types.inc | 10 +- html/inc/user.inc | 2 +- html/ops/db_update.php | 6 + html/user/account_finish_action.php | 8 +- html/user/create_account_action.php | 5 +- html/user/home.php | 26 +++-- html/user/team.php | 8 +- html/user/team_join.php | 28 +++++ html/user/team_quit_action.php | 3 +- html/user/team_search.php | 164 ++++++++++++++++++++++++++++ html/user/validate_email_addr.php | 59 ++++++++++ html/user/white.css | 6 +- 15 files changed, 335 insertions(+), 28 deletions(-) create mode 100644 html/user/team_join.php create mode 100644 html/user/team_search.php create mode 100644 html/user/validate_email_addr.php diff --git a/checkin_notes b/checkin_notes index 7ba6804d14..9c72093a52 100755 --- a/checkin_notes +++ b/checkin_notes @@ -8952,3 +8952,33 @@ Rytis 29 Sep 2007 forum_edit.php forum_post.php forum_reply.php + +David 1 Oct 2007 + - user web: add "team search" page, which does a multi-criteria + search (keywords, country, type). + Have the new-user scenario route the user through this page. + Also, link to it rather than team.php for existing users. + - user web: use cookies rather than URLs to identify new users, + and show "Welcome to X" when they reach their user page. + - user web: don't show user intermediate page for join/quit team. + Just take them to their user page. + + DB update required; see ops/db_update.php + + html/ + inc/ + team.inc + team_types.inc + user.inc + ops/ + db_update.php + user/ + account_finish_action.php + create_account_action.php + home.php + team.php + team_join.php + team_search.php + team_quit_action.php + validate_email_addr.php + white.css diff --git a/doc/links.php b/doc/links.php index f8c426c555..7c92ce8fc0 100644 --- a/doc/links.php +++ b/doc/links.php @@ -161,7 +161,7 @@ echo " language("Belgium (Dutch/French/English)", array( site("http://www.boinc.be", "www.boinc.be"), - seti("http://icewolves.plid.be", "IceWolves"), + site("http://icewolves.plid.be", "IceWolves"), )); language("Catalan", array( site("http://www.boinc.cat", "BOINC.cat"), diff --git a/html/inc/team.inc b/html/inc/team.inc index b529ae2f8d..5c3dd9c678 100644 --- a/html/inc/team.inc +++ b/html/inc/team.inc @@ -58,7 +58,11 @@ function display_team_page($team, $offset, $sort_by) { row2("Country", $team->country); row2("Type", team_type_name($team->type)); if ($user->teamid != $team->id) { - row2("Join this team", "Join"); + $tokens = url_tokens($user->authenticator); + row2("", + "Join this team +
Note: joining a team gives its founder access to your email address." + ); } if (($user->teamid == $team->id) && ($user->id != $founder->id)) { row2("Request team founder transfer", "Initiate transfer"); diff --git a/html/inc/team_types.inc b/html/inc/team_types.inc index 6ebce73f30..ba44bff75c 100644 --- a/html/inc/team_types.inc +++ b/html/inc/team_types.inc @@ -35,7 +35,7 @@ function team_type_num($name) { return 0; } -function team_type_select($team){ +function team_type_select($team, $allow_none=false){ global $team_types; if (!empty($team)) { @@ -43,8 +43,12 @@ function team_type_select($team){ } else { $type = 1; } - - return select_from_array('type', $team_types, $type); + $types = $team_types; + if ($allow_none) { + $types[0] = '---'; + $type = 0; + } + return select_from_array('type', $types, $type); } ?> diff --git a/html/inc/user.inc b/html/inc/user.inc index e37a663bc1..3d0120a4bf 100644 --- a/html/inc/user.inc +++ b/html/inc/user.inc @@ -211,7 +211,7 @@ function show_user_info_private($user) { } row2("Team", $x); } else { - row2("Team", "None (find a team)"); + row2("Team", "None (find a team)"); } $team_founder = lookup_team_founder($user->id); diff --git a/html/ops/db_update.php b/html/ops/db_update.php index f6be270485..74947bac19 100755 --- a/html/ops/db_update.php +++ b/html/ops/db_update.php @@ -445,6 +445,12 @@ function update_9_26_2007() { do_query("ALTER TABLE team CHANGE ping_user ping_user integer NOT NULL DEFAULT 0"); } +function update_9_28_2007() { + do_query("alter table team engine=myisam"); + do_query("alter table team change description description text"); + do_query("alter table team add fulltext index team_name_desc(name, description)"); +} + // modify the following to call the function you want. // Make sure you do all needed functions, in order. // (Look at your DB structure using "explain" queries to see diff --git a/html/user/account_finish_action.php b/html/user/account_finish_action.php index 273713fed7..7c20cead7a 100644 --- a/html/user/account_finish_action.php +++ b/html/user/account_finish_action.php @@ -26,11 +26,8 @@ if ($new_name != strip_tags($new_name)) { } $country = post_str("country"); -if ($country == "") { - $country = "International"; -} if (!is_valid_country($country)) { - show_error( "bad country"); + show_error( "invalid country"); } $postal_code = strip_tags(process_user_text(post_str("postal_code", true))); @@ -43,7 +40,8 @@ if (!$retval) { session_start(); $_SESSION["authenticator"] = $auth; -Header("Location: home.php?new_acct=1"); +Header("Location: team_search.php"); setcookie('auth', $auth, time()+3600*24*365); +setcookie('init', "1", time()+3600*24*365); ?> diff --git a/html/user/create_account_action.php b/html/user/create_account_action.php index 213a54dfee..e5afc78c1c 100644 --- a/html/user/create_account_action.php +++ b/html/user/create_account_action.php @@ -125,7 +125,10 @@ if(defined('INVITE_CODES')) { session_start(); $_SESSION["authenticator"] = $user->authenticator; -Header("Location: home.php?new_acct=1&via_web=1"); +Header("Location: home.php"); setcookie('auth', $user->authenticator, time()+3600*24*365); +setcookie('init', "1", time()+3600*24*365); +setcookie('via_web', "1", time()+3600*24*365); + ?> diff --git a/html/user/home.php b/html/user/home.php index 62f3581bd7..4136320c90 100644 --- a/html/user/home.php +++ b/html/user/home.php @@ -11,22 +11,28 @@ db_init(); $user = get_logged_in_user(); $user = getForumPreferences($user); $user = get_other_projects($user); -page_head("Your account"); -if (get_str("new_acct", true)) { +$init = isset($_COOKIE['init']); +$via_web = isset($_COOKIE['via_web']); + +if ($init) { + setcookie('init', '', time()-3600); + page_head("Welcome to ".PROJECT); echo "

- Welcome to ".PROJECT.". View and edit your account preferences using the links below. "; + if ($via_web) { + setcookie('via_web', '', time()-3600); + echo " +

If you have not already done so, + download BOINC client software. + "; + } +} else { + page_head("Your account"); } -if (get_str("via_web", true)) { - echo " -

- If you have not already done so, - download BOINC client software. - "; -} + echo "

\n"; show_user_page_private($user); diff --git a/html/user/team.php b/html/user/team.php index 72b7c0540d..8e20d0c782 100644 --- a/html/user/team.php +++ b/html/user/team.php @@ -22,16 +22,18 @@ echo "

".PROJECT." participants may form teams.

  • disband a team if it has no members

    - To join a team, visit its team page and click Join. + To join a team, visit its team page and click Join this team.


    +
    Show top teams: