@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | -form_start("create_account_action.php","post"); |
|
69 | +form_start("create_account_action.php", "post"); |
|
70 | 70 | create_account_form($teamid, $next_url); |
71 | 71 | global $recaptcha_public_key; |
72 | 72 | if ($recaptcha_public_key) { |
@@ -77,5 +77,5 @@ discard block |
||
77 | 77 | |
78 | 78 | page_tail(); |
79 | 79 | |
80 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
80 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
81 | 81 | ?> |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if (!defined("DELETE_DELAY")) define("DELETE_DELAY", 2); |
43 | 43 | |
44 | 44 | function is_delete_account_token_valid($userid, $token) { |
45 | - if (!is_valid_token($userid, $token, TOKEN_TYPE_DELETE_ACCOUNT) ) { |
|
45 | + if (!is_valid_token($userid, $token, TOKEN_TYPE_DELETE_ACCOUNT)) { |
|
46 | 46 | sleep(LOGIN_FAIL_SLEEP_SEC); |
47 | 47 | return false; |
48 | 48 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | // |
127 | 127 | function is_over_but_not_validated($res) { |
128 | 128 | if ($res->server_state == RESULT_SERVER_STATE_OVER && $res->outcome == RESULT_OUTCOME_SUCCESS && |
129 | - ($res->validate_state == VALIDATE_STATE_INIT || $res->validate_state == VALIDATE_STATE_INCONCLUSIVE) ) { |
|
129 | + ($res->validate_state == VALIDATE_STATE_INIT || $res->validate_state == VALIDATE_STATE_INCONCLUSIVE)) { |
|
130 | 130 | return true; |
131 | 131 | } |
132 | 132 | return false; |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | // |
145 | 145 | function cancel_results_for_user($user) { |
146 | 146 | $ress = BoincResult::enum("userid = $user->id"); |
147 | - $cancel_clause="server_state=".RESULT_SERVER_STATE_OVER.", outcome=".RESULT_OUTCOME_CLIENT_DETACHED.", validate_state=".VALIDATE_STATE_INVALID; |
|
148 | - $set_id_clause="hostid=0, userid=0"; |
|
147 | + $cancel_clause = "server_state=".RESULT_SERVER_STATE_OVER.", outcome=".RESULT_OUTCOME_CLIENT_DETACHED.", validate_state=".VALIDATE_STATE_INVALID; |
|
148 | + $set_id_clause = "hostid=0, userid=0"; |
|
149 | 149 | foreach ($ress as $res) { |
150 | 150 | if (is_in_progress($res) || is_over_but_not_validated($res)) { |
151 | 151 | $res->update($cancel_clause.", ".$set_id_clause); |
@@ -168,12 +168,12 @@ discard block |
||
168 | 168 | |
169 | 169 | // delete remote submit user |
170 | 170 | // |
171 | - delete_remote_submit_user($user); // from submit_util.inc |
|
171 | + delete_remote_submit_user($user); // from submit_util.inc |
|
172 | 172 | |
173 | 173 | // remove user's team records |
174 | 174 | // |
175 | - user_erase_team_owner($user); // from team.inc |
|
176 | - user_quit_team($user); // from team.inc |
|
175 | + user_erase_team_owner($user); // from team.inc |
|
176 | + user_quit_team($user); // from team.inc |
|
177 | 177 | user_erase_team_delta($user); // from team.inc |
178 | 178 | |
179 | 179 | // Items that do not have logic elsewhere |
@@ -199,6 +199,6 @@ discard block |
||
199 | 199 | BoincConsent::delete_for_user($user->id); |
200 | 200 | |
201 | 201 | // final action |
202 | - delete_user($user); //from user_util.inc |
|
202 | + delete_user($user); //from user_util.inc |
|
203 | 203 | return 0; |
204 | 204 | } |
@@ -59,7 +59,7 @@ |
||
59 | 59 | if ($checkct) { |
60 | 60 | $rc1 = consent_to_a_policy($user, $ctid, 1, 0, 'Webform', time()); |
61 | 61 | if (!$rc1) { |
62 | - error_page("Database error when attempting to INSERT into table consent with ID=$user->id. " . BoincDb::error() . " Please contact site administrators."); |
|
62 | + error_page("Database error when attempting to INSERT into table consent with ID=$user->id. ".BoincDb::error()." Please contact site administrators."); |
|
63 | 63 | } |
64 | 64 | } else { |
65 | 65 | error_page("Error: consent type for enrollment not found. Please contact site administrators."); |
@@ -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); |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | abstract class PREF { |
45 | - public $desc; // short description |
|
46 | - public $tooltip; // longer description, shown as tooltip |
|
47 | - public $tag; // the pref's primary XML tag |
|
45 | + public $desc; // short description |
|
46 | + public $tooltip; // longer description, shown as tooltip |
|
47 | + public $tag; // the pref's primary XML tag |
|
48 | 48 | function __construct($desc, $tooltip, $tag) { |
49 | 49 | $this->desc = $desc; |
50 | 50 | $this->tooltip = $tooltip; |
@@ -122,15 +122,15 @@ discard block |
||
122 | 122 | |
123 | 123 | class PREF_BOOL extends PREF { |
124 | 124 | public $default; |
125 | - public $invert; // show to user in opposite sense |
|
126 | - function __construct($desc, $tooltip, $tag, $default, $invert=false) { |
|
125 | + public $invert; // show to user in opposite sense |
|
126 | + function __construct($desc, $tooltip, $tag, $default, $invert = false) { |
|
127 | 127 | $this->default = $default; |
128 | 128 | $this->invert = $invert; |
129 | 129 | parent::__construct($desc, $tooltip, $tag); |
130 | 130 | } |
131 | 131 | function show_value($prefs) { |
132 | 132 | $tag = $this->tag; |
133 | - $v = $this->invert?!$prefs->$tag:$prefs->$tag; |
|
133 | + $v = $this->invert ? !$prefs->$tag : $prefs->$tag; |
|
134 | 134 | echo "<td>".readonly_checkbox($v)."</td>"; |
135 | 135 | } |
136 | 136 | function show_form($prefs, $error) { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | } |
143 | 143 | echo "<td ".VALUE_ATTRS.">" |
144 | 144 | ."<input type=checkbox name=$this->tag " |
145 | - . ($checked?"checked":"") |
|
145 | + . ($checked ? "checked" : "") |
|
146 | 146 | ."></td> |
147 | 147 | "; |
148 | 148 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | function xml_string($prefs) { |
156 | 156 | $tag = $this->tag; |
157 | 157 | return "<$tag>" |
158 | - .($prefs->$tag?"1":"0") |
|
158 | + .($prefs->$tag ? "1" : "0") |
|
159 | 159 | ."</$tag>\n"; |
160 | 160 | } |
161 | 161 | function xml_parse(&$prefs, $name, $text) { |
@@ -175,9 +175,9 @@ discard block |
||
175 | 175 | public $consent_type_id; // the consent_type_id from the consent_type table |
176 | 176 | public $consent_name; // the consent_name to configure |
177 | 177 | public $default; |
178 | - public $invert; // show to user in opposite sense |
|
178 | + public $invert; // show to user in opposite sense |
|
179 | 179 | |
180 | - function __construct($desc, $tooltip, $tag, $consent_type_id, $consent_name, $default, $invert=false) { |
|
180 | + function __construct($desc, $tooltip, $tag, $consent_type_id, $consent_name, $default, $invert = false) { |
|
181 | 181 | $this->consent_type_id = $consent_type_id; |
182 | 182 | $this->consent_name = $consent_name; |
183 | 183 | $this->default = $default; |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | } else { |
232 | 232 | $value = false; |
233 | 233 | } |
234 | - echo "<td>" . readonly_checkbox($value) . "</td>"; |
|
234 | + echo "<td>".readonly_checkbox($value)."</td>"; |
|
235 | 235 | } |
236 | 236 | function show_form($user, $error) { |
237 | 237 | $consent_type_id = $this->consent_type_id; |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | } |
248 | 248 | echo "<td ".VALUE_ATTRS.">" |
249 | 249 | ."<input type=checkbox name=$this->tag " |
250 | - . ($checked?"checked":"") |
|
250 | + . ($checked ? "checked" : "") |
|
251 | 251 | ."></td> |
252 | 252 | "; |
253 | 253 | } |
@@ -264,8 +264,8 @@ discard block |
||
264 | 264 | // to this consent type. |
265 | 265 | $cr = BoincLatestConsent::lookup("userid={$user->id} AND consent_type_id='${consent_type_id}'"); |
266 | 266 | |
267 | - if ( (($cr) and ($cr->consent_flag!=$flag)) or |
|
268 | - (!$cr) ) { |
|
267 | + if ((($cr) and ($cr->consent_flag != $flag)) or |
|
268 | + (!$cr)) { |
|
269 | 269 | $rc = consent_to_a_policy($user, $consent_type_id, $flag, 0, 'Webform', time()); |
270 | 270 | if (!$rc) { |
271 | 271 | error_page(tra("Database error:").BoincDb::error()); |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | // this is the value if they check the box |
302 | 302 | public $scale; |
303 | 303 | |
304 | - function __construct($suffix, $min, $max, $default, $scale=1, $default2=0) { |
|
304 | + function __construct($suffix, $min, $max, $default, $scale = 1, $default2 = 0) { |
|
305 | 305 | $this->suffix = " $suffix"; |
306 | 306 | $this->min = $min; |
307 | 307 | $this->max = $max; |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | $v .= "$this->suffix "; |
321 | 321 | return $v; |
322 | 322 | } |
323 | - function form_str($tag, $v, $had_error, $disabled=false, $id=null) { |
|
323 | + function form_str($tag, $v, $had_error, $disabled = false, $id = null) { |
|
324 | 324 | if (is_numeric($v)) { |
325 | 325 | $v /= $this->scale; |
326 | 326 | if (!$had_error && ($v < $this->min || $v > $this->max)) { |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | } |
329 | 329 | } |
330 | 330 | if ($disabled) $v = ""; |
331 | - $i = $id?"id=\"$id\"":""; |
|
331 | + $i = $id ? "id=\"$id\"" : ""; |
|
332 | 332 | return '<input type="text" size="5" class="form-control input-sm" name="'.$tag.'" value="'.$v."\" $disabled $i> $this->suffix "; |
333 | 333 | } |
334 | 334 | function form_convert($in, &$out, &$error) { |
@@ -451,8 +451,8 @@ discard block |
||
451 | 451 | $text_id = $this->tag; |
452 | 452 | $default = $this->num_spec->get_default(); |
453 | 453 | $val = $prefs->$tag; |
454 | - $c = $val?"checked":""; |
|
455 | - $d = $val?"":"disabled"; |
|
454 | + $c = $val ? "checked" : ""; |
|
455 | + $d = $val ? "" : "disabled"; |
|
456 | 456 | echo "<td $attrs>" |
457 | 457 | ."<input type=checkbox id=$checkbox_id onClick=\"checkbox_clicked('$checkbox_id', '$text_id', $default)\" $c> " |
458 | 458 | .$this->num_spec->form_str($tag, $prefs->$tag, $had_error, $d, $text_id) |
@@ -565,8 +565,8 @@ discard block |
||
565 | 565 | function hour_select($x, $name, $id, $d) { |
566 | 566 | $s = ""; |
567 | 567 | $s .= "<select class=\"selectbox form-control input-sm\" name=$name id=$id $d>\n"; |
568 | - for ($i=0; $i<24; $i++) { |
|
569 | - $sel = ($x == $i)?"selected":""; |
|
568 | + for ($i = 0; $i < 24; $i++) { |
|
569 | + $sel = ($x == $i) ? "selected" : ""; |
|
570 | 570 | $s .= "<option value=$i $sel> $i:00"; |
571 | 571 | } |
572 | 572 | $s .= "</select>\n"; |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | |
668 | 668 | // row_defs - Display a value for all 4 venues in one row |
669 | 669 | // |
670 | -function row_defs($pre, $item, $post, $type, $prefs, $tooltip=null) { |
|
670 | +function row_defs($pre, $item, $post, $type, $prefs, $tooltip = null) { |
|
671 | 671 | $gen = $prefs->$item; |
672 | 672 | $hom = (isset($prefs->home) && isset($prefs->home->$item)) ? $prefs->home->$item : "--"; |
673 | 673 | $schl = (isset($prefs->school) && isset($prefs->school->$item)) ? $prefs->school->$item : "--"; |
@@ -679,10 +679,10 @@ discard block |
||
679 | 679 | echo "<tr>"; |
680 | 680 | } |
681 | 681 | echo "<td ".NAME_ATTRS.">$pre</td>"; |
682 | - row_field($gen, $type); |
|
683 | - row_field($hom, $type); |
|
682 | + row_field($gen, $type); |
|
683 | + row_field($hom, $type); |
|
684 | 684 | row_field($schl, $type); |
685 | - row_field($wrk, $type); |
|
685 | + row_field($wrk, $type); |
|
686 | 686 | echo "<td align=left>$post</td></tr>\n"; |
687 | 687 | } |
688 | 688 | |
@@ -692,16 +692,16 @@ discard block |
||
692 | 692 | function row_field($value, $type) { |
693 | 693 | echo "<td>"; |
694 | 694 | $type = $value === "--" ? "--" : $type; |
695 | - switch($type) { |
|
695 | + switch ($type) { |
|
696 | 696 | case "yesno": |
697 | - echo $value ?tra("yes"):tra("no"); |
|
697 | + echo $value ?tra("yes") : tra("no"); |
|
698 | 698 | break; |
699 | 699 | case "noyes": |
700 | - echo $value ?tra("no"):tra("yes"); |
|
700 | + echo $value ?tra("no") : tra("yes"); |
|
701 | 701 | break; |
702 | 702 | case "limit": |
703 | 703 | $x = max_bytes_display_mode($value); |
704 | - $y = "$x " . BYTE_ABBR; |
|
704 | + $y = "$x ".BYTE_ABBR; |
|
705 | 705 | echo $x ? "$y" : tra("no limit"); |
706 | 706 | break; |
707 | 707 | case "minutes": |
@@ -22,68 +22,68 @@ |
||
22 | 22 | define('KW_CATEGORY_SCIENCE', 0); |
23 | 23 | define('KW_CATEGORY_LOC', 1); |
24 | 24 | |
25 | -define('KW_ASTRONOMY', 1); |
|
26 | -define('KW_SETI', 2); |
|
27 | -define('KW_PULSARS', 3); |
|
28 | -define('KW_GW', 4); |
|
29 | -define('KW_COSMOLOGY', 5); |
|
30 | -define('KW_PHYSICS', 6); |
|
25 | +define('KW_ASTRONOMY', 1); |
|
26 | +define('KW_SETI', 2); |
|
27 | +define('KW_PULSARS', 3); |
|
28 | +define('KW_GW', 4); |
|
29 | +define('KW_COSMOLOGY', 5); |
|
30 | +define('KW_PHYSICS', 6); |
|
31 | 31 | define('KW_PARTICLE_PHYSICS', 7); |
32 | -define('KW_NANOSCIENCE', 8); |
|
33 | -define('KW_BIOMED', 9); |
|
32 | +define('KW_NANOSCIENCE', 8); |
|
33 | +define('KW_BIOMED', 9); |
|
34 | 34 | define('KW_DRUG_DISCOVERY', 10); |
35 | -define('KW_PROTEINS', 11); |
|
36 | -define('KW_GENETICS', 12); |
|
37 | -define('KW_DISEASE', 13); |
|
38 | -define('KW_CANCER', 14); |
|
39 | -define('KW_MATH_CS', 15); |
|
40 | -define('KW_AI', 16); |
|
41 | -define('KW_OCEANIA', 17); |
|
42 | -define('KW_AUSTRALIA', 18); |
|
35 | +define('KW_PROTEINS', 11); |
|
36 | +define('KW_GENETICS', 12); |
|
37 | +define('KW_DISEASE', 13); |
|
38 | +define('KW_CANCER', 14); |
|
39 | +define('KW_MATH_CS', 15); |
|
40 | +define('KW_AI', 16); |
|
41 | +define('KW_OCEANIA', 17); |
|
42 | +define('KW_AUSTRALIA', 18); |
|
43 | 43 | |
44 | -define('KW_EUROPE', 20); |
|
45 | -define('KW_GERMANY', 21); |
|
46 | -define('KW_ASIA', 22); |
|
47 | -define('KW_AMERICAS', 23); |
|
48 | -define('KW_US', 24); |
|
49 | -define('KW_UCB', 25); |
|
50 | -define('KW_AEI', 26); |
|
51 | -define('KW_CERN', 27); |
|
52 | -define('KW_UW', 28); |
|
53 | -define('KW_EARTH_SCI', 29); |
|
54 | -define('KW_SPAIN', 30); |
|
55 | -define('KW_SAN_JORGE', 31); |
|
56 | -define('KW_NUMBER_THEORY', 32); |
|
57 | -define('KW_CRYPTO', 33); |
|
58 | -define('KW_ENV_RESEARCH', 34); |
|
59 | -define('KW_CLIMATE', 35); |
|
60 | -define('KW_CZECH', 36); |
|
44 | +define('KW_EUROPE', 20); |
|
45 | +define('KW_GERMANY', 21); |
|
46 | +define('KW_ASIA', 22); |
|
47 | +define('KW_AMERICAS', 23); |
|
48 | +define('KW_US', 24); |
|
49 | +define('KW_UCB', 25); |
|
50 | +define('KW_AEI', 26); |
|
51 | +define('KW_CERN', 27); |
|
52 | +define('KW_UW', 28); |
|
53 | +define('KW_EARTH_SCI', 29); |
|
54 | +define('KW_SPAIN', 30); |
|
55 | +define('KW_SAN_JORGE', 31); |
|
56 | +define('KW_NUMBER_THEORY', 32); |
|
57 | +define('KW_CRYPTO', 33); |
|
58 | +define('KW_ENV_RESEARCH', 34); |
|
59 | +define('KW_CLIMATE', 35); |
|
60 | +define('KW_CZECH', 36); |
|
61 | 61 | define('KW_CHARLES_PRAGUE', 37); |
62 | -define('KW_RECHENKRAFT', 38); |
|
63 | -define('KW_RHEINMAIN', 39); |
|
64 | -define('KW_HUNGARY', 40); |
|
65 | -define('KW_IRELAND', 41); |
|
66 | -define('KW_UC_DUBLIN', 42); |
|
67 | -define('KW_POLAND', 43); |
|
68 | -define('KW_RUSSIA', 44); |
|
62 | +define('KW_RECHENKRAFT', 38); |
|
63 | +define('KW_RHEINMAIN', 39); |
|
64 | +define('KW_HUNGARY', 40); |
|
65 | +define('KW_IRELAND', 41); |
|
66 | +define('KW_UC_DUBLIN', 42); |
|
67 | +define('KW_POLAND', 43); |
|
68 | +define('KW_RUSSIA', 44); |
|
69 | 69 | define('KW_SW_STATE_RUSSIA', 45); |
70 | -define('KW_RAS', 46); |
|
71 | -define('KW_PRBB', 47); |
|
72 | -define('KW_UK', 48); |
|
73 | -define('KW_OXFORD', 49); |
|
74 | -define('KW_CHINA', 50); |
|
75 | -define('KW_U_DAYTON', 51); |
|
76 | -define('KW_WRIGHT_STATE', 52); |
|
77 | -define('KW_USC', 53); |
|
78 | -define('KW_FULLERTON', 54); |
|
79 | -define('KW_ARIZONA_STATE', 55); |
|
80 | -define('KW_U_ILLINOIS', 56); |
|
81 | -define('KW_U_WARSAW', 57); |
|
82 | -define('KW_RPI', 58); |
|
83 | -define('KW_INTERNATIONAL', 59); |
|
84 | -define('KW_UND', 60); |
|
85 | -define('KW_HOLLAND', 61); |
|
86 | -define('KW_CHEMISTRY', 62); |
|
70 | +define('KW_RAS', 46); |
|
71 | +define('KW_PRBB', 47); |
|
72 | +define('KW_UK', 48); |
|
73 | +define('KW_OXFORD', 49); |
|
74 | +define('KW_CHINA', 50); |
|
75 | +define('KW_U_DAYTON', 51); |
|
76 | +define('KW_WRIGHT_STATE', 52); |
|
77 | +define('KW_USC', 53); |
|
78 | +define('KW_FULLERTON', 54); |
|
79 | +define('KW_ARIZONA_STATE', 55); |
|
80 | +define('KW_U_ILLINOIS', 56); |
|
81 | +define('KW_U_WARSAW', 57); |
|
82 | +define('KW_RPI', 58); |
|
83 | +define('KW_INTERNATIONAL', 59); |
|
84 | +define('KW_UND', 60); |
|
85 | +define('KW_HOLLAND', 61); |
|
86 | +define('KW_CHEMISTRY', 62); |
|
87 | 87 | |
88 | 88 | $job_keywords = array(); |
89 | 89 |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | '#default_value' => $default['boinc_server_status_url'], |
121 | 121 | '#description' => t('An absolute URL or path relative to the site base to the server status page (e.g. %full_url or just %relative_url).', |
122 | 122 | array( |
123 | - '%full_url' => $base_url . '/server_status.php', |
|
123 | + '%full_url' => $base_url.'/server_status.php', |
|
124 | 124 | '%relative_url' => 'server_status.php', |
125 | 125 | ) |
126 | 126 | ), |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | '#default_value' => $default['boinc_app_list_url'], |
132 | 132 | '#description' => t('An absolute URL or path relative to the site base to the applications page (e.g. %full_url or just %relative_url).', |
133 | 133 | array( |
134 | - '%full_url' => $base_url . '/apps.php', |
|
134 | + '%full_url' => $base_url.'/apps.php', |
|
135 | 135 | '%relative_url' => 'apps.php', |
136 | 136 | ) |
137 | 137 | ), |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | '#type' => 'checkbox', |
355 | 355 | '#title' => t('Enable create_account.php RPC'), |
356 | 356 | '#default_value' => $default['boinc_weboptions_enableaccountcreateRPC'], |
357 | - '#description' => t('If checked, users will be able to create an account remotely using the create_account.php RPC. This option is independent of the user regsitration option found in ') . l(t('User management -> User settings'), '/admin/user/settings') . '. If enabled, user <b>may not be able to see and agree to the terms-of-use</b> to your site\'s privacy and data retention policies!', |
|
357 | + '#description' => t('If checked, users will be able to create an account remotely using the create_account.php RPC. This option is independent of the user regsitration option found in ').l(t('User management -> User settings'), '/admin/user/settings').'. If enabled, user <b>may not be able to see and agree to the terms-of-use</b> to your site\'s privacy and data retention policies!', |
|
358 | 358 | ); |
359 | 359 | |
360 | 360 | $form['boinc_weboptions_registrationtitle'] = array( |
@@ -409,32 +409,32 @@ discard block |
||
409 | 409 | '#rows' => 8, |
410 | 410 | '#description' => t('A list of Drupal URLs/paths to ignore for Terms of Use (ToU). If the option above \'Are existing users forced to agree to the Terms of Use?\' is activated, then some paths need to be ignored when checking if a user has agreed to the ToU. A good example is the logout path, "logout", or else users will not be able to logout! |
411 | 411 | <p>There is a default list of paths that must be ignored or else the site will not function. They are not included in this box. Here you may provide additional paths to be ignored, for example the privacy policy page may be accessible so that users may read it before agreeing to the site\'s ToU. |
412 | -<p>Paths should be entered one per line. All paths should be <em>lower-case</em> and should not include a leading \'/\'. Example: account/info/edit will allow the user to visit ' . $base_url . '/account/info/edit without first agreeing to the ToU. Regexp are allowed. Example: account/* will allow the user to visit any path starting with ' . $base_url . '/account/.'), |
|
412 | +<p>Paths should be entered one per line. All paths should be <em>lower-case</em> and should not include a leading \'/\'. Example: account/info/edit will allow the user to visit ' . $base_url.'/account/info/edit without first agreeing to the ToU. Regexp are allowed. Example: account/* will allow the user to visit any path starting with '.$base_url.'/account/.'), |
|
413 | 413 | ); |
414 | 414 | |
415 | 415 | $form['pathtitle'] = array( |
416 | 416 | '#value' => '<h3>Path Options</h3>', |
417 | 417 | ); |
418 | 418 | |
419 | - $form['boinc_weboptions_accountfinish'] = array ( |
|
419 | + $form['boinc_weboptions_accountfinish'] = array( |
|
420 | 420 | '#type' => 'textfield', |
421 | 421 | '#title' => t('Path to a custom account_finish.php page, should be a path to a node'), |
422 | 422 | '#description' => t('Provide a path to a node which will serve as your site\'s landing page for users create an account using the BOINC client manager. They will be directed to this page after the account is created. If blank, a default account_finish page will be used.<br>Examples: account_finish, content/welcome, node/123'), |
423 | 423 | '#default_value' => $default['boinc_weboptions_accountfinish'], |
424 | 424 | ); |
425 | - $form['boinc_weboptions_moderationpage'] = array ( |
|
425 | + $form['boinc_weboptions_moderationpage'] = array( |
|
426 | 426 | '#type' => 'textfield', |
427 | 427 | '#title' => t('Path to the site\'s content moderation info page, should be a path to a node'), |
428 | 428 | '#description' => t('Provide a path to a node which will serve as your site\'s page for account/content moderation information. This will be used on the default account_finish page. If blank, no link to a moderation page will be provided. If a path is provided to the custom account_finish.php page (above), this field will be ignored.<br>Examples: moderation, content/moderation, node/456'), |
429 | 429 | '#default_value' => $default['boinc_weboptions_moderationpage'], |
430 | 430 | ); |
431 | - $form['boinc_weboptions_rulespolicies'] = array ( |
|
431 | + $form['boinc_weboptions_rulespolicies'] = array( |
|
432 | 432 | '#type' => 'textfield', |
433 | 433 | '#title' => t('Path to the site\'s rule and policies page, should be a path to a node'), |
434 | 434 | '#description' => t('Provide a path to a node which will serve as your site\'s rules and policies page. This will be used on the Join page shown to new users. If blank, no link to a rules and policies page will be provided.<br>Examples: rules-and-policies, node/789'), |
435 | 435 | '#default_value' => $default['boinc_weboptions_rulespolicies'], |
436 | 436 | ); |
437 | - $form['boinc_other_frontpage'] = array ( |
|
437 | + $form['boinc_other_frontpage'] = array( |
|
438 | 438 | '#type' => 'textarea', |
439 | 439 | '#title' => bts('Message for site\'s Home Page', array(), NULL, 'boinc:admin-boinc-other-options'), |
440 | 440 | '#default_value' => $default['boinc_other_frontpage'], |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | '#value' => '<h3>Other Options</h3>', |
448 | 448 | ); |
449 | 449 | |
450 | - $form['boinc_weboptions_blacklisted_usernames'] = array ( |
|
450 | + $form['boinc_weboptions_blacklisted_usernames'] = array( |
|
451 | 451 | '#type' => 'textarea', |
452 | 452 | '#title' => t('BOINC username blacklist'), |
453 | 453 | '#default_value' => $default['boinc_weboptions_blacklisted_usernames'], |
@@ -466,17 +466,17 @@ discard block |
||
466 | 466 | $values = $form_state['values']; |
467 | 467 | |
468 | 468 | $accountfinish = $values['boinc_weboptions_accountfinish']; |
469 | - if ( ($accountfinish) AND (!drupal_lookup_path('source', $accountfinish)) ) { |
|
469 | + if (($accountfinish) AND (!drupal_lookup_path('source', $accountfinish))) { |
|
470 | 470 | form_set_error('boinc weboptions_accountfinish', t('Path to custom account finish page not found. Please provide a valid path, or leave blank to unset.')); |
471 | 471 | } |
472 | 472 | |
473 | 473 | $moderationpage = $values['boinc_weboptions_moderationpage']; |
474 | - if ( ($moderationpage) AND (!drupal_lookup_path('source', $moderationpage)) ) { |
|
474 | + if (($moderationpage) AND (!drupal_lookup_path('source', $moderationpage))) { |
|
475 | 475 | form_set_error('boinc weboptions_moderationpage', t('Path to moderation page not found. Please provide a valid path, or leave blank to unset.')); |
476 | 476 | } |
477 | 477 | |
478 | 478 | $rulespolicies = $values['boinc_weboptions_rulespolicies']; |
479 | - if ( ($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies)) ) { |
|
479 | + if (($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies))) { |
|
480 | 480 | form_set_error('boinc weboptions_rulespolicies', t('Path to rules and policies page not found. Please provide a valid path, or leave blank to unset.')); |
481 | 481 | } |
482 | 482 | } |
@@ -485,5 +485,5 @@ discard block |
||
485 | 485 | * Submit BOINC other form |
486 | 486 | */ |
487 | 487 | function boincuser_admin_weboptions_submit($form, &$form_state) { |
488 | - drupal_set_message( bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options') ); |
|
488 | + drupal_set_message(bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options')); |
|
489 | 489 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | // they've participated in |
34 | 34 | // |
35 | 35 | function get_other_projects($user) { |
36 | - $cpid = md5($user->cross_project_id . $user->email_addr); |
|
36 | + $cpid = md5($user->cross_project_id.$user->email_addr); |
|
37 | 37 | $url = "http://boinc.netsoft-online.com/get_user.php?cpid=".$cpid; |
38 | 38 | |
39 | 39 | // Check the cache for that URL |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | |
176 | 176 | if (!NO_STATS) { |
177 | - $cpid = md5($user->cross_project_id . $user->email_addr); |
|
177 | + $cpid = md5($user->cross_project_id.$user->email_addr); |
|
178 | 178 | $x = ""; |
179 | 179 | shuffle($cpid_stats_sites); |
180 | 180 | foreach ($cpid_stats_sites as $site) { |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | // if $badge_height is > 0, show badges |
329 | 329 | // if $name_limit, limit name to N chars |
330 | 330 | // |
331 | -function user_links($user, $badge_height=0, $name_limit=0) { |
|
331 | +function user_links($user, $badge_height = 0, $name_limit = 0) { |
|
332 | 332 | BoincForumPrefs::lookup($user); |
333 | 333 | if (is_banished($user)) { |
334 | 334 | return "(banished: ID $user->id)"; |
@@ -343,13 +343,13 @@ discard block |
||
343 | 343 | $name = substr($name, 0, $name_limit)."..."; |
344 | 344 | } |
345 | 345 | $x .= " <a href=\"".url_base()."show_user.php?userid=".$user->id."\">".$name."</a>"; |
346 | - if (function_exists("project_user_links")){ |
|
346 | + if (function_exists("project_user_links")) { |
|
347 | 347 | $x .= project_user_links($user); |
348 | 348 | } |
349 | 349 | if ($badge_height) { |
350 | 350 | $x .= badges_string(true, $user, $badge_height); |
351 | 351 | } |
352 | - return $name_limit?"<nobr>$x</nobr>":$x; |
|
352 | + return $name_limit ? "<nobr>$x</nobr>" : $x; |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | function show_community_private($user) { |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | |
397 | 397 | // if there's a foundership request, notify the founder |
398 | 398 | // |
399 | - if ($user->id==$team->userid && $team->ping_user >0) { |
|
399 | + if ($user->id == $team->userid && $team->ping_user > 0) { |
|
400 | 400 | $x .= "<p class=\"text-danger\">".tra("(foundership change request pending)")."</p>"; |
401 | 401 | } |
402 | 402 | row2(tra("Member of team"), $x); |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | $x = "<a href=\"user_search.php\">".tra("Find friends")."</a><br/>\n"; |
422 | 422 | $n = count($friends); |
423 | 423 | if ($n) { |
424 | - foreach($friends as $friend) { |
|
424 | + foreach ($friends as $friend) { |
|
425 | 425 | $fuser = BoincUser::lookup_id($friend->user_dest); |
426 | 426 | if (!$fuser) continue; |
427 | 427 | $x .= friend_links($fuser); |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | // Returns a cacheable community links data object |
465 | 465 | // @param user The user to produce a community links object for |
466 | 466 | |
467 | -function get_community_links_object($user){ |
|
467 | +function get_community_links_object($user) { |
|
468 | 468 | $cache_object = new StdClass; |
469 | 469 | $cache_object->post_count = total_posts($user); |
470 | 470 | $cache_object->user = $user; |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $cache_object->friends = array(); |
473 | 473 | |
474 | 474 | $friends = BoincFriend::enum("user_src=$user->id and reciprocated=1"); |
475 | - foreach($friends as $friend) { |
|
475 | + foreach ($friends as $friend) { |
|
476 | 476 | $fuser = BoincUser::lookup_id($friend->user_dest); |
477 | 477 | if (!$fuser) continue; |
478 | 478 | $cache_object->friends[] = $fuser; |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | return $cache_object; |
481 | 481 | } |
482 | 482 | |
483 | -function community_links($clo, $logged_in_user){ |
|
483 | +function community_links($clo, $logged_in_user) { |
|
484 | 484 | $user = $clo->user; |
485 | 485 | $team = $clo->team; |
486 | 486 | $friends = $clo->friends; |
@@ -506,15 +506,15 @@ discard block |
||
506 | 506 | "<a href=\"friend.php?action=cancel_confirm&userid=$user->id\">".tra("Cancel friendship")."</a>" |
507 | 507 | ); |
508 | 508 | } else if ($friend) { |
509 | - row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Request pending")."</a>"); |
|
509 | + row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Request pending")."</a>"); |
|
510 | 510 | } else { |
511 | - row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Add as friend")."</a>"); |
|
511 | + row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Add as friend")."</a>"); |
|
512 | 512 | } |
513 | 513 | } |
514 | 514 | |
515 | 515 | if ($friends) { |
516 | 516 | $x = ""; |
517 | - foreach($friends as $friend) { |
|
517 | + foreach ($friends as $friend) { |
|
518 | 518 | $x .= friend_links($friend); |
519 | 519 | } |
520 | 520 | row2(tra("Friends")." (".sizeof($friends).")", $x); |
@@ -558,6 +558,6 @@ discard block |
||
558 | 558 | } |
559 | 559 | |
560 | 560 | |
561 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
561 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
562 | 562 | |
563 | 563 | ?> |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | define('THREAD_SOLVED', 1); |
55 | 55 | |
56 | 56 | define('AVATAR_WIDTH', 100); |
57 | -define('AVATAR_HEIGHT',100); |
|
57 | +define('AVATAR_HEIGHT', 100); |
|
58 | 58 | |
59 | 59 | define('ST_NEW_TIME', 1209600); //3600*24*14 - 14 days |
60 | 60 | define('ST_NEW', 'New member'); |
61 | 61 | |
62 | -define('MAXIMUM_EDIT_TIME',3600); |
|
62 | +define('MAXIMUM_EDIT_TIME', 3600); |
|
63 | 63 | // allow edits of forums posts up till one hour after posting. |
64 | 64 | |
65 | 65 | define('MAX_FORUM_LOGGING_TIME', 2419200); //3600*24*28 - 28 days |
@@ -77,24 +77,24 @@ discard block |
||
77 | 77 | define('IMAGE_HIDDEN', 'img/hidden.png'); |
78 | 78 | define('IMAGE_STICKY_LOCKED', 'img/sticky_locked_post.png'); |
79 | 79 | define('IMAGE_POST', 'img/post.png'); |
80 | -define('NEW_IMAGE_HEIGHT','15'); |
|
80 | +define('NEW_IMAGE_HEIGHT', '15'); |
|
81 | 81 | define('EMPHASIZE_IMAGE', 'img/emphasized_post.png'); |
82 | -define('EMPHASIZE_IMAGE_HEIGHT','15'); |
|
82 | +define('EMPHASIZE_IMAGE_HEIGHT', '15'); |
|
83 | 83 | define('FILTER_IMAGE', 'img/filtered_post.png'); |
84 | -define('FILTER_IMAGE_HEIGHT','15'); |
|
84 | +define('FILTER_IMAGE_HEIGHT', '15'); |
|
85 | 85 | define('RATE_POSITIVE_IMAGE', 'img/rate_positive.png'); |
86 | -define('RATE_POSITIVE_IMAGE_HEIGHT','9'); |
|
86 | +define('RATE_POSITIVE_IMAGE_HEIGHT', '9'); |
|
87 | 87 | define('RATE_NEGATIVE_IMAGE', 'img/rate_negative.png'); |
88 | -define('RATE_NEGATIVE_IMAGE_HEIGHT','9'); |
|
88 | +define('RATE_NEGATIVE_IMAGE_HEIGHT', '9'); |
|
89 | 89 | define('REPORT_POST_IMAGE', 'img/report_post.png'); |
90 | -define('REPORT_POST_IMAGE_HEIGHT','9'); |
|
90 | +define('REPORT_POST_IMAGE_HEIGHT', '9'); |
|
91 | 91 | |
92 | 92 | define('SOLUTION', tra('This answered my question')); |
93 | 93 | define('SUFFERER', tra('I also have this question')); |
94 | 94 | define('OFF_TOPIC', tra('Off-topic')); |
95 | 95 | |
96 | -define ('DEFAULT_LOW_RATING_THRESHOLD', -25); |
|
97 | -define ('DEFAULT_HIGH_RATING_THRESHOLD', 5); |
|
96 | +define('DEFAULT_LOW_RATING_THRESHOLD', -25); |
|
97 | +define('DEFAULT_HIGH_RATING_THRESHOLD', 5); |
|
98 | 98 | |
99 | 99 | // special user attributes |
100 | 100 | // |
@@ -164,15 +164,15 @@ discard block |
||
164 | 164 | |
165 | 165 | // Output the forum/thread title. |
166 | 166 | // |
167 | -function show_forum_title($category, $forum, $thread, $link_thread=false) { |
|
167 | +function show_forum_title($category, $forum, $thread, $link_thread = false) { |
|
168 | 168 | if ($category) { |
169 | 169 | $is_helpdesk = $category->is_helpdesk; |
170 | 170 | } else { |
171 | 171 | $is_helpdesk = false; |
172 | 172 | } |
173 | 173 | |
174 | - $where = $is_helpdesk?tra("Questions and Answers"):tra("Message boards"); |
|
175 | - $top_url = $is_helpdesk?"forum_help_desk.php":"forum_index.php"; |
|
174 | + $where = $is_helpdesk ?tra("Questions and Answers") : tra("Message boards"); |
|
175 | + $top_url = $is_helpdesk ? "forum_help_desk.php" : "forum_index.php"; |
|
176 | 176 | |
177 | 177 | if (!$forum && !$thread) { |
178 | 178 | echo "<span class=\"title\">$where</span>\n"; |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } |
201 | 201 | } |
202 | 202 | |
203 | -function show_team_forum_title($forum, $thread=null, $link_thread=false) { |
|
203 | +function show_team_forum_title($forum, $thread = null, $link_thread = false) { |
|
204 | 204 | $team = BoincTeam::lookup_id($forum->category); |
205 | 205 | echo "<span class=title> |
206 | 206 | <a href=\"forum_index.php\">".tra("Message boards")."</a> : |
@@ -233,12 +233,12 @@ discard block |
||
233 | 233 | } |
234 | 234 | |
235 | 235 | function page_link($url, $page_num, $items_per_page, $text) { |
236 | - return " <a href=\"$url&start=" . $page_num*$items_per_page . "\">$text</a> "; |
|
236 | + return " <a href=\"$url&start=".$page_num*$items_per_page."\">$text</a> "; |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | // return a string for navigating pages |
240 | 240 | // |
241 | -function page_links($url, $nitems, $items_per_page, $start){ |
|
241 | +function page_links($url, $nitems, $items_per_page, $start) { |
|
242 | 242 | // How many pages to potentially show before and after this one: |
243 | 243 | $preshow = 3; |
244 | 244 | $postshow = 3; |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | $x = ""; |
247 | 247 | |
248 | 248 | if ($nitems <= $items_per_page) return ""; |
249 | - $npages = ceil($nitems / $items_per_page); |
|
250 | - $curpage = ceil($start / $items_per_page); |
|
249 | + $npages = ceil($nitems/$items_per_page); |
|
250 | + $curpage = ceil($start/$items_per_page); |
|
251 | 251 | |
252 | 252 | // If this is not the first page, display "previous" |
253 | 253 | // |
254 | - if ($curpage > 0){ |
|
254 | + if ($curpage > 0) { |
|
255 | 255 | $x .= page_link( |
256 | - $url, $curpage-1, $items_per_page, |
|
256 | + $url, $curpage - 1, $items_per_page, |
|
257 | 257 | tra("Previous")." · " |
258 | 258 | ); |
259 | 259 | } |
@@ -268,8 +268,8 @@ discard block |
||
268 | 268 | } |
269 | 269 | // Display a list of pages surrounding this one |
270 | 270 | // |
271 | - for ($i=$curpage-$preshow; $i<=$curpage+$postshow; $i++){ |
|
272 | - $page_str = (string)($i+1); |
|
271 | + for ($i = $curpage - $preshow; $i <= $curpage + $postshow; $i++) { |
|
272 | + $page_str = (string)($i + 1); |
|
273 | 273 | if ($i < 0) continue; |
274 | 274 | if ($i >= $npages) break; |
275 | 275 | |
@@ -278,20 +278,20 @@ discard block |
||
278 | 278 | } else { |
279 | 279 | $x .= page_link($url, $i, $items_per_page, $page_str); |
280 | 280 | } |
281 | - if ($i == $npages-1) break; |
|
282 | - if ($i == $curpage+$postshow) break; |
|
281 | + if ($i == $npages - 1) break; |
|
282 | + if ($i == $curpage + $postshow) break; |
|
283 | 283 | $x .= " · "; |
284 | 284 | } |
285 | 285 | |
286 | - if ($curpage + $postshow < $npages-1) { |
|
286 | + if ($curpage + $postshow < $npages - 1) { |
|
287 | 287 | $x .= " . . . "; |
288 | - $x .= page_link($url, $npages-1, $items_per_page, $npages); |
|
288 | + $x .= page_link($url, $npages - 1, $items_per_page, $npages); |
|
289 | 289 | } |
290 | 290 | // If there is a next page |
291 | 291 | // |
292 | - if ($curpage < $npages-1){ |
|
292 | + if ($curpage < $npages - 1) { |
|
293 | 293 | $x .= page_link( |
294 | - $url, $curpage+1, $items_per_page, |
|
294 | + $url, $curpage + 1, $items_per_page, |
|
295 | 295 | " · ".tra("Next") |
296 | 296 | ); |
297 | 297 | } |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | function cleanup_title($title) { |
313 | 313 | $x = sanitize_tags(bb2html($title)); |
314 | 314 | $x = trim($x); |
315 | - if (strlen($x)==0) return "(no title)"; |
|
315 | + if (strlen($x) == 0) return "(no title)"; |
|
316 | 316 | else return $x; |
317 | 317 | } |
318 | 318 | |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $i = 0; |
375 | 375 | foreach ($posts as $post) { |
376 | 376 | if ($post->id == $postid) { |
377 | - $start = $i - ($i % $num_to_show); |
|
377 | + $start = $i - ($i%$num_to_show); |
|
378 | 378 | $jump_to_post = $post; |
379 | 379 | break; |
380 | 380 | } |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | // if jump to post, figure out what page to show |
402 | 402 | // |
403 | 403 | if ($jump_to_post) { |
404 | - $start = $ibest - ($ibest % $num_to_show); |
|
404 | + $start = $ibest - ($ibest%$num_to_show); |
|
405 | 405 | } else { |
406 | 406 | $start = $default_start; |
407 | 407 | } |
@@ -503,8 +503,8 @@ discard block |
||
503 | 503 | // Generates a table row with two cells: author and message |
504 | 504 | // |
505 | 505 | function show_post( |
506 | - $post, $thread, $forum, $logged_in_user, $start=0, |
|
507 | - $latest_viewed=0, $controls=FORUM_CONTROLS, $filter=true |
|
506 | + $post, $thread, $forum, $logged_in_user, $start = 0, |
|
507 | + $latest_viewed = 0, $controls = FORUM_CONTROLS, $filter = true |
|
508 | 508 | ) { |
509 | 509 | global $country_to_iso3166_2; |
510 | 510 | |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | |
517 | 517 | // If the user no longer exists, skip the post |
518 | 518 | // |
519 | - if (!$user){ |
|
519 | + if (!$user) { |
|
520 | 520 | return; |
521 | 521 | } |
522 | 522 | |
@@ -532,9 +532,9 @@ discard block |
||
532 | 532 | // check whether the poster is on the list of people to ignore |
533 | 533 | // |
534 | 534 | $ignore_poster = false; |
535 | - if ($logged_in_user){ |
|
535 | + if ($logged_in_user) { |
|
536 | 536 | $tokens = url_tokens($logged_in_user->authenticator); |
537 | - if (is_ignoring($logged_in_user, $user)){ |
|
537 | + if (is_ignoring($logged_in_user, $user)) { |
|
538 | 538 | $ignore_poster = true; |
539 | 539 | } |
540 | 540 | } |
@@ -548,8 +548,8 @@ discard block |
||
548 | 548 | if (is_moderator($logged_in_user, $forum)) { |
549 | 549 | $can_edit = true; |
550 | 550 | } else if (can_reply($thread, $forum, $logged_in_user)) { |
551 | - $time_limit = $post->timestamp+MAXIMUM_EDIT_TIME; |
|
552 | - $can_edit = time()<$time_limit; |
|
551 | + $time_limit = $post->timestamp + MAXIMUM_EDIT_TIME; |
|
552 | + $can_edit = time() < $time_limit; |
|
553 | 553 | } else { |
554 | 554 | $can_edit = false; |
555 | 555 | } |
@@ -559,24 +559,24 @@ discard block |
||
559 | 559 | // Print the special user lines, if any |
560 | 560 | // |
561 | 561 | global $special_user_bitfield; |
562 | - $fstatus=""; |
|
562 | + $fstatus = ""; |
|
563 | 563 | $keys = array_keys($special_user_bitfield); |
564 | 564 | $is_posted_by_special = false; |
565 | - for ($i=0; $i<sizeof($special_user_bitfield);$i++) { |
|
565 | + for ($i = 0; $i < sizeof($special_user_bitfield); $i++) { |
|
566 | 566 | if ($user->prefs && $user->prefs->privilege($keys[$i])) { |
567 | - $fstatus.="<nobr>".$special_user_bitfield[$keys[$i]]."<nobr><br>"; |
|
567 | + $fstatus .= "<nobr>".$special_user_bitfield[$keys[$i]]."<nobr><br>"; |
|
568 | 568 | $is_posted_by_special = true; |
569 | 569 | } |
570 | 570 | } |
571 | 571 | |
572 | 572 | // Highlight special users if set in prefs; |
573 | 573 | // |
574 | - if ($logged_in_user && $logged_in_user->prefs){ |
|
574 | + if ($logged_in_user && $logged_in_user->prefs) { |
|
575 | 575 | $highlight = $logged_in_user->prefs->highlight_special && $is_posted_by_special; |
576 | 576 | } else { |
577 | 577 | $highlight = $is_posted_by_special; |
578 | 578 | } |
579 | - $class = $highlight?' style="border-left: 5px solid LightGreen" ':''; |
|
579 | + $class = $highlight ? ' style="border-left: 5px solid LightGreen" ' : ''; |
|
580 | 580 | |
581 | 581 | // row and start of author col |
582 | 582 | // |
@@ -588,12 +588,12 @@ discard block |
||
588 | 588 | |
589 | 589 | echo user_links($user, 0, 30); |
590 | 590 | echo "<br>"; |
591 | - if ($user->create_time > time()-ST_NEW_TIME) $fstatus.=ST_NEW."<br>"; |
|
591 | + if ($user->create_time > time() - ST_NEW_TIME) $fstatus .= ST_NEW."<br>"; |
|
592 | 592 | echo "<span class=\"small\">"; |
593 | 593 | if ($fstatus) echo "$fstatus"; |
594 | 594 | |
595 | - if (!$filter || !$ignore_poster){ |
|
596 | - if ($user->prefs && $user->prefs->avatar!="" && (!$logged_in_user || ($logged_in_user->prefs->hide_avatars==false))) { |
|
595 | + if (!$filter || !$ignore_poster) { |
|
596 | + if ($user->prefs && $user->prefs->avatar != "" && (!$logged_in_user || ($logged_in_user->prefs->hide_avatars == false))) { |
|
597 | 597 | echo "<img width=\"".AVATAR_WIDTH."\" height=\"".AVATAR_HEIGHT."\" src=\"".avatar_url($user->prefs->avatar)."\" alt=\"Avatar\"><br>"; |
598 | 598 | } |
599 | 599 | } |
@@ -601,14 +601,14 @@ discard block |
||
601 | 601 | |
602 | 602 | $url = "pm.php?action=new&userid=".$user->id; |
603 | 603 | $name = $user->name; |
604 | - show_button_small($url, tra("Send message"), tra("Send %1 a private message",$name)); |
|
604 | + show_button_small($url, tra("Send message"), tra("Send %1 a private message", $name)); |
|
605 | 605 | echo '<br>'.tra("Joined: %1", gmdate('j M y', $user->create_time)), "<br>"; |
606 | 606 | |
607 | 607 | if (!isset($user->nposts)) { |
608 | 608 | $user->nposts = BoincPost::count("user=$user->id"); |
609 | 609 | } |
610 | 610 | |
611 | - if (function_exists('project_forum_user_info')){ |
|
611 | + if (function_exists('project_forum_user_info')) { |
|
612 | 612 | project_forum_user_info($user); |
613 | 613 | } else { |
614 | 614 | echo tra("Posts: %1", $user->nposts)."<br>"; |
@@ -617,8 +617,8 @@ discard block |
||
617 | 617 | // |
618 | 618 | //echo "ID: ".$user->id."<br>"; |
619 | 619 | if (!NO_COMPUTING) { |
620 | - echo tra("Credit: %1", number_format($user->total_credit)) ."<br>"; |
|
621 | - echo tra("RAC: %1", number_format($user->expavg_credit))."<br>"; |
|
620 | + echo tra("Credit: %1", number_format($user->total_credit))."<br>"; |
|
621 | + echo tra("RAC: %1", number_format($user->expavg_credit))."<br>"; |
|
622 | 622 | } |
623 | 623 | |
624 | 624 | // to use this feature: |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | echo "<form action=\"forum_rate.php?post=", $post->id, "\" method=\"post\">"; |
648 | 648 | } |
649 | 649 | |
650 | - if ($logged_in_user && $post->timestamp > $latest_viewed){ |
|
650 | + if ($logged_in_user && $post->timestamp > $latest_viewed) { |
|
651 | 651 | show_image(NEW_IMAGE, tra("You haven't read this message yet"), tra("Unread"), NEW_IMAGE_HEIGHT); |
652 | 652 | } |
653 | 653 | |
@@ -667,8 +667,8 @@ discard block |
||
667 | 667 | if ($post->modified) { |
668 | 668 | echo "<br>".tra("Last modified: %1", pretty_time_Str($post->modified)); |
669 | 669 | } |
670 | - if ($ignore_poster && $filter){ |
|
671 | - echo "<br>" .tra( |
|
670 | + if ($ignore_poster && $filter) { |
|
671 | + echo "<br>".tra( |
|
672 | 672 | "This post is hidden because the sender is on your 'ignore' list. Click %1 here %2 to view hidden posts", |
673 | 673 | "<a href=\"?id=".$thread->id."&filter=false&start=$start#".$post->id."\">", |
674 | 674 | "</a>" |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | <p> |
682 | 682 | "; |
683 | 683 | |
684 | - if (!$filter || !$ignore_poster){ |
|
684 | + if (!$filter || !$ignore_poster) { |
|
685 | 685 | $posttext = $post->content; |
686 | 686 | |
687 | 687 | // If the creator of this post has a signature and |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | // user has signatures enabled: show it |
690 | 690 | // |
691 | 691 | $posttext = output_transform($posttext, $options); |
692 | - if ($post->signature && (!$logged_in_user || !$logged_in_user->prefs->hide_signatures)){ |
|
692 | + if ($post->signature && (!$logged_in_user || !$logged_in_user->prefs->hide_signatures)) { |
|
693 | 693 | $sig = output_transform($user->prefs->signature, $options); |
694 | 694 | $posttext .= "<hr>$sig\n"; |
695 | 695 | } |
@@ -723,10 +723,10 @@ discard block |
||
723 | 723 | } |
724 | 724 | if (($controls == FORUM_CONTROLS) && (can_reply($thread, $forum, $logged_in_user))) { |
725 | 725 | echo " "; |
726 | - $url = "forum_reply.php?thread=" . $thread->id . "&post=" . $post->id . "&no_quote=1#input"; |
|
726 | + $url = "forum_reply.php?thread=".$thread->id."&post=".$post->id."&no_quote=1#input"; |
|
727 | 727 | // "Reply" is used as a verb |
728 | 728 | show_button($url, tra("Reply"), tra("Post a reply to this message")); |
729 | - $url = "forum_reply.php?thread=" . $thread->id . "&post=" . $post->id . "#input"; |
|
729 | + $url = "forum_reply.php?thread=".$thread->id."&post=".$post->id."#input"; |
|
730 | 730 | // "Quote" is used as a verb |
731 | 731 | show_button($url, tra("Quote"), tra("Post a reply by quoting this message")); |
732 | 732 | } |
@@ -798,9 +798,9 @@ discard block |
||
798 | 798 | |
799 | 799 | function post_rules() { |
800 | 800 | if (function_exists("project_forum_post_rules")) { |
801 | - $project_rules=project_forum_post_rules(); |
|
801 | + $project_rules = project_forum_post_rules(); |
|
802 | 802 | } else { |
803 | - $project_rules=""; |
|
803 | + $project_rules = ""; |
|
804 | 804 | } |
805 | 805 | return sprintf(" |
806 | 806 | <ul> |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | ); |
830 | 830 | } |
831 | 831 | |
832 | -function post_warning($forum=null) { |
|
832 | +function post_warning($forum = null) { |
|
833 | 833 | $x = "<br><br> |
834 | 834 | <table><tr><td align=left> |
835 | 835 | "; |
@@ -889,7 +889,7 @@ discard block |
||
889 | 889 | $content = substr($content, 0, 64000); |
890 | 890 | $content = BoincDb::escape_string($content); |
891 | 891 | $now = time(); |
892 | - $sig = $signature?1:0; |
|
892 | + $sig = $signature ? 1 : 0; |
|
893 | 893 | $id = BoincPost::insert("(thread, user, timestamp, content, modified, parent_post, score, votes, signature, hidden) values ($thread->id, $user->id, $now, '$content', 0, $parent_id, 0, 0, $sig, 0)"); |
894 | 894 | if (!$id) { |
895 | 895 | $forum_error = "Failed to add post to DB."; |
@@ -909,7 +909,7 @@ discard block |
||
909 | 909 | // |
910 | 910 | function update_thread_timestamp($thread) { |
911 | 911 | $posts = BoincPost::enum("thread=$thread->id and hidden=0 order by timestamp desc limit 1"); |
912 | - if (count($posts)>0) { |
|
912 | + if (count($posts) > 0) { |
|
913 | 913 | $post = $posts[0]; |
914 | 914 | $thread->update("timestamp=$post->timestamp"); |
915 | 915 | } |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | |
918 | 918 | function update_forum_timestamp($forum) { |
919 | 919 | $threads = BoincThread::enum("forum=$forum->id and hidden=0 order by timestamp desc limit 1"); |
920 | - if (count($threads)>0) { |
|
920 | + if (count($threads) > 0) { |
|
921 | 921 | $thread = $threads[0]; |
922 | 922 | $forum->update("timestamp=$thread->timestamp"); |
923 | 923 | } |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | if (is_news_forum($forum) && !$export) { |
941 | 941 | $status = 1; |
942 | 942 | } |
943 | - $id = BoincThread::insert("(forum, owner, status, title, timestamp, views, replies, activity, sufferers, score, votes, create_time, hidden, sticky, locked) values ($forum->id, $user->id, $status, '$title', $now, 0, -1, 0, 0, 0, 0, $now, 0, 0, 0)"); |
|
943 | + $id = BoincThread::insert("(forum, owner, status, title, timestamp, views, replies, activity, sufferers, score, votes, create_time, hidden, sticky, locked) values ($forum->id, $user->id, $status, '$title', $now, 0, -1, 0, 0, 0, 0, $now, 0, 0, 0)"); |
|
944 | 944 | if (!$id) { |
945 | 945 | $forum_error = "Failed to add thread to DB."; |
946 | 946 | return null; |
@@ -1068,22 +1068,22 @@ discard block |
||
1068 | 1068 | // $sticky - bool (not directly passed to SQL) |
1069 | 1069 | // |
1070 | 1070 | function get_forum_threads( |
1071 | - $forumID, $start=-1, $nRec=-1, $sort_style=MODIFIED_NEW, |
|
1071 | + $forumID, $start = -1, $nRec = -1, $sort_style = MODIFIED_NEW, |
|
1072 | 1072 | $show_hidden = 0, $sticky = 1 |
1073 | 1073 | ) { |
1074 | 1074 | //if (! (is_numeric($forumID) && is_numeric($min) && is_numeric($nRec))) { |
1075 | 1075 | // return NULL; // Something is wrong here. |
1076 | 1076 | //} |
1077 | 1077 | |
1078 | - $sql = 'forum = ' . $forumID ; |
|
1078 | + $sql = 'forum = '.$forumID; |
|
1079 | 1079 | $stickysql = ""; |
1080 | - if ($sticky){ |
|
1080 | + if ($sticky) { |
|
1081 | 1081 | $stickysql = "sticky DESC, "; |
1082 | 1082 | } |
1083 | 1083 | if (!$show_hidden) { |
1084 | 1084 | $sql .= ' AND hidden = 0'; |
1085 | 1085 | } |
1086 | - switch($sort_style) { |
|
1086 | + switch ($sort_style) { |
|
1087 | 1087 | case MODIFIED_NEW: |
1088 | 1088 | $sql .= ' ORDER BY '.$stickysql.'timestamp DESC'; |
1089 | 1089 | break; |
@@ -1136,7 +1136,7 @@ discard block |
||
1136 | 1136 | if (!$show_hidden) { |
1137 | 1137 | $sql .= ' AND hidden = 0'; |
1138 | 1138 | } |
1139 | - switch($sort_style) { |
|
1139 | + switch ($sort_style) { |
|
1140 | 1140 | case CREATE_TIME_NEW: |
1141 | 1141 | $sql .= ' ORDER BY timestamp desc'; |
1142 | 1142 | break; |
@@ -1158,7 +1158,7 @@ discard block |
||
1158 | 1158 | // |
1159 | 1159 | function show_post_moderation_links( |
1160 | 1160 | $config, $logged_in_user, $post, $forum, $tokens |
1161 | -){ |
|
1161 | +) { |
|
1162 | 1162 | $moderators_allowed_to_ban = parse_bool($config, "moderators_allowed_to_ban"); |
1163 | 1163 | $moderators_vote_to_ban = parse_bool($config, "moderators_vote_to_ban"); |
1164 | 1164 | |
@@ -1245,14 +1245,14 @@ discard block |
||
1245 | 1245 | // We do not tell the (ab)user how much this is - |
1246 | 1246 | // no need to make it easy for them to break the system. |
1247 | 1247 | // |
1248 | - if ($user->total_credit<$forum->post_min_total_credit || $user->expavg_credit<$forum->post_min_expavg_credit) { |
|
1248 | + if ($user->total_credit < $forum->post_min_total_credit || $user->expavg_credit < $forum->post_min_expavg_credit) { |
|
1249 | 1249 | error_page(tra("To create a new thread in %1 you must have a certain level of average credit. This is to protect against abuse of the system.", $forum->title)); |
1250 | 1250 | } |
1251 | 1251 | |
1252 | 1252 | // If the user is posting faster than forum regulations allow |
1253 | 1253 | // Tell the user to wait a while before creating any more posts |
1254 | 1254 | // |
1255 | - if (time()-$user->prefs->last_post <$forum->post_min_interval) { |
|
1255 | + if (time() - $user->prefs->last_post < $forum->post_min_interval) { |
|
1256 | 1256 | error_page(tra("You cannot create threads right now. Please wait before trying again. This is to protect against abuse of the system.")); |
1257 | 1257 | } |
1258 | 1258 | } |
@@ -1280,7 +1280,7 @@ discard block |
||
1280 | 1280 | |
1281 | 1281 | function is_moderator($user, $forum) { |
1282 | 1282 | if (!$user) return false; |
1283 | - $type = $forum?$forum->parent_type:0; |
|
1283 | + $type = $forum ? $forum->parent_type : 0; |
|
1284 | 1284 | switch ($type) { |
1285 | 1285 | case 0: |
1286 | 1286 | if ($user->prefs->privilege(S_MODERATOR)) return true; |
@@ -1317,7 +1317,7 @@ discard block |
||
1317 | 1317 | if (!is_forum_visible_to_user($thread_forum, $user)) return; |
1318 | 1318 | $owner = BoincUser::lookup_id($thread->owner); |
1319 | 1319 | echo "<tr><td>\n"; |
1320 | - switch($thread_forum->parent_type) { |
|
1320 | + switch ($thread_forum->parent_type) { |
|
1321 | 1321 | case 0: |
1322 | 1322 | $category = BoincCategory::lookup_id($thread_forum->category); |
1323 | 1323 | show_forum_title($category, $thread_forum, $thread, true); |
@@ -1327,7 +1327,7 @@ discard block |
||
1327 | 1327 | break; |
1328 | 1328 | } |
1329 | 1329 | echo ' |
1330 | - </td><td class="numbers">'.($thread->replies+1).'</td> |
|
1330 | + </td><td class="numbers">'.($thread->replies + 1).'</td> |
|
1331 | 1331 | <td>'.user_links($owner).'</td> |
1332 | 1332 | <td class="numbers">'.$thread->views.'</td> |
1333 | 1333 | <td class="lastpost">'.time_diff_str($thread->timestamp, time()).'</td> |
@@ -1361,13 +1361,13 @@ discard block |
||
1361 | 1361 | |
1362 | 1362 | function subscribed_post_web_line($notify) { |
1363 | 1363 | $thread = BoincThread::lookup_id($notify->opaque); |
1364 | - return tra("New posts in the thread %1","<a href=forum_thread.php?id=$thread->id>$thread->title</a>"); |
|
1364 | + return tra("New posts in the thread %1", "<a href=forum_thread.php?id=$thread->id>$thread->title</a>"); |
|
1365 | 1365 | } |
1366 | 1366 | |
1367 | 1367 | function subscribe_rss($notify, &$title, &$msg, &$url) { |
1368 | 1368 | $thread = BoincThread::lookup_id($notify->opaque); |
1369 | 1369 | $title = tra("New posts in subscribed thread"); |
1370 | - $msg = tra("There are new posts in the thread '%1'",$thread->title); |
|
1370 | + $msg = tra("There are new posts in the thread '%1'", $thread->title); |
|
1371 | 1371 | $url = secure_url_base()."forum_thread.php?id=$thread->id"; |
1372 | 1372 | } |
1373 | 1373 |