@@ -369,7 +369,7 @@ |
||
| 369 | 369 | $text = "---"; |
| 370 | 370 | if ($batch->state == BATCH_STATE_COMPLETE) { |
| 371 | 371 | $y = '<font color="red">failed</font>'; |
| 372 | - } else { |
|
| 372 | + } else { |
|
| 373 | 373 | $y = "in progress"; |
| 374 | 374 | } |
| 375 | 375 | } |
@@ -48,14 +48,14 @@ |
||
| 48 | 48 | |
| 49 | 49 | if (!$sort_style) { |
| 50 | 50 | // get the sort style either from the logged in user or a cookie |
| 51 | - if ($user){ |
|
| 51 | + if ($user) { |
|
| 52 | 52 | $sort_style = $user->prefs->forum_sorting; |
| 53 | 53 | } else { |
| 54 | 54 | list($sort_style, $thread_style) = parse_forum_cookie(); |
| 55 | 55 | } |
| 56 | 56 | } else { |
| 57 | 57 | // set the sort style |
| 58 | - if ($user){ |
|
| 58 | + if ($user) { |
|
| 59 | 59 | $user->prefs->forum_sorting = $sort_style; |
| 60 | 60 | $user->prefs->update("forum_sorting=$sort_style"); |
| 61 | 61 | } else { |
@@ -92,7 +92,8 @@ |
||
| 92 | 92 | |
| 93 | 93 | $navailable_users = 0; |
| 94 | 94 | foreach ($users as $user) { |
| 95 | - if ($user->id != $team->userid) { //don't show current founder |
|
| 95 | + if ($user->id != $team->userid) { |
|
| 96 | +//don't show current founder |
|
| 96 | 97 | $user_total_credit = format_credit($user->total_credit); |
| 97 | 98 | $user_expavg_credit = format_credit($user->expavg_credit); |
| 98 | 99 | $selected = ($user->id == $team->ping_user)?"selected":""; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | // Do we have the data in cache? |
| 93 | 93 | // |
| 94 | - if ($cacheddata){ |
|
| 94 | + if ($cacheddata) { |
|
| 95 | 95 | $data = unserialize($cacheddata); // use the cached data |
| 96 | 96 | } else { |
| 97 | 97 | //if not do queries etc to generate new data |
@@ -122,7 +122,8 @@ discard block |
||
| 122 | 122 | echo "<a href=top_users.php?sort_by=$sort_by&offset=$new_offset>".tra("Previous %1", $users_per_page)."</a> · "; |
| 123 | 123 | |
| 124 | 124 | } |
| 125 | -if ($n==$users_per_page){ //If we aren't on the last page |
|
| 125 | +if ($n==$users_per_page) { |
|
| 126 | +//If we aren't on the last page |
|
| 126 | 127 | $new_offset = $offset + $users_per_page; |
| 127 | 128 | echo "<a href=top_users.php?sort_by=$sort_by&offset=$new_offset>".tra("Next %1", $users_per_page)."</a>"; |
| 128 | 129 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $parent_post_id = 0; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | -if ($filter != "false"){ |
|
| 53 | +if ($filter != "false") { |
|
| 54 | 54 | $filter = true; |
| 55 | 55 | } else { |
| 56 | 56 | $filter = false; |
@@ -65,10 +65,10 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | $warning = null; |
| 68 | -if ($content && (!$preview)){ |
|
| 69 | - if (post_str('add_signature',true)=="add_it"){ |
|
| 68 | +if ($content && (!$preview)) { |
|
| 69 | + if (post_str('add_signature',true)=="add_it") { |
|
| 70 | 70 | $add_signature=true; // set a flag and concatenate later |
| 71 | - } else { |
|
| 71 | + } else { |
|
| 72 | 72 | $add_signature=false; |
| 73 | 73 | } |
| 74 | 74 | check_tokens($logged_in_user->authenticator); |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | $cache_args = "userid=$userid"; |
| 46 | 46 | $cacheddata = get_cached_data(USER_PROFILE_TTL, $cache_args); |
| 47 | -if ($cacheddata){ |
|
| 47 | +if ($cacheddata) { |
|
| 48 | 48 | // Already got a cached version of the information |
| 49 | 49 | $community_links_object = unserialize($cacheddata); |
| 50 | 50 | } else { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | // See if "action" is provided - either through post or get |
| 39 | 39 | if (!post_str('action', true)) { |
| 40 | - if (!get_str('action', true)){ |
|
| 40 | + if (!get_str('action', true)) { |
|
| 41 | 41 | error_page(tra("You must specify an action...")); |
| 42 | 42 | } else { |
| 43 | 43 | $action = get_str('action'); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $userid = post_int('userid'); |
| 50 | 50 | $user=BoincUser::lookup_id($userid); |
| 51 | 51 | |
| 52 | -if ($action!="start"){ |
|
| 52 | +if ($action!="start") { |
|
| 53 | 53 | error_page("Unknown action"); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $mod_category = tra("Other"); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | -if (post_str('reason', true)){ |
|
| 68 | +if (post_str('reason', true)) { |
|
| 69 | 69 | start_vote($config,$logged_in_user,$user, $mod_category,post_str("reason")); |
| 70 | 70 | } else { |
| 71 | 71 | start_vote($config,$logged_in_user,$user, $mod_category,"None given"); |
@@ -53,8 +53,9 @@ discard block |
||
| 53 | 53 | // ------------ Forum identity ----------- |
| 54 | 54 | |
| 55 | 55 | $select_0 = $select_1 = $select_2 = ""; |
| 56 | -if (strlen($user->prefs->avatar)){ |
|
| 57 | - if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { // Gravatar |
|
| 56 | +if (strlen($user->prefs->avatar)) { |
|
| 57 | + if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { |
|
| 58 | +// Gravatar |
|
| 58 | 59 | $select_1 = "checked=\"true\""; |
| 59 | 60 | } else { |
| 60 | 61 | $select_2 = "checked=\"true\""; |
@@ -73,7 +74,7 @@ discard block |
||
| 73 | 74 | <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" ".$select_2."> |
| 74 | 75 | <label for=\"avatar_select_2\">".tra("Use this uploaded avatar:")."</label> <input type=\"file\" name=\"picture\">" |
| 75 | 76 | ); |
| 76 | -if (strlen($user->prefs->avatar)){ |
|
| 77 | +if (strlen($user->prefs->avatar)) { |
|
| 77 | 78 | row2(tra("Avatar preview")."<br><p class=\"text-muted\">".tra("This is how your avatar will look")."</p>", |
| 78 | 79 | "<img src=\"".$user->prefs->avatar."\" width=\"100\" height=\"100\">"); |
| 79 | 80 | } |
@@ -92,7 +93,7 @@ discard block |
||
| 92 | 93 | textarea_with_counter("signature", 250, $signature) |
| 93 | 94 | ."<br><input type=\"checkbox\" name=\"signature_by_default\" ".$signature_by_default."> ".tra("Attach signature by default") |
| 94 | 95 | ); |
| 95 | -if ($user->prefs->signature!=""){ |
|
| 96 | +if ($user->prefs->signature!="") { |
|
| 96 | 97 | row2(tra("Signature preview"). |
| 97 | 98 | "<br><p class=\"text-muted\">".tra("This is how your signature will look in the forums")."</p>", |
| 98 | 99 | output_transform($user->prefs->signature) |
@@ -138,7 +139,7 @@ discard block |
||
| 138 | 139 | |
| 139 | 140 | $filtered_userlist = get_ignored_list($user); |
| 140 | 141 | $forum_filtered_userlist = ""; |
| 141 | -for ($i=0; $i<sizeof($filtered_userlist); $i++){ |
|
| 142 | +for ($i=0; $i<sizeof($filtered_userlist); $i++) { |
|
| 142 | 143 | $id = (int)$filtered_userlist[$i]; |
| 143 | 144 | if ($id) { |
| 144 | 145 | $filtered_user = BoincUser::lookup_id($id); |
@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | proc_terminate($p); |
| 39 | 39 | // echo "child process is $ret\n"; |
| 40 | 40 | $pids=preg_split('/\s+/',$ret); |
| 41 | - foreach($pids as $pid){ |
|
| 42 | - if(is_numeric($pid)){ |
|
| 41 | + foreach($pids as $pid) { |
|
| 42 | + if(is_numeric($pid)) { |
|
| 43 | 43 | if($GLOBALS["debug"])echo "killing child process $pid\n"; |
| 44 | 44 | posix_kill($pid,9); |
| 45 | 45 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $p = proc_open("$cmd", $descs, $pipes); |
| 61 | 61 | while (1) { |
| 62 | 62 | $ctime=time(); |
| 63 | - if($ctime-$stime >=2 and ! file_exists("log.1")){ |
|
| 63 | + if($ctime-$stime >=2 and ! file_exists("log.1")) { |
|
| 64 | 64 | if($GLOBALS["debug"]) echo "time out "."<br>"; |
| 65 | 65 | terminate_job($p); |
| 66 | 66 | break; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $steps = $end_step-$start_step; |
| 158 | 158 | $avg_cpu = $cpu/$steps; |
| 159 | 159 | #$avg_cpu = $cpu/$count; |
| 160 | - if ($GLOBALS["debug"]){ |
|
| 160 | + if ($GLOBALS["debug"]) { |
|
| 161 | 161 | echo "test steps is ".$steps."<br>"; |
| 162 | 162 | echo "avg_cpu is ".$avg_cpu."<br>"; |
| 163 | 163 | } |
@@ -169,20 +169,19 @@ discard block |
||
| 169 | 169 | return array($avg_cpu,$test_steps); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | -function calc_est_size($lammps_script, $structure_file, $cmd_file,$test_steps){ |
|
| 172 | +function calc_est_size($lammps_script, $structure_file, $cmd_file,$test_steps) { |
|
| 173 | 173 | $dump_types = 0; |
| 174 | 174 | $fd = fopen($lammps_script,"r"); |
| 175 | - if (!$fd){ |
|
| 175 | + if (!$fd) { |
|
| 176 | 176 | echo "can not open file $lammps_script\n"; |
| 177 | 177 | exit(-1); |
| 178 | 178 | } |
| 179 | - while (!feof($fd)){ |
|
| 179 | + while (!feof($fd)) { |
|
| 180 | 180 | $line = fgets($fd, 4096); |
| 181 | 181 | //if (preg_match("/^\s*dump/", $line) |
| 182 | 182 | // and preg_match_all("/dump\S+\.\w{3}/", $line, $matches, PREG_PATTERN_ORDER)) |
| 183 | 183 | |
| 184 | - if(preg_match("/^\s*dump\s+(\d)\s+/", $line,$matches)) |
|
| 185 | - { |
|
| 184 | + if(preg_match("/^\s*dump\s+(\d)\s+/", $line,$matches)) { |
|
| 186 | 185 | if($GLOBALS["debug"]){print "matches=";print_r($matches);} |
| 187 | 186 | |
| 188 | 187 | $dump_types=(int)$matches[1]; |
@@ -194,7 +193,7 @@ discard block |
||
| 194 | 193 | |
| 195 | 194 | $structure_file_size = filesize($structure_file); |
| 196 | 195 | $fd = fopen($cmd_file,"r"); |
| 197 | - if (!$fd){ |
|
| 196 | + if (!$fd) { |
|
| 198 | 197 | echo "can not open file $cmd_file\n"; |
| 199 | 198 | exit(-1); |
| 200 | 199 | } |
@@ -202,10 +201,10 @@ discard block |
||
| 202 | 201 | |
| 203 | 202 | $loopno=1; |
| 204 | 203 | $looprun=1; |
| 205 | - while (!feof($fd)){ |
|
| 204 | + while (!feof($fd)) { |
|
| 206 | 205 | $line = fgets($fd,4096); |
| 207 | - if(preg_match("/loopnumber\s+\d+/", $line, $matches)){ |
|
| 208 | - if(preg_match("/\d+/", $matches[0], $no)){ |
|
| 206 | + if(preg_match("/loopnumber\s+\d+/", $line, $matches)) { |
|
| 207 | + if(preg_match("/\d+/", $matches[0], $no)) { |
|
| 209 | 208 | //$loopno=$no[0]; |
| 210 | 209 | if($no[0]>$loopno)$loopno=$no[0]; |
| 211 | 210 | } |
@@ -215,7 +214,7 @@ discard block |
||
| 215 | 214 | } |
| 216 | 215 | } |
| 217 | 216 | fclose($fd); |
| 218 | - if($GLOBALS["debug"]){ |
|
| 217 | + if($GLOBALS["debug"]) { |
|
| 219 | 218 | print "max loopno(number of loops to run)=".$loopno."<br>"; |
| 220 | 219 | print "max looprun(steps for each loop)=".$looprun."<br>"; |
| 221 | 220 | } |
@@ -231,7 +230,7 @@ discard block |
||
| 231 | 230 | $app_fixed_size = 5e7; |
| 232 | 231 | $est_size = $log_size+$dump_size+$app_fixed_size; |
| 233 | 232 | |
| 234 | - if($GLOBALS["debug"]){ |
|
| 233 | + if($GLOBALS["debug"]) { |
|
| 235 | 234 | print "test_steps=".$test_steps."<br>"; |
| 236 | 235 | print "test_log_size=".$test_log_size."<br>"; |
| 237 | 236 | print "log_size1=".$log_size1."<br>"; |
@@ -367,7 +366,7 @@ discard block |
||
| 367 | 366 | $err="Your test job <strong>failed</strong> |
| 368 | 367 | <br>Please refer to the following Error Message:<br><p> |
| 369 | 368 | "; |
| 370 | - foreach($err_msgs as $line){ |
|
| 369 | + foreach($err_msgs as $line) { |
|
| 371 | 370 | $err=$err.$line."<br>"; |
| 372 | 371 | } |
| 373 | 372 | $err=$err." <p> |
@@ -380,9 +379,9 @@ discard block |
||
| 380 | 379 | $info->rsc_fpops_est = $est_cpu_time * 1.5e9; |
| 381 | 380 | $info->rsc_fpops_bound = $info->rsc_fpops_est * 20; |
| 382 | 381 | |
| 383 | - if ($disk==0){ |
|
| 382 | + if ($disk==0) { |
|
| 384 | 383 | $info->rsc_disk_bound=1000000; |
| 385 | - } else{ |
|
| 384 | + } else { |
|
| 386 | 385 | $info->rsc_disk_bound = $disk; |
| 387 | 386 | } |
| 388 | 387 | |
@@ -444,7 +443,7 @@ discard block |
||
| 444 | 443 | |
| 445 | 444 | $njobs=0; |
| 446 | 445 | $cmdlines = file($info->cmdline_file_path); |
| 447 | - foreach ($cmdlines as $cmdline){ |
|
| 446 | + foreach ($cmdlines as $cmdline) { |
|
| 448 | 447 | if (preg_match("/^\s*-var/", $cmdline)) { |
| 449 | 448 | $njobs++; |
| 450 | 449 | } |
@@ -460,7 +459,7 @@ discard block |
||
| 460 | 459 | |
| 461 | 460 | $i = 0; |
| 462 | 461 | foreach ($cmdlines as $cmdline) { |
| 463 | - if (preg_match("/^\s*-var/", $cmdline)){ |
|
| 462 | + if (preg_match("/^\s*-var/", $cmdline)) { |
|
| 464 | 463 | submit_job($app, $batch_id, $info, $cmdline, $i); |
| 465 | 464 | $i++; |
| 466 | 465 | } |