@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | $dh = opendir($langdir.$transdir); |
65 | 65 | if (!$dh) die("can't open translation dir"); |
66 | 66 | while (($file = readdir($dh)) !== false) { |
67 | - if ($file==".." || $file==".") { |
|
67 | + if ($file == ".." || $file == ".") { |
|
68 | 68 | continue; |
69 | 69 | } |
70 | 70 | // only do files ending in .po |
71 | - if (substr($file,-3) != ".po"){ |
|
71 | + if (substr($file, -3) != ".po") { |
|
72 | 72 | //debug("File $file with unknown extension found in $info_dir"); |
73 | 73 | continue; |
74 | 74 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | "-------------Compiling $transdir$file------------", 0 |
77 | 77 | ); |
78 | 78 | $language = parse_po_file($langdir.$transdir.$file); |
79 | - if (!$language){ |
|
79 | + if (!$language) { |
|
80 | 80 | language_log( |
81 | 81 | "WARNING: Could not parse language ".$file |
82 | 82 | ); |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | ); |
96 | 96 | exit; |
97 | 97 | } |
98 | - foreach ($language as $key => $value){ |
|
98 | + foreach ($language as $key => $value) { |
|
99 | 99 | if ($value !== "") { |
100 | 100 | // Skip if the msgstr is empty |
101 | - fwrite($fh, "\$language_lookup_array[\"".str_replace("\"", "\\\"", substr($file,0,-3))."\"][\"".$key."\"] = \"".$value."\";\n"); |
|
101 | + fwrite($fh, "\$language_lookup_array[\"".str_replace("\"", "\\\"", substr($file, 0, -3))."\"][\"".$key."\"] = \"".$value."\";\n"); |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 | // don't write \?\> - may append |
@@ -115,27 +115,27 @@ discard block |
||
115 | 115 | function parse_po_file($file) { |
116 | 116 | $translation_file = file($file); |
117 | 117 | $first_entry = true; |
118 | - $current_token_text=""; |
|
119 | - $current_token =""; |
|
118 | + $current_token_text = ""; |
|
119 | + $current_token = ""; |
|
120 | 120 | $parsing_token = false; |
121 | 121 | $parsing_text = false; |
122 | 122 | $size = sizeof($translation_file); |
123 | 123 | $output = array(); |
124 | - for ($i=0; $i<$size; $i++){ |
|
124 | + for ($i = 0; $i < $size; $i++) { |
|
125 | 125 | $entry = trim($translation_file[$i]); |
126 | 126 | //echo "line $i: $entry\n"; |
127 | - if (substr($entry, 0, 1)=="#") { |
|
127 | + if (substr($entry, 0, 1) == "#") { |
|
128 | 128 | continue; |
129 | 129 | } elseif (strpos($entry, "msgid") !== false) { |
130 | - if (!$first_entry){ |
|
130 | + if (!$first_entry) { |
|
131 | 131 | //If this is not the first, save the previous entry |
132 | - $output[$current_token]=$current_token_text; |
|
132 | + $output[$current_token] = $current_token_text; |
|
133 | 133 | } |
134 | 134 | $current_token = get_po_line($entry, $file); |
135 | - $current_token_text=""; |
|
135 | + $current_token_text = ""; |
|
136 | 136 | $parsing_token = true; |
137 | 137 | $parsing_text = false; |
138 | - $first_entry=false; |
|
138 | + $first_entry = false; |
|
139 | 139 | } elseif (strpos($entry, "msgstr") !== false) { |
140 | 140 | $current_token_text = get_po_line($entry, $file); |
141 | 141 | $parsing_token = false; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | // Get the last token |
151 | 151 | // |
152 | - if ($current_token && $current_token_text){ |
|
152 | + if ($current_token && $current_token_text) { |
|
153 | 153 | $output[$current_token] = $current_token_text; |
154 | 154 | } |
155 | 155 | return $output; |
@@ -159,9 +159,9 @@ discard block |
||
159 | 159 | // Returns the contents of a line (ie removes "" from start and end) |
160 | 160 | // |
161 | 161 | function get_po_line($line, $file) { |
162 | - $start = strpos($line, '"')+1; |
|
162 | + $start = strpos($line, '"') + 1; |
|
163 | 163 | $stop = strrpos($line, '"'); |
164 | - $x = substr($line, $start, $stop-$start); |
|
164 | + $x = substr($line, $start, $stop - $start); |
|
165 | 165 | $n = preg_match("/[^\\\\]\"/", $x); |
166 | 166 | if ($n) { |
167 | 167 | echo "ERROR - MISMATCHED QUOTES IN $file: $line\n"; |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | |
181 | 181 | // Find the string in the user's language |
182 | 182 | // |
183 | - foreach ($languages_in_use as $language){ |
|
183 | + foreach ($languages_in_use as $language) { |
|
184 | 184 | if (isset($language_lookup_array[$language][$text])) { |
185 | 185 | $text = $language_lookup_array[$language][$text]; |
186 | 186 | break; |
187 | - } else if ($language=="en"){ |
|
187 | + } else if ($language == "en") { |
|
188 | 188 | // This language is defined in the code and is always available |
189 | 189 | break; |
190 | 190 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | // Replace relevant substrings with given arguments. |
194 | 194 | // Use strtr to avoid problems if an argument contains %n. |
195 | 195 | $replacements = array(); |
196 | - for ($i=1; $i<func_num_args(); $i++){ |
|
196 | + for ($i = 1; $i < func_num_args(); $i++) { |
|
197 | 197 | $replacements["%".$i] = func_get_arg($i); |
198 | 198 | } |
199 | 199 | |
@@ -210,14 +210,14 @@ discard block |
||
210 | 210 | return $text; |
211 | 211 | } |
212 | 212 | |
213 | -function language_log($message, $loglevel=0) { |
|
213 | +function language_log($message, $loglevel = 0) { |
|
214 | 214 | global $lang_log_level; |
215 | 215 | $msg = ""; |
216 | - if ($loglevel==0) $msg = "[ Debug ]"; |
|
217 | - if ($loglevel==1) $msg = "[ Warning ]"; |
|
218 | - if ($loglevel==2) $msg = "[ CRITICAL ]"; |
|
216 | + if ($loglevel == 0) $msg = "[ Debug ]"; |
|
217 | + if ($loglevel == 1) $msg = "[ Warning ]"; |
|
218 | + if ($loglevel == 2) $msg = "[ CRITICAL ]"; |
|
219 | 219 | |
220 | - if ($loglevel >= $lang_log_level){ |
|
220 | + if ($loglevel >= $lang_log_level) { |
|
221 | 221 | echo gmdate("Y-m-d H:i:s", time())." ".$msg." ".$message."\n"; |
222 | 222 | } |
223 | 223 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | // (by looking at cookies and browser settings) |
227 | 227 | // cookies have highest priority. |
228 | 228 | |
229 | -if (isset($_COOKIE['lang'])){ |
|
229 | +if (isset($_COOKIE['lang'])) { |
|
230 | 230 | $language_string = $_COOKIE['lang'].","; |
231 | 231 | } else { |
232 | 232 | $language_string = ''; |
@@ -257,10 +257,10 @@ discard block |
||
257 | 257 | // Loop over languages that the client requests |
258 | 258 | // |
259 | 259 | $size = sizeof($client_languages); |
260 | -for ($i=0; $i<$size; $i++) { |
|
261 | - if ((strlen($client_languages[$i])>2) |
|
260 | +for ($i = 0; $i < $size; $i++) { |
|
261 | + if ((strlen($client_languages[$i]) > 2) |
|
262 | 262 | && (substr($client_languages[$i], 2, 1) == "_" || substr($client_languages[$i], 2, 1) == "-") |
263 | - ){ |
|
263 | + ) { |
|
264 | 264 | // If this is defined as primary-secondary, represent it as xx_YY |
265 | 265 | // |
266 | 266 | $language = substr( |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | |
280 | 280 | // if main language is english, look no further |
281 | 281 | // |
282 | - if ((count($languages_in_use)==0) && ($language == 'en' || $language2 == 'en')) { |
|
282 | + if ((count($languages_in_use) == 0) && ($language == 'en' || $language2 == 'en')) { |
|
283 | 283 | break; |
284 | 284 | } |
285 | 285 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | // |
288 | 288 | $file_name = $lang_language_dir.$lang_compiled_dir.$language.".po.inc"; |
289 | 289 | if (file_exists($file_name)) { |
290 | - if (!in_array($language, $languages_in_use)){ |
|
290 | + if (!in_array($language, $languages_in_use)) { |
|
291 | 291 | require_once($file_name); |
292 | 292 | $languages_in_use[] = $language; |
293 | 293 | } |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | if ($language2) { |
296 | 296 | $file_name = $lang_language_dir.$lang_compiled_dir.$language2.".po.inc"; |
297 | 297 | if (file_exists($file_name)) { |
298 | - if (!in_array($language2, $languages_in_use)){ |
|
298 | + if (!in_array($language2, $languages_in_use)) { |
|
299 | 299 | require_once($file_name); |
300 | 300 | $languages_in_use[] = $language2; |
301 | 301 | } |
@@ -303,6 +303,6 @@ discard block |
||
303 | 303 | } |
304 | 304 | } |
305 | 305 | |
306 | -$GLOBALS['languages_in_use'] = $languages_in_use; // for Drupal |
|
306 | +$GLOBALS['languages_in_use'] = $languages_in_use; // for Drupal |
|
307 | 307 | |
308 | 308 | ?> |
@@ -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 |
@@ -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 | } |
@@ -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); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | // You should have received a copy of the GNU Lesser General Public License |
17 | 17 | // along with BOINC. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | |
19 | -NOT FINISHED. DON'T USE |
|
19 | +NOT FINISHED.DON'T USE |
|
20 | 20 | |
21 | 21 | require 'openid.php'; |
22 | 22 | include_once("../inc/boinc_db.inc"); |
@@ -26,14 +26,14 @@ discard block |
||
26 | 26 | |
27 | 27 | function show_error($str) { |
28 | 28 | page_head("Can't create account"); |
29 | - echo "$str<br>\n"; |
|
29 | + echo "$str < br > \n"; |
|
30 | 30 | page_tail(); |
31 | 31 | exit(); |
32 | 32 | } |
33 | 33 | |
34 | 34 | try { |
35 | 35 | $openid = new LightOpenID; |
36 | - echo "<pre>"; |
|
36 | + echo " < pre > "; |
|
37 | 37 | if(!$openid->mode) { |
38 | 38 | if(isset($_POST['openid_identifier'])) { |
39 | 39 | $openid->identity = $_POST['openid_identifier']; |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $subset = sanitize_tags(get_str("subset")); |
28 | 28 | $venue = sanitize_tags(get_str("venue", true)); |
29 | 29 | $columns = get_int("cols", true); |
30 | -$c = $columns?"&cols=$columns":""; |
|
30 | +$c = $columns ? "&cols=$columns" : ""; |
|
31 | 31 | check_subset($subset); |
32 | 32 | if ($action) { |
33 | 33 | check_tokens($user->authenticator); |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | return file_exists("$d/stop_sched"); |
57 | 57 | } |
58 | 58 | |
59 | -function xml_error($num=-1, $msg=null, $file=null, $line=null) { |
|
59 | +function xml_error($num = -1, $msg = null, $file = null, $line = null) { |
|
60 | 60 | global $xml_outer_tag; |
61 | 61 | if (!$msg) { |
62 | - switch($num) { |
|
62 | + switch ($num) { |
|
63 | 63 | case -112: $msg = "Invalid XML"; break; |
64 | 64 | case -136: $msg = "Not found"; break; |
65 | 65 | case -137: $msg = "Name or email address is not unique"; break; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | // If it's a single-tag element, and it's present, just return the tag |
106 | 106 | // |
107 | 107 | function parse_element($xml, $tag) { |
108 | - $closetag = "</" . substr($tag,1); |
|
108 | + $closetag = "</".substr($tag, 1); |
|
109 | 109 | $x = strstr($xml, $tag); |
110 | 110 | if ($x) { |
111 | 111 | if (strstr($tag, "/>")) return $tag; |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | |
122 | 122 | function parse_next_element($xml, $tag, &$cursor) { |
123 | 123 | $element = null; |
124 | - $closetag = "</" . substr($tag,1); |
|
125 | - $pos = substr($xml,$cursor); |
|
124 | + $closetag = "</".substr($tag, 1); |
|
125 | + $pos = substr($xml, $cursor); |
|
126 | 126 | $x = strstr($pos, $tag); |
127 | 127 | if ($x) { |
128 | 128 | if (strstr($tag, "/>")) return $tag; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | // whose OSs may have such restrictions. |
223 | 223 | // |
224 | 224 | function is_valid_filename($x) { |
225 | - if (strlen($x)>255) return false; |
|
225 | + if (strlen($x) > 255) return false; |
|
226 | 226 | // \w means A-Za-z0-9_ |
227 | 227 | return preg_match('/^[\w\-.]+$/', $x); |
228 | 228 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | error_page("Forums are disabled"); |
44 | 44 | } |
45 | 45 | |
46 | -if (user_can_create_thread($logged_in_user, $forum)=='no') { |
|
46 | +if (user_can_create_thread($logged_in_user, $forum) == 'no') { |
|
47 | 47 | error_page(tra("Only project admins may create a thread here. However, you may reply to existing threads.")); |
48 | 48 | } |
49 | 49 | check_post_access($logged_in_user, $forum); |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | $preview = post_str("preview", true); |
57 | 57 | $warning = null; |
58 | 58 | |
59 | -if ($content && $title && (!$preview)){ |
|
59 | +if ($content && $title && (!$preview)) { |
|
60 | 60 | if (post_str('add_signature', true)) { |
61 | - $add_signature = true; // set a flag and concatenate later |
|
62 | - } else { |
|
61 | + $add_signature = true; // set a flag and concatenate later |
|
62 | + } else { |
|
63 | 63 | $add_signature = false; |
64 | 64 | } |
65 | 65 | check_tokens($logged_in_user->authenticator); |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | if (post_str('subscribe', true)) { |
75 | 75 | BoincSubscription::replace($logged_in_user->id, $thread->id); |
76 | 76 | } |
77 | - header('Location: forum_thread.php?id=' . $thread->id); |
|
77 | + header('Location: forum_thread.php?id='.$thread->id); |
|
78 | 78 | } else { |
79 | 79 | error_page("Can't create thread. $forum_error"); |
80 | 80 | } |
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | -page_head(tra("Create new thread"),'','','', $bbcode_js); |
|
84 | +page_head(tra("Create new thread"), '', '', '', $bbcode_js); |
|
85 | 85 | show_forum_header($logged_in_user); |
86 | 86 | |
87 | 87 | if ($warning) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>"; |
123 | 123 | } |
124 | 124 | |
125 | -if ($force_title && $title){ |
|
125 | +if ($force_title && $title) { |
|
126 | 126 | row2( |
127 | 127 | tra("Title"), |
128 | 128 | sprintf( |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | row2( |
137 | 137 | tra("Title").$submit_help, |
138 | 138 | sprintf('<input type="text" class="form-control" name="title" value="%s">', |
139 | - $title?htmlspecialchars($title):'' |
|
139 | + $title ?htmlspecialchars($title) : '' |
|
140 | 140 | ), |
141 | 141 | null, FORUM_LH_PCT |
142 | 142 | ); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | sprintf( |
148 | 148 | '%s <textarea class="form-control" name="content" rows="12" cols="80">%s</textarea>', |
149 | 149 | $bbcode_html, |
150 | - $content?htmlspecialchars($content):'' |
|
150 | + $content ?htmlspecialchars($content) : '' |
|
151 | 151 | ), |
152 | 152 | null, FORUM_LH_PCT |
153 | 153 | ); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | if (!$logged_in_user->prefs->no_signature_by_default) { |
156 | 156 | $enable_signature = 'checked="true"'; |
157 | 157 | } else { |
158 | - $enable_signature=''; |
|
158 | + $enable_signature = ''; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | if (is_news_forum($forum)) { |