@@ -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) { |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | row1("Current special users", 99); |
| 29 | 29 | |
| 30 | 30 | echo "<tr><th>User</th>"; |
| 31 | - for ($i=0; $i<S_NFLAGS; $i++) { |
|
| 32 | - echo "<th>" . $special_user_bitfield[$i] . "</th>\n"; |
|
| 31 | + for ($i = 0; $i < S_NFLAGS; $i++) { |
|
| 32 | + echo "<th>".$special_user_bitfield[$i]."</th>\n"; |
|
| 33 | 33 | } |
| 34 | 34 | echo "<th> </th></tr>"; |
| 35 | 35 | |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | <form action=\"user_permissions.php\" method=\"POST\"> |
| 45 | 45 | <input type=\"hidden\" name=\"userid\" value=\"$foo->userid\"> |
| 46 | 46 | "; |
| 47 | - for ($j=0; $j<S_NFLAGS; $j++) { |
|
| 47 | + for ($j = 0; $j < S_NFLAGS; $j++) { |
|
| 48 | 48 | $bit = substr($foo->special_user, $j, 1); |
| 49 | - $c = ($bit == 1)?"checked":""; |
|
| 49 | + $c = ($bit == 1) ? "checked" : ""; |
|
| 50 | 50 | echo "<td> |
| 51 | 51 | <input type=\"checkbox\" name=\"role".$j."\" value=\"1\" $c> |
| 52 | 52 | </td> |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | <td>Add User ID:<input type=\"text\" name=\"userid\" size=\"6\"></td> |
| 63 | 63 | "; |
| 64 | 64 | |
| 65 | - for ($j=0; $j<S_NFLAGS; $j++) { |
|
| 65 | + for ($j = 0; $j < S_NFLAGS; $j++) { |
|
| 66 | 66 | echo "<td> |
| 67 | 67 | <input type=\"checkbox\" name=\"role".$j."\" value=\"1\"> |
| 68 | 68 | </td> |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | function user_permissions_action() { |
| 84 | 84 | $bitset = ''; |
| 85 | 85 | |
| 86 | - for ($i=0; $i<S_NFLAGS; $i++) { |
|
| 86 | + for ($i = 0; $i < S_NFLAGS; $i++) { |
|
| 87 | 87 | if (post_int("role".$i, TRUE) == 1) { |
| 88 | 88 | $bitset .= '1'; |
| 89 | 89 | echo "<br> setting $i"; |
@@ -111,5 +111,5 @@ discard block |
||
| 111 | 111 | user_permissions_form(); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
| 114 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
| 115 | 115 | ?> |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | require_once("../inc/submit_util.inc"); |
| 80 | 80 | |
| 81 | 81 | function upload_error_description($errno) { |
| 82 | - switch($errno) { |
|
| 82 | + switch ($errno) { |
|
| 83 | 83 | case UPLOAD_ERR_INI_SIZE: |
| 84 | 84 | return "The uploaded file exceeds upload_max_filesize of php.ini."; break; |
| 85 | 85 | case UPLOAD_ERR_FORM_SIZE: |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | $delete_time = (int)$r->delete_time; |
| 106 | 106 | $batch_id = (int)$r->batch_id; |
| 107 | 107 | $fanout = parse_config(get_config(), "<uldl_dir_fanout>"); |
| 108 | - $phys_names= array(); |
|
| 109 | - foreach($r->phys_name as $f) { |
|
| 108 | + $phys_names = array(); |
|
| 109 | + foreach ($r->phys_name as $f) { |
|
| 110 | 110 | $phys_names[] = (string)$f; |
| 111 | 111 | } |
| 112 | 112 | $i = 0; |
| 113 | - foreach($phys_names as $fname) { |
|
| 114 | - $path = dir_hier_path($fname, project_dir() . "/download", $fanout); |
|
| 113 | + foreach ($phys_names as $fname) { |
|
| 114 | + $path = dir_hier_path($fname, project_dir()."/download", $fanout); |
|
| 115 | 115 | |
| 116 | 116 | // if the job_file record is there, |
| 117 | 117 | // update the delete time first to avoid race condition |
@@ -216,9 +216,9 @@ discard block |
||
| 216 | 216 | foreach ($_FILES as $f) { |
| 217 | 217 | $tmp_name = $f['tmp_name']; |
| 218 | 218 | $fname = $phys_names[$i]; |
| 219 | - $path = dir_hier_path($fname, project_dir() . "/download", $fanout); |
|
| 219 | + $path = dir_hier_path($fname, project_dir()."/download", $fanout); |
|
| 220 | 220 | |
| 221 | - switch(check_download_file($tmp_name, $path)) { |
|
| 221 | + switch (check_download_file($tmp_name, $path)) { |
|
| 222 | 222 | case 0: |
| 223 | 223 | break; |
| 224 | 224 | case 1: |
@@ -266,10 +266,10 @@ discard block |
||
| 266 | 266 | if ($request_log) { |
| 267 | 267 | $request_log_dir = parse_config(get_config(), "<log_dir>"); |
| 268 | 268 | if ($request_log_dir) { |
| 269 | - $request_log = $request_log_dir . "/" . $request_log; |
|
| 269 | + $request_log = $request_log_dir."/".$request_log; |
|
| 270 | 270 | } |
| 271 | 271 | if ($file = fopen($request_log, "a+")) { |
| 272 | - fwrite($file, "\n<job_file date=\"" . date(DATE_ATOM) . "\">\n" . $_POST['request'] . "\n</job_file>\n"); |
|
| 272 | + fwrite($file, "\n<job_file date=\"".date(DATE_ATOM)."\">\n".$_POST['request']."\n</job_file>\n"); |
|
| 273 | 273 | fclose($file); |
| 274 | 274 | } |
| 275 | 275 | } |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | xml_error(-1, "can't parse request message: $req", __FILE__, __LINE__); |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | -switch($r->getName()) { |
|
| 284 | +switch ($r->getName()) { |
|
| 285 | 285 | case 'query_files': |
| 286 | 286 | query_files($r); |
| 287 | 287 | break; |
@@ -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> |