@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | if ($app_types->cpu) { |
73 | - $project_pref_descs[] = new PREF_BOOL ( |
|
73 | + $project_pref_descs[] = new PREF_BOOL( |
|
74 | 74 | tra("Allow CPU-only tasks"), |
75 | 75 | "Request CPU-only tasks from this project.", |
76 | 76 | "no_cpu", |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ); |
80 | 80 | } |
81 | 81 | if ($app_types->ati) { |
82 | - $project_pref_descs[] = new PREF_BOOL ( |
|
82 | + $project_pref_descs[] = new PREF_BOOL( |
|
83 | 83 | tra("Use AMD GPU"), |
84 | 84 | "Request AMD GPU tasks from this project.", |
85 | 85 | "no_ati", |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | ); |
89 | 89 | } |
90 | 90 | if ($app_types->cuda) { |
91 | - $project_pref_descs[] = new PREF_BOOL ( |
|
91 | + $project_pref_descs[] = new PREF_BOOL( |
|
92 | 92 | tra("Use NVIDIA GPU"), |
93 | 93 | "Request NVIDIA GPU tasks from this project.", |
94 | 94 | "no_cuda", |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | ); |
98 | 98 | } |
99 | 99 | if ($app_types->intel_gpu) { |
100 | - $project_pref_descs[] = new PREF_BOOL ( |
|
100 | + $project_pref_descs[] = new PREF_BOOL( |
|
101 | 101 | tra("Use Intel GPU"), |
102 | 102 | "Request Intel GPU tasks from this project.", |
103 | 103 | "no_intel_gpu", |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | ); |
107 | 107 | } |
108 | 108 | if ($app_types->apple_gpu) { |
109 | - $project_pref_descs[] = new PREF_BOOL ( |
|
109 | + $project_pref_descs[] = new PREF_BOOL( |
|
110 | 110 | tra("Use Apple GPU"), |
111 | 111 | "Request Apple GPU tasks from this project.", |
112 | 112 | "no_apple_gpu", |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $x = ""; |
132 | 132 | } |
133 | 133 | |
134 | -$privacy_pref_descs = array ( |
|
134 | +$privacy_pref_descs = array( |
|
135 | 135 | new PREF_BOOL( |
136 | 136 | tra("Is it OK for %1 and your team (if any) to email you?", PROJECT).$x, |
137 | 137 | "", |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | global $in_project_specific; |
180 | 180 | global $venue_name; |
181 | 181 | |
182 | - switch($name) { |
|
182 | + switch ($name) { |
|
183 | 183 | case "venue": |
184 | 184 | $venue_name = $attrs["name"]; |
185 | 185 | $top_parse_result = $parse_result; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | break; |
192 | 192 | default: |
193 | 193 | if ($in_project_specific) { |
194 | - $text= $text."<$name>"; |
|
194 | + $text = $text."<$name>"; |
|
195 | 195 | } else { |
196 | 196 | $text = ""; |
197 | 197 | } |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | global $venue_name; |
207 | 207 | global $project_pref_descs; |
208 | 208 | |
209 | - foreach($project_pref_descs as $p) { |
|
209 | + foreach ($project_pref_descs as $p) { |
|
210 | 210 | if ($p->xml_parse($parse_result, $name, $text)) { |
211 | 211 | return; |
212 | 212 | } |
213 | 213 | } |
214 | - switch($name) { |
|
214 | + switch ($name) { |
|
215 | 215 | case "venue": |
216 | 216 | $top_parse_result->$venue_name = $parse_result; |
217 | 217 | $parse_result = $top_parse_result; |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | return $parse_result; |
256 | 256 | } |
257 | 257 | |
258 | -function prefs_show_project($prefs, $columns=false) { |
|
258 | +function prefs_show_project($prefs, $columns = false) { |
|
259 | 259 | global $project_pref_descs; |
260 | 260 | if ($columns) { |
261 | 261 | foreach ($project_pref_descs as $p) { |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | } |
295 | 295 | } |
296 | 296 | |
297 | -function prefs_show_project_specific($prefs, $columns=false) { |
|
297 | +function prefs_show_project_specific($prefs, $columns = false) { |
|
298 | 298 | if ($columns) { |
299 | 299 | $project_specific_prefs = project_specific_prefs_parse($prefs->project_specific); |
300 | 300 | $project_specific_prefs->home = isset($prefs->home) ? project_specific_prefs_parse($prefs->home->project_specific) : ""; |
@@ -306,10 +306,10 @@ discard block |
||
306 | 306 | project_specific_prefs_show($project_specific_prefs, $columns); |
307 | 307 | } |
308 | 308 | |
309 | -function print_prefs_display_project($user, $columns=false) { |
|
309 | +function print_prefs_display_project($user, $columns = false) { |
|
310 | 310 | $project_prefs = prefs_parse_project($user->project_prefs); |
311 | 311 | |
312 | - $switch_link = " <font size=\"-1\"><a href=prefs.php?subset=project&cols=". (int)!$columns .">".tra("(Switch View)")."</a></font>"; |
|
312 | + $switch_link = " <font size=\"-1\"><a href=prefs.php?subset=project&cols=".(int)!$columns.">".tra("(Switch View)")."</a></font>"; |
|
313 | 313 | if ($columns) { |
314 | 314 | start_table(); |
315 | 315 | row_heading(tra("Combined preferences").$switch_link); |
@@ -360,14 +360,14 @@ discard block |
||
360 | 360 | } |
361 | 361 | } |
362 | 362 | |
363 | -function prefs_form_project($prefs, $error=false) { |
|
363 | +function prefs_form_project($prefs, $error = false) { |
|
364 | 364 | global $project_pref_descs; |
365 | 365 | foreach ($project_pref_descs as $p) { |
366 | 366 | $p->show_form_row($prefs, $error); |
367 | 367 | } |
368 | 368 | } |
369 | 369 | |
370 | -function prefs_form_project_specific($prefs_xml, $error=false) { |
|
370 | +function prefs_form_project_specific($prefs_xml, $error = false) { |
|
371 | 371 | $prefs = project_specific_prefs_parse($prefs_xml); |
372 | 372 | project_specific_prefs_edit($prefs, $error); |
373 | 373 | } |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | |
416 | 416 | // given a prefs structure, return the corresponding XML string |
417 | 417 | // |
418 | -function project_prefs_make_xml($prefs, $primary=true) { |
|
418 | +function project_prefs_make_xml($prefs, $primary = true) { |
|
419 | 419 | global $project_pref_descs; |
420 | 420 | $xml = ""; |
421 | 421 | if ($primary) { |
@@ -450,8 +450,8 @@ discard block |
||
450 | 450 | // |
451 | 451 | function project_prefs_update(&$user, $prefs) { |
452 | 452 | $prefs_xml = BoincDb::escape_string(project_prefs_make_xml($prefs)); |
453 | - $send_email = $user->send_email?1:0; |
|
454 | - $show_hosts = $user->show_hosts?1:0; |
|
453 | + $send_email = $user->send_email ? 1 : 0; |
|
454 | + $show_hosts = $user->show_hosts ? 1 : 0; |
|
455 | 455 | $retval = $user->update("project_prefs='$prefs_xml', send_email=$send_email, show_hosts=$show_hosts"); |
456 | 456 | if (!$retval) { |
457 | 457 | return 1; |
@@ -30,7 +30,7 @@ |
||
30 | 30 | $wuid2 = get_int('wuid2'); |
31 | 31 | $unsent_only = get_str('unsent_only', true); |
32 | 32 | |
33 | -if ($wuid1<1 || $wuid2<$wuid1) { |
|
33 | +if ($wuid1 < 1 || $wuid2 < $wuid1) { |
|
34 | 34 | admin_error_page( |
35 | 35 | "<h2>Workunit IDs fail to satisfy the conditions:<p> 0 < ID1 <= ID2" |
36 | 36 | ); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | db_init(); |
25 | 25 | |
26 | 26 | admin_page_head("screen profile action"); |
27 | -for ($i=0; $i<$n; $i++) { |
|
27 | +for ($i = 0; $i < $n; $i++) { |
|
28 | 28 | $y = "user".$i; |
29 | 29 | $val = $_GET[$y]; |
30 | 30 | $x = "userid".$i; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $apps = BoincApp::enum(""); |
156 | 156 | foreach ($apps as $app) { |
157 | 157 | if (in_array($app->id, $show_only) |
158 | - || ( in_array("all", $show_only) |
|
158 | + || (in_array("all", $show_only) |
|
159 | 159 | && (!$app->deprecated || $show_deprecated) |
160 | 160 | )) { |
161 | 161 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | <b>Results for <tt>$app->name</tt>:</b> |
164 | 164 | <ul> |
165 | 165 | "; |
166 | - for ($i=0; $i<2; $i++) { |
|
166 | + for ($i = 0; $i < 2; $i++) { |
|
167 | 167 | if ($i) { |
168 | 168 | $secs = 7*86400; |
169 | 169 | $period = " 7 days"; |
@@ -41,10 +41,10 @@ |
||
41 | 41 | return $db->insert_id(); |
42 | 42 | } |
43 | 43 | |
44 | -function create_forum($category, $orderID, $title, $description, $is_dev_blog=0) { |
|
44 | +function create_forum($category, $orderID, $title, $description, $is_dev_blog = 0) { |
|
45 | 45 | $q = "(category, orderID, title, description, is_dev_blog) values ($category, $orderID, '$title', '$description', $is_dev_blog)"; |
46 | 46 | $db = BoincDB::get(); |
47 | - $result = $db->insert("forum",$q); |
|
47 | + $result = $db->insert("forum", $q); |
|
48 | 48 | if (!$result) { |
49 | 49 | $forum = BoincForum::lookup("category=$category and title='$title'"); |
50 | 50 | if ($forum) return $forum->id; |
@@ -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 { |
@@ -29,7 +29,7 @@ |
||
29 | 29 | $venue = get_str("venue"); |
30 | 30 | $confirmed = get_str("confirmed", true); |
31 | 31 | $columns = get_int("cols", true); |
32 | -$c = $columns?"&cols=$columns":""; |
|
32 | +$c = $columns ? "&cols=$columns" : ""; |
|
33 | 33 | |
34 | 34 | if ($confirmed) { |
35 | 35 | if ($subset == "global") { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $rating = post_int('rating', true); |
35 | 35 | if (!$choice) $choice = get_str('choice', true); |
36 | 36 | |
37 | - if ($choice == SOLUTION or $choice=="p") { |
|
37 | + if ($choice == SOLUTION or $choice == "p") { |
|
38 | 38 | $rating = 1; |
39 | 39 | } else { |
40 | 40 | $rating = -1; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | // Make sure the user has the forum's minimum amount of RAC and total credit |
54 | 54 | // before allowing them to rate a post. |
55 | 55 | // |
56 | - if ($user->total_credit<$forum->rate_min_total_credit || $user->expavg_credit<$forum->rate_min_expavg_credit) { |
|
56 | + if ($user->total_credit < $forum->rate_min_total_credit || $user->expavg_credit < $forum->rate_min_expavg_credit) { |
|
57 | 57 | error_page(tra("You need more average or total credit to rate a post.")); |
58 | 58 | } |
59 | 59 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $user = get_logged_in_user(); |
44 | 44 | |
45 | 45 | if ($choice == null && ($rating == null || $rating > 2 || $rating < -2)) { |
46 | - show_result_page(false, NULL, NULL, $choice); |
|
46 | + show_result_page(false, null, null, $choice); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $post = BoincPost::lookup_id($post_id); |
@@ -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"; |