@@ -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 | ?> |
@@ -148,6 +148,6 @@ |
||
148 | 148 | |
149 | 149 | page_tail(); |
150 | 150 | |
151 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
151 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
152 | 152 | |
153 | 153 | ?> |
@@ -141,7 +141,7 @@ |
||
141 | 141 | global $special_user_bitfield; |
142 | 142 | $Nbf = sizeof($special_user_bitfield); |
143 | 143 | |
144 | - admin_page_head("Management $user->name"); |
|
144 | + admin_page_head("management $user->name"); |
|
145 | 145 | |
146 | 146 | if (!defined("POST_REPORT_EMAILS")) { |
147 | 147 | echo "<p><font color='RED'> |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | |
40 | 40 | // Delete a user if they have no credit, results, or posts |
41 | 41 | // |
42 | -function possibly_delete_user($user){ |
|
43 | - if ($user->total_credit > 0.0){ |
|
42 | +function possibly_delete_user($user) { |
|
43 | + if ($user->total_credit > 0.0) { |
|
44 | 44 | admin_error_page("Cannot delete user: User has credit."); |
45 | 45 | } |
46 | 46 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | admin_error_page("Cannot delete user: User has forum posts."); |
57 | 57 | } |
58 | 58 | |
59 | - if ($user->teamid){ |
|
59 | + if ($user->teamid) { |
|
60 | 60 | user_quit_team($user); |
61 | 61 | } |
62 | 62 | delete_user($user); |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | function handle_special_user($user) { |
68 | 68 | global $special_user_bitfield; |
69 | 69 | $Nbf = sizeof($special_user_bitfield); |
70 | - $bits=""; |
|
71 | - for ($i=0; $i<$Nbf; $i++) { |
|
70 | + $bits = ""; |
|
71 | + for ($i = 0; $i < $Nbf; $i++) { |
|
72 | 72 | $key = "special_user_$i"; |
73 | 73 | if (array_key_exists($key, $_POST) && $_POST[$key]) { |
74 | 74 | $bits .= "1"; |
@@ -94,35 +94,35 @@ discard block |
||
94 | 94 | ); |
95 | 95 | } else { |
96 | 96 | if (is_numeric($dt)) { |
97 | - $t = $dt>0 ? time()+$dt : 0; |
|
97 | + $t = $dt > 0 ? time() + $dt : 0; |
|
98 | 98 | $q = "UPDATE forum_preferences SET banished_until=$t WHERE userid=$user->id"; |
99 | 99 | _mysql_query($q); |
100 | 100 | |
101 | 101 | // put a timestamp in wiki to trigger re-validation of credentials |
102 | 102 | |
103 | - if (function_exists('touch_wiki_user')){ |
|
103 | + if (function_exists('touch_wiki_user')) { |
|
104 | 104 | touch_wiki_user($user); |
105 | 105 | } |
106 | 106 | |
107 | 107 | // Send suspension e-mail to user and administrators |
108 | 108 | |
109 | - if ($dt>0) { |
|
110 | - $subject = PROJECT." posting privileges suspended for ". $user->name; |
|
109 | + if ($dt > 0) { |
|
110 | + $subject = PROJECT." posting privileges suspended for ".$user->name; |
|
111 | 111 | $body = " |
112 | -Forum posting privileges for the " .PROJECT. " user \"".$user->name."\" |
|
113 | -have been suspended for " .time_diff($dt). " by ".$g_logged_in_user->name.". |
|
112 | +Forum posting privileges for the " .PROJECT." user \"".$user->name."\" |
|
113 | +have been suspended for " .time_diff($dt)." by ".$g_logged_in_user->name.". |
|
114 | 114 | The reason given was: |
115 | 115 | |
116 | 116 | $reason |
117 | 117 | |
118 | -The suspension will end at " .time_str($t)."\n"; |
|
118 | +The suspension will end at ".time_str($t)."\n"; |
|
119 | 119 | } else { |
120 | - $subject = PROJECT." user ". $user->name. " unsuspended"; |
|
120 | + $subject = PROJECT." user ".$user->name." unsuspended"; |
|
121 | 121 | $body = " |
122 | -Forum posting privileges for the " .PROJECT. " user \"".$user->name."\" |
|
122 | +Forum posting privileges for the " .PROJECT." user \"".$user->name."\" |
|
123 | 123 | have been restored by ".$g_logged_in_user->name."\n"; |
124 | 124 | if ($reason) { |
125 | - $body.="The reason given was:\n\n $reason\n"; |
|
125 | + $body .= "The reason given was:\n\n $reason\n"; |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
@@ -186,13 +186,13 @@ discard block |
||
186 | 186 | row1("Special User Status"); |
187 | 187 | |
188 | 188 | echo "<tr>\n"; |
189 | - for ($i=0; $i<$Nbf; $i++) { |
|
189 | + for ($i = 0; $i < $Nbf; $i++) { |
|
190 | 190 | $bit = substr($user->prefs->special_user, $i, 1); |
191 | 191 | echo "<tr><td><input type='checkbox'' name='special_user_".$i."' value='1'"; |
192 | 192 | if ($bit == 1) { |
193 | 193 | echo " checked='checked'"; |
194 | 194 | } |
195 | - echo ">". $special_user_bitfield[$i] ."</td></tr>\n"; |
|
195 | + echo ">".$special_user_bitfield[$i]."</td></tr>\n"; |
|
196 | 196 | } |
197 | 197 | echo "</tr>"; |
198 | 198 | |
@@ -217,10 +217,10 @@ discard block |
||
217 | 217 | if ($user->prefs->banished_until) { |
218 | 218 | $dt = $user->prefs->banished_until - time(); |
219 | 219 | if ($dt > 0) { |
220 | - $x = " Suspended until " . time_str($user->prefs->banished_until) |
|
221 | - ."<br/> (Expires in " . time_diff($dt) .")" ; |
|
220 | + $x = " Suspended until ".time_str($user->prefs->banished_until) |
|
221 | + ."<br/> (Expires in ".time_diff($dt).")"; |
|
222 | 222 | } else { |
223 | - $x = " last suspended " . time_str($user->prefs->banished_until); |
|
223 | + $x = " last suspended ".time_str($user->prefs->banished_until); |
|
224 | 224 | } |
225 | 225 | row1($x); |
226 | 226 | } else { |
@@ -238,11 +238,11 @@ discard block |
||
238 | 238 | "; |
239 | 239 | echo " |
240 | 240 | <input type='radio' name='suspend_for' value='172800'> 48 hours <br/> |
241 | - <input type='radio' name='suspend_for' value='",86400*7,"'> 1 week <br/> |
|
242 | - <input type='radio' name='suspend_for' value='",86400*14,"'> 2 weeks <br/> |
|
241 | + <input type='radio' name='suspend_for' value='",86400*7, "'> 1 week <br/> |
|
242 | + <input type='radio' name='suspend_for' value='",86400*14, "'> 2 weeks <br/> |
|
243 | 243 | "; |
244 | 244 | |
245 | - if ($dt>0) { |
|
245 | + if ($dt > 0) { |
|
246 | 246 | echo " |
247 | 247 | <input type='radio' name='suspend_for' value='-1'> <b>unsuspend</b> <br/>"; |
248 | 248 | } |
@@ -306,6 +306,6 @@ discard block |
||
306 | 306 | |
307 | 307 | show_manage_user_form($user); |
308 | 308 | |
309 | -$cvs_version_tracker[]= //Generated automatically - do not edit |
|
309 | +$cvs_version_tracker[] = //Generated automatically - do not edit |
|
310 | 310 | "\$Id$"; |
311 | 311 | ?> |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | |
40 | 40 | // Delete a user if they have no credit, results, or posts |
41 | 41 | // |
42 | -function possibly_delete_user($user){ |
|
43 | - if ($user->total_credit > 0.0){ |
|
42 | +function possibly_delete_user($user) { |
|
43 | + if ($user->total_credit > 0.0) { |
|
44 | 44 | admin_error_page("Cannot delete user: User has credit."); |
45 | 45 | } |
46 | 46 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | admin_error_page("Cannot delete user: User has forum posts."); |
57 | 57 | } |
58 | 58 | |
59 | - if ($user->teamid){ |
|
59 | + if ($user->teamid) { |
|
60 | 60 | user_quit_team($user); |
61 | 61 | } |
62 | 62 | delete_user($user); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | // put a timestamp in wiki to trigger re-validation of credentials |
102 | 102 | |
103 | - if (function_exists('touch_wiki_user')){ |
|
103 | + if (function_exists('touch_wiki_user')) { |
|
104 | 104 | touch_wiki_user($user); |
105 | 105 | } |
106 | 106 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | $n = post_str("fraction_done_exact", true)?1:0; |
50 | 50 | $app->update("fraction_done_exact=$n"); |
51 | 51 | |
52 | - echo "Application $id updated. |
|
52 | + echo "application $id updated. |
|
53 | 53 | <p> |
54 | 54 | You must restart the project for this to take effect. |
55 | 55 | "; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $app = BoincApp::lookup_id($id); |
26 | 26 | if (!$app) admin_error_page("no such app"); |
27 | 27 | |
28 | - $n = post_str("deprecated", true)?1:0; |
|
28 | + $n = post_str("deprecated", true) ? 1 : 0; |
|
29 | 29 | $app->update("deprecated=$n"); |
30 | 30 | |
31 | 31 | $n = post_num("weight"); |
@@ -37,16 +37,16 @@ discard block |
||
37 | 37 | $n = post_int("target_nresults"); |
38 | 38 | $app->update("target_nresults=$n"); |
39 | 39 | |
40 | - $n = post_str("homogeneous_app_version", true)?1:0; |
|
40 | + $n = post_str("homogeneous_app_version", true) ? 1 : 0; |
|
41 | 41 | $app->update("homogeneous_app_version=$n"); |
42 | 42 | |
43 | - $n = post_str("non_cpu_intensive", true)?1:0; |
|
43 | + $n = post_str("non_cpu_intensive", true) ? 1 : 0; |
|
44 | 44 | $app->update("non_cpu_intensive=$n"); |
45 | 45 | |
46 | - $n = post_str("beta", true)?1:0; |
|
46 | + $n = post_str("beta", true) ? 1 : 0; |
|
47 | 47 | $app->update("beta=$n"); |
48 | 48 | |
49 | - $n = post_str("fraction_done_exact", true)?1:0; |
|
49 | + $n = post_str("fraction_done_exact", true) ? 1 : 0; |
|
50 | 50 | $app->update("fraction_done_exact=$n"); |
51 | 51 | |
52 | 52 | echo "Application $id updated. |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | function add_app() { |
59 | 59 | $name = BoincDb::escape_string(post_str('add_name')); |
60 | 60 | $user_friendly_name = BoincDb::escape_string(post_str('add_user_friendly_name')); |
61 | - if (empty($name) || empty($user_friendly_name) ) { |
|
61 | + if (empty($name) || empty($user_friendly_name)) { |
|
62 | 62 | admin_error_page( |
63 | 63 | "To add a new application please supply both a brief name and a longer 'user-friendly' name.</font></p>" |
64 | 64 | ); |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | <h2>Edit applications</h2> |
82 | 82 | "; |
83 | 83 | |
84 | - $app_clause="deprecated=0"; |
|
85 | - $action_url="manage_apps.php"; |
|
86 | - if($all) { |
|
84 | + $app_clause = "deprecated=0"; |
|
85 | + $action_url = "manage_apps.php"; |
|
86 | + if ($all) { |
|
87 | 87 | $app_clause = ""; |
88 | - $action_url="manage_apps.php?all=1"; |
|
88 | + $action_url = "manage_apps.php?all=1"; |
|
89 | 89 | echo "<a href=\"manage_apps.php\">Don't show deprecated applications</a>"; |
90 | 90 | } else { |
91 | 91 | echo "<a href=\"manage_apps.php?all=1\">Show deprecated applications</a>"; |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | $apps = BoincApp::enum($app_clause); |
118 | 118 | foreach ($apps as $app) { |
119 | 119 | // grey-out deprecated versions |
120 | - $f1=$f2=''; |
|
121 | - if ($app->deprecated==1) { |
|
120 | + $f1 = $f2 = ''; |
|
121 | + if ($app->deprecated == 1) { |
|
122 | 122 | $f1 = "<font color='GREY'>"; |
123 | 123 | $f2 = "</font>"; |
124 | 124 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | echo " <TD align='left'>$f1<a href=app_details.php?appid=$app->id>$app->name</a><br> $app->user_friendly_name $f2</TD>\n"; |
130 | 130 | |
131 | - echo " <TD align='center'>$f1 " .date_str($app->create_time)."$f2</TD>\n"; |
|
131 | + echo " <TD align='center'>$f1 ".date_str($app->create_time)."$f2</TD>\n"; |
|
132 | 132 | |
133 | 133 | $v = $app->weight; |
134 | 134 | echo " <TD align='center'> |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | "; |
152 | 152 | |
153 | 153 | $v = ''; |
154 | - if ($app->homogeneous_app_version) $v=' CHECKED '; |
|
154 | + if ($app->homogeneous_app_version) $v = ' CHECKED '; |
|
155 | 155 | echo " <TD align='center'> |
156 | 156 | <input name='homogeneous_app_version' type='checkbox' $v></TD> |
157 | 157 | "; |
@@ -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, |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | $preview = post_str("preview", true); |
57 | 57 | $warning = null; |
58 | 58 | |
59 | -if ($content && $title && (!$preview)){ |
|
60 | - if (post_str('add_signature', true) == "add_it"){ |
|
61 | - $add_signature = true; // set a flag and concatenate later |
|
62 | - } else { |
|
59 | +if ($content && $title && (!$preview)) { |
|
60 | + if (post_str('add_signature', true) == "add_it") { |
|
61 | + $add_signature = true; // set a flag and concatenate later |
|
62 | + } else { |
|
63 | 63 | $add_signature = false; |
64 | 64 | } |
65 | 65 | check_tokens($logged_in_user->authenticator); |
@@ -71,14 +71,14 @@ discard block |
||
71 | 71 | $title, $content, $logged_in_user, $forum, $add_signature, $export |
72 | 72 | ); |
73 | 73 | if ($thread) { |
74 | - header('Location: forum_thread.php?id=' . $thread->id); |
|
74 | + header('Location: forum_thread.php?id='.$thread->id); |
|
75 | 75 | } else { |
76 | 76 | error_page("Can't create thread. $forum_error"); |
77 | 77 | } |
78 | 78 | } |
79 | 79 | } |
80 | 80 | |
81 | -page_head(tra("Create new thread"),'','','', $bbcode_js); |
|
81 | +page_head(tra("Create new thread"), '', '', '', $bbcode_js); |
|
82 | 82 | show_forum_header($logged_in_user); |
83 | 83 | |
84 | 84 | if ($warning) { |
@@ -119,12 +119,12 @@ discard block |
||
119 | 119 | $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>"; |
120 | 120 | } |
121 | 121 | |
122 | -if ($force_title && $title){ |
|
122 | +if ($force_title && $title) { |
|
123 | 123 | row2(tra("Title"), htmlspecialchars($title)."<input type=\"hidden\" name=\"title\" value=\"".htmlspecialchars($title)."\">"); |
124 | 124 | } else { |
125 | 125 | row2(tra("Title").$submit_help, |
126 | 126 | sprintf('<input type="text" class="form-control" name="title" value="%s">', |
127 | - $title?htmlspecialchars($title):'' |
|
127 | + $title ?htmlspecialchars($title) : '' |
|
128 | 128 | ) |
129 | 129 | ); |
130 | 130 | } |
@@ -134,14 +134,14 @@ discard block |
||
134 | 134 | echo $bbcode_html; |
135 | 135 | end_table(); |
136 | 136 | echo sprintf('<textarea class="form-control" name="content" rows="12" cols="80">%s</textarea>', |
137 | - $content?htmlspecialchars($content):'' |
|
137 | + $content ?htmlspecialchars($content) : '' |
|
138 | 138 | ); |
139 | 139 | echo "</td></tr>"; |
140 | 140 | |
141 | 141 | if (!$logged_in_user->prefs->no_signature_by_default) { |
142 | - $enable_signature="checked=\"true\""; |
|
142 | + $enable_signature = "checked=\"true\""; |
|
143 | 143 | } else { |
144 | - $enable_signature=""; |
|
144 | + $enable_signature = ""; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | if (is_news_forum($forum)) { |
@@ -157,5 +157,5 @@ discard block |
||
157 | 157 | |
158 | 158 | page_tail(); |
159 | 159 | |
160 | -$cvs_version_tracker[]="\$Id$"; |
|
160 | +$cvs_version_tracker[] = "\$Id$"; |
|
161 | 161 | ?> |
@@ -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; |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $avg = round($app->info->avg, 2); |
181 | 181 | $min = round($app->info->min, 2); |
182 | 182 | $max = round($app->info->max, 2); |
183 | - $x = $max?"$avg ($min - $max)":"---"; |
|
183 | + $x = $max ? "$avg ($min - $max)" : "---"; |
|
184 | 184 | $u = $app->info->users; |
185 | 185 | } else { |
186 | 186 | $x = '---'; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $cmd = trim($cmd); |
274 | 274 | $x = explode(" ", $cmd); |
275 | 275 | $prog = $x[0]; |
276 | - $pidname = $prog . '.pid'; |
|
276 | + $pidname = $prog.'.pid'; |
|
277 | 277 | } |
278 | 278 | $path = "../../pid_$host/$pidname"; |
279 | 279 | if (is_file($path)) { |
@@ -314,12 +314,12 @@ discard block |
||
314 | 314 | } |
315 | 315 | $master_host = $u["host"]; |
316 | 316 | if ($config->www_host) { |
317 | - $web_host = trim((string) $config->www_host); |
|
317 | + $web_host = trim((string)$config->www_host); |
|
318 | 318 | } else { |
319 | 319 | $web_host = $main_host; |
320 | 320 | } |
321 | 321 | if ($config->sched_host) { |
322 | - $sched_host = trim((string) $config->sched_host); |
|
322 | + $sched_host = trim((string)$config->sched_host); |
|
323 | 323 | } else { |
324 | 324 | $sched_host = $main_host; |
325 | 325 | } |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | |
330 | 330 | // the upload and download servers are sort of daemons too |
331 | 331 | // |
332 | - $url = trim((string) $config->download_url); |
|
332 | + $url = trim((string)$config->download_url); |
|
333 | 333 | $u = parse_url($url); |
334 | 334 | $h = $u["host"]; |
335 | 335 | if ($h == $master_host) { |
@@ -341,14 +341,14 @@ discard block |
||
341 | 341 | } else { |
342 | 342 | $have_remote = true; |
343 | 343 | } |
344 | - $url = trim((string) $config->upload_url); |
|
344 | + $url = trim((string)$config->upload_url); |
|
345 | 345 | $u = parse_url($url); |
346 | 346 | $h = $u["host"]; |
347 | 347 | if ($h == $master_host) { |
348 | 348 | $y = new StdClass; |
349 | 349 | $y->cmd = "Upload server"; |
350 | 350 | $y->host = $h; |
351 | - $y->status = !file_exists("../../stop_upload");; |
|
351 | + $y->status = !file_exists("../../stop_upload"); ; |
|
352 | 352 | $local_daemons[] = $y; |
353 | 353 | } else { |
354 | 354 | $have_remote = true; |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | $y = new StdClass; |
361 | 361 | $y->cmd = "Scheduler"; |
362 | 362 | $y->host = $sched_host; |
363 | - $y->status = !file_exists("../../stop_sched");; |
|
363 | + $y->status = !file_exists("../../stop_sched"); ; |
|
364 | 364 | $local_daemons[] = $y; |
365 | 365 | } else { |
366 | 366 | $have_remote = true; |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | $disabled_daemons[] = $x; |
377 | 377 | continue; |
378 | 378 | } |
379 | - $host = $d->host?(string)$d->host:$main_host; |
|
379 | + $host = $d->host ? (string)$d->host : $main_host; |
|
380 | 380 | if ($host != $web_host) { |
381 | 381 | $have_remote = true; |
382 | 382 | 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 | } |
@@ -365,11 +365,11 @@ discard block |
||
365 | 365 | function progress_bar($batch, $wus, $width) { |
366 | 366 | $w_success = $width*$batch->fraction_done; |
367 | 367 | $w_fail = $width*$batch->nerror_jobs/$batch->njobs; |
368 | - $nsuccess = $batch->njobs * $batch->fraction_done; |
|
368 | + $nsuccess = $batch->njobs*$batch->fraction_done; |
|
369 | 369 | $nsent = wus_nsent($wus); |
370 | 370 | $nprog = $nsent - $nsuccess - $batch->nerror_jobs; |
371 | 371 | $w_prog = $width*$nprog/$batch->njobs; |
372 | - $nunsent = $batch->njobs-$nsent; |
|
372 | + $nunsent = $batch->njobs - $nsent; |
|
373 | 373 | $w_unsent = $width*$nunsent/$batch->njobs; |
374 | 374 | $x = '<table height=20><tr>'; |
375 | 375 | if ($w_fail) { |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | page_head("Batch $batch_id"); |
408 | 408 | start_table(); |
409 | 409 | row2("name", $batch->name); |
410 | - row2("application", $app?$app->name:'---'); |
|
410 | + row2("application", $app ? $app->name : '---'); |
|
411 | 411 | row2("state", batch_state_string($batch->state)); |
412 | 412 | //row2("# jobs", $batch->njobs); |
413 | 413 | //row2("# error jobs", $batch->nerror_jobs); |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | "Canonical instance<br><small>click to see result page on BOINC server</smallp>", |
455 | 455 | "Download Results" |
456 | 456 | ); |
457 | - foreach($wus as $wu) { |
|
457 | + foreach ($wus as $wu) { |
|
458 | 458 | $resultid = $wu->canonical_resultid; |
459 | 459 | if ($resultid) { |
460 | 460 | $x = "<a href=result.php?resultid=$resultid>$resultid</a>"; |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | $text = "---"; |
466 | 466 | if ($batch->state == BATCH_STATE_COMPLETE) { |
467 | 467 | $y = '<font color="red">failed</font>'; |
468 | - } else { |
|
468 | + } else { |
|
469 | 469 | $y = "in progress"; |
470 | 470 | } |
471 | 471 | } |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | $results = BoincResult::enum("workunitid=$wuid"); |
531 | 531 | $upload_dir = parse_config(get_config(), "<upload_dir>"); |
532 | 532 | $fanout = parse_config(get_config(), "<uldl_dir_fanout>"); |
533 | - foreach($results as $result) { |
|
533 | + foreach ($results as $result) { |
|
534 | 534 | echo "<tr> |
535 | 535 | <td><a href=result.php?resultid=$result->id>$result->id · $result->name </a></td> |
536 | 536 | <td>".state_string($result)."</td> |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | if ($result->server_state == 5) { |
541 | 541 | $phys_names = get_outfile_names($result); |
542 | 542 | $log_names = get_outfile_log_names($result); |
543 | - for ($i=0; $i<count($phys_names); $i++) { |
|
543 | + for ($i = 0; $i < count($phys_names); $i++) { |
|
544 | 544 | $url = sprintf( |
545 | 545 | 'get_output2.php?cmd=result&result_id=%d&file_num=%d', |
546 | 546 | $result->id, $i |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | $wus = BoincWorkunit::enum("batch = $batch->id"); |
405 | 405 | $batch = get_batch_params($batch, $wus); |
406 | 406 | |
407 | - page_head("Batch $batch_id"); |
|
407 | + page_head("batch $batch_id"); |
|
408 | 408 | start_table(); |
409 | 409 | row2("name", $batch->name); |
410 | 410 | row2("application", $app?$app->name:'---'); |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $wu = BoincWorkunit::lookup_id($wuid); |
490 | 490 | if (!$wu) error_page("no such job"); |
491 | 491 | |
492 | - page_head("Job $wuid"); |
|
492 | + page_head("job $wuid"); |
|
493 | 493 | |
494 | 494 | echo " |
495 | 495 | <a href=workunit.php?wuid=$wuid>Workunit details</a> · |
@@ -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); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $parent_post_id = 0; |
54 | 54 | } |
55 | 55 | |
56 | -if ($filter != "false"){ |
|
56 | +if ($filter != "false") { |
|
57 | 57 | $filter = true; |
58 | 58 | } else { |
59 | 59 | $filter = false; |
@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | $warning = null; |
71 | -if ($content && (!$preview)){ |
|
72 | - if (post_str('add_signature',true)=="add_it"){ |
|
73 | - $add_signature=true; // set a flag and concatenate later |
|
74 | - } else { |
|
75 | - $add_signature=false; |
|
71 | +if ($content && (!$preview)) { |
|
72 | + if (post_str('add_signature', true) == "add_it") { |
|
73 | + $add_signature = true; // set a flag and concatenate later |
|
74 | + } else { |
|
75 | + $add_signature = false; |
|
76 | 76 | } |
77 | 77 | check_tokens($logged_in_user->authenticator); |
78 | 78 | if (!akismet_check($logged_in_user, $content)) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | -page_head(tra("Post to thread"),'','','', $bbcode_js); |
|
94 | +page_head(tra("Post to thread"), '', '', '', $bbcode_js); |
|
95 | 95 | |
96 | 96 | show_forum_header($logged_in_user); |
97 | 97 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $x1 = tra("Message:").bbcode_info().post_warning(); |
146 | 146 | $x2 = ""; |
147 | 147 | if ($parent_post) { |
148 | - $x2 .=" ".tra("reply to %1 Message ID %2:", "<a href=#".$parent_post->id.">", " ".$parent_post->id."</a>"); |
|
148 | + $x2 .= " ".tra("reply to %1 Message ID %2:", "<a href=#".$parent_post->id.">", " ".$parent_post->id."</a>"); |
|
149 | 149 | } |
150 | 150 | $x2 .= "<form action=forum_reply.php?thread=".$thread->id; |
151 | 151 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $x2 .= " method=\"post\" name=\"post\" onsubmit=\"return checkForm(this)\">\n"; |
157 | 157 | $x2 .= form_tokens($logged_in_user->authenticator); |
158 | 158 | $x2 .= start_table_str().$bbcode_html.end_table_str()."<textarea class=\"form-control\" name=\"content\" rows=\"18\">"; |
159 | - $no_quote = get_int("no_quote", true)==1; |
|
159 | + $no_quote = get_int("no_quote", true) == 1; |
|
160 | 160 | if ($preview) { |
161 | 161 | $x2 .= htmlspecialchars($content); |
162 | 162 | } else if (!$no_quote) { |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | } |
166 | 166 | } |
167 | 167 | if (!$logged_in_user->prefs->no_signature_by_default) { |
168 | - $enable_signature='checked="true"'; |
|
168 | + $enable_signature = 'checked="true"'; |
|
169 | 169 | } else { |
170 | - $enable_signature=""; |
|
170 | + $enable_signature = ""; |
|
171 | 171 | } |
172 | 172 | $x2 .= sprintf('</textarea><p> </p> |
173 | 173 | <input class="btn btn-sm" %s type="submit" name="preview" value="%s"> |
@@ -187,9 +187,9 @@ discard block |
||
187 | 187 | } |
188 | 188 | |
189 | 189 | function quote_text($text) { |
190 | - $text = "[quote]" . $text . "[/quote]"; |
|
190 | + $text = "[quote]".$text."[/quote]"; |
|
191 | 191 | return $text; |
192 | 192 | } |
193 | 193 | |
194 | -$cvs_version_tracker[]="\$Id$"; |
|
194 | +$cvs_version_tracker[] = "\$Id$"; |
|
195 | 195 | ?> |