Passed
Push — vko_fix_manager_add_projects_w... ( 672238 )
by Vitalii
10:53
created
html/ops/manage_special_users.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     WHERE CONVERT(special_user, DECIMAL) > 0 and prefs.userid=user.id"
39 39
 );
40 40
 for ($i=1; $i<=_mysql_num_rows($result); $i++){
41
-	$foo = _mysql_fetch_object($result);
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>
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
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\"
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
html/ops/grant_credit.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 }
50 50
 
51 51
 function grant_credits_for_wu($wuid) {
52
-    $max_credit=300;
52
+    $max_credit = 300;
53 53
     $ndone = 0;
54 54
     $query_r = _mysql_query("select * from result where granted_credit=0 and claimed_credit>0 and workunitid=$wuid");
55 55
  
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
         $user    = _mysql_fetch_object($query_u);
67 67
 
68 68
         $credit = $result->claimed_credit;
69
-        if ($credit>$max_credit) {
70
-            $credit=$max_credit;
69
+        if ($credit > $max_credit) {
70
+            $credit = $max_credit;
71 71
             echo " WARNING: USER $user->name ($userid) CLAIMED $result->claimed_credit CREDITS (getting $credit)!";
72 72
         }
73 73
         $user->total_credit += $credit;
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
 }
107 107
 
108 108
 function grant_credits_for_cancelled() {
109
-    $ngranted=0;
110
-    $query_w  = _mysql_query("select * from workunit where error_mask!=0");
109
+    $ngranted = 0;
110
+    $query_w = _mysql_query("select * from workunit where error_mask!=0");
111 111
     while (($workunit = _mysql_fetch_object($query_w))) {
112 112
         // echo "Starting WU $workunit->id\n";
113 113
         $ngranted += grant_credits_for_wu($workunit->id);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
 function testquery($argstring) {
42 42
     if (0) {
43 43
         echo "WOULD DO: $argstring\n";
44
-    }
45
-    else {
44
+    } else {
46 45
         _mysql_query($argstring);
47 46
     }
48 47
     return;
Please login to merge, or discard this patch.
html/ops/news_convert.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
     $content = str_replace("\n", " ", $content);
93 93
     $content = _mysql_escape_string($content);
94 94
 
95
-    $thread_id  = BoincThread::insert("(forum, owner, title, create_time, timestamp, replies) values ($forum_id, $user->id, '$title', $when, $when, 0)");
95
+    $thread_id = BoincThread::insert("(forum, owner, title, create_time, timestamp, replies) values ($forum_id, $user->id, '$title', $when, $when, 0)");
96 96
     if (!$thread_id) {
97 97
         echo "thread insert failed\n";
98 98
         echo "title: [$title]\n";
Please login to merge, or discard this patch.
html/ops/remind.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 $globals->userid = 0;
83 83
 $globals->count = -1;
84 84
 
85
-for ($i=1; $i<$argc; $i++) {
85
+for ($i = 1; $i < $argc; $i++) {
86 86
     if ($argv[$i] == "--failed") {
87 87
         $globals->do_failed = true;
88 88
     } elseif ($argv[$i] == "--lapsed") {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         number_format($user->total_credit, 0),
190 190
         opt_out_url($user),
191 191
         $user->id,
192
-        floor ((time() - last_rpc_time($user)) / 86400),
192
+        floor((time() - last_rpc_time($user))/86400),
193 193
     );
194 194
     return preg_replace($pat, $rep, $template);
195 195
 }
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
     $result = _mysql_query($query);
241 241
     $t = 0;
242 242
     while ($r = _mysql_fetch_object($result)) {
243
-        if ($r->email_type !=2 && $r->email_type != 3) continue;
243
+        if ($r->email_type != 2 && $r->email_type != 3) continue;
244 244
         if ($r->time_sent > $t) $t = $r->time_sent;
245 245
 
246 246
     }
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     if ($globals->explain) {
269 269
         $x = (time() - $user->create_time)/86400;
270 270
         $t = last_rpc_time($user);
271
-        $show_lapsed_interval = (time()-$t)/86400;
271
+        $show_lapsed_interval = (time() - $t)/86400;
272 272
         echo "user $user->id ($user->email_addr) was created $x days ago\n";
273 273
         echo "  total_credit: $user->total_credit; last RPC $show_lapsed_interval days ago\n";
274 274
         echo "  sending $do_type email\n";
Please login to merge, or discard this patch.
html/inc/recaptchalib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
 function boinc_recaptcha_get_html($publickey) {
34 34
     if ($publickey) {
35
-        return '<div class="g-recaptcha" data-sitekey="' . $publickey . '"></div>';
35
+        return '<div class="g-recaptcha" data-sitekey="'.$publickey.'"></div>';
36 36
     } else {
37 37
         return '';
38 38
     }
Please login to merge, or discard this patch.
html/inc/forum_db.inc 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@
 block discarded – undo
164 164
         $user->prefs = $prefs;
165 165
     }
166 166
     function privilege($specialbit) {
167
-         return (substr($this->special_user, $specialbit,1)==1);
167
+            return (substr($this->special_user, $specialbit,1)==1);
168 168
     }
169 169
     function update($clause) {
170 170
         $db = BoincDb::get();
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -215,7 +215,7 @@
 block discarded – undo
215 215
         //
216 216
         $fl = BoincForumLogging::lookup(0, 0);
217 217
         if ($fl) {
218
-            if ($fl->timestamp<time()-MAX_FORUM_LOGGING_TIME){
218
+            if ($fl->timestamp<time()-MAX_FORUM_LOGGING_TIME) {
219 219
                 BoincForumLogging::delete_aux("timestamp<'".(time()-MAX_FORUM_LOGGING_TIME)."' and userid != 0");
220 220
                 BoincForumLogging::replace(0, 0, time());
221 221
             }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         $db = BoincDb::get();
28 28
         return $db->lookup('category', 'BoincCategory', $clause);
29 29
     }
30
-    static function enum($clause=null) {
30
+    static function enum($clause = null) {
31 31
         $db = BoincDb::get();
32 32
         return $db->enum('category', 'BoincCategory', $clause);
33 33
     }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $db = BoincDb::get();
79 79
         return $db->update($this, 'thread', $clause);
80 80
     }
81
-    static function enum($clause="") {
81
+    static function enum($clause = "") {
82 82
         $db = BoincDb::get();
83 83
         return $db->enum('thread', 'BoincThread', $clause);
84 84
     }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         $db = BoincDb::get();
143 143
         $ret = $db->insert('forum_preferences', $clause);
144 144
     }
145
-    static function lookup(&$user, $nocache=false) {
145
+    static function lookup(&$user, $nocache = false) {
146 146
         if (!$user) return;
147 147
         if (isset($user->prefs)) return;
148 148
         if (!$nocache && isset(self::$cache[$user->id])) {
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         $user->prefs = $prefs;
165 165
     }
166 166
     function privilege($specialbit) {
167
-         return (substr($this->special_user, $specialbit,1)==1);
167
+         return (substr($this->special_user, $specialbit, 1) == 1);
168 168
     }
169 169
     function update($clause) {
170 170
         $db = BoincDb::get();
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         $db = BoincDb::get();
176 176
         return $db->delete_aux('forum_preferences', "userid=$this->userid");
177 177
     }
178
-    static function enum($clause=null) {
178
+    static function enum($clause = null) {
179 179
         $db = BoincDb::get();
180 180
         return $db->enum('forum_preferences', 'BoincForumPrefs', $clause);
181 181
     }
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
         //
216 216
         $fl = BoincForumLogging::lookup(0, 0);
217 217
         if ($fl) {
218
-            if ($fl->timestamp<time()-MAX_FORUM_LOGGING_TIME){
219
-                BoincForumLogging::delete_aux("timestamp<'".(time()-MAX_FORUM_LOGGING_TIME)."' and userid != 0");
218
+            if ($fl->timestamp < time() - MAX_FORUM_LOGGING_TIME) {
219
+                BoincForumLogging::delete_aux("timestamp<'".(time() - MAX_FORUM_LOGGING_TIME)."' and userid != 0");
220 220
                 BoincForumLogging::replace(0, 0, time());
221 221
             }
222 222
         } else {
@@ -326,10 +326,10 @@  discard block
 block discarded – undo
326 326
     }
327 327
 }
328 328
 
329
-define ('NOTIFY_FRIEND_REQ', 1);
330
-define ('NOTIFY_FRIEND_ACCEPT', 2);
331
-define ('NOTIFY_PM', 3);
332
-define ('NOTIFY_SUBSCRIBED_THREAD', 4);
333
-define ('NOTIFY_SUBSCRIBED_FORUM', 5);
329
+define('NOTIFY_FRIEND_REQ', 1);
330
+define('NOTIFY_FRIEND_ACCEPT', 2);
331
+define('NOTIFY_PM', 3);
332
+define('NOTIFY_SUBSCRIBED_THREAD', 4);
333
+define('NOTIFY_SUBSCRIBED_FORUM', 5);
334 334
 
335 335
 ?>
Please login to merge, or discard this patch.
html/inc/credit.inc 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,13 +24,13 @@
 block discarded – undo
24 24
 function update_average($now, $work_start_time, $work, &$avg, &$avg_time) {
25 25
     if ($avg_time) {
26 26
         $diff = $now - $avg_time;
27
-        if ($diff <0) $diff = 0;
27
+        if ($diff < 0) $diff = 0;
28 28
         $diff_days = $diff/86400;
29 29
         $weight = exp(-$diff*M_LN2/CREDIT_HALF_LIFE);
30 30
         $avg *= $weight;
31 31
 
32
-        if ((1.0-$weight)>0.000001) {
33
-            $avg += (1.0-$weight)*($work/$diff_days);
32
+        if ((1.0 - $weight) > 0.000001) {
33
+            $avg += (1.0 - $weight)*($work/$diff_days);
34 34
         }
35 35
         else {
36 36
             $avg += M_LN2*$work*86400/CREDIT_HALF_LIFE;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@
 block discarded – undo
31 31
 
32 32
         if ((1.0-$weight)>0.000001) {
33 33
             $avg += (1.0-$weight)*($work/$diff_days);
34
-        }
35
-        else {
34
+        } else {
36 35
             $avg += M_LN2*$work*86400/CREDIT_HALF_LIFE;
37 36
         }
38 37
     } else if ($work) {
Please login to merge, or discard this patch.
html/inc/util_ops.inc 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
 function print_text_field($text,$name,$value) {
64 64
     echo "$text <input type=\"text\" size=\"10\" name=\"$name\" value=\"$value\">\n"
65
-         . "<p>\n";
65
+            . "<p>\n";
66 66
 }
67 67
 
68 68
 function row($x, $y) {
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
         $db->do_query($q4);
379 379
         return 2;
380 380
     } else if (!$db->do_query($q3)) {
381
-      echo "MySQL command '$q3' failed:<br/>unable to cancel workunits and trigger transitioner.<br>\n";
381
+        echo "MySQL command '$q3' failed:<br/>unable to cancel workunits and trigger transitioner.<br>\n";
382 382
         $db->do_query($q4);
383 383
         return 3;
384 384
     }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -46,21 +46,21 @@  discard block
 block discarded – undo
46 46
 
47 47
 // TODO: get rid of all the following
48 48
 
49
-function print_checkbox($text,$name,$checked) {
49
+function print_checkbox($text, $name, $checked) {
50 50
     echo "<input type=\"checkbox\" name=\"$name\""
51
-        . (strlen($checked) ? " checked=\"checked\"" : "") . ">"
51
+        . (strlen($checked) ? " checked=\"checked\"" : "").">"
52 52
         . "$text\n"
53 53
         . "<p>\n";
54 54
 }
55 55
 
56
-function print_radio_button($text,$name,$value,$checked) {
56
+function print_radio_button($text, $name, $value, $checked) {
57 57
     echo "<input type=\"radio\" name=\"$name\" value=\"$value\""
58
-        . (strlen($checked) ? " checked=\"checked\"" : "") . ">"
58
+        . (strlen($checked) ? " checked=\"checked\"" : "").">"
59 59
         . "$text\n"
60 60
         . "<br>\n";
61 61
 }
62 62
 
63
-function print_text_field($text,$name,$value) {
63
+function print_text_field($text, $name, $value) {
64 64
     echo "$text <input type=\"text\" size=\"10\" name=\"$name\" value=\"$value\">\n"
65 65
          . "<p>\n";
66 66
 }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     if ($host == null) {
92 92
         $host = "localhost";
93 93
     }
94
-    $in = fopen("php://stdin","r");
94
+    $in = fopen("php://stdin", "r");
95 95
     print "Database username (default: owner of mysqld process): ";
96 96
     $user = rtrim(fgets($in, 80));
97 97
     print "Database password (if any): ";
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     }
104 104
 }
105 105
 
106
-function print_login_form_ops($next_url='') {
106
+function print_login_form_ops($next_url = '') {
107 107
     if ($next_url == '') $next_url = $_SERVER['REQUEST_URI'];
108 108
     start_table();
109 109
     echo "
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 // return a list of the current, non-deprecated ones
201 201
 //
202 202
 function current_versions($avs) {
203
-    foreach($avs as $av) {
203
+    foreach ($avs as $av) {
204 204
         foreach ($avs as $av2) {
205 205
             if ($av->id == $av2->id) continue;
206 206
             if ($av->platformid == $av2->platformid && $av->plan_class == $av2->plan_class && $av->version_num > $av2->version_num) {
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
         }
210 210
     }
211 211
     $x = array();
212
-    foreach($avs as $av) {
212
+    foreach ($avs as $av) {
213 213
         if (!$av->deprecated) $x[] = $av;
214 214
     }
215 215
     return $x;
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 //
322 322
 function unassign_badges($is_user, $item, $badges, $k) {
323 323
     $list = null;
324
-    for ($i=0; $i<count($badges); $i++) {
324
+    for ($i = 0; $i < count($badges); $i++) {
325 325
         if ($i == $k) continue;
326 326
         $badge = $badges[$i];
327 327
         if ($list) {
Please login to merge, or discard this patch.
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.