@@ -36,7 +36,7 @@ |
||
36 | 36 | "X-Poedit-SourceCharset: utf-8\\n" |
37 | 37 | |
38 | 38 | |
39 | -HDR; |
|
39 | +hdr; |
|
40 | 40 | |
41 | 41 | $out = fopen("en.po", "w"); |
42 | 42 |
@@ -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 | ?> |
@@ -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 | } |
@@ -28,10 +28,10 @@ |
||
28 | 28 | // |
29 | 29 | function show_platforms() { |
30 | 30 | $xmlFragment = unserialize(get_cached_data(3600, "project_config_platform_xml")); |
31 | - if ($xmlFragment==false){ |
|
31 | + if ($xmlFragment==false) { |
|
32 | 32 | $platforms = BoincDB::get()->enum_fields("platform, DBNAME.app_version, DBNAME.app", "BoincPlatform", "platform.name, platform.user_friendly_name, plan_class", "app_version.platformid = platform.id and app_version.appid = app.id and app_version.deprecated=0 and app.deprecated=0 group by platform.name, plan_class", ""); |
33 | 33 | $xmlFragment = " <platforms>"; |
34 | - foreach ($platforms as $platform){ |
|
34 | + foreach ($platforms as $platform) { |
|
35 | 35 | $xmlFragment .= " |
36 | 36 | <platform> |
37 | 37 | <platform_name>$platform->name</platform_name> |
@@ -86,11 +86,11 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | if ($disable_account_creation || defined('INVITE_CODES')) { |
89 | - echo " <account_creation_disabled/>\n"; |
|
89 | + echo " <account_creation_disabled/>\n"; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | if (defined('INVITE_CODES')) { |
93 | - echo " <invite_code_required/>\n"; |
|
93 | + echo " <invite_code_required/>\n"; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | echo " <min_passwd_length>$min_passwd_length</min_passwd_length>\n"; |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | // the terms_of_use.txt file in the project base directory. |
114 | 114 | // |
115 | 115 | if (defined('TERMSOFUSE_FILE')) { |
116 | - $tou_file = TERMSOFUSE_FILE; |
|
116 | + $tou_file = TERMSOFUSE_FILE; |
|
117 | 117 | } else { |
118 | - $tou_file = "../../terms_of_use.txt"; |
|
118 | + $tou_file = "../../terms_of_use.txt"; |
|
119 | 119 | } |
120 | 120 | if (file_exists($tou_file)) { |
121 | 121 | $terms_of_use = trim(file_get_contents($tou_file)); |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | // |
31 | 31 | function show_platforms() { |
32 | 32 | $xmlFragment = unserialize(get_cached_data(3600, "project_config_platform_xml")); |
33 | - if ($xmlFragment==false){ |
|
33 | + if ($xmlFragment == false) { |
|
34 | 34 | $platforms = BoincDB::get()->enum_fields("platform, DBNAME.app_version, DBNAME.app", "BoincPlatform", "platform.name, platform.user_friendly_name, plan_class", "app_version.platformid = platform.id and app_version.appid = app.id and app_version.deprecated=0 and app.deprecated=0 group by platform.name, plan_class", ""); |
35 | 35 | $xmlFragment = " <platforms>"; |
36 | - foreach ($platforms as $platform){ |
|
36 | + foreach ($platforms as $platform) { |
|
37 | 37 | $xmlFragment .= " |
38 | 38 | <platform> |
39 | 39 | <platform_name>$platform->name</platform_name> |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | if (defined('TERMSOFUSE_FILE')) { |
116 | 116 | $tou_file = TERMSOFUSE_FILE; |
117 | 117 | } else { |
118 | - $tou_file = "../../terms_of_use.txt"; |
|
118 | + $tou_file = "../../terms_of_use.txt"; |
|
119 | 119 | } |
120 | 120 | if (file_exists($tou_file)) { |
121 | 121 | $terms_of_use = trim(file_get_contents($tou_file)); |