@@ -43,10 +43,10 @@ |
||
43 | 43 | credit_to_ops($credit, $ops, $unit); |
44 | 44 | |
45 | 45 | if ($bolden) { |
46 | - $lbold="[["; |
|
47 | - $rbold="]]"; |
|
46 | + $lbold = "[["; |
|
47 | + $rbold = "]]"; |
|
48 | 48 | } else { |
49 | - $lbold=""; $rbold=""; |
|
49 | + $lbold = ""; $rbold = ""; |
|
50 | 50 | } |
51 | 51 | return " $lbold$cobbs Cobblestones$rbold of computation ($ops $unit floating-point operations)"; |
52 | 52 | } |
@@ -11,10 +11,10 @@ |
||
11 | 11 | |
12 | 12 | spl_autoload_register(function ($class) { |
13 | 13 | if (substr($class, 0, 10) !== 'ReCaptcha\\') { |
14 | - /* If the class does not lie under the "ReCaptcha" namespace, |
|
14 | + /* If the class does not lie under the "ReCaptcha" namespace, |
|
15 | 15 | * then we can exit immediately. |
16 | 16 | */ |
17 | - return; |
|
17 | + return; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /* All of the classes have names like "ReCaptcha\Foo", so we need |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * classes. |
10 | 10 | */ |
11 | 11 | |
12 | -spl_autoload_register(function ($class) { |
|
12 | +spl_autoload_register(function($class) { |
|
13 | 13 | if (substr($class, 0, 10) !== 'ReCaptcha\\') { |
14 | 14 | /* If the class does not lie under the "ReCaptcha" namespace, |
15 | 15 | * then we can exit immediately. |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | require_once('../inc/sanitize_html.inc'); |
21 | 21 | |
22 | -function image_as_bb($text){ |
|
22 | +function image_as_bb($text) { |
|
23 | 23 | // This function depends on sanitized HTML |
24 | 24 | |
25 | 25 | $pattern = '@<img(.*) src=\"([^>^"]+)\"([^>]*)>@si'; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | return $text; |
34 | 34 | } |
35 | 35 | |
36 | -function link_as_bb($text){ |
|
36 | +function link_as_bb($text) { |
|
37 | 37 | /* This function depends on sanitized HTML */ |
38 | 38 | // Build some regex (should be a *lot* faster) |
39 | 39 | $pattern = '@<a href=\"([^>]+)\">@si'; // Gives us the URL in $1... |
@@ -49,35 +49,35 @@ discard block |
||
49 | 49 | return $text; |
50 | 50 | } |
51 | 51 | |
52 | -function formatting_as_bb($text){ |
|
52 | +function formatting_as_bb($text) { |
|
53 | 53 | /* This function depends on sanitized HTML */ |
54 | - $in[]="<b>";$out[]="[b]"; |
|
55 | - $in[]="</b>";$out[]="[/b]"; |
|
54 | + $in[] = "<b>"; $out[] = "[b]"; |
|
55 | + $in[] = "</b>"; $out[] = "[/b]"; |
|
56 | 56 | |
57 | - $in[]="<i>";$out[]="[i]"; |
|
58 | - $in[]="</i>";$out[]="[/i]"; |
|
57 | + $in[] = "<i>"; $out[] = "[i]"; |
|
58 | + $in[] = "</i>"; $out[] = "[/i]"; |
|
59 | 59 | |
60 | - $in[]="<u>";$out[]="[u]"; |
|
61 | - $in[]="</u>";$out[]="[/u]"; |
|
60 | + $in[] = "<u>"; $out[] = "[u]"; |
|
61 | + $in[] = "</u>"; $out[] = "[/u]"; |
|
62 | 62 | |
63 | - $in[]="<b>";$out[]="[b]"; |
|
64 | - $in[]="</b>";$out[]="[/b]"; |
|
63 | + $in[] = "<b>"; $out[] = "[b]"; |
|
64 | + $in[] = "</b>"; $out[] = "[/b]"; |
|
65 | 65 | |
66 | - $in[]="<ul>";$out[]="[list]"; |
|
67 | - $in[]="</ul>";$out[]="[/list]"; |
|
66 | + $in[] = "<ul>"; $out[] = "[list]"; |
|
67 | + $in[] = "</ul>"; $out[] = "[/list]"; |
|
68 | 68 | |
69 | - $in[]="<ol>";$out[]="[list=1]"; |
|
70 | - $in[]="</ol>";$out[]="[/list]"; |
|
69 | + $in[] = "<ol>"; $out[] = "[list=1]"; |
|
70 | + $in[] = "</ol>"; $out[] = "[/list]"; |
|
71 | 71 | |
72 | - $in[]="<pre>";$out[]="[pre]"; |
|
73 | - $in[]="</pre>";$out[]="[/pre]"; |
|
72 | + $in[] = "<pre>"; $out[] = "[pre]"; |
|
73 | + $in[] = "</pre>"; $out[] = "[/pre]"; |
|
74 | 74 | |
75 | - $in[]="</br>";$out[]="\n"; |
|
76 | - $in[]="<br/>";$out[]="\n"; |
|
77 | - $in[]="<br>";$out[]="\n"; |
|
78 | - $in[]=">";$out[]=">"; |
|
79 | - $in[]="<";$out[]="<"; |
|
80 | - $in[]="&";$out[]="&"; |
|
75 | + $in[] = "</br>"; $out[] = "\n"; |
|
76 | + $in[] = "<br/>"; $out[] = "\n"; |
|
77 | + $in[] = "<br>"; $out[] = "\n"; |
|
78 | + $in[] = ">"; $out[] = ">"; |
|
79 | + $in[] = "<"; $out[] = "<"; |
|
80 | + $in[] = "&"; $out[] = "&"; |
|
81 | 81 | |
82 | 82 | return str_replace($in, $out, $text); |
83 | 83 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | require_once('../inc/sanitize_html.inc'); |
21 | 21 | |
22 | -function image_as_bb($text){ |
|
22 | +function image_as_bb($text) { |
|
23 | 23 | // This function depends on sanitized HTML |
24 | 24 | |
25 | 25 | $pattern = '@<img(.*) src=\"([^>^"]+)\"([^>]*)>@si'; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | return $text; |
34 | 34 | } |
35 | 35 | |
36 | -function link_as_bb($text){ |
|
36 | +function link_as_bb($text) { |
|
37 | 37 | /* This function depends on sanitized HTML */ |
38 | 38 | // Build some regex (should be a *lot* faster) |
39 | 39 | $pattern = '@<a href=\"([^>]+)\">@si'; // Gives us the URL in $1... |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return $text; |
50 | 50 | } |
51 | 51 | |
52 | -function formatting_as_bb($text){ |
|
52 | +function formatting_as_bb($text) { |
|
53 | 53 | /* This function depends on sanitized HTML */ |
54 | 54 | $in[]="<b>";$out[]="[b]"; |
55 | 55 | $in[]="</b>";$out[]="[/b]"; |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | // The following is a global var accessed by exercise functions. |
22 | 22 | // |
23 | 23 | $bolt_ex = null; |
24 | -$bolt_ex->mode = 0; // input: SHOW/SCORE/ANSWER |
|
25 | -$bolt_ex->index = 0; // input: sequence of this exercise in file |
|
26 | -$bolt_ex->score = 0; // input/output: cumulative score (if mode = SCORE) |
|
27 | -$bolt_ex->weight = 0; // input/output: cumulative weight |
|
28 | -$bolt_ex->query_string = ""; // user's response (if SCORE or ANSWER) |
|
24 | +$bolt_ex->mode = 0; // input: SHOW/SCORE/ANSWER |
|
25 | +$bolt_ex->index = 0; // input: sequence of this exercise in file |
|
26 | +$bolt_ex->score = 0; // input/output: cumulative score (if mode = SCORE) |
|
27 | +$bolt_ex->weight = 0; // input/output: cumulative weight |
|
28 | +$bolt_ex->query_string = ""; // user's response (if SCORE or ANSWER) |
|
29 | 29 | |
30 | 30 | function weight($w) { |
31 | 31 | return array('weight', $w); |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | $response = isset($$key); |
171 | 171 | $r = $choice[1]; |
172 | 172 | $correct = ($r && $response) || (!$r && !$response); |
173 | - $color = $correct?"#88ff88":"#ff8888"; |
|
174 | - table_row($c, $r?"yes":"no", |
|
175 | - array($response?"yes":"no", "bgcolor=$color") |
|
173 | + $color = $correct ? "#88ff88" : "#ff8888"; |
|
174 | + table_row($c, $r ? "yes" : "no", |
|
175 | + array($response ? "yes" : "no", "bgcolor=$color") |
|
176 | 176 | ); |
177 | 177 | $i++; |
178 | 178 | } |
@@ -215,11 +215,11 @@ discard block |
||
215 | 215 | if ($y > $rect[3]) $right = false; |
216 | 216 | $cx = $rect[0]; |
217 | 217 | $cy = $rect[2]; |
218 | - $sizex = $rect[1]-$rect[0]; |
|
219 | - $sizey = $rect[3]-$rect[2]; |
|
220 | - $ax = $x-4; |
|
221 | - $ay = $y-4; |
|
222 | - $color = $right?"green":"red"; |
|
218 | + $sizex = $rect[1] - $rect[0]; |
|
219 | + $sizey = $rect[3] - $rect[2]; |
|
220 | + $ax = $x - 4; |
|
221 | + $ay = $y - 4; |
|
222 | + $color = $right ? "green" : "red"; |
|
223 | 223 | if ($right) { |
224 | 224 | echo "The point you selected (shown in green) is correct."; |
225 | 225 | } else { |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | |
258 | 258 | class BoltFitbAnswer { |
259 | - public $type; // 0=constant, 1=regexp, 2=func |
|
259 | + public $type; // 0=constant, 1=regexp, 2=func |
|
260 | 260 | public $ans; |
261 | 261 | function __construct($type, $ans) { |
262 | 262 | $this->type = $type; |
@@ -358,10 +358,10 @@ |
||
358 | 358 | $db = BoincDb::get(); |
359 | 359 | return $db->enum('result', 'BoincResult', $where_clause); |
360 | 360 | } |
361 | - static function enum_fields($fields, $where_clause, $order_clause) { |
|
361 | + static function enum_fields($fields, $where_clause, $order_clause) { |
|
362 | 362 | $db = BoincDb::get(); |
363 | - return $db->enum_fields('result', 'BoincResult', $fields, $where_clause, $order_clause); |
|
364 | - } |
|
363 | + return $db->enum_fields('result', 'BoincResult', $fields, $where_clause, $order_clause); |
|
364 | + } |
|
365 | 365 | function update($clause) { |
366 | 366 | $db = BoincDb::get(); |
367 | 367 | return $db->update($this, 'result', $clause); |
@@ -208,11 +208,11 @@ discard block |
||
208 | 208 | $db = BoincDb::get(); |
209 | 209 | return $db->update($this, 'user', $clause); |
210 | 210 | } |
211 | - static function enum($where_clause, $order_clause=null) { |
|
211 | + static function enum($where_clause, $order_clause = null) { |
|
212 | 212 | $db = BoincDb::get(); |
213 | 213 | return $db->enum('user', 'BoincUser', $where_clause, $order_clause); |
214 | 214 | } |
215 | - static function enum_fields($fields, $where_clause, $order_clause=null) { |
|
215 | + static function enum_fields($fields, $where_clause, $order_clause = null) { |
|
216 | 216 | $db = BoincDb::get(); |
217 | 217 | return $db->enum_fields( |
218 | 218 | 'user', 'BoincUser', $fields, $where_clause, $order_clause |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | $db = BoincDb::get(); |
262 | 262 | return $db->update($this, 'team', $clause); |
263 | 263 | } |
264 | - static function enum($where_clause, $order_clause=null) { |
|
264 | + static function enum($where_clause, $order_clause = null) { |
|
265 | 265 | $db = BoincDb::get(); |
266 | 266 | return $db->enum('team', 'BoincTeam', $where_clause, $order_clause); |
267 | 267 | } |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | $db = BoincDb::get(); |
287 | 287 | return $db->max('team', $field); |
288 | 288 | } |
289 | - static function enum_fields($fields, $where_clause, $order_clause=null) { |
|
289 | + static function enum_fields($fields, $where_clause, $order_clause = null) { |
|
290 | 290 | $db = BoincDb::get(); |
291 | 291 | return $db->enum_fields( |
292 | 292 | 'team', 'BoincTeam', $fields, $where_clause, $order_clause |
@@ -322,11 +322,11 @@ discard block |
||
322 | 322 | $db = BoincDb::get(); |
323 | 323 | return $db->delete($this, 'host'); |
324 | 324 | } |
325 | - static function enum($where_clause, $order_clause=null) { |
|
325 | + static function enum($where_clause, $order_clause = null) { |
|
326 | 326 | $db = BoincDb::get(); |
327 | 327 | return $db->enum('host', 'BoincHost', $where_clause, $order_clause); |
328 | 328 | } |
329 | - static function enum_fields($fields, $where_clause, $order_clause=null) { |
|
329 | + static function enum_fields($fields, $where_clause, $order_clause = null) { |
|
330 | 330 | $db = BoincDb::get(); |
331 | 331 | return $db->enum_fields( |
332 | 332 | 'host', 'BoincHost', $fields, $where_clause, $order_clause |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | $db = BoincDb::get(); |
446 | 446 | return $db->update($this, 'app', $clause); |
447 | 447 | } |
448 | - static function sum($field, $clause=null) { |
|
448 | + static function sum($field, $clause = null) { |
|
449 | 449 | $db = BoincDb::get(); |
450 | 450 | return $db->sum('app', $field, $clause); |
451 | 451 | } |
@@ -501,11 +501,11 @@ discard block |
||
501 | 501 | $db = BoincDb::get(); |
502 | 502 | return $db->insert('profile', $clause); |
503 | 503 | } |
504 | - static function enum($where_clause=null, $order_clause=null) { |
|
504 | + static function enum($where_clause = null, $order_clause = null) { |
|
505 | 505 | $db = BoincDb::get(); |
506 | 506 | return $db->enum('profile', 'BoincProfile', $where_clause, $order_clause); |
507 | 507 | } |
508 | - static function enum_fields($fields, $where_clause=null, $order_clause=null) { |
|
508 | + static function enum_fields($fields, $where_clause = null, $order_clause = null) { |
|
509 | 509 | $db = BoincDb::get(); |
510 | 510 | return $db->enum_fields('profile', 'BoincProfile', $fields, $where_clause, $order_clause); |
511 | 511 | } |
@@ -889,12 +889,12 @@ discard block |
||
889 | 889 | return $db->enum('consent', 'BoincConsent', $where_clause); |
890 | 890 | } |
891 | 891 | |
892 | - static function insert ($clause) { |
|
892 | + static function insert($clause) { |
|
893 | 893 | $db = BoincDb::get(); |
894 | 894 | return $db->insert('consent', $clause); |
895 | 895 | } |
896 | 896 | |
897 | - static function update ($clause) { |
|
897 | + static function update($clause) { |
|
898 | 898 | $db = BoincDb::get(); |
899 | 899 | return $db->update_aux('consent', $clause); |
900 | 900 | } |
@@ -918,17 +918,17 @@ discard block |
||
918 | 918 | return $db->lookup('consent_type', 'BoincConsentType', $clause); |
919 | 919 | } |
920 | 920 | |
921 | - static function enum($where_clause, $order_clause=null) { |
|
921 | + static function enum($where_clause, $order_clause = null) { |
|
922 | 922 | $db = BoincDb::get(); |
923 | 923 | return $db->enum('consent_type', 'BoincConsentType', $where_clause, $order_clause); |
924 | 924 | } |
925 | 925 | |
926 | - static function insert ($clause) { |
|
926 | + static function insert($clause) { |
|
927 | 927 | $db = BoincDb::get(); |
928 | 928 | return $db->insert('consent_type', $clause); |
929 | 929 | } |
930 | 930 | |
931 | - static function update ($clause) { |
|
931 | + static function update($clause) { |
|
932 | 932 | $db = BoincDb::get(); |
933 | 933 | return $db->update_aux('consent_type', $clause); |
934 | 934 | } |
@@ -953,7 +953,7 @@ discard block |
||
953 | 953 | return $db->lookup('latest_consent', 'BoincLatestConsent', $clause); |
954 | 954 | } |
955 | 955 | |
956 | - static function enum($where_clause, $order_clause=null) { |
|
956 | + static function enum($where_clause, $order_clause = null) { |
|
957 | 957 | $db = BoincDb::get(); |
958 | 958 | return $db->enum('latest_consent', 'BoincLatestConsent', $where_clause, $order_clause); |
959 | 959 | } |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | // apply this to any user-supplied strings used in queries |
965 | 965 | // |
966 | 966 | function boinc_real_escape_string($x) { |
967 | - if (version_compare(phpversion(),"4.3.0")>=0) { |
|
967 | + if (version_compare(phpversion(), "4.3.0") >= 0) { |
|
968 | 968 | return BoincDb::escape_string($x); |
969 | 969 | } else { |
970 | 970 | $x = str_replace("'", "\'", $x); |
@@ -191,7 +191,7 @@ |
||
191 | 191 | $min_credit = parse_config(get_config(), "<profile_min_credit>"); |
192 | 192 | if (!$logged_in_user && $min_credit && $user->expavg_credit < $min_credit ) { |
193 | 193 | error_page( |
194 | - tra("To prevent spam, profiles of users with an average credit of less than %1 are displayed only to logged-in users. We apologize for this inconvenience.", $min_credit) |
|
194 | + tra("To prevent spam, profiles of users with an average credit of less than %1 are displayed only to logged-in users. We apologize for this inconvenience.", $min_credit) |
|
195 | 195 | ); |
196 | 196 | } |
197 | 197 | if (is_banished($user)) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if (!$user->has_profile) return null; |
72 | 72 | $profile = BoincProfile::lookup("userid=$user->id"); |
73 | 73 | if (!$profile->has_picture) return null; |
74 | - if (profile_screening() && $profile->verification!=1) return null; |
|
74 | + if (profile_screening() && $profile->verification != 1) return null; |
|
75 | 75 | return profile_thumb_url($user->id); |
76 | 76 | } |
77 | 77 | |
@@ -125,18 +125,18 @@ discard block |
||
125 | 125 | return $image; |
126 | 126 | } |
127 | 127 | |
128 | - ($origWidth > $origHeight)? $scalar = ($origWidth / $targetWidth) : $scalar = ($origHeight / $targetHeight); |
|
128 | + ($origWidth > $origHeight) ? $scalar = ($origWidth/$targetWidth) : $scalar = ($origHeight/$targetHeight); |
|
129 | 129 | |
130 | 130 | if ($scalar != 0) { |
131 | - $destWidth = $origWidth / $scalar; |
|
132 | - $destHeight = $origHeight / $scalar; |
|
131 | + $destWidth = $origWidth/$scalar; |
|
132 | + $destHeight = $origHeight/$scalar; |
|
133 | 133 | } else { |
134 | 134 | $destWidth = $origWidth; |
135 | 135 | $destHeight = $origHeight; |
136 | 136 | } |
137 | 137 | |
138 | 138 | $gd_info = gd_info(); |
139 | - $newGD = (strstr($gd_info["GD Version"], "2.0")!=""); |
|
139 | + $newGD = (strstr($gd_info["GD Version"], "2.0") != ""); |
|
140 | 140 | if ($newGD) { |
141 | 141 | // If you are using a modern PHP/GD installation that does |
142 | 142 | // 'truecolor' images, this is what's needed. |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $options->htmlitems = false; |
180 | 180 | $temp = output_transform($profile->response1, $options); |
181 | 181 | $temp = sanitize_tags($temp); |
182 | - $description = "(\"" . sub_sentence($temp, ' ', MAX_DESC_LENGTH, true) . "\")"; |
|
182 | + $description = "(\"".sub_sentence($temp, ' ', MAX_DESC_LENGTH, true)."\")"; |
|
183 | 183 | |
184 | 184 | } |
185 | 185 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | |
190 | 190 | function check_whether_to_show_profile($user, $logged_in_user) { |
191 | 191 | $min_credit = parse_config(get_config(), "<profile_min_credit>"); |
192 | - if (!$logged_in_user && $min_credit && $user->expavg_credit < $min_credit ) { |
|
192 | + if (!$logged_in_user && $min_credit && $user->expavg_credit < $min_credit) { |
|
193 | 193 | error_page( |
194 | 194 | tra("To prevent spam, profiles of users with an average credit of less than %1 are displayed only to logged-in users. We apologize for this inconvenience.", $min_credit) |
195 | 195 | ); |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | // |
228 | 228 | $show_picture = $profile->has_picture; |
229 | 229 | if (profile_screening()) { |
230 | - if (!$screen_mode && !$can_edit && $profile->verification!=1) { |
|
230 | + if (!$screen_mode && !$can_edit && $profile->verification != 1) { |
|
231 | 231 | $show_picture = false; |
232 | 232 | } |
233 | 233 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | // yet verified. This will tell them if other users can't view it yet, or |
244 | 244 | // if there is a problem with it and they need to replace it. |
245 | 245 | // |
246 | - if (profile_screening() && $profile->has_picture && $can_edit && $profile->verification!=1) { |
|
246 | + if (profile_screening() && $profile->has_picture && $can_edit && $profile->verification != 1) { |
|
247 | 247 | row1(offensive_profile_warning($profile->verification)); |
248 | 248 | } |
249 | 249 | |
@@ -276,6 +276,6 @@ discard block |
||
276 | 276 | } |
277 | 277 | } |
278 | 278 | |
279 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
279 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
280 | 280 | |
281 | 281 | ?> |
@@ -46,8 +46,8 @@ |
||
46 | 46 | define('BOLT_COURSE_FINISHED', 3); |
47 | 47 | |
48 | 48 | // bits in bolt_user.flags |
49 | -define('BOLT_FLAGS_DEBUG', 1); // print debugging info in output pages |
|
50 | -define('BOLT_FLAGS_SHOW_ALL', 2); // show hidden courses |
|
49 | +define('BOLT_FLAGS_DEBUG', 1); // print debugging info in output pages |
|
50 | +define('BOLT_FLAGS_SHOW_ALL', 2); // show hidden courses |
|
51 | 51 | |
52 | 52 | class BoltDb extends DbConn { |
53 | 53 | static $instance; |
@@ -86,14 +86,14 @@ |
||
86 | 86 | function _mysql_field_attrs($r, $i) { |
87 | 87 | $x = mysqli_fetch_field_direct($r, $i); |
88 | 88 | switch ($x->type) { |
89 | - case 1: $x->type = 'tinyint'; break; |
|
90 | - case 2: $x->type = 'smallint'; break; |
|
91 | - case 3: $x->type = 'int'; break; |
|
92 | - case 5: $x->type = 'double'; break; |
|
93 | - case 7: $x->type = 'timestamp'; break; |
|
94 | - case 252: $x->type = 'blob'; break; |
|
95 | - case 253: $x->type = 'varchar'; break; |
|
96 | - case 254: $x->type = 'char'; break; |
|
89 | + case 1: $x->type = 'tinyint'; break; |
|
90 | + case 2: $x->type = 'smallint'; break; |
|
91 | + case 3: $x->type = 'int'; break; |
|
92 | + case 5: $x->type = 'double'; break; |
|
93 | + case 7: $x->type = 'timestamp'; break; |
|
94 | + case 252: $x->type = 'blob'; break; |
|
95 | + case 253: $x->type = 'varchar'; break; |
|
96 | + case 254: $x->type = 'char'; break; |
|
97 | 97 | } |
98 | 98 | return $x; |
99 | 99 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | function _mysql_connect($host, $user, $pass, $dbname) { |
44 | 44 | global $mysqli; |
45 | 45 | $x = explode(":", $host); |
46 | - if (sizeof($x)>1) { |
|
46 | + if (sizeof($x) > 1) { |
|
47 | 47 | $host = $x[0]; |
48 | 48 | $port = $x[1]; |
49 | 49 | } else { |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | } |
163 | 163 | } |
164 | 164 | |
165 | -function db_init_aux($try_replica=false) { |
|
165 | +function db_init_aux($try_replica = false) { |
|
166 | 166 | $config = get_config(); |
167 | 167 | $user = parse_config($config, "<db_user>"); |
168 | 168 | $pass = parse_config($config, "<db_passwd>"); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | echo " |
53 | 53 | <span style=\"width:".$size."px;height:".$size."px;position:absolute;top:".$cy.";left:".$cx.";color:white;border-style:solid;border-width:1px\"> |
54 | 54 | "; |
55 | - $c = $f->comment?"($f->comment)":""; |
|
55 | + $c = $f->comment ? "($f->comment)" : ""; |
|
56 | 56 | echo " |
57 | 57 | <span class=link> |
58 | 58 | <a href=\"javascript: void(0)\"> |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $features = $opaque_data->features; |
99 | 99 | $x = ""; |
100 | 100 | foreach ($features as $f) { |
101 | - $c = $f->comment?"($f->comment)":""; |
|
101 | + $c = $f->comment ? "($f->comment)" : ""; |
|
102 | 102 | $x .= "$f->type $c <br>"; |
103 | 103 | } |
104 | 104 | return $x; |