@@ -71,9 +71,9 @@ |
||
71 | 71 | "; |
72 | 72 | start_table(); |
73 | 73 | row1("User settings"); |
74 | - $x = ($flags&BOLT_FLAGS_SHOW_ALL)?"checked":""; |
|
74 | + $x = ($flags&BOLT_FLAGS_SHOW_ALL) ? "checked" : ""; |
|
75 | 75 | row2("Show hidden courses?", "<input type=checkbox name=show_all $x>"); |
76 | - $x = ($flags&BOLT_FLAGS_DEBUG)?"checked":""; |
|
76 | + $x = ($flags&BOLT_FLAGS_DEBUG) ? "checked" : ""; |
|
77 | 77 | row2("Show debugging output?", "<input type=checkbox name=debug $x>"); |
78 | 78 | row2("", "<input class=\"btn btn-primary\" type=submit name=submit value=\"Update settings\">"); |
79 | 79 | end_table(); |
@@ -21,11 +21,11 @@ |
||
21 | 21 | // TODO: document - when/why would you want to do this? |
22 | 22 | // TODO: use new DB interface |
23 | 23 | |
24 | -include_once( "../inc/db.inc" ); |
|
25 | -include_once( "../inc/util.inc" ); |
|
26 | -include_once( "../inc/db_ops.inc" ); |
|
27 | -include_once( "../inc/util_ops.inc" ); |
|
28 | -include_once( "../inc/prefs.inc" ); |
|
24 | +include_once("../inc/db.inc"); |
|
25 | +include_once("../inc/util.inc"); |
|
26 | +include_once("../inc/db_ops.inc"); |
|
27 | +include_once("../inc/util_ops.inc"); |
|
28 | +include_once("../inc/prefs.inc"); |
|
29 | 29 | |
30 | 30 | db_init(); |
31 | 31 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | echo "no app for batch $b->id\n"; |
34 | 34 | return; |
35 | 35 | } |
36 | - if ($b->fraction_done>0 && $b->credit_canonical>0) { |
|
36 | + if ($b->fraction_done > 0 && $b->credit_canonical > 0) { |
|
37 | 37 | $credit_total = $b->credit_canonical/$b->fraction_done; |
38 | 38 | $fpops_total = $credit_total*(86400e9/200); |
39 | 39 | } else { |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | start_table(); |
93 | 93 | table_header("Workunit", "Elapsed", "Proj FLOPS", "Raw credit", "granted"); |
94 | 94 | $n = 0; |
95 | - $total=0; |
|
96 | - foreach($rs as $r) { |
|
95 | + $total = 0; |
|
96 | + foreach ($rs as $r) { |
|
97 | 97 | $raw_credit = $r->elapsed_time*$r->flops_estimate*COBB_SCALE; |
98 | 98 | $n++; |
99 | 99 | $total += $raw_credit; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | function av_string($av_id) { |
119 | - if ($av_id> 0) { |
|
119 | + if ($av_id > 0) { |
|
120 | 120 | $av = BoincAppVersion::lookup($av_id); |
121 | 121 | $plat = BoincPlatform::lookup_id($av->platformid); |
122 | 122 | $x = "<a href=credit.php?av_id=$av_id>$plat->name $av->plan_class</a>"; |
@@ -44,15 +44,15 @@ |
||
44 | 44 | $start_id = 0; //Set this to something else if you like |
45 | 45 | $posts = _mysql_query("select * from post where id>$start_id order by id"); |
46 | 46 | echo _mysql_error(); |
47 | - $i=0; |
|
48 | - while ($post = _mysql_fetch_object($posts)){ |
|
47 | + $i = 0; |
|
48 | + while ($post = _mysql_fetch_object($posts)) { |
|
49 | 49 | $i++; |
50 | 50 | if ($i%100 == 0) { //For every 100 posts |
51 | - echo $post->id.". "; flush(); // print out where we are |
|
51 | + echo $post->id.". "; flush(); // print out where we are |
|
52 | 52 | //usleep(200000); |
53 | 53 | } |
54 | 54 | |
55 | - if ($post->id > $start_id){ |
|
55 | + if ($post->id > $start_id) { |
|
56 | 56 | fix_post($post); |
57 | 57 | } |
58 | 58 | } |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | row1("Current special users", '9'); |
28 | 28 | |
29 | 29 | echo "<tr><td>User</td>"; |
30 | -for ($i=0; $i<S_NFLAGS; $i++) { |
|
31 | - echo "<td width=\"15\">" . $special_user_bitfield[$i] . "</td>\n"; |
|
30 | +for ($i = 0; $i < S_NFLAGS; $i++) { |
|
31 | + echo "<td width=\"15\">".$special_user_bitfield[$i]."</td>\n"; |
|
32 | 32 | } |
33 | 33 | echo "</tr>"; |
34 | 34 | |
@@ -37,13 +37,13 @@ discard block |
||
37 | 37 | FROM forum_preferences as prefs, user |
38 | 38 | WHERE CONVERT(special_user, DECIMAL) > 0 and prefs.userid=user.id" |
39 | 39 | ); |
40 | -for ($i=1; $i<=_mysql_num_rows($result); $i++){ |
|
40 | +for ($i = 1; $i <= _mysql_num_rows($result); $i++) { |
|
41 | 41 | $foo = _mysql_fetch_object($result); |
42 | 42 | echo "<form action=\"manage_special_users_action.php\" method=\"POST\">\n"; |
43 | 43 | echo "<input type=\"hidden\" name=\"userid\" value=\"$foo->userid\" |
44 | 44 | <tr><td>$foo->name ($foo->id)</td> |
45 | 45 | "; |
46 | - for ($j=0; $j<S_NFLAGS; $j++) { |
|
46 | + for ($j = 0; $j < S_NFLAGS; $j++) { |
|
47 | 47 | $bit = substr($foo->special_user, $j, 1); |
48 | 48 | echo "<td><input type=\"checkbox\" name=\"role".$j."\" value=\"1\""; |
49 | 49 | if ($bit == 1) { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | echo "<tr><form action=\"manage_special_users_action.php\" method=\"POST\">\n"; |
59 | 59 | echo "<td>Add UserID:<input type=\"text\" name=\"userid\" size=\"6\"></td>"; |
60 | 60 | |
61 | -for ($j=0; $j<S_NFLAGS; $j++) { |
|
61 | +for ($j = 0; $j < S_NFLAGS; $j++) { |
|
62 | 62 | echo "<td><input type=\"checkbox\" name=\"role".$j."\" value=\"1\""; |
63 | 63 | echo "></td>\n"; |
64 | 64 | } |
@@ -69,5 +69,5 @@ discard block |
||
69 | 69 | |
70 | 70 | admin_page_tail(); |
71 | 71 | |
72 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
72 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
73 | 73 | ?> |
@@ -96,5 +96,5 @@ |
||
96 | 96 | "; |
97 | 97 | |
98 | 98 | admin_page_tail(); |
99 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
99 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
100 | 100 | ?> |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $apps = BoincApp::enum(""); |
154 | 154 | foreach ($apps as $app) { |
155 | 155 | if (in_array($app->id, $show_only) |
156 | - || ( in_array("all", $show_only) |
|
156 | + || (in_array("all", $show_only) |
|
157 | 157 | && (!$app->deprecated || $show_deprecated) |
158 | 158 | )) { |
159 | 159 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | <b>Results for <tt>$app->name</tt>:</b> |
162 | 162 | <ul> |
163 | 163 | "; |
164 | - for ($i=0; $i<2; $i++) { |
|
164 | + for ($i = 0; $i < 2; $i++) { |
|
165 | 165 | if ($i) { |
166 | 166 | $secs = 7*86400; |
167 | 167 | $period = " 7 days"; |
@@ -218,5 +218,5 @@ discard block |
||
218 | 218 | |
219 | 219 | admin_page_tail(); |
220 | 220 | |
221 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
221 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
222 | 222 | ?> |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | |
27 | 27 | |
28 | 28 | // Create the graph. These two calls are always required |
29 | - $graph = new Graph(350,250,"auto"); |
|
29 | + $graph = new Graph(350, 250, "auto"); |
|
30 | 30 | //$graph->SetScale("lin"); |
31 | 31 | //$graph->SetScale("textlin"); |
32 | 32 | $graph->SetScale("loglin"); |
33 | 33 | |
34 | 34 | // Create the linear plot |
35 | - $lineplot=new BarPlot($arr, $xarr); |
|
35 | + $lineplot = new BarPlot($arr, $xarr); |
|
36 | 36 | $lineplot->SetColor("blue"); |
37 | 37 | |
38 | 38 | // Add the plot to the graph |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | function show_text($xarr, $yarr) { |
46 | 46 | $n = sizeof($xarr); |
47 | - for ($i=0; $i<$n; $i++) { |
|
47 | + for ($i = 0; $i < $n; $i++) { |
|
48 | 48 | echo "<br>$xarr[$i] $yarr[$i]\n"; |
49 | 49 | } |
50 | 50 | } |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | if ($ind > $maxind) $maxind = $ind; |
91 | 91 | } |
92 | 92 | $xarr = array(); |
93 | - for ($i=0; $i<=$maxind; $i++) { |
|
93 | + for ($i = 0; $i <= $maxind; $i++) { |
|
94 | 94 | $xarr[$i] = $i; |
95 | - if (is_null($yarr[$i])) $yarr[$i]=0; |
|
95 | + if (is_null($yarr[$i])) $yarr[$i] = 0; |
|
96 | 96 | } |
97 | 97 | if ($show_text) { |
98 | 98 | show_text($xarr, $yarr); |