Ticket #646: user.inc.patch
File user.inc.patch, 9.9 KB (added by , 16 years ago) |
---|
-
user.inc
80 80 } 81 81 echo "<tr> 82 82 <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> 86 86 </tr> 87 87 "; 88 88 } … … 96 96 if (count($user->projects) > 1) { 97 97 usort($user->projects, "cmp"); 98 98 if ($personal) { 99 echo "<h3> Projects in which you are participating</h3>";99 echo "<h3>".tra("Projects in which you are participating")."</h3>"; 100 100 } 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>"; 102 102 } 103 103 start_table(); 104 104 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") 106 106 )); 107 107 foreach($user->projects as $project) { 108 108 show_project($project); … … 132 132 if (parse_bool($config, "show_results")) { 133 133 row2(tra("Pending credit"), "<a href=\"pending.php\">".tra("View")."</a>"); 134 134 } 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>"); 138 136 row2(tra("Tasks"), "<a href=\"results.php?userid=$user->id\">".tra("View")."</a>"); 139 137 $cpid = md5($user->cross_project_id . $user->email_addr); 140 138 $x = ""; … … 142 140 foreach ($cpid_stats_sites as $site) { 143 141 $name = $site[0]; 144 142 $y = sprintf($site[1], $cpid); 145 $x .= "<a href=\"$y\">$name</a><br >";143 $x .= "<a href=\"$y\">$name</a><br/>"; 146 144 } 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"; 148 146 row2(tra("Cross-project statistics"), $x); 149 147 row2(tra("Stats on your cell phone"), URL_BASE."userw.php?id=$user->id"); 150 148 } … … 191 189 row2(tra("%1 member since", PROJECT), date_str($user->create_time)); 192 190 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>"); 193 191 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)); 197 195 198 196 row1("<a name=\"prefs\"></a>".tra("Preferences")); 199 197 row2( … … 219 217 row2(tra("Profile"), $x); 220 218 $tot = total_posts($user); 221 219 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>"); 223 221 } 224 222 225 223 row2(tra("Private messages"), pm_notification($user).pm_email_remind($user)); … … 230 228 foreach ($notifies as $notify) { 231 229 $x .= "• ".notify_description($notify)."<br>"; 232 230 } 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); 235 233 } 236 234 237 235 if ($user->teamid) { … … 245 243 // if there's a foundership request, notify the founder 246 244 // 247 245 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>"; 249 247 } 250 248 row2(tra("Member of team"), $x); 251 249 } else { … … 258 256 $x = "<a href=\"team_display.php?teamid=$team->id\">$team->name</a>"; 259 257 $x .= "| <a href=\"team_manage.php?teamid=".$team->id."\">".tra("Administer")."</a>"; 260 258 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>"; 262 260 } 263 261 row2(tra("Founder but not member of"), $x); 264 262 } 265 263 } 266 264 267 265 $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"; 269 267 $n = count($friends); 270 268 if ($n) { 271 269 foreach($friends as $friend) { 272 270 $fuser = BoincUser::lookup_id($friend->user_dest); 273 271 $x .= friend_links($fuser); 274 272 } 275 row2( "Friends($n)", $x);273 row2(tra("Friends"), "($n)", $x); 276 274 } else { 277 row2( "Friends", $x);275 row2(tra("Friends"), $x); 278 276 } 279 277 } 280 278 … … 282 280 // 283 281 function show_user_summary_public($user) { 284 282 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); 287 285 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>"); 289 287 } 290 288 show_credit($user); 291 289 292 290 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>"); 294 292 } else { 295 row2( "Computers", "hidden");293 row2(tra("Computers"), tra("hidden")); 296 294 } 297 295 if ($user->donated == 1) { 298 296 if (file_exists("../project/donations.inc")) { 299 297 require_once("../project/donations.inc"); 300 298 $x .= DONATION_LINK; 301 row2( "Donor",$x);299 row2(tra("Donor"), $x); 302 300 } 303 301 } 304 305 302 } 306 303 307 304 function community_links($user) { 308 305 global $g_logged_in_user; 309 306 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>"); 311 308 } else { 312 row2( "Team", "None");309 row2(tra("Team"), tra("None")); 313 310 } 314 311 $tot = total_posts($user); 315 312 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>"); 317 314 } 318 315 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>"); 320 317 $friend = BoincFriend::lookup($g_logged_in_user->id, $user->id); 321 318 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>" 324 321 ); 325 322 } 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>"); 327 324 } 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>"); 329 326 } 330 327 } 331 328 $friends = BoincFriend::enum("user_src=$user->id and reciprocated=1"); … … 336 333 $fuser = BoincUser::lookup_id($friend->user_dest); 337 334 $x .= friend_links($fuser); 338 335 } 339 row2( "Friends($n)", $x);336 row2(tra("Friends"), "($n)", $x); 340 337 } 341 342 338 } 343 339 344 340 function show_profile_link($user) { 345 341 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>"); 347 343 } 348 344 } 349 345