@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | echo "<users>\n"; |
52 | 52 | $users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, expavg_time, has_profile, donated, country, cross_project_id, create_time, url", "teamid=$team->id"); |
53 | - foreach($users as $user) { |
|
53 | + foreach ($users as $user) { |
|
54 | 54 | show_team_member($user, $creditonly); |
55 | 55 | } |
56 | 56 | echo "</users>\n"; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | $users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, has_profile, donated, country, cross_project_id, create_time, url", "teamid=$team->id"); |
84 | -foreach($users as $user) { |
|
84 | +foreach ($users as $user) { |
|
85 | 85 | if ($plain) { |
86 | 86 | echo "$user->name $user->id\n"; |
87 | 87 | } else { |
@@ -94,5 +94,5 @@ discard block |
||
94 | 94 | page_tail(); |
95 | 95 | } |
96 | 96 | |
97 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
97 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
98 | 98 | ?> |
@@ -45,7 +45,7 @@ |
||
45 | 45 | $n = 0; |
46 | 46 | $t = 0; |
47 | 47 | $a = 0; |
48 | - foreach($hosts as $h) { |
|
48 | + foreach ($hosts as $h) { |
|
49 | 49 | $t += $h->total_credit; |
50 | 50 | $a += $h->expavg_credit; |
51 | 51 | if ($h->expavg_credit > .1) $n++; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | if (!$show_dep && $app->deprecated) { |
41 | 41 | return null; |
42 | 42 | } |
43 | - $rsc_type = $gavid % 1000000; |
|
43 | + $rsc_type = $gavid%1000000; |
|
44 | 44 | $r = rsc_name($rsc_type); |
45 | 45 | return "$app->user_friendly_name (".tra("anonymous platform").", $r)"; |
46 | 46 | } else { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | $platform = BoincPlatform::lookup_id($av->platformid); |
62 | 62 | if (!$platform) return tra("Missing platform"); |
63 | - $pc = (strlen($av->plan_class))?"($av->plan_class)":""; |
|
63 | + $pc = (strlen($av->plan_class)) ? "($av->plan_class)" : ""; |
|
64 | 64 | $v = number_format($av->version_num/100, 2); |
65 | 65 | return "$app->user_friendly_name $v $platform->name $pc"; |
66 | 66 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | // $x->linux |
61 | 61 | // $x->mac |
62 | 62 | // |
63 | -function get_gpu_list($vendor, $alt_vendor=null) { |
|
63 | +function get_gpu_list($vendor, $alt_vendor = null) { |
|
64 | 64 | $clause = "plan_class like '%$vendor%'"; |
65 | 65 | if ($alt_vendor) { |
66 | 66 | $clause .= " or plan_class like '%$alt_vendor%'"; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | $av_ids = ""; |
76 | - foreach($avs as $av) { |
|
76 | + foreach ($avs as $av) { |
|
77 | 77 | $av_ids .= "$av->id, "; |
78 | 78 | } |
79 | 79 | if ($vendor == "cuda") { |
@@ -176,14 +176,14 @@ discard block |
||
176 | 176 | echo tra("No GPU tasks reported"); |
177 | 177 | return; |
178 | 178 | } |
179 | - $have_win = count($x->win)>0; |
|
180 | - $have_mac = count($x->mac)>0; |
|
181 | - $have_linux = count($x->linux)>0; |
|
179 | + $have_win = count($x->win) > 0; |
|
180 | + $have_mac = count($x->mac) > 0; |
|
181 | + $have_linux = count($x->linux) > 0; |
|
182 | 182 | $n = 0; |
183 | 183 | if ($have_win) $n++; |
184 | 184 | if ($have_mac) $n++; |
185 | 185 | if ($have_linux) $n++; |
186 | - $show_total = $n>1; |
|
186 | + $show_total = $n > 1; |
|
187 | 187 | start_table(); |
188 | 188 | echo "<tr>"; |
189 | 189 | if ($show_total) { |
@@ -44,5 +44,5 @@ |
||
44 | 44 | "; |
45 | 45 | page_tail(); |
46 | 46 | |
47 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
47 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
48 | 48 | ?> |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | page_head(tra("Sending emails")); |
29 | 29 | $found = false; |
30 | -for ($i=0; $i<6; $i++) { |
|
30 | +for ($i = 0; $i < 6; $i++) { |
|
31 | 31 | $e = get_str("e$i", true); |
32 | 32 | if (!$e) continue; |
33 | 33 | $found = true; |
@@ -44,21 +44,21 @@ discard block |
||
44 | 44 | // Using the same rules as for rating (at least for now) |
45 | 45 | // |
46 | 46 | |
47 | -if ($user->total_credit<$forum->rate_min_total_credit || $user->expavg_credit<$forum->rate_min_expavg_credit) { |
|
47 | +if ($user->total_credit < $forum->rate_min_total_credit || $user->expavg_credit < $forum->rate_min_expavg_credit) { |
|
48 | 48 | error_page(tra("You need more average or total credit to report a post.")); |
49 | 49 | } |
50 | 50 | |
51 | 51 | // Action part |
52 | 52 | // |
53 | -$success_page=0; |
|
54 | -if (get_str("submit",true)){ |
|
53 | +$success_page = 0; |
|
54 | +if (get_str("submit", true)) { |
|
55 | 55 | check_tokens($user->authenticator); |
56 | 56 | $reason = get_str("reason"); |
57 | - if (send_report_post_email($user, $forum, $thread, $post, $reason)){ |
|
58 | - $success_page=1; |
|
57 | + if (send_report_post_email($user, $forum, $thread, $post, $reason)) { |
|
58 | + $success_page = 1; |
|
59 | 59 | } else { |
60 | 60 | echo "send email failed"; |
61 | - $success_page=-1; |
|
61 | + $success_page = -1; |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | |
67 | 67 | // Display part |
68 | 68 | // |
69 | -if ($success_page==1) { |
|
69 | +if ($success_page == 1) { |
|
70 | 70 | page_head(tra("Report Registered")); |
71 | 71 | echo tra("Your report has been recorded. Thanks for your input.")."<p>" |
72 | 72 | .tra("A moderator will now look at your report and decide what will happen - this may take a little while, so please be patient"); |
73 | 73 | |
74 | 74 | echo "<p><a href=\"forum_thread.php?id=$thread->id&postid=$post->id\">".tra("Return to thread")."</a>"; |
75 | -} elseif ($success_page==0){ |
|
75 | +} elseif ($success_page == 0) { |
|
76 | 76 | page_head(tra("Report a forum post")); |
77 | 77 | if (!$no_forum_rating) { |
78 | 78 | echo "<p>".tra("Before reporting this post, consider using the +/- rating system instead. If enough users rate a post negatively it will eventually be hidden.<br />You can find the rating system at the bottom of the post.")."</p> |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | echo "</td></tr>"; |
101 | 101 | end_table(); |
102 | 102 | echo "</form>"; |
103 | -} elseif ($success_page==-1) { |
|
103 | +} elseif ($success_page == -1) { |
|
104 | 104 | page_head(tra("Report not registered")); |
105 | 105 | echo "<p>".tra("Your report could not be recorded. Please wait a while and try again.")."</p> |
106 | 106 | <p>".tra("If this is not a temporary error, please report it to the project developers.")."</p> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $sum = 0; |
48 | 48 | echo "<pending_credit>\n"; |
49 | 49 | $results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0"); |
50 | - foreach($results as $result) { |
|
50 | + foreach ($results as $result) { |
|
51 | 51 | echo "<result>\n"; |
52 | 52 | echo " <resultid>".$result->id."</resultid>\n"; |
53 | 53 | echo " <workunitid>".$result->workunitid."</workunitid>\n"; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | start_table(); |
68 | 68 | echo "<tr><th>".tra("Result ID")."</th><th>".tra("Workunit ID")."</th><th>".tra("Host ID")."</th><th>".tra("Claimed credit")."</th></tr>\n"; |
69 | 69 | $results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0"); |
70 | - foreach($results as $result) { |
|
70 | + foreach ($results as $result) { |
|
71 | 71 | echo "<tr>\n"; |
72 | 72 | echo "<td><a href=\"result.php?resultid=$result->id\">$result->id</a></td>\n"; |
73 | 73 | echo "<td><a href=\"workunit.php?wuid=$result->workunitid\">$result->workunitid</a></td>\n"; |
@@ -82,5 +82,5 @@ discard block |
||
82 | 82 | page_tail(); |
83 | 83 | } |
84 | 84 | |
85 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
85 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
86 | 86 | ?> |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | $acquired = $acquired - $required; |
74 | 74 | $progress = 100; |
75 | 75 | } else { |
76 | - $progress = round($acquired / ($required) * 100); |
|
77 | - $progress2 = round($acquired / ($required) * 100,1); |
|
76 | + $progress = round($acquired/($required)*100); |
|
77 | + $progress2 = round($acquired/($required)*100, 1); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | $col2 = "<input style=\"float: left\" type=\"radio\" name=\"item_id\" value=\"".$row->id."\""; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } elseif ($progress == 100) { |
90 | 90 | $col2 .= "<div style=\"float: left; width: 300px; height: 18px; background-color: green; border: 1px solid #000000\">"; |
91 | 91 | } else { |
92 | - $col2 .= "<div style=\"float: left; width: ".($progress*3 - 1)."px; height: 18px; background-color: green; border: 1px solid #000000;\" align=\"right\"><b>".$progress2."</b>%</div><div style=\"float: left; width: ".((100-$progress)*3 - 1)."px; height: 18px; background-color: red; border: 1px solid #000000;\">"; |
|
92 | + $col2 .= "<div style=\"float: left; width: ".($progress*3 - 1)."px; height: 18px; background-color: green; border: 1px solid #000000;\" align=\"right\"><b>".$progress2."</b>%</div><div style=\"float: left; width: ".((100 - $progress)*3 - 1)."px; height: 18px; background-color: red; border: 1px solid #000000;\">"; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | row2($col1, $col2); |