Passed
Push — master ( df8229...8ae080 )
by Vitalii
01:16 queued 19s
created
html/inc/uotd.inc 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
         $u->email_addr = UOTD_ADMIN_EMAIL;
99 99
         $u->name = "UOTD admin";
100 100
         send_email($u,
101
-            PROJECT . ": User of the Day pool is running low!",
101
+            PROJECT.": User of the Day pool is running low!",
102 102
             "The pool of approved candidates for User of the Day has".
103
-            " reached your assigned threshold: there are now only " . $result->num_rows . " approved users.\n\n".
103
+            " reached your assigned threshold: there are now only ".$result->num_rows." approved users.\n\n".
104 104
             "To approve more candidates for User of the Day,".
105
-            " go to the " . PROJECT . " administration page and click \"Screen user profiles\""
105
+            " go to the ".PROJECT." administration page and click \"Screen user profiles\""
106 106
         );
107 107
     }
108 108
 
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
     $profile->update("uotd_time = ".time());
148 148
 
149 149
     send_email($user,
150
-        "You're the " . PROJECT . " user of the day!",
150
+        "You're the ".PROJECT." user of the day!",
151 151
         "Congratulations!\n\nYou've been chosen as the "
152
-        . PROJECT . " user of the day!
153
-        Your profile will be featured on the " . PROJECT . " website for the next 24 hours."
152
+        . PROJECT." user of the day!
153
+        Your profile will be featured on the " . PROJECT." website for the next 24 hours."
154 154
     );
155 155
     echo "Chose user $user->id as UOTD\n";
156 156
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 // To override this with your own policy, create a similar function in
162 162
 // your own project.inc called uotd_candidates_query()
163 163
 //
164
-function default_uotd_candidates_query(){
164
+function default_uotd_candidates_query() {
165 165
     $query = "SELECT * FROM profile,user WHERE profile.userid=user.id ";
166 166
     $query .= " AND verification=1 ";
167 167
     $query .= " AND expavg_credit>1 ";
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 // get a list of profiles that have been 'approved' for UOTD,
174 174
 // using a project-specific query if supplied in project.inc
175 175
 //
176
-function count_uotd_candidates(){
177
-    $n = -1;                    // negative value returned on error
176
+function count_uotd_candidates() {
177
+    $n = -1; // negative value returned on error
178 178
     if (function_exists('uotd_candidates_query')) {
179 179
         $query = uotd_candidates_query();
180 180
     } else {
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
     
184 184
     $db = BoincDb::get();
185 185
     $result = $db->do_query($query);
186
-    if($result) {
186
+    if ($result) {
187 187
         $n = $result->num_rows;
188 188
     }
189 189
     $result->free();
@@ -195,15 +195,15 @@  discard block
 block discarded – undo
195 195
 //
196 196
 function generate_uotd_gadget($profile, $user) {
197 197
     $x = "<font size='2'>\n";
198
-    $gadget =  PROFILE_PATH."uotd_gadget.html";
199
-    if( $h = fopen($gadget, "w") ){
200
-        $age = time()-$profile->uotd_time;
198
+    $gadget = PROFILE_PATH."uotd_gadget.html";
199
+    if ($h = fopen($gadget, "w")) {
200
+        $age = time() - $profile->uotd_time;
201 201
         echo "age: $age";
202
-        if($age <= 86400+3600) { // allow for slop
202
+        if ($age <= 86400 + 3600) { // allow for slop
203 203
             $x .= uotd_thumbnail($profile, $user);
204 204
             $x .= user_links($user, BADGE_HEIGHT_MEDIUM);
205 205
             $resp = sanitize_tags(output_transform($profile->response1));
206
-            $x .= "&nbsp;&nbsp;". sub_sentence($resp, ' ', 250, true);
206
+            $x .= "&nbsp;&nbsp;".sub_sentence($resp, ' ', 250, true);
207 207
         }
208 208
         else {
209 209
             $x .= "<font color='fuscia'>
Please login to merge, or discard this patch.
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 // To override this with your own policy, create a similar function in
162 162
 // your own project.inc called uotd_candidates_query()
163 163
 //
164
-function default_uotd_candidates_query(){
164
+function default_uotd_candidates_query() {
165 165
     $query = "SELECT * FROM profile,user WHERE profile.userid=user.id ";
166 166
     $query .= " AND verification=1 ";
167 167
     $query .= " AND expavg_credit>1 ";
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 // get a list of profiles that have been 'approved' for UOTD,
174 174
 // using a project-specific query if supplied in project.inc
175 175
 //
176
-function count_uotd_candidates(){
176
+function count_uotd_candidates() {
177 177
     $n = -1;                    // negative value returned on error
178 178
     if (function_exists('uotd_candidates_query')) {
179 179
         $query = uotd_candidates_query();
@@ -196,16 +196,16 @@  discard block
 block discarded – undo
196 196
 function generate_uotd_gadget($profile, $user) {
197 197
     $x = "<font size='2'>\n";
198 198
     $gadget =  PROFILE_PATH."uotd_gadget.html";
199
-    if( $h = fopen($gadget, "w") ){
199
+    if( $h = fopen($gadget, "w") ) {
200 200
         $age = time()-$profile->uotd_time;
201 201
         echo "age: $age";
202
-        if($age <= 86400+3600) { // allow for slop
202
+        if($age <= 86400+3600) {
203
+// allow for slop
203 204
             $x .= uotd_thumbnail($profile, $user);
204 205
             $x .= user_links($user, BADGE_HEIGHT_MEDIUM);
205 206
             $resp = sanitize_tags(output_transform($profile->response1));
206 207
             $x .= "&nbsp;&nbsp;". sub_sentence($resp, ' ', 250, true);
207
-        }
208
-        else {
208
+        } else {
209 209
             $x .= "<font color='fuscia'>
210 210
                 There is no User of the Day today.
211 211
                 Only volunteers who have created a Profile
Please login to merge, or discard this patch.
html/inc/time.inc 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,21 +22,21 @@  discard block
 block discarded – undo
22 22
 function time_diff_str($t1, $t2) {
23 23
     if (!$t1 || !$t2) return "---";
24 24
     $diff = $t2 - $t1;
25
-    if ($diff<0){
26
-        $pre="In ";
27
-        $post="";
28
-        $diff=-$diff;
25
+    if ($diff < 0) {
26
+        $pre = "In ";
27
+        $post = "";
28
+        $diff = -$diff;
29 29
     } else {
30 30
         if ($diff > 86400*30) {
31 31
             return date_str($t1);
32 32
         }
33
-        $pre="";
34
-        $post=" ago";
33
+        $pre = "";
34
+        $post = " ago";
35 35
     }
36 36
     $x = "";
37 37
 
38 38
     if ($diff >= 3600*24) {
39
-        $n = (int) ($diff/(3600*24));
39
+        $n = (int)($diff/(3600*24));
40 40
         if ($n == 1) {
41 41
             $x .= "1 day ";
42 42
         } else {
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         return $pre.$x.$post;
46 46
         //$diff -= $n*3600*24;
47 47
     } elseif ($diff >= 3600) {
48
-        $n = (int) ($diff/3600);
48
+        $n = (int)($diff/3600);
49 49
         if ($n == 1) {
50 50
             $x .= "1 hour ";
51 51
         } else {
@@ -54,16 +54,16 @@  discard block
 block discarded – undo
54 54
         return $pre.$x.$post;
55 55
         //$diff -= $n*3600;
56 56
     } elseif ($diff >= 60) {
57
-        $n = (int) ($diff/60);
57
+        $n = (int)($diff/60);
58 58
         if ($n == 1) {
59 59
             $x .= "1 minute ";
60 60
         } else {
61 61
             $x .= $n." minutes ";
62 62
         }
63 63
         return $pre.$x.$post;
64
-    } elseif($diff > 1 || $diff==0) {
64
+    } elseif ($diff > 1 || $diff == 0) {
65 65
         return $pre."$diff seconds".$post;
66
-    } elseif($diff == 1){
66
+    } elseif ($diff == 1) {
67 67
         return $pre."$diff seconds".$post;
68 68
     }
69 69
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 function time_diff_str($t1, $t2) {
23 23
     if (!$t1 || !$t2) return "---";
24 24
     $diff = $t2 - $t1;
25
-    if ($diff<0){
25
+    if ($diff<0) {
26 26
         $pre="In ";
27 27
         $post="";
28 28
         $diff=-$diff;
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         return $pre.$x.$post;
64 64
     } elseif($diff > 1 || $diff==0) {
65 65
         return $pre."$diff seconds".$post;
66
-    } elseif($diff == 1){
66
+    } elseif($diff == 1) {
67 67
         return $pre."$diff seconds".$post;
68 68
     }
69 69
 }
Please login to merge, or discard this patch.
html/inc/recaptcha_loader.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
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.
Please login to merge, or discard this patch.
html/inc/bbcode_convert.inc 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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[]="&gt;";$out[]=">";
79
-    $in[]="&lt;";$out[]="<";
80
-    $in[]="&amp;";$out[]="&";
75
+    $in[] = "</br>"; $out[] = "\n";
76
+    $in[] = "<br/>"; $out[] = "\n";
77
+    $in[] = "<br>"; $out[] = "\n";
78
+    $in[] = "&gt;"; $out[] = ">";
79
+    $in[] = "&lt;"; $out[] = "<";
80
+    $in[] = "&amp;"; $out[] = "&";
81 81
 
82 82
     return str_replace($in, $out, $text);
83 83
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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]";
Please login to merge, or discard this patch.
html/inc/boinc_db.inc 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -358,10 +358,10 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
html/inc/profile.inc 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 ?>
Please login to merge, or discard this patch.
html/inc/db.inc 2 patches
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -86,14 +86,14 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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>");
Please login to merge, or discard this patch.
html/inc/wap.inc 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
     header("Expires: Thu, 01 Jan 1970 00:00:00 GMT");
24 24
 
25 25
     echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>"
26
-     . "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" "
27
-     . "\"http://www.wapforum.org/DTD/wml_1.2.xml\">"
28
-     . "<wml><card id=\"cd1\"><p>";
26
+        . "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" "
27
+        . "\"http://www.wapforum.org/DTD/wml_1.2.xml\">"
28
+        . "<wml><card id=\"cd1\"><p>";
29 29
 }
30 30
 
31 31
 function wap_end() {
@@ -33,6 +33,6 @@  discard block
 block discarded – undo
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
 ?>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,6 +33,6 @@
 block discarded – undo
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
 ?>
Please login to merge, or discard this patch.
html/inc/image.inc 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
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);
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 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);
Please login to merge, or discard this patch.