Ticket #646: user.inc.patch

File user.inc.patch, 9.9 KB (added by Simek, 16 years ago)

updated

  • user.inc

     
    8080    }
    8181    echo "<tr>
    8282        <td>$x</td>
    83         <td align=right>".number_format($project->total_credit, 0)."</td>
    84         <td align=right>".number_format($project->expavg_credit, 0)."</td>
    85         <td align=right>".date_str($project->create_time)."</td>
     83        <td align=\"right\">".number_format($project->total_credit, 0)."</td>
     84        <td align=\"right\">".number_format($project->expavg_credit, 0)."</td>
     85        <td align=\"right\">".date_str($project->create_time)."</td>
    8686        </tr>
    8787    ";
    8888}
     
    9696    if (count($user->projects) > 1) {
    9797        usort($user->projects, "cmp");
    9898        if ($personal) {
    99             echo "<h3>Projects in which you are participating</h3>";
     99            echo "<h3>".tra("Projects in which you are participating")."</h3>";
    100100        } else {
    101             echo "<h3>Projects in which $user->name is participating</h3>";
     101            echo "<h3>."tra("Projects in which %1 is participating", $user->name)."</h3>";
    102102        }
    103103        start_table();
    104104        row_heading_array(array(
    105             "Project<br><span class=note>Click for user page</span>", "Total credit", "Average credit", "Since"
     105            tra("Project"), "<br/><span class=\"note\">".tra("Click for user page")."</span>", tra("Total credit"), tra("Average credit"), tra("Since")
    106106        ));
    107107        foreach($user->projects as $project) {
    108108            show_project($project);
     
    132132    if (parse_bool($config, "show_results")) {
    133133        row2(tra("Pending credit"), "<a href=\"pending.php\">".tra("View")."</a>");
    134134    }
    135     row2(tra("Computers on this account"),
    136         "<a href=\"hosts_user.php\">".tra("View")."</a>"
    137     );
     135    row2(tra("Computers on this account"), "<a href=\"hosts_user.php\">".tra("View")."</a>");
    138136    row2(tra("Tasks"), "<a href=\"results.php?userid=$user->id\">".tra("View")."</a>");
    139137    $cpid = md5($user->cross_project_id . $user->email_addr);
    140138    $x = "";
     
    142140    foreach ($cpid_stats_sites as $site) {
    143141        $name = $site[0];
    144142        $y = sprintf($site[1], $cpid);
    145         $x .= "<a href=\"$y\">$name</a><br>";
     143        $x .= "<a href=\"$y\">$name</a><br/>";
    146144    }
    147     $x .= "<br><span class=\"smalltext\">".tra("Cross-project ID").": $cpid</span>\n";
     145    $x .= "<br/><span class=\"smalltext\">".tra("Cross-project ID").": $cpid</span>\n";
    148146    row2(tra("Cross-project statistics"), $x);
    149147    row2(tra("Stats on your cell phone"), URL_BASE."userw.php?id=$user->id");
    150148}
     
    191189    row2(tra("%1 member since", PROJECT), date_str($user->create_time));
    192190    row2(tra("Change"), "<a href=\"edit_email_form.php\">".tra("email address")."</a> | <a href=\"edit_passwd_form.php\">".tra("password")."</a> | <a href=\"edit_user_info_form.php\">".tra("other account info")."</a>");
    193191    row2("", "<a href=\"logout.php?".url_tokens($user->authenticator)."\">".tra("Log out")."</a>");
    194     row2("User ID<br><span class=note>Used in community functions</span>", $user->id);
    195     row2("Account key<br><span class=note>Provides full access to your account</span>", $user->authenticator);
    196     row2("Weak account key<br><span class=note>Provides <a href=weak_auth.php> limited access</a> to your account</span>", weak_auth($user));
     192    row2(tra("User ID"), "<br/><span class=\"note\">".tra("Used in community functions")."</span>", $user->id);
     193    row2(tra("Account key"), "<br/><span class=\"note\">".tra("Provides full access to your account")."</span>", $user->authenticator);
     194    row2(tra("Weak account key"), "<br/><span class=\"note\">".tra("Provides")." <a href=\"weak_auth.php\">".tra("limited access")."</a>".tra("to your account")."</span>", weak_auth($user));
    197195
    198196    row1("<a name=\"prefs\"></a>".tra("Preferences"));
    199197    row2(
     
    219217    row2(tra("Profile"), $x);
    220218    $tot = total_posts($user);
    221219    if ($tot) {
    222         row2(tra("Message boards"), "<a href=".URL_BASE."forum_user_posts.php?userid=$user->id>".tra("%1 posts", $tot)."</a>");
     220        row2(tra("Message boards"), "<a href=\"".URL_BASE."forum_user_posts.php?userid=$user->id\">".tra("%1 posts", $tot)."</a>");
    223221    }
    224222   
    225223    row2(tra("Private messages"), pm_notification($user).pm_email_remind($user));
     
    230228        foreach ($notifies as $notify) {
    231229            $x .= "&bull; ".notify_description($notify)."<br>";
    232230        }
    233         $x .= "<a href=".notify_rss_url($user)."><img vspace=4 border=0 src=img/rss_icon.gif alt=RSS></a>";
    234         row2("Notifications", $x);
     231        $x .= "<a href=\"".notify_rss_url($user)."\"><img vspace=\"4\" border=\"0\" src=\"img/rss_icon.gif\" alt=\"RSS\" /></a>";
     232        row2(tra("Notifications"), $x);
    235233    }
    236234
    237235    if ($user->teamid) {
     
    245243        // if there's a foundership request, notify the founder
    246244        //
    247245        if ($user->id==$team->userid && $team->ping_user >0) {
    248             $x .= " <font color=red>(foundership change request pending)</font>";
     246            $x .= "<span style=\"color:red;\">".tra("(foundership change request pending)")."</span>";
    249247        }
    250248        row2(tra("Member of team"), $x);
    251249    } else {
     
    258256            $x = "<a href=\"team_display.php?teamid=$team->id\">$team->name</a>";
    259257            $x .= "| <a href=\"team_manage.php?teamid=".$team->id."\">".tra("Administer")."</a>";
    260258            if ($team->ping_user > 0) {
    261                 $x .= " <font color=red>(foundership change request pending)</font>";
     259                $x .= "<span style=\"color:red;\">".tra("(foundership change request pending)")."</span>";
    262260            }
    263261            row2(tra("Founder but not member of"), $x);
    264262        }
    265263    }
    266264
    267265    $friends = BoincFriend::enum("user_src=$user->id and reciprocated=1");
    268     $x = "<a href=user_search.php>Find friends</a><br>\n";
     266    $x = "<a href=\"user_search.php\">".tra("Find friends")."</a><br\>\n";
    269267    $n = count($friends);
    270268    if ($n) {
    271269        foreach($friends as $friend) {
    272270            $fuser = BoincUser::lookup_id($friend->user_dest);
    273271            $x .= friend_links($fuser);
    274272        }
    275         row2("Friends ($n)", $x);
     273        row2(tra("Friends"), "($n)", $x);
    276274    } else {
    277         row2("Friends", $x);
     275        row2(tra("Friends"), $x);
    278276    }
    279277}
    280278
     
    282280//
    283281function show_user_summary_public($user) {
    284282    global $g_logged_in_user;
    285     row2(PROJECT." member since", date_str($user->create_time));
    286     row2("Country", $user->country);
     283    row2("%1 member since", PROJECT), date_str($user->create_time));
     284    row2(tra("Country"), $user->country);
    287285    if (strlen($user->url)) {
    288         row2("URL", "<a href=\"http://$user->url\">http://$user->url</a>");
     286        row2(tra("URL"), "<a href=\"http://$user->url\">http://$user->url</a>");
    289287    }
    290288    show_credit($user);
    291289
    292290    if ($user->show_hosts) {
    293         row2("Computers", "<a href=\"".URL_BASE."hosts_user.php?userid=$user->id\">View</a>");
     291        row2(tra("Computers"), "<a href=\"".URL_BASE."hosts_user.php?userid=$user->id\">".tra("View")."</a>");
    294292    } else {
    295         row2("Computers", "hidden");
     293        row2(tra("Computers"), tra("hidden"));
    296294    }
    297295    if ($user->donated == 1) {
    298296        if (file_exists("../project/donations.inc")) {
    299297            require_once("../project/donations.inc");
    300298            $x .= DONATION_LINK;
    301             row2("Donor",$x);
     299            row2(tra("Donor"), $x);
    302300        }
    303301    }
    304    
    305302}
    306303
    307304function community_links($user) {
    308305    global $g_logged_in_user;
    309306    if ($user->teamid && ($team = lookup_team($user->teamid))) {
    310         row2("Team", "<a href=\"".URL_BASE."team_display.php?teamid=$team->id\">$team->name</a>");
     307        row2(tra("Team"), "<a href=\"".URL_BASE."team_display.php?teamid=$team->id\">$team->name</a>");
    311308    } else {
    312         row2("Team", "None");
     309        row2(tra("Team"), tra("None"));
    313310    }
    314311    $tot = total_posts($user);
    315312    if ($tot) {
    316         row2("Message boards", "<a href=\"".URL_BASE."forum_user_posts.php?userid=$user->id\">$tot posts</a>");
     313        row2(tra("Message boards"), "<a href=\"".URL_BASE."forum_user_posts.php?userid=$user->id\">".tra("%1 posts", $tot)."</a>");
    317314    }
    318315    if ($g_logged_in_user && $g_logged_in_user->id != $user->id) {
    319         row2("Contact", "<a href=\"pm.php?action=new&userid=".$user->id."\">Send private message</a>");
     316        row2(tra("Contact"), "<a href=\"pm.php?action=new&userid=".$user->id."\">".tra("Send private message")."</a>");
    320317        $friend = BoincFriend::lookup($g_logged_in_user->id, $user->id);
    321318        if ($friend && $friend->reciprocated) {
    322             row2("This person is a friend",
    323                 "<a href=friend.php?action=cancel_confirm&userid=$user->id>Cancel friendship</a>"
     319            row2(tra("This person is a friend"),
     320                "<a href=\"friend.php?action=cancel_confirm&userid=$user->id\">".tra("Cancel friendship")."</a>"
    324321            );
    325322        } else if ($friend) {
    326             row2("Friends", "<a href=friend.php?action=add&userid=$user->id>Request pending</a>");
     323            row2(tra("Friends"),  "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Request pending")."</a>");
    327324        } else {
    328             row2("Friends", "<a href=friend.php?action=add&userid=$user->id>Add as friend</a>");
     325            row2(tra("Friends"),  "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Add as friend")."</a>");
    329326        }
    330327    }
    331328    $friends = BoincFriend::enum("user_src=$user->id and reciprocated=1");
     
    336333            $fuser = BoincUser::lookup_id($friend->user_dest);
    337334            $x .= friend_links($fuser);
    338335        }
    339         row2("Friends ($n)", $x);
     336        row2(tra("Friends"), "($n)", $x);
    340337    }
    341 
    342338}
    343339
    344340function show_profile_link($user) {
    345341    if ($user->has_profile) {
    346         row2("Profile", "<a href=\"view_profile.php?userid=$user->id\">View</a>");
     342        row2(tra("Profile"), "<a href=\"view_profile.php?userid=$user->id\">".tra("View")."</a>");
    347343    }
    348344}
    349345