@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $y = []; |
26 | 26 | $x[] = sprintf('%s%s', |
27 | 27 | user_links($user, BADGE_HEIGHT_MEDIUM), |
28 | - UNIQUE_USER_NAME?'':" (ID $user->id)" |
|
28 | + UNIQUE_USER_NAME ? '' : " (ID $user->id)" |
|
29 | 29 | ); |
30 | 30 | $y[] = null; |
31 | 31 | if (!DISABLE_TEAMS) { |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $where = "true"; |
109 | 109 | $search_string = get_str('search_string'); |
110 | 110 | if (strlen($search_string)) { |
111 | - if (strlen($search_string)<3) { |
|
111 | + if (strlen($search_string) < 3) { |
|
112 | 112 | error_page(tra("search string must be at least 3 characters")); |
113 | 113 | } |
114 | 114 | $s = BoincDb::escape_string($search_string); |
@@ -140,17 +140,17 @@ discard block |
||
140 | 140 | $search_type = get_str('search_type', true); |
141 | 141 | $order_clause = "id desc"; |
142 | 142 | if ($search_type == 'rac') { |
143 | - $order_clause ="expavg_credit desc"; |
|
143 | + $order_clause = "expavg_credit desc"; |
|
144 | 144 | } else if ($search_type == 'total') { |
145 | - $order_clause ="total_credit desc"; |
|
145 | + $order_clause = "total_credit desc"; |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | $fields = "id, create_time, name, country, total_credit, expavg_credit, teamid, url, has_profile, donated"; |
149 | 149 | $users = BoincUser::enum_fields($fields, $where, "order by $order_clause limit 100"); |
150 | 150 | page_head(tra("User search results")); |
151 | - $n=0; |
|
151 | + $n = 0; |
|
152 | 152 | foreach ($users as $user) { |
153 | - if ($n==0) { |
|
153 | + if ($n == 0) { |
|
154 | 154 | start_table('table-striped'); |
155 | 155 | $x = ['Name']; |
156 | 156 | $y = [null]; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | start_table('table-striped'); |
28 | 28 | |
29 | 29 | $x = ['User']; |
30 | - for ($i=0; $i<S_NFLAGS; $i++) { |
|
30 | + for ($i = 0; $i < S_NFLAGS; $i++) { |
|
31 | 31 | $x[] = $special_user_bitfield[$i]; |
32 | 32 | } |
33 | 33 | $x[] = ''; |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | $pref->userid |
43 | 43 | ); |
44 | 44 | $x = ["$user->name ($user->id)"]; |
45 | - for ($j=0; $j<S_NFLAGS; $j++) { |
|
45 | + for ($j = 0; $j < S_NFLAGS; $j++) { |
|
46 | 46 | $bit = substr($pref->special_user, $j, 1); |
47 | - $c = ($bit == 1)?"checked":""; |
|
47 | + $c = ($bit == 1) ? "checked" : ""; |
|
48 | 48 | $x[] = sprintf( |
49 | 49 | '<input type="checkbox" name="role%d" value="1" %s>', |
50 | 50 | $j, $c |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | echo '<form action="user_permissions.php" method="POST">'; |
59 | 59 | $x = ['Add User ID: <input type="text" name="userid" size="6">']; |
60 | - for ($j=0; $j<S_NFLAGS; $j++) { |
|
60 | + for ($j = 0; $j < S_NFLAGS; $j++) { |
|
61 | 61 | $x[] = sprintf( |
62 | 62 | '<input type="checkbox" name="role%d" value="1">', |
63 | 63 | $j |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if (!$user) error_page('no user'); |
78 | 78 | BoincForumPrefs::lookup($user); |
79 | 79 | |
80 | - for ($i=0; $i<S_NFLAGS; $i++) { |
|
80 | + for ($i = 0; $i < S_NFLAGS; $i++) { |
|
81 | 81 | if (post_int("role$i", true) == 1) { |
82 | 82 | $bitset .= '1'; |
83 | 83 | echo "<br> setting $i"; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | // Also error-check values, and return errors in $errors->* |
34 | 34 | |
35 | 35 | function option($name, $val) { |
36 | - $x = ($name == $val) ? "selected" : ""; |
|
36 | + $x = ($name == $val) ? "selected" : ""; |
|
37 | 37 | return "<option name='$name' $x>$name\n"; |
38 | 38 | } |
39 | 39 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | if (APP_SELECT_PREFS) { |
54 | 54 | $app_array = array(); |
55 | 55 | $apps = BoincApp::enum("deprecated=0"); |
56 | - foreach($apps as $app) { |
|
56 | + foreach ($apps as $app) { |
|
57 | 57 | $app_array[] = array($app->id, $app->user_friendly_name); |
58 | 58 | } |
59 | 59 | } else { |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | function number_select($name, $max, $n) { |
94 | - $sel = ($n == 0) ? "selected":""; |
|
94 | + $sel = ($n == 0) ? "selected" : ""; |
|
95 | 95 | $x = "<select class=\"form-control input-sm\" name=$name> <option value=0 $sel>".tra("No limit")."</option>"; |
96 | - for ($i=1; $i<=$max; $i++) { |
|
97 | - $sel = ($n == $i) ? "selected":""; |
|
96 | + for ($i = 1; $i <= $max; $i++) { |
|
97 | + $sel = ($n == $i) ? "selected" : ""; |
|
98 | 98 | $x .= "<option value=$i $sel>$i</option>"; |
99 | 99 | } |
100 | 100 | $x .= "</select>"; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | return tra("No limit"); |
107 | 107 | } |
108 | 108 | |
109 | -function project_specific_prefs_edit($prefs, $error=false) { |
|
109 | +function project_specific_prefs_edit($prefs, $error = false) { |
|
110 | 110 | global $app_array; |
111 | 111 | if (COLOR_PREFS) { |
112 | 112 | $x = $prefs->color_scheme; |
@@ -132,15 +132,15 @@ discard block |
||
132 | 132 | } else { |
133 | 133 | $present = true; |
134 | 134 | } |
135 | - $checked = $present?"checked":""; |
|
135 | + $checked = $present ? "checked" : ""; |
|
136 | 136 | $x .= "<input type=checkbox name=app_id_$app_id $checked> $app_name<br>"; |
137 | 137 | } |
138 | 138 | tooltip_row2(APP_SELECT_TOOLTIP, APP_SELECT_DESC, $x); |
139 | - $checked = $prefs->allow_non_preferred_apps?"checked":""; |
|
139 | + $checked = $prefs->allow_non_preferred_apps ? "checked" : ""; |
|
140 | 140 | row2(ACCEPT_ANY_DESC, "<input type=checkbox name=allow_non_preferred_apps $checked>"); |
141 | 141 | } |
142 | 142 | if (NON_GRAPHICAL_PREF) { |
143 | - $checked = $prefs->non_graphical?"checked":""; |
|
143 | + $checked = $prefs->non_graphical ? "checked" : ""; |
|
144 | 144 | row2( |
145 | 145 | NON_GRAPHICAL_DESC, |
146 | 146 | "<input type=checkbox name=non_graphical $checked>" |
@@ -216,11 +216,11 @@ discard block |
||
216 | 216 | return $x; |
217 | 217 | } |
218 | 218 | |
219 | -function project_specific_prefs_show($prefs, $columns=false) { |
|
219 | +function project_specific_prefs_show($prefs, $columns = false) { |
|
220 | 220 | global $app_array; |
221 | 221 | if ($columns) { |
222 | 222 | if (COLOR_PREFS) { |
223 | - row_defs(COLOR_DESC,"color_scheme", "", "", $prefs); |
|
223 | + row_defs(COLOR_DESC, "color_scheme", "", "", $prefs); |
|
224 | 224 | } |
225 | 225 | if (GFX_CPU_PREFS) { |
226 | 226 | row_defs(MAX_GFX_CPU_PCT_DESC, "max_gfx_cpu_pct", "", "", $prefs); |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | row2(ACCEPT_ANY_DESC, $prefs->allow_non_preferred_apps_text); |
255 | 255 | } |
256 | 256 | if (NON_GRAPHICAL_PREF) { |
257 | - row2(NON_GRAPHICAL_DESC, $prefs->non_graphical?tra("yes"):tra("no")); |
|
257 | + row2(NON_GRAPHICAL_DESC, $prefs->non_graphical ?tra("yes") : tra("no")); |
|
258 | 258 | } |
259 | 259 | if (MAX_JOBS_PREF) { |
260 | 260 | row2(tra("Max # jobs"), limit_string($prefs->max_jobs)); |
@@ -277,12 +277,12 @@ discard block |
||
277 | 277 | $cursor = 0; |
278 | 278 | while ($thisxml = parse_next_element($prefs_xml, "<app_id>", $cursor)) { |
279 | 279 | if (is_numeric($thisxml)) { |
280 | - $n = (int) $thisxml; |
|
280 | + $n = (int)$thisxml; |
|
281 | 281 | $prefs->app_ids[] = $n; |
282 | 282 | } |
283 | 283 | } |
284 | 284 | $prefs->allow_non_preferred_apps = parse_element($prefs_xml, "<allow_non_preferred_apps>"); |
285 | - $prefs->allow_non_preferred_apps_text = $prefs->allow_non_preferred_apps?"yes":"no"; |
|
285 | + $prefs->allow_non_preferred_apps_text = $prefs->allow_non_preferred_apps ? "yes" : "no"; |
|
286 | 286 | } |
287 | 287 | if (NON_GRAPHICAL_PREF) { |
288 | 288 | $prefs->non_graphical = parse_bool($prefs_xml, "non_graphical"); |
@@ -147,11 +147,11 @@ |
||
147 | 147 | |
148 | 148 | function site_list($sites) { |
149 | 149 | echo "<ul>\n"; |
150 | - for ($i=0; $i<count($sites); $i++) { |
|
150 | + for ($i = 0; $i < count($sites); $i++) { |
|
151 | 151 | $s = $sites[$i]; |
152 | 152 | $url = $s[0]; |
153 | 153 | $name = $s[1]; |
154 | - $comment = array_key_exists(2, $s)?$s[2]:""; |
|
154 | + $comment = array_key_exists(2, $s) ? $s[2] : ""; |
|
155 | 155 | echo "<li><a href=\"$url\">$name</a> $comment\n"; |
156 | 156 | } |
157 | 157 | echo "</ul>\n"; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | row2('<b>'.tra('Search criteria (use one or more)').'</b>', ''); |
41 | 41 | row2( |
42 | 42 | tra('Key words').'<br><small>'.tra('Find teams with these words in their names or descriptions').'</small>', |
43 | - '<input class="form-control" type="text" name="keywords" value="' . htmlspecialchars($params->keywords) . '">'); |
|
43 | + '<input class="form-control" type="text" name="keywords" value="'.htmlspecialchars($params->keywords).'">'); |
|
44 | 44 | row2_init(tra('Country')); |
45 | 45 | echo '<select class="form-control" name="country"><option value="" selected>---</option>'; |
46 | 46 | $country = $params->country; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | echo country_select_options($country); |
49 | 49 | echo "</select></td></tr>\n"; |
50 | 50 | row2(tra('Type of team'), team_type_select($params->type, true)); |
51 | - $checked = $params->active?"checked":""; |
|
51 | + $checked = $params->active ? "checked" : ""; |
|
52 | 52 | row2(tra('Show only active teams'), "<input type=checkbox name=active $checked>"); |
53 | 53 | row2("", "<input class=\"btn btn-primary\" type=submit name=submit value=\"".tra('Search')."\">"); |
54 | 54 | end_table(); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | row2("Created", date_str($team->create_time)); |
96 | 96 | if (defined("SHOW_NONVALIDATED_TEAMS")) { |
97 | 97 | $founder = $team->founder; |
98 | - row2("Founder email validated", $founder->email_validated?"Yes":"No (team will not be exported)"); |
|
98 | + row2("Founder email validated", $founder->email_validated ? "Yes" : "No (team will not be exported)"); |
|
99 | 99 | } |
100 | 100 | if (strlen($team->url)) {; |
101 | 101 | if (strstr($team->url, "http://")) { |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | row1(tra('Members')); |
170 | 170 | row2(tra('Founder'), |
171 | - $team->founder?user_links($team->founder, BADGE_HEIGHT_MEDIUM):"---" |
|
171 | + $team->founder ?user_links($team->founder, BADGE_HEIGHT_MEDIUM) : "---" |
|
172 | 172 | ); |
173 | 173 | if (count($team->admins)) { |
174 | 174 | $first = true; |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | foreach ($deltas as $delta) { |
356 | 356 | $u = BoincUser::lookup_id($delta->userid); |
357 | 357 | if ($u->teamid == $teamid) { |
358 | - $new_members[] = $u->id; // they might have later quit |
|
358 | + $new_members[] = $u->id; // they might have later quit |
|
359 | 359 | } |
360 | 360 | } |
361 | 361 | return array_unique($new_members); |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | if (!$user->teamid) return; |
439 | 439 | $user->update("teamid=0"); |
440 | 440 | $team = BoincTeam::lookup_id($user->teamid); |
441 | - if ($team && $team->ping_user==$user->id) { |
|
441 | + if ($team && $team->ping_user == $user->id) { |
|
442 | 442 | $team->update("ping_user=-ping_user"); |
443 | 443 | } |
444 | 444 | BoincTeamAdmin::delete("teamid=$user->teamid and userid=$user->id"); |
@@ -477,33 +477,33 @@ discard block |
||
477 | 477 | start_table(); |
478 | 478 | row2(tra('Team name, text version').' |
479 | 479 | <br><p class=\"text-muted\">'.tra('Don\'t use HTML tags.').'</p>', |
480 | - '<input class="form-control" name="name" type="text" size="50" value="'.($team?$team->name:"").'">' |
|
480 | + '<input class="form-control" name="name" type="text" size="50" value="'.($team ? $team->name : "").'">' |
|
481 | 481 | ); |
482 | 482 | row2(tra('Team name, HTML version').' |
483 | 483 | <br><p class=\"text-muted\"> |
484 | 484 | '.tra('You may use %1 limited HTML tags %2.', '<a href="html.php" target="_new">', '</a>').' |
485 | 485 | '.tra('If you don\'t know HTML, leave this box blank.').'</p>', |
486 | - '<input class="form-control" name="name_html" type="text" size="50" value="'.str_replace('"',"'",($team?$team->name_html:"")).'">' |
|
486 | + '<input class="form-control" name="name_html" type="text" size="50" value="'.str_replace('"', "'", ($team ? $team->name_html : "")).'">' |
|
487 | 487 | ); |
488 | 488 | row2(tra('URL of team web page, if any').':<br><font size=-2>('.tra('without "http://"').') |
489 | 489 | '.tra('This URL will be linked to from the team\'s page on this site.'), |
490 | - '<input class="form-control" type="text" name="url" size="60" value="'.($team?$team->url:"").'">' |
|
490 | + '<input class="form-control" type="text" name="url" size="60" value="'.($team ? $team->url : "").'">' |
|
491 | 491 | ); |
492 | 492 | row2(tra('Description of team').': |
493 | 493 | <br><p class=\"text-muted\"> |
494 | 494 | '.tra('You may use %1 limited HTML tags %2.', '<a href="html.php" target="_new">', '</a>').' |
495 | 495 | </p>', |
496 | - '<textarea class="form-control" name="description" rows=10>'.($team?$team->description:"").'</textarea>' |
|
496 | + '<textarea class="form-control" name="description" rows=10>'.($team ? $team->description : "").'</textarea>' |
|
497 | 497 | ); |
498 | 498 | |
499 | - row2(tra('Type of team').':', team_type_select($team?$team->type:null)); |
|
499 | + row2(tra('Type of team').':', team_type_select($team ? $team->type : null)); |
|
500 | 500 | |
501 | 501 | row2_init(tra('Country')); |
502 | 502 | echo '<select class="form-control" name="country">'; |
503 | - echo country_select_options($team?$team->country:null); |
|
503 | + echo country_select_options($team ? $team->country : null); |
|
504 | 504 | echo "</select></td></tr>\n"; |
505 | 505 | |
506 | - $x = (!$team || $team->joinable)?"checked":""; |
|
506 | + $x = (!$team || $team->joinable) ? "checked" : ""; |
|
507 | 507 | row2(tra("Accept new members?"), "<input type=checkbox name=joinable $x>"); |
508 | 508 | // Check if we're using reCaptcha to prevent spam accounts |
509 | 509 | // |
@@ -571,12 +571,12 @@ discard block |
||
571 | 571 | // |
572 | 572 | function new_transfer_request_ok($team, $now) { |
573 | 573 | if ($team->ping_user <= 0) { |
574 | - if ($team->ping_time < $now - 60 * 86400) { |
|
574 | + if ($team->ping_time < $now - 60*86400) { |
|
575 | 575 | return true; |
576 | 576 | } |
577 | 577 | return false; |
578 | 578 | } |
579 | - if ($team->ping_time < $now - 90 * 86400) { |
|
579 | + if ($team->ping_time < $now - 90*86400) { |
|
580 | 580 | return true; |
581 | 581 | } |
582 | 582 | return false; |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | if (!is_valid_country($country)) { |
612 | 612 | $country = tra('None'); |
613 | 613 | } |
614 | - $country = BoincDb::escape_string($country); // for Cote d'Ivoire |
|
614 | + $country = BoincDb::escape_string($country); // for Cote d'Ivoire |
|
615 | 615 | |
616 | 616 | $clause = sprintf( |
617 | 617 | "(userid, create_time, name, name_lc, url, type, name_html, description, country, nusers, expavg_time) values(%d, %d, '%s', '%s', '%s', %d, '%s', '%s', '%s', %d, unix_timestamp())", |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if (!$user->has_profile) return null; |
72 | 72 | $profile = BoincProfile::lookup("userid=$user->id"); |
73 | 73 | if (!$profile->has_picture) return null; |
74 | - if (profile_screening() && $profile->verification!=1) return null; |
|
74 | + if (profile_screening() && $profile->verification != 1) return null; |
|
75 | 75 | return profile_thumb_url($user->id); |
76 | 76 | } |
77 | 77 | |
@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | return $image; |
126 | 126 | } |
127 | 127 | |
128 | - ($origWidth > $origHeight)? $scalar = ($origWidth / $targetWidth) : $scalar = ($origHeight / $targetHeight); |
|
128 | + ($origWidth > $origHeight) ? $scalar = ($origWidth/$targetWidth) : $scalar = ($origHeight/$targetHeight); |
|
129 | 129 | |
130 | 130 | if ($scalar != 0) { |
131 | - $destWidth = $origWidth / $scalar; |
|
132 | - $destHeight = $origHeight / $scalar; |
|
131 | + $destWidth = $origWidth/$scalar; |
|
132 | + $destHeight = $origHeight/$scalar; |
|
133 | 133 | } else { |
134 | 134 | $destWidth = $origWidth; |
135 | 135 | $destHeight = $origHeight; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $gd_info = gd_info(); |
139 | 139 | $v = $gd_info["GD Version"]; |
140 | 140 | $v = explode('.', $v); |
141 | - $v = (int)$v[0]; // major version |
|
141 | + $v = (int)$v[0]; // major version |
|
142 | 142 | if ($v >= 2) { |
143 | 143 | // If you are using a modern PHP/GD installation that does |
144 | 144 | // 'truecolor' images, this is what's needed. |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $options->htmlitems = false; |
182 | 182 | $temp = output_transform($profile->response1, $options); |
183 | 183 | $temp = sanitize_tags($temp); |
184 | - $description = "(\"" . sub_sentence($temp, ' ', MAX_DESC_LENGTH, true) . "\")"; |
|
184 | + $description = "(\"".sub_sentence($temp, ' ', MAX_DESC_LENGTH, true)."\")"; |
|
185 | 185 | |
186 | 186 | } |
187 | 187 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | function check_whether_to_show_profile($user, $logged_in_user) { |
193 | 193 | $min_credit = parse_config(get_config(), "<profile_min_credit>"); |
194 | - if (!$logged_in_user && $min_credit && $user->expavg_credit < $min_credit ) { |
|
194 | + if (!$logged_in_user && $min_credit && $user->expavg_credit < $min_credit) { |
|
195 | 195 | error_page( |
196 | 196 | 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) |
197 | 197 | ); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | // |
230 | 230 | $show_picture = $profile->has_picture; |
231 | 231 | if (profile_screening()) { |
232 | - if (!$screen_mode && !$can_edit && $profile->verification!=1) { |
|
232 | + if (!$screen_mode && !$can_edit && $profile->verification != 1) { |
|
233 | 233 | $show_picture = false; |
234 | 234 | } |
235 | 235 | } |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | // yet verified. This will tell them if other users can't view it yet, or |
246 | 246 | // if there is a problem with it and they need to replace it. |
247 | 247 | // |
248 | - if (profile_screening() && $profile->has_picture && $can_edit && $profile->verification!=1) { |
|
248 | + if (profile_screening() && $profile->has_picture && $can_edit && $profile->verification != 1) { |
|
249 | 249 | row1(offensive_profile_warning($profile->verification)); |
250 | 250 | } |
251 | 251 |
@@ -193,7 +193,7 @@ |
||
193 | 193 | $min_credit = parse_config(get_config(), "<profile_min_credit>"); |
194 | 194 | if (!$logged_in_user && $min_credit && $user->expavg_credit < $min_credit ) { |
195 | 195 | error_page( |
196 | - 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) |
|
196 | + 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) |
|
197 | 197 | ); |
198 | 198 | } |
199 | 199 | } |
@@ -27,25 +27,25 @@ |
||
27 | 27 | row_array(array("Name", "Engine", "Version", "Row Format", "Rows", "Avg Row Length (KB)", "Data Length (MB)", "Max Data Length (MB)", "Index Length (MB)", "Data free (MB)", "Create Time", "Update Time", "Check Time", "Create Options", "Comment")); |
28 | 28 | db_init(); |
29 | 29 | $result = _mysql_query("show table status"); |
30 | - while($row = _mysql_fetch_array($result)) { |
|
30 | + while ($row = _mysql_fetch_array($result)) { |
|
31 | 31 | $size += ($row["Data_length"] + $row["Index_length"]); |
32 | 32 | $engine = $row["Engine"]; |
33 | 33 | //if (!$engine) $engine = $row["Type"]; |
34 | 34 | row_array(array( |
35 | 35 | $row["Name"], |
36 | 36 | $engine, |
37 | - $row["Version"] , |
|
38 | - $row["Row_format"] , |
|
39 | - $row["Rows"] , |
|
40 | - round($row["Avg_row_length"]/1024,2) , |
|
41 | - round($row["Data_length"]/(1024*1024),2) , |
|
42 | - round($row["Max_data_length"]/(1024*1024),2) , |
|
43 | - round($row["Index_length"]/(1024*1024),2) , |
|
44 | - round($row["Data_free"]/(1024*1024),2) , |
|
45 | - $row["Create_time"] , |
|
46 | - $row["Update_time"] , |
|
47 | - $row["Check_time"] , |
|
48 | - $row["Create_options"] , |
|
37 | + $row["Version"], |
|
38 | + $row["Row_format"], |
|
39 | + $row["Rows"], |
|
40 | + round($row["Avg_row_length"]/1024, 2), |
|
41 | + round($row["Data_length"]/(1024*1024), 2), |
|
42 | + round($row["Max_data_length"]/(1024*1024), 2), |
|
43 | + round($row["Index_length"]/(1024*1024), 2), |
|
44 | + round($row["Data_free"]/(1024*1024), 2), |
|
45 | + $row["Create_time"], |
|
46 | + $row["Update_time"], |
|
47 | + $row["Check_time"], |
|
48 | + $row["Create_options"], |
|
49 | 49 | $row["Comment"] |
50 | 50 | )); |
51 | 51 | } |
@@ -218,13 +218,13 @@ |
||
218 | 218 | function get_file($user) { |
219 | 219 | $dir = sandbox_dir($user); |
220 | 220 | $url = post_str('url'); |
221 | - if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) { |
|
221 | + if (filter_var($url, FILTER_VALIDATE_URL) === false) { |
|
222 | 222 | error_page('Not a valid URL'); |
223 | 223 | } |
224 | 224 | $fname = basename($url); |
225 | 225 | $path = "$dir/$fname"; |
226 | 226 | if (file_exists($path)) { |
227 | - error_page("File $fname exists; delete it first."); |
|
227 | + error_page("file $fname exists; delete it first."); |
|
228 | 228 | } |
229 | 229 | copy($url, $path); |
230 | 230 | $notice = "Fetched file from <strong>$url</strong><br/>"; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | page_tail(); |
85 | 85 | } |
86 | 86 | |
87 | -function list_files($user, $notice=null) { |
|
87 | +function list_files($user, $notice = null) { |
|
88 | 88 | $dir = sandbox_dir($user); |
89 | 89 | if (!is_dir($dir)) error_page("Can't open sandbox directory"); |
90 | 90 | page_head("File sandbox"); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $notice = ""; |
169 | 169 | $dir = sandbox_dir($user); |
170 | 170 | $count = count($_FILES['new_file']['tmp_name']); |
171 | - for ($i=0; $i<$count; $i++) { |
|
171 | + for ($i = 0; $i < $count; $i++) { |
|
172 | 172 | $tmp_name = $_FILES['new_file']['tmp_name'][$i]; |
173 | 173 | if (!is_uploaded_file($tmp_name)) { |
174 | 174 | error_page("$tmp_name is not uploaded file"); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | require_once("../inc/boinc_db.inc"); |
22 | 22 | require_once("../inc/util.inc"); |
23 | 23 | |
24 | -define('CONSENT_TYPE_ENROLL','ENROLL'); |
|
24 | +define('CONSENT_TYPE_ENROLL', 'ENROLL'); |
|
25 | 25 | |
26 | 26 | function check_termsofuse() { |
27 | 27 | return defined('TERMSOFUSE_FILE') and file_exists(TERMSOFUSE_FILE); |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | $source, $ctime = 0 |
33 | 33 | ) { |
34 | 34 | $mys = BoincDb::escape_string($source); |
35 | - if ($ctime==0) { |
|
35 | + if ($ctime == 0) { |
|
36 | 36 | $mytime = $user->create_time; |
37 | 37 | } else { |
38 | 38 | $mytime = $ctime; |
39 | 39 | } |
40 | 40 | return BoincConsent::insert( |
41 | - "(userid, consent_type_id, consent_time, consent_flag, consent_not_required, source) " . |
|
41 | + "(userid, consent_type_id, consent_time, consent_flag, consent_not_required, source) ". |
|
42 | 42 | "values($user->id, $consent_type_id, $mytime, $consent_flag, $consent_not_required, '$mys')" |
43 | 43 | ); |
44 | 44 | |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | // The integer is the consent_type_id- the id from consent_type table. |
66 | 66 | // If the boolean is FALSE, the integer returned is -1. |
67 | 67 | // |
68 | -function check_consent_type($name, $checkenabled=TRUE) { |
|
68 | +function check_consent_type($name, $checkenabled = TRUE) { |
|
69 | 69 | $name = BoincDb::escape_string($name); |
70 | 70 | $ct = BoincConsentType::lookup("shortname = '$name'"); |
71 | - if ($ct and ( !$checkenabled or ($ct->enabled)) ) { |
|
71 | + if ($ct and (!$checkenabled or ($ct->enabled))) { |
|
72 | 72 | return array(TRUE, $ct->id); |
73 | 73 | } |
74 | 74 | return array(FALSE, -1); |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | "userid=$user->id AND consent_type_id=$ctid AND consent_flag=1" |
53 | 53 | ); |
54 | 54 | if ($consent_result) { |
55 | - return TRUE; |
|
55 | + return true; |
|
56 | 56 | } |
57 | 57 | } |
58 | - return FALSE; |
|
58 | + return false; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | // Check if a particular consent_type name is available. |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | // The integer is the consent_type_id- the id from consent_type table. |
66 | 66 | // If the boolean is FALSE, the integer returned is -1. |
67 | 67 | // |
68 | -function check_consent_type($name, $checkenabled=TRUE) { |
|
68 | +function check_consent_type($name, $checkenabled=true) { |
|
69 | 69 | $name = BoincDb::escape_string($name); |
70 | 70 | $ct = BoincConsentType::lookup("shortname = '$name'"); |
71 | 71 | if ($ct and ( !$checkenabled or ($ct->enabled)) ) { |
72 | - return array(TRUE, $ct->id); |
|
72 | + return array(true, $ct->id); |
|
73 | 73 | } |
74 | - return array(FALSE, -1); |
|
74 | + return array(false, -1); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | // When a user uses the Web site to login, this function checks the |