@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | $preview = post_str("preview", true); |
54 | 54 | $warning = null; |
55 | 55 | |
56 | -if ($content && $title && (!$preview)){ |
|
57 | - if (post_str('add_signature', true) == "add_it"){ |
|
56 | +if ($content && $title && (!$preview)) { |
|
57 | + if (post_str('add_signature', true) == "add_it") { |
|
58 | 58 | $add_signature = true; // set a flag and concatenate later |
59 | - } else { |
|
59 | + } else { |
|
60 | 60 | $add_signature = false; |
61 | 61 | } |
62 | 62 | check_tokens($logged_in_user->authenticator); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>"; |
112 | 112 | } |
113 | 113 | |
114 | -if ($force_title && $title){ |
|
114 | +if ($force_title && $title) { |
|
115 | 115 | row2(tra("Title"), htmlspecialchars($title)."<input type=\"hidden\" name=\"title\" value=\"".htmlspecialchars($title)."\">"); |
116 | 116 | } else { |
117 | 117 | row2(tra("Title").$submit_help, |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | $preview = post_str("preview", true); |
54 | 54 | $warning = null; |
55 | 55 | |
56 | -if ($content && $title && (!$preview)){ |
|
57 | - if (post_str('add_signature', true) == "add_it"){ |
|
58 | - $add_signature = true; // set a flag and concatenate later |
|
59 | - } else { |
|
56 | +if ($content && $title && (!$preview)) { |
|
57 | + if (post_str('add_signature', true) == "add_it") { |
|
58 | + $add_signature = true; // set a flag and concatenate later |
|
59 | + } else { |
|
60 | 60 | $add_signature = false; |
61 | 61 | } |
62 | 62 | check_tokens($logged_in_user->authenticator); |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | $title, $content, $logged_in_user, $forum, $add_signature, $export |
69 | 69 | ); |
70 | 70 | if ($thread) { |
71 | - header('Location: forum_thread.php?id=' . $thread->id); |
|
71 | + header('Location: forum_thread.php?id='.$thread->id); |
|
72 | 72 | } else { |
73 | 73 | error_page("Can't create thread. $forum_error"); |
74 | 74 | } |
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
78 | -page_head(tra("Create new thread"),'','','', $bbcode_js); |
|
78 | +page_head(tra("Create new thread"), '', '', '', $bbcode_js); |
|
79 | 79 | show_forum_header($logged_in_user); |
80 | 80 | |
81 | 81 | if ($warning) { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>"; |
117 | 117 | } |
118 | 118 | |
119 | -if ($force_title && $title){ |
|
119 | +if ($force_title && $title) { |
|
120 | 120 | row2(tra("Title"), htmlspecialchars($title)."<input type=\"hidden\" name=\"title\" value=\"".htmlspecialchars($title)."\">"); |
121 | 121 | } else { |
122 | 122 | row2(tra("Title").$submit_help, |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | echo "</td></tr>"; |
133 | 133 | |
134 | 134 | if (!$logged_in_user->prefs->no_signature_by_default) { |
135 | - $enable_signature="checked=\"true\""; |
|
135 | + $enable_signature = "checked=\"true\""; |
|
136 | 136 | } else { |
137 | - $enable_signature=""; |
|
137 | + $enable_signature = ""; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | if (is_news_forum($forum)) { |
@@ -150,5 +150,5 @@ discard block |
||
150 | 150 | |
151 | 151 | page_tail(); |
152 | 152 | |
153 | -$cvs_version_tracker[]="\$Id$"; |
|
153 | +$cvs_version_tracker[] = "\$Id$"; |
|
154 | 154 | ?> |
@@ -251,7 +251,7 @@ |
||
251 | 251 | $pid = file_get_contents($path); |
252 | 252 | if ($pid) { |
253 | 253 | $pid = trim($pid); |
254 | - $out = Array(); |
|
254 | + $out = array(); |
|
255 | 255 | exec("ps -ww $pid", $out); |
256 | 256 | foreach ($out as $y) { |
257 | 257 | if (strstr($y, (string)$pid)) return 1; |
@@ -188,9 +188,9 @@ |
||
188 | 188 | |
189 | 189 | global $server_version; |
190 | 190 | if ( isset($server_version) ) { |
191 | - $url = "https://github.com/BOINC/boinc/tree/server_release/"; |
|
192 | - $url .= explode(".", $server_version)[0] . "." . explode(".", $server_version)[1] . "/" . "$server_version"; |
|
193 | - echo "Upstream server release: <a href=\"" . $url . "\">$server_version</a> <br>"; |
|
191 | + $url = "https://github.com/BOINC/boinc/tree/server_release/"; |
|
192 | + $url .= explode(".", $server_version)[0] . "." . explode(".", $server_version)[1] . "/" . "$server_version"; |
|
193 | + echo "Upstream server release: <a href=\"" . $url . "\">$server_version</a> <br>"; |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | if ($j->db_revision) { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | require_once("../inc/util.inc"); |
31 | 31 | require_once("../inc/xml.inc"); |
32 | 32 | require_once("../inc/boinc_db.inc"); |
33 | -if(file_exists('../inc/release.inc')) |
|
33 | +if (file_exists('../inc/release.inc')) |
|
34 | 34 | include '../inc/release.inc'; |
35 | 35 | |
36 | 36 | if (!defined('STATUS_PAGE_TTL')) { |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $avg = round($app->info->avg, 2); |
174 | 174 | $min = round($app->info->min, 2); |
175 | 175 | $max = round($app->info->max, 2); |
176 | - $x = $max?"$avg ($min - $max)":"---"; |
|
176 | + $x = $max ? "$avg ($min - $max)" : "---"; |
|
177 | 177 | $u = $app->info->users; |
178 | 178 | echo "<tr> |
179 | 179 | <td>$app->user_friendly_name</td> |
@@ -187,10 +187,10 @@ discard block |
||
187 | 187 | end_table(); |
188 | 188 | |
189 | 189 | global $server_version; |
190 | - if ( isset($server_version) ) { |
|
190 | + if (isset($server_version)) { |
|
191 | 191 | $url = "https://github.com/BOINC/boinc/tree/server_release/"; |
192 | - $url .= explode(".", $server_version)[0] . "." . explode(".", $server_version)[1] . "/" . "$server_version"; |
|
193 | - echo "Upstream server release: <a href=\"" . $url . "\">$server_version</a> <br>"; |
|
192 | + $url .= explode(".", $server_version)[0].".".explode(".", $server_version)[1]."/"."$server_version"; |
|
193 | + echo "Upstream server release: <a href=\"".$url."\">$server_version</a> <br>"; |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | if ($j->db_revision) { |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $cmd = trim($cmd); |
255 | 255 | $x = explode(" ", $cmd); |
256 | 256 | $prog = $x[0]; |
257 | - $pidname = $prog . '.pid'; |
|
257 | + $pidname = $prog.'.pid'; |
|
258 | 258 | } |
259 | 259 | $path = "../../pid_$host/$pidname"; |
260 | 260 | if (is_file($path)) { |
@@ -295,12 +295,12 @@ discard block |
||
295 | 295 | } |
296 | 296 | $master_host = $u["host"]; |
297 | 297 | if ($config->www_host) { |
298 | - $web_host = trim((string) $config->www_host); |
|
298 | + $web_host = trim((string)$config->www_host); |
|
299 | 299 | } else { |
300 | 300 | $web_host = $main_host; |
301 | 301 | } |
302 | 302 | if ($config->sched_host) { |
303 | - $sched_host = trim((string) $config->sched_host); |
|
303 | + $sched_host = trim((string)$config->sched_host); |
|
304 | 304 | } else { |
305 | 305 | $sched_host = $main_host; |
306 | 306 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | |
311 | 311 | // the upload and download servers are sort of daemons too |
312 | 312 | // |
313 | - $url = trim((string) $config->download_url); |
|
313 | + $url = trim((string)$config->download_url); |
|
314 | 314 | $u = parse_url($url); |
315 | 315 | $h = $u["host"]; |
316 | 316 | if ($h == $master_host) { |
@@ -322,14 +322,14 @@ discard block |
||
322 | 322 | } else { |
323 | 323 | $have_remote = true; |
324 | 324 | } |
325 | - $url = trim((string) $config->upload_url); |
|
325 | + $url = trim((string)$config->upload_url); |
|
326 | 326 | $u = parse_url($url); |
327 | 327 | $h = $u["host"]; |
328 | 328 | if ($h == $master_host) { |
329 | 329 | $y = new StdClass; |
330 | 330 | $y->cmd = "Upload server"; |
331 | 331 | $y->host = $h; |
332 | - $y->status = !file_exists("../../stop_upload");; |
|
332 | + $y->status = !file_exists("../../stop_upload"); ; |
|
333 | 333 | $local_daemons[] = $y; |
334 | 334 | } else { |
335 | 335 | $have_remote = true; |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $y = new StdClass; |
342 | 342 | $y->cmd = "Scheduler"; |
343 | 343 | $y->host = $sched_host; |
344 | - $y->status = !file_exists("../../stop_sched");; |
|
344 | + $y->status = !file_exists("../../stop_sched"); ; |
|
345 | 345 | $local_daemons[] = $y; |
346 | 346 | } else { |
347 | 347 | $have_remote = true; |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $disabled_daemons[] = $x; |
358 | 358 | continue; |
359 | 359 | } |
360 | - $host = $d->host?(string)$d->host:$main_host; |
|
360 | + $host = $d->host ? (string)$d->host : $main_host; |
|
361 | 361 | if ($host != $web_host) { |
362 | 362 | $have_remote = true; |
363 | 363 | continue; |
@@ -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 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | $wus = BoincWorkunit::enum("batch = $batch->id"); |
309 | 309 | $batch = get_batch_params($batch, $wus); |
310 | 310 | |
311 | - page_head("Batch $batch_id"); |
|
311 | + page_head("batch $batch_id"); |
|
312 | 312 | start_table(); |
313 | 313 | row2("name", $batch->name); |
314 | 314 | row2("application", $app->name); |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | $wu = BoincWorkunit::lookup_id($wuid); |
394 | 394 | if (!$wu) error_page("no such job"); |
395 | 395 | |
396 | - page_head("Job $wuid"); |
|
396 | + page_head("job $wuid"); |
|
397 | 397 | |
398 | 398 | echo " |
399 | 399 | <a href=workunit.php?wuid=$wuid>Workunit details</a> · |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | } |
324 | 324 | row2("GFLOP/hours, estimated", number_format(credit_to_gflop_hours($batch->credit_estimate), 2)); |
325 | 325 | row2("GFLOP/hours, actual", number_format(credit_to_gflop_hours($batch->credit_canonical), 2)); |
326 | - row2("Output File Size (MB)", number_format(batch_output_file_size($batch->id)/1e6,2)); |
|
326 | + row2("Output File Size (MB)", number_format(batch_output_file_size($batch->id)/1e6, 2)); |
|
327 | 327 | end_table(); |
328 | 328 | if (batch_output_file_size($batch->id) <= 1e8) { |
329 | 329 | $url = boinc_get_output_files_url($user, $batch_id); |
@@ -357,9 +357,9 @@ discard block |
||
357 | 357 | "Canonical instance<br><small>click to see result page on BOINC server</smallp>", |
358 | 358 | "Download Results" |
359 | 359 | ); |
360 | - foreach($wus as $wu) { |
|
360 | + foreach ($wus as $wu) { |
|
361 | 361 | $resultid = $wu->canonical_resultid; |
362 | - $durl = boinc_get_wu_output_files_url($user,$wu->id); |
|
362 | + $durl = boinc_get_wu_output_files_url($user, $wu->id); |
|
363 | 363 | if ($resultid) { |
364 | 364 | $x = "<a href=result.php?resultid=$resultid>$resultid</a>"; |
365 | 365 | $y = '<font color="green">completed</font>'; |
@@ -369,7 +369,7 @@ discard block |
||
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 | } |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | $results = BoincResult::enum("workunitid=$wuid"); |
435 | 435 | $upload_dir = parse_config(get_config(), "<upload_dir>"); |
436 | 436 | $fanout = parse_config(get_config(), "<uldl_dir_fanout>"); |
437 | - foreach($results as $result) { |
|
437 | + foreach ($results as $result) { |
|
438 | 438 | echo "<tr> |
439 | 439 | <td><a href=result.php?resultid=$result->id>$result->id · $result->name </a></td> |
440 | 440 | <td>".state_string($result)."</td> |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $view = BoltView::lookup_id($e->last_view_id); |
43 | 43 | $ago = time_diff(time() - $view->start_time); |
44 | 44 | $pct = number_format($view->fraction_done*100, 0); |
45 | - $status = "Started $start |
|
45 | + $status = "started $start |
|
46 | 46 | <br>Last visit: $ago ago |
47 | 47 | <br>$pct% done |
48 | 48 | "; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | if ($course->hidden && !($user->bolt->flags&BOLT_FLAG_SHOW_ALL)) { |
37 | 37 | continue; |
38 | 38 | } |
39 | - $e = $user?BoltEnrollment::lookup($user->id, $course->id):null; |
|
39 | + $e = $user ?BoltEnrollment::lookup($user->id, $course->id) : null; |
|
40 | 40 | if ($e) { |
41 | 41 | $start = date_str($e->create_time); |
42 | 42 | $view = BoltView::lookup_id($e->last_view_id); |
@@ -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); |
@@ -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,11 +65,11 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | $warning = null; |
68 | -if ($content && (!$preview)){ |
|
69 | - if (post_str('add_signature',true)=="add_it"){ |
|
70 | - $add_signature=true; // set a flag and concatenate later |
|
71 | - } else { |
|
72 | - $add_signature=false; |
|
68 | +if ($content && (!$preview)) { |
|
69 | + if (post_str('add_signature', true) == "add_it") { |
|
70 | + $add_signature = true; // set a flag and concatenate later |
|
71 | + } else { |
|
72 | + $add_signature = false; |
|
73 | 73 | } |
74 | 74 | check_tokens($logged_in_user->authenticator); |
75 | 75 | if (!akismet_check($logged_in_user, $content)) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | -page_head(tra("Post to thread"),'','','', $bbcode_js); |
|
91 | +page_head(tra("Post to thread"), '', '', '', $bbcode_js); |
|
92 | 92 | |
93 | 93 | show_forum_header($logged_in_user); |
94 | 94 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $x1 = tra("Message:").bbcode_info().post_warning(); |
143 | 143 | $x2 = ""; |
144 | 144 | if ($parent_post) { |
145 | - $x2 .=" ".tra("reply to %1 Message ID %2:", "<a href=#".$parent_post->id.">", " ".$parent_post->id."</a>"); |
|
145 | + $x2 .= " ".tra("reply to %1 Message ID %2:", "<a href=#".$parent_post->id.">", " ".$parent_post->id."</a>"); |
|
146 | 146 | } |
147 | 147 | $x2 .= "<form action=forum_reply.php?thread=".$thread->id; |
148 | 148 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $x2 .= " method=\"post\" name=\"post\" onsubmit=\"return checkForm(this)\">\n"; |
154 | 154 | $x2 .= form_tokens($logged_in_user->authenticator); |
155 | 155 | $x2 .= start_table_str().$bbcode_html.end_table_str()."<textarea class=\"form-control\" name=\"content\" rows=\"18\">"; |
156 | - $no_quote = get_int("no_quote", true)==1; |
|
156 | + $no_quote = get_int("no_quote", true) == 1; |
|
157 | 157 | if ($preview) { |
158 | 158 | $x2 .= htmlspecialchars($content); |
159 | 159 | } else if (!$no_quote) { |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | } |
163 | 163 | } |
164 | 164 | if (!$logged_in_user->prefs->no_signature_by_default) { |
165 | - $enable_signature="checked=\"true\""; |
|
165 | + $enable_signature = "checked=\"true\""; |
|
166 | 166 | } else { |
167 | - $enable_signature=""; |
|
167 | + $enable_signature = ""; |
|
168 | 168 | } |
169 | 169 | $x2 .= "</textarea><p> </p> |
170 | 170 | <input class=\"btn btn-primary btn-sm \" type=\"submit\" name=\"preview\" value=\"".tra("Preview")."\"> |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | } |
180 | 180 | |
181 | 181 | function quote_text($text) { |
182 | - $text = "[quote]" . $text . "[/quote]"; |
|
182 | + $text = "[quote]".$text."[/quote]"; |
|
183 | 183 | return $text; |
184 | 184 | } |
185 | 185 | |
186 | -$cvs_version_tracker[]="\$Id$"; |
|
186 | +$cvs_version_tracker[] = "\$Id$"; |
|
187 | 187 | ?> |
@@ -32,7 +32,7 @@ |
||
32 | 32 | if (!$batch || $batch->user_id != $user->id) { |
33 | 33 | error_page("no batch"); |
34 | 34 | } |
35 | - page_head("Batch $batch->id"); |
|
35 | + page_head("batch $batch->id"); |
|
36 | 36 | $results = BoincResult::enum("batch=$batch->id order by workunitid"); |
37 | 37 | result_table_start(true, true, null); |
38 | 38 | foreach ($results as $result) { |
@@ -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,9 +38,9 @@ discard block |
||
38 | 38 | // ------------ Notification ----------- |
39 | 39 | |
40 | 40 | row1(tra("Notifications")); |
41 | -$ch0 = $user->prefs->pm_notification==0?"checked":""; |
|
42 | -$ch1 = $user->prefs->pm_notification==1?"checked":""; |
|
43 | -$ch2 = $user->prefs->pm_notification==2?"checked":""; |
|
41 | +$ch0 = $user->prefs->pm_notification == 0 ? "checked" : ""; |
|
42 | +$ch1 = $user->prefs->pm_notification == 1 ? "checked" : ""; |
|
43 | +$ch2 = $user->prefs->pm_notification == 2 ? "checked" : ""; |
|
44 | 44 | row2( |
45 | 45 | tra("How should we notify you of new private messages, friend requests, posts in subscribed threads, and other events?"), |
46 | 46 | "<input type=radio name=pm_notification value=0 $ch0> ".tra("On my Account page (no email)")." |
@@ -53,8 +53,8 @@ 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") { // Gravatar |
|
58 | 58 | $select_1 = "checked=\"true\""; |
59 | 59 | } else { |
60 | 60 | $select_2 = "checked=\"true\""; |
@@ -73,15 +73,15 @@ discard block |
||
73 | 73 | <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" ".$select_2."> |
74 | 74 | <label for=\"avatar_select_2\">".tra("Use this uploaded avatar:")."</label> <input type=\"file\" name=\"picture\">" |
75 | 75 | ); |
76 | -if (strlen($user->prefs->avatar)){ |
|
76 | +if (strlen($user->prefs->avatar)) { |
|
77 | 77 | row2(tra("Avatar preview")."<br><p class=\"text-muted\">".tra("This is how your avatar will look")."</p>", |
78 | 78 | "<img src=\"".$user->prefs->avatar."\" width=\"100\" height=\"100\">"); |
79 | 79 | } |
80 | 80 | |
81 | -$signature_by_default = $user->prefs->no_signature_by_default==false?"checked=\"checked\"":""; |
|
81 | +$signature_by_default = $user->prefs->no_signature_by_default == false ? "checked=\"checked\"" : ""; |
|
82 | 82 | |
83 | -$signature=$user->prefs->signature; |
|
84 | -$maxlen=250; |
|
83 | +$signature = $user->prefs->signature; |
|
84 | +$maxlen = 250; |
|
85 | 85 | row2( |
86 | 86 | tra("Signature for message board posts") |
87 | 87 | .bbcode_info() |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | textarea_with_counter("signature", 250, $signature) |
93 | 93 | ."<br><input type=\"checkbox\" name=\"signature_by_default\" ".$signature_by_default."> ".tra("Attach signature by default") |
94 | 94 | ); |
95 | -if ($user->prefs->signature!=""){ |
|
95 | +if ($user->prefs->signature != "") { |
|
96 | 96 | row2(tra("Signature preview"). |
97 | 97 | "<br><p class=\"text-muted\">".tra("This is how your signature will look in the forums")."</p>", |
98 | 98 | output_transform($user->prefs->signature) |
@@ -101,13 +101,13 @@ discard block |
||
101 | 101 | |
102 | 102 | // ------------ Message display ----------- |
103 | 103 | |
104 | -$forum_hide_avatars = $user->prefs->hide_avatars?"checked=\"checked\"":""; |
|
105 | -$forum_hide_signatures = $user->prefs->hide_signatures?"checked=\"checked\"":""; |
|
106 | -$forum_link_popup = $user->prefs->link_popup?"checked=\"checked\"":""; |
|
107 | -$forum_image_as_link = $user->prefs->images_as_links?"checked=\"checked\"":""; |
|
108 | -$forum_jump_to_unread = $user->prefs->jump_to_unread?"checked=\"checked\"":""; |
|
109 | -$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts?"checked=\"checked\"":""; |
|
110 | -$forum_highlight_special = $user->prefs->highlight_special?"checked=\"checked\"":""; |
|
104 | +$forum_hide_avatars = $user->prefs->hide_avatars ? "checked=\"checked\"" : ""; |
|
105 | +$forum_hide_signatures = $user->prefs->hide_signatures ? "checked=\"checked\"" : ""; |
|
106 | +$forum_link_popup = $user->prefs->link_popup ? "checked=\"checked\"" : ""; |
|
107 | +$forum_image_as_link = $user->prefs->images_as_links ? "checked=\"checked\"" : ""; |
|
108 | +$forum_jump_to_unread = $user->prefs->jump_to_unread ? "checked=\"checked\"" : ""; |
|
109 | +$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts ? "checked=\"checked\"" : ""; |
|
110 | +$forum_highlight_special = $user->prefs->highlight_special ? "checked=\"checked\"" : ""; |
|
111 | 111 | |
112 | 112 | $forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount); |
113 | 113 | $forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | $filtered_userlist = get_ignored_list($user); |
140 | 140 | $forum_filtered_userlist = ""; |
141 | -for ($i=0; $i<sizeof($filtered_userlist); $i++){ |
|
141 | +for ($i = 0; $i < sizeof($filtered_userlist); $i++) { |
|
142 | 142 | $id = (int)$filtered_userlist[$i]; |
143 | 143 | if ($id) { |
144 | 144 | $filtered_user = BoincUser::lookup_id($id); |
@@ -168,5 +168,5 @@ discard block |
||
168 | 168 | end_table(); |
169 | 169 | page_tail(); |
170 | 170 | |
171 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
171 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
172 | 172 | ?> |
@@ -691,7 +691,8 @@ |
||
691 | 691 | <id>$result->id</id> |
692 | 692 | <state>".state_string($result)."</state> |
693 | 693 | "; |
694 | - if ($result->server_state == 5) { // over? |
|
694 | + if ($result->server_state == 5) { |
|
695 | +// over? |
|
695 | 696 | $paths = get_outfile_paths($result); |
696 | 697 | foreach($paths as $path) { |
697 | 698 | if (is_file($path)) { |
@@ -595,7 +595,7 @@ |
||
595 | 595 | // return a batch specified by the command, using either ID or name |
596 | 596 | // |
597 | 597 | function get_batch($r) { |
598 | - $batch = NULL; |
|
598 | + $batch = null; |
|
599 | 599 | if (!empty($r->batch_id)) { |
600 | 600 | $batch_id = (int)($r->batch_id); |
601 | 601 | $batch = BoincBatch::lookup_id($batch_id); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | if ($template) { |
55 | 55 | $t = (double)$template->workunit->rsc_fpops_est; |
56 | 56 | } |
57 | - foreach($r->batch->job as $job) { |
|
57 | + foreach ($r->batch->job as $job) { |
|
58 | 58 | $y = (double)$job->rsc_fpops_est; |
59 | 59 | if ($y) { |
60 | 60 | $x += $y; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | function est_elapsed_time($r, $template) { |
80 | 80 | // crude estimate: batch FLOPs / project FLOPS |
81 | 81 | // |
82 | - return batch_flop_count($r, $template) / project_flops(); |
|
82 | + return batch_flop_count($r, $template)/project_flops(); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | // if batch-level input template filename was given, read it; |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | // |
90 | 90 | function read_input_template($app, $r) { |
91 | 91 | if ((isset($r->batch)) && (isset($r->batch->workunit_template_file)) && ($r->batch->workunit_template_file)) { |
92 | - $path = project_dir() . "/templates/".$r->batch->workunit_template_file; |
|
92 | + $path = project_dir()."/templates/".$r->batch->workunit_template_file; |
|
93 | 93 | } else { |
94 | - $path = project_dir() . "/templates/$app->name"."_in"; |
|
94 | + $path = project_dir()."/templates/$app->name"."_in"; |
|
95 | 95 | } |
96 | 96 | if (file_exists($path)) { |
97 | 97 | $x = simplexml_load_file($path); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | function validate_batch($jobs, $template) { |
135 | 135 | $i = 0; |
136 | 136 | $n = count($template->file_info); |
137 | - foreach($jobs as $job) { |
|
137 | + foreach ($jobs as $job) { |
|
138 | 138 | $m = count($job->input_files); |
139 | 139 | if ($n != $m) { |
140 | 140 | xml_error(-1, "wrong # of input files for job $i: need $n, got $m"); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | // stage all the files |
190 | 190 | // |
191 | 191 | function stage_files(&$jobs) { |
192 | - foreach($jobs as $job) { |
|
192 | + foreach ($jobs as $job) { |
|
193 | 193 | foreach ($job->input_files as $file) { |
194 | 194 | if ($file->mode != "remote") { |
195 | 195 | $file->name = stage_file($file); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | // |
203 | 203 | function submit_jobs( |
204 | 204 | $jobs, $job_params, $app, $batch_id, $priority, $app_version_num, |
205 | - $input_template_filename, // batch-level; can also specify per job |
|
205 | + $input_template_filename, // batch-level; can also specify per job |
|
206 | 206 | $output_template_filename |
207 | 207 | ) { |
208 | 208 | global $input_templates, $output_templates; |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | // one line per job |
212 | 212 | // |
213 | 213 | $x = ""; |
214 | - foreach($jobs as $job) { |
|
214 | + foreach ($jobs as $job) { |
|
215 | 215 | if ($job->name) { |
216 | 216 | $x .= " --wu_name $job->name"; |
217 | 217 | } |
@@ -243,8 +243,8 @@ discard block |
||
243 | 243 | $x .= "\n"; |
244 | 244 | } |
245 | 245 | |
246 | - $errfile = "/tmp/create_work_" . getmypid() . ".err"; |
|
247 | - $cmd = "cd " . project_dir() . "; ./bin/create_work --appname $app->name --batch $batch_id --priority $priority"; |
|
246 | + $errfile = "/tmp/create_work_".getmypid().".err"; |
|
247 | + $cmd = "cd ".project_dir()."; ./bin/create_work --appname $app->name --batch $batch_id --priority $priority"; |
|
248 | 248 | if ($input_template_filename) { |
249 | 249 | $cmd .= " --wu_template templates/$input_template_filename"; |
250 | 250 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | // |
341 | 341 | function xml_get_jobs($r) { |
342 | 342 | $jobs = array(); |
343 | - foreach($r->batch->job as $j) { |
|
343 | + foreach ($r->batch->job as $j) { |
|
344 | 344 | $job = new StdClass; |
345 | 345 | $job->input_files = array(); |
346 | 346 | $job->command_line = (string)$j->command_line; |
@@ -420,16 +420,16 @@ discard block |
||
420 | 420 | // - use that for batch logical end time and job priority |
421 | 421 | // |
422 | 422 | $total_flops = 0; |
423 | - foreach($jobs as $job) { |
|
423 | + foreach ($jobs as $job) { |
|
424 | 424 | //print_r($job); |
425 | 425 | if ($job->rsc_fpops_est) { |
426 | 426 | $total_flops += $job->rsc_fpops_est; |
427 | 427 | } else if ($job->input_template && $job->input_template->workunit->rsc_fpops_est) { |
428 | - $total_flops += (double) $job->input_template->workunit->rsc_fpops_est; |
|
428 | + $total_flops += (double)$job->input_template->workunit->rsc_fpops_est; |
|
429 | 429 | } else if ($r->batch->job_params->rsc_fpops_est) { |
430 | - $total_flops += (double) $r->batch->job_params->rsc_fpops_est; |
|
430 | + $total_flops += (double)$r->batch->job_params->rsc_fpops_est; |
|
431 | 431 | } else { |
432 | - $x = (double) $template->workunit->rsc_fpops_est; |
|
432 | + $x = (double)$template->workunit->rsc_fpops_est; |
|
433 | 433 | if ($x) { |
434 | 434 | $total_flops += $x; |
435 | 435 | } else { |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | } |
438 | 438 | } |
439 | 439 | } |
440 | - $cmd = "cd " . project_dir() . "/bin; ./adjust_user_priority --user $user->id --flops $total_flops --app $app->name"; |
|
440 | + $cmd = "cd ".project_dir()."/bin; ./adjust_user_priority --user $user->id --flops $total_flops --app $app->name"; |
|
441 | 441 | $x = exec($cmd); |
442 | 442 | if (!is_numeric($x) || (double)$x == 0) { |
443 | 443 | xml_error(-1, "$cmd returned $x"); |
@@ -461,15 +461,15 @@ discard block |
||
461 | 461 | } |
462 | 462 | |
463 | 463 | $job_params = new StdClass; |
464 | - $job_params->rsc_disk_bound = (double) $r->batch->job_params->rsc_disk_bound; |
|
465 | - $job_params->rsc_fpops_est = (double) $r->batch->job_params->rsc_fpops_est; |
|
466 | - $job_params->rsc_fpops_bound = (double) $r->batch->job_params->rsc_fpops_bound; |
|
467 | - $job_params->rsc_memory_bound = (double) $r->batch->job_params->rsc_memory_bound; |
|
468 | - $job_params->delay_bound = (double) $r->batch->job_params->delay_bound; |
|
464 | + $job_params->rsc_disk_bound = (double)$r->batch->job_params->rsc_disk_bound; |
|
465 | + $job_params->rsc_fpops_est = (double)$r->batch->job_params->rsc_fpops_est; |
|
466 | + $job_params->rsc_fpops_bound = (double)$r->batch->job_params->rsc_fpops_bound; |
|
467 | + $job_params->rsc_memory_bound = (double)$r->batch->job_params->rsc_memory_bound; |
|
468 | + $job_params->delay_bound = (double)$r->batch->job_params->delay_bound; |
|
469 | 469 | // could add quorum-related stuff |
470 | 470 | |
471 | - $input_template_filename = (string) $r->batch->input_template_filename; |
|
472 | - $output_template_filename = (string) $r->batch->output_template_filename; |
|
471 | + $input_template_filename = (string)$r->batch->input_template_filename; |
|
472 | + $output_template_filename = (string)$r->batch->output_template_filename; |
|
473 | 473 | // possibly empty |
474 | 474 | |
475 | 475 | submit_jobs( |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | } |
553 | 553 | |
554 | 554 | function n_outfiles($wu) { |
555 | - $path = project_dir() . "/$wu->output_template_filename"; |
|
555 | + $path = project_dir()."/$wu->output_template_filename"; |
|
556 | 556 | $r = simplexml_load_file($path); |
557 | 557 | return count($r->file_info); |
558 | 558 | } |
@@ -748,7 +748,7 @@ discard block |
||
748 | 748 | "; |
749 | 749 | if ($result->server_state == 5) { // over? |
750 | 750 | $paths = get_outfile_paths($result); |
751 | - foreach($paths as $path) { |
|
751 | + foreach ($paths as $path) { |
|
752 | 752 | if (is_file($path)) { |
753 | 753 | $size = filesize($path); |
754 | 754 | echo " <outfile> |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | } else { |
789 | 789 | $results = BoincResult::enum("workunitid=$job_id"); |
790 | 790 | foreach ($results as $r) { |
791 | - switch($r->outcome) { |
|
791 | + switch ($r->outcome) { |
|
792 | 792 | case 1: |
793 | 793 | case 3: |
794 | 794 | case 6: |
@@ -896,8 +896,8 @@ discard block |
||
896 | 896 | } |
897 | 897 | |
898 | 898 | list($user, $user_submit) = authenticate_user($r, $app); |
899 | - $in = file_get_contents(project_dir() . "/templates/".$app->name."_in"); |
|
900 | - $out = file_get_contents(project_dir() . "/templates/".$app->name."_out"); |
|
899 | + $in = file_get_contents(project_dir()."/templates/".$app->name."_in"); |
|
900 | + $out = file_get_contents(project_dir()."/templates/".$app->name."_out"); |
|
901 | 901 | if ($in === false || $out === false) { |
902 | 902 | xml_error(-1, "template file missing"); |
903 | 903 | } |
@@ -908,7 +908,7 @@ discard block |
||
908 | 908 | |
909 | 909 | function ping($r) { |
910 | 910 | xml_start_tag("ping"); |
911 | - BoincDb::get(); // errors out if DB down or web disabled |
|
911 | + BoincDb::get(); // errors out if DB down or web disabled |
|
912 | 912 | echo "<success>1</success> |
913 | 913 | </ping> |
914 | 914 | "; |
@@ -974,10 +974,10 @@ discard block |
||
974 | 974 | if ($request_log) { |
975 | 975 | $request_log_dir = parse_config(get_config(), "<log_dir>"); |
976 | 976 | if ($request_log_dir) { |
977 | - $request_log = $request_log_dir . "/" . $request_log; |
|
977 | + $request_log = $request_log_dir."/".$request_log; |
|
978 | 978 | } |
979 | 979 | if ($file = fopen($request_log, "a+")) { |
980 | - fwrite($file, "\n<submit_rpc_handler date=\"" . date(DATE_ATOM) . "\">\n" . $_POST['request'] . "\n</submit_rpc_handler>\n"); |
|
980 | + fwrite($file, "\n<submit_rpc_handler date=\"".date(DATE_ATOM)."\">\n".$_POST['request']."\n</submit_rpc_handler>\n"); |
|
981 | 981 | fclose($file); |
982 | 982 | } |
983 | 983 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | </select>"); |
57 | 57 | |
58 | 58 | $forumid = null; |
59 | -if (get_str("forumid",true)){ |
|
59 | +if (get_str("forumid",true)) { |
|
60 | 60 | $forumid = get_str("forumid"); |
61 | 61 | } |
62 | 62 | $forumlist="<option value=\"-1\">".tra("All")."</option>"; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | foreach ($categories as $category) { |
65 | 65 | $forums = BoincForum::enum("parent_type=0 and category=$category->id"); |
66 | 66 | foreach ($forums as $forum) { |
67 | - if ($forum->id==$forumid){ |
|
67 | + if ($forum->id==$forumid) { |
|
68 | 68 | $forumlist.="<option selected value=\"".$forum->id."\">".$forum->title."</option>"; |
69 | 69 | } else { |
70 | 70 | $forumlist.="<option value=\"".$forum->id."\">".$forum->title."</option>"; |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | '<select class="form-control" name="search_forum">'.$forumlist.'</select'); |
77 | 77 | |
78 | 78 | $sortlist = null; |
79 | -foreach ($thread_sort_styles as $id => $style){ |
|
80 | - if ($id == CREATE_TIME_NEW){ |
|
79 | +foreach ($thread_sort_styles as $id => $style) { |
|
80 | + if ($id == CREATE_TIME_NEW) { |
|
81 | 81 | $sortlist.="<option selected value=\"".$id."\">".$style."</option>"; |
82 | 82 | } else { |
83 | 83 | $sortlist.="<option value=\"".$id."\">".$style."</option>"; |
@@ -56,18 +56,18 @@ discard block |
||
56 | 56 | </select>"); |
57 | 57 | |
58 | 58 | $forumid = null; |
59 | -if (get_str("forumid",true)){ |
|
59 | +if (get_str("forumid", true)) { |
|
60 | 60 | $forumid = get_str("forumid"); |
61 | 61 | } |
62 | -$forumlist="<option value=\"-1\">".tra("All")."</option>"; |
|
62 | +$forumlist = "<option value=\"-1\">".tra("All")."</option>"; |
|
63 | 63 | $categories = BoincCategory::enum(); |
64 | 64 | foreach ($categories as $category) { |
65 | 65 | $forums = BoincForum::enum("parent_type=0 and category=$category->id"); |
66 | 66 | foreach ($forums as $forum) { |
67 | - if ($forum->id==$forumid){ |
|
68 | - $forumlist.="<option selected value=\"".$forum->id."\">".$forum->title."</option>"; |
|
67 | + if ($forum->id == $forumid) { |
|
68 | + $forumlist .= "<option selected value=\"".$forum->id."\">".$forum->title."</option>"; |
|
69 | 69 | } else { |
70 | - $forumlist.="<option value=\"".$forum->id."\">".$forum->title."</option>"; |
|
70 | + $forumlist .= "<option value=\"".$forum->id."\">".$forum->title."</option>"; |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | } |
@@ -76,22 +76,22 @@ discard block |
||
76 | 76 | '<select class="form-control" name="search_forum">'.$forumlist.'</select'); |
77 | 77 | |
78 | 78 | $sortlist = null; |
79 | -foreach ($thread_sort_styles as $id => $style){ |
|
80 | - if ($id == CREATE_TIME_NEW){ |
|
81 | - $sortlist.="<option selected value=\"".$id."\">".$style."</option>"; |
|
79 | +foreach ($thread_sort_styles as $id => $style) { |
|
80 | + if ($id == CREATE_TIME_NEW) { |
|
81 | + $sortlist .= "<option selected value=\"".$id."\">".$style."</option>"; |
|
82 | 82 | } else { |
83 | - $sortlist.="<option value=\"".$id."\">".$style."</option>"; |
|
83 | + $sortlist .= "<option value=\"".$id."\">".$style."</option>"; |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | row2(tra("Sort by"), |
87 | 87 | '<select class="form-control" name="search_sort">'.$sortlist.'</select'); |
88 | 88 | |
89 | 89 | row1(" "); |
90 | -row2("","<input class=\"btn btn-success\" type=\"submit\" value=\"".tra("Start the search")."\">"); |
|
90 | +row2("", "<input class=\"btn btn-success\" type=\"submit\" value=\"".tra("Start the search")."\">"); |
|
91 | 91 | echo "</form>"; |
92 | 92 | end_table(); |
93 | 93 | |
94 | 94 | page_tail(); |
95 | 95 | |
96 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
96 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
97 | 97 | ?> |