@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $n1 = $x[1] + $x[3]; |
| 27 | 27 | $n2 = $y[1] + $y[3]; |
| 28 | 28 | if ($n1 == $n2) return 0; |
| 29 | - return ($n1 < $n2)?1:-1; |
|
| 29 | + return ($n1 < $n2) ? 1 : -1; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | function get_models() { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $m[$r->outcome]++; |
| 45 | 45 | $models[$name_uc] = $m; |
| 46 | 46 | } else { |
| 47 | - $m = array(0,0,0,0,0,0,0,0); |
|
| 47 | + $m = array(0, 0, 0, 0, 0, 0, 0, 0); |
|
| 48 | 48 | $m[$r->outcome]++; |
| 49 | 49 | $models[$name_uc] = $m; |
| 50 | 50 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $name = $name[0]; |
| 60 | 60 | if (array_key_exists($name, $vendors)) { |
| 61 | 61 | $v = $vendors[$name]; |
| 62 | - for ($i=0; $i<8; $i++) { |
|
| 62 | + for ($i = 0; $i < 8; $i++) { |
|
| 63 | 63 | $v[$i] += $m[$i]; |
| 64 | 64 | } |
| 65 | 65 | $vendors[$name] = $v; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | "Vendor<br><p class=\"text-muted\">click for models</p>", |
| 101 | 101 | "Success", "Failure", "Success rate" |
| 102 | 102 | ); |
| 103 | - $y = array(0,0,0,0,0,0,0,0); |
|
| 103 | + $y = array(0, 0, 0, 0, 0, 0, 0, 0); |
|
| 104 | 104 | foreach ($vendors as $name=>$x) { |
| 105 | 105 | if (!$name) { |
| 106 | 106 | $name = "not reported by client"; |
@@ -33,8 +33,8 @@ |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | $set_lang = get_str("set_lang", true); |
| 36 | -if ($set_lang){ |
|
| 37 | - if (!in_array($set_lang, $languages) && $set_lang!="auto"){ |
|
| 36 | +if ($set_lang) { |
|
| 37 | + if (!in_array($set_lang, $languages) && $set_lang != "auto") { |
|
| 38 | 38 | error_page("Language not supported"); |
| 39 | 39 | } else { |
| 40 | 40 | send_cookie('lang', $set_lang, true); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | ; |
| 59 | 59 | $admins = BoincTeamAdmin::enum("teamid=$teamid"); |
| 60 | 60 | start_table(); |
| 61 | - if (count($admins)==0) { |
|
| 61 | + if (count($admins) == 0) { |
|
| 62 | 62 | row1(tra("There are currently no Team Admins")); |
| 63 | 63 | } else { |
| 64 | 64 | row1(tra("Current Team Admins"), 3); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | function add_admin($team) { |
| 98 | 98 | $email_addr = get_str('email_addr'); |
| 99 | - $email_addr = BoincDb::escape_string($email_addr); |
|
| 99 | + $email_addr = BoincDb::escape_string($email_addr); |
|
| 100 | 100 | $user = BoincUser::lookup("email_addr='$email_addr'"); |
| 101 | 101 | if (!$user) error_page(tra("no such user")); |
| 102 | 102 | if ($user->teamid != $team->id) error_page(tra("User is not member of team")); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | require_founder_login($user, $team); |
| 116 | 116 | |
| 117 | 117 | $action = get_str('action', true); |
| 118 | -switch($action) { |
|
| 118 | +switch ($action) { |
|
| 119 | 119 | case 'remove': |
| 120 | 120 | check_tokens($user->authenticator); |
| 121 | 121 | remove_admin($team); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $rating = post_int('rating', true); |
| 38 | 38 | if (!$choice) $choice = get_str('choice', true); |
| 39 | 39 | |
| 40 | - if ($choice == SOLUTION or $choice=="p") { |
|
| 40 | + if ($choice == SOLUTION or $choice == "p") { |
|
| 41 | 41 | $rating = 1; |
| 42 | 42 | } else { |
| 43 | 43 | $rating = -1; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | // Make sure the user has the forum's minimum amount of RAC and total credit |
| 57 | 57 | // before allowing them to rate a post. |
| 58 | 58 | // |
| 59 | - if ($user->total_credit<$forum->rate_min_total_credit || $user->expavg_credit<$forum->rate_min_expavg_credit) { |
|
| 59 | + if ($user->total_credit < $forum->rate_min_total_credit || $user->expavg_credit < $forum->rate_min_expavg_credit) { |
|
| 60 | 60 | error_page(tra("You need more average or total credit to rate a post.")); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -91,5 +91,5 @@ discard block |
||
| 91 | 91 | exit; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
| 94 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
| 95 | 95 | ?> |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | echo $x; |
| 93 | 93 | break; |
| 94 | 94 | } |
| 95 | - echo "</td><td align=right>".format_credit_large($y->credit),"</td><td align=right>$y->nresults</td></tr>\n"; |
|
| 95 | + echo "</td><td align=right>".format_credit_large($y->credit), "</td><td align=right>$y->nresults</td></tr>\n"; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | $mode = get_str('mode', true); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $auth = post_str("auth"); |
| 24 | 24 | $name = post_str("name"); |
| 25 | 25 | |
| 26 | -if (strlen($name)==0) { |
|
| 26 | +if (strlen($name) == 0) { |
|
| 27 | 27 | error_page(tra("You must supply a name for your account")); |
| 28 | 28 | } |
| 29 | 29 | if ($name != sanitize_tags($name)) { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | echo " <beta/>\n"; |
| 49 | 49 | } |
| 50 | 50 | } else { |
| 51 | - $b = $app->beta?" (beta test)":""; |
|
| 51 | + $b = $app->beta ? " (beta test)" : ""; |
|
| 52 | 52 | echo " |
| 53 | 53 | <tr><th class=\"bg-primary\" colspan=4>$app->user_friendly_name$b</th></tr> |
| 54 | 54 | <tr> |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | foreach ($platforms as $platform) { |
| 63 | 63 | $avs = latest_avs_app_platform($app->id, $platform->id); |
| 64 | - foreach($avs as $av) { |
|
| 64 | + foreach ($avs as $av) { |
|
| 65 | 65 | $create_time_f = pretty_time_str($av->create_time); |
| 66 | 66 | if ($xml) { |
| 67 | 67 | echo " <version>\n"; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $gf = $av->expavg_credit/200; |
| 84 | 84 | $total_gf += $gf; |
| 85 | 85 | $gf = number_format($gf, 0); |
| 86 | - $b = $av->beta?" (beta test)":""; |
|
| 86 | + $b = $av->beta ? " (beta test)" : ""; |
|
| 87 | 87 | echo "<tr> |
| 88 | 88 | <td>$platform->user_friendly_name</td> |
| 89 | 89 | <td>$version_num_f$b</td> |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | function mod_comment() { |
| 28 | 28 | $x = ""; |
| 29 | 29 | $reason = post_str('reason', true); |
| 30 | - if ($reason){ |
|
| 30 | + if ($reason) { |
|
| 31 | 31 | $x .= "\nModerator comment: $reason |
| 32 | 32 | "; |
| 33 | 33 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | // See if "action" is provided - either through post or get |
| 64 | 64 | if (!post_str('action', true)) { |
| 65 | - if (!get_str('action', true)){ |
|
| 65 | + if (!get_str('action', true)) { |
|
| 66 | 66 | error_page(tra("You must specify an action...")); |
| 67 | 67 | } else { |
| 68 | 68 | $action = get_str('action'); |
@@ -72,14 +72,14 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $explanation = null; |
| 75 | -if ($action=="hide"){ |
|
| 75 | +if ($action == "hide") { |
|
| 76 | 76 | $result = hide_post($post, $thread, $forum); |
| 77 | 77 | $action_name = "hidden"; |
| 78 | 78 | $explanation = hide_explanation(); |
| 79 | -} elseif ($action=="unhide"){ |
|
| 79 | +} elseif ($action == "unhide") { |
|
| 80 | 80 | $result = unhide_post($post, $thread, $forum); |
| 81 | 81 | $action_name = "unhidden"; |
| 82 | -} elseif ($action=="delete"){ |
|
| 82 | +} elseif ($action == "delete") { |
|
| 83 | 83 | $result = delete_post($post, $thread, $forum); |
| 84 | 84 | if (!$result) error_page("Can't delete post"); |
| 85 | 85 | page_head("Post deleted"); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | page_tail(); |
| 98 | 98 | exit; |
| 99 | -} elseif ($action=="move"){ |
|
| 99 | +} elseif ($action == "move") { |
|
| 100 | 100 | $destid = post_int('threadid'); |
| 101 | 101 | $new_thread = BoincThread::lookup_id($destid); |
| 102 | 102 | if (!$new_thread) error_page("No such thread"); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | "; |
| 118 | 118 | $explanation .= mod_comment(); |
| 119 | 119 | $action_name = "moved to another thread"; |
| 120 | -} elseif ($action=="banish_user"){ |
|
| 120 | +} elseif ($action == "banish_user") { |
|
| 121 | 121 | $auth = false; |
| 122 | 122 | if (defined("MODERATORS_CAN_BANISH") && $user->prefs->privilege(S_MODERATOR)) { |
| 123 | 123 | $auth = true; |
@@ -164,5 +164,5 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | header('Location: forum_thread.php?id='.$thread->id); |
| 166 | 166 | |
| 167 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
| 167 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
| 168 | 168 | ?> |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | if (!hosts_compatible($host, $host2, $detail)) continue; |
| 51 | 51 | $hosts[] = $host2; |
| 52 | 52 | $nhosts++; |
| 53 | - if ($nhosts==500) break; |
|
| 53 | + if ($nhosts == 500) break; |
|
| 54 | 54 | } |
| 55 | 55 | if ($nhosts == 1) { |
| 56 | 56 | echo "<br>".tra("No hosts are eligible for merging with this one."); |
@@ -90,14 +90,14 @@ discard block |
||
| 90 | 90 | <script> |
| 91 | 91 | function set_all() { |
| 92 | 92 | "; |
| 93 | -for ($i=1; $i<$nhosts; $i++) { |
|
| 93 | +for ($i = 1; $i < $nhosts; $i++) { |
|
| 94 | 94 | echo "document.host_list.id_$i.checked=1;\n"; |
| 95 | 95 | } |
| 96 | 96 | echo " |
| 97 | 97 | } |
| 98 | 98 | function clear_all() { |
| 99 | 99 | "; |
| 100 | -for ($i=1; $i<$nhosts; $i++) { |
|
| 100 | +for ($i = 1; $i < $nhosts; $i++) { |
|
| 101 | 101 | echo "document.host_list.id_$i.checked=0;\n"; |
| 102 | 102 | } |
| 103 | 103 | echo " |