@@ -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; |
@@ -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; |
@@ -33,6 +33,6 @@ |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | function wap_timestamp() { |
36 | - return gmdate('j M Y G:i:s', time()) . " UTC"; |
|
36 | + return gmdate('j M Y G:i:s', time())." UTC"; |
|
37 | 37 | } |
38 | 38 | ?> |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | $gd_info = gd_info(); |
24 | 24 | // libgd version numbers seem to be always three numbers |
25 | 25 | preg_match('/(\d).(\d).(\d)/', $gd_info['GD Version'], $match); |
26 | - $newGD = ($match[1]>=2); |
|
26 | + $newGD = ($match[1] >= 2); |
|
27 | 27 | |
28 | 28 | list($ow, $oh, $from_type) = getimagesize($sourcefile); |
29 | - switch($from_type) { |
|
29 | + switch ($from_type) { |
|
30 | 30 | case 1: // GIF |
31 | 31 | $srcImage = imageCreateFromGif($sourcefile); |
32 | 32 | break; |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | $tempw = $fw; |
42 | 42 | $temph = number_format((($oh*$fw)/$ow), 0); |
43 | 43 | |
44 | - if($temph < $fh) { |
|
44 | + if ($temph < $fh) { |
|
45 | 45 | $tempw = number_format((($ow*$fh)/$oh), 0); |
46 | 46 | $temph = $fh; |
47 | 47 | } |
48 | 48 | |
49 | - if ($newGD){ |
|
49 | + if ($newGD) { |
|
50 | 50 | $tempImage = imageCreateTrueColor($tempw, $temph); |
51 | 51 | // Seems not to work: |
52 | 52 | // imageAntiAlias($tempImage, true); |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | |
60 | 60 | // Calculate offsets |
61 | - if($temph < $fh) { |
|
62 | - $offsety = number_format(($temph/2)-($fh/2), 0); |
|
61 | + if ($temph < $fh) { |
|
62 | + $offsety = number_format(($temph/2) - ($fh/2), 0); |
|
63 | 63 | $offsetx = 0; |
64 | 64 | } else { |
65 | 65 | $offsety = 0; |
66 | - $offsetx = number_format(($tempw/2)-($fw/2), 0); |
|
66 | + $offsetx = number_format(($tempw/2) - ($fw/2), 0); |
|
67 | 67 | } |
68 | 68 | |
69 | - if ($newGD){ |
|
69 | + if ($newGD) { |
|
70 | 70 | $destImage = imageCreateTrueColor($fw, $fh); |
71 | 71 | // Seems not to work: |
72 | 72 | // imageAntiAlias($tempImage, true); |
@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | function select_cmp($a, $b) { |
20 | 20 | if ($a->value == $b->value) return 0; |
21 | - return ($a->value < $b->value)?1:-1; |
|
21 | + return ($a->value < $b->value) ? 1 : -1; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | class BoltSelect extends BoltSet { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | function team_type_name($num) { |
39 | 39 | global $team_types; |
40 | - if ($num>0 && $num<count($team_types)) { |
|
40 | + if ($num > 0 && $num < count($team_types)) { |
|
41 | 41 | return $team_types[$num]; |
42 | 42 | } |
43 | 43 | return "None"; |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | |
54 | 54 | function team_type_num($name) { |
55 | 55 | global $team_types; |
56 | - for ($i=0; $i<sizeof($team_types); $i++) { |
|
56 | + for ($i = 0; $i < sizeof($team_types); $i++) { |
|
57 | 57 | if ($name == $team_types[$i]) return $i; |
58 | 58 | } |
59 | 59 | return 0; |
60 | 60 | } |
61 | 61 | |
62 | -function team_type_select($selected_type, $allow_none=false){ |
|
62 | +function team_type_select($selected_type, $allow_none = false) { |
|
63 | 63 | global $team_types; |
64 | 64 | |
65 | 65 | $types = $team_types; |
@@ -74,9 +74,9 @@ |
||
74 | 74 | foreach ($insts as $inst) { |
75 | 75 | $results[] = $inst->get_opaque_data(); |
76 | 76 | } |
77 | - for ($i=0; $i<$n-1; $i++) { |
|
77 | + for ($i = 0; $i < $n - 1; $i++) { |
|
78 | 78 | $r1 = $results[$i]; |
79 | - for ($j=$i+1; $j<$n; $j++) { |
|
79 | + for ($j = $i + 1; $j < $n; $j++) { |
|
80 | 80 | $r2 = $results[$j]; |
81 | 81 | if (compatible($r1, $r2)) { |
82 | 82 | $job->set_state(BOSSA_JOB_DONE); |