@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | page_tail(); |
| 45 | 45 | exit; |
| 46 | 46 | } |
| 47 | - if (substr($user->authenticator, 0, 1) == 'x'){ |
|
| 47 | + if (substr($user->authenticator, 0, 1) == 'x') { |
|
| 48 | 48 | sleep(LOGIN_FAIL_SLEEP_SEC); |
| 49 | 49 | error_page("This account has been administratively disabled."); |
| 50 | 50 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | Please <a href=get_passwd.php>try again</a>. |
| 106 | 106 | "; |
| 107 | 107 | page_tail(); |
| 108 | - } else if (substr($user->authenticator, 0, 1) == 'x'){ |
|
| 108 | + } else if (substr($user->authenticator, 0, 1) == 'x') { |
|
| 109 | 109 | sleep(LOGIN_FAIL_SLEEP_SEC); |
| 110 | 110 | error_page("This account has been administratively disabled."); |
| 111 | 111 | } else { |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | $clause = "hostid=$hostid"; |
| 58 | 58 | page_head(tra("$s tasks for computer %1", $host->id)); |
| 59 | 59 | $show_host_link = false; |
| 60 | -} else if ($userid){ |
|
| 60 | +} else if ($userid) { |
|
| 61 | 61 | $user = get_logged_in_user(); |
| 62 | 62 | if ($userid != $user->id) { |
| 63 | 63 | error_page(tra("No access")); |
@@ -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); |
@@ -28,10 +28,10 @@ |
||
| 28 | 28 | // |
| 29 | 29 | function show_platforms() { |
| 30 | 30 | $xmlFragment = unserialize(get_cached_data(3600, "project_config_platform_xml")); |
| 31 | - if ($xmlFragment==false){ |
|
| 31 | + if ($xmlFragment==false) { |
|
| 32 | 32 | $platforms = BoincDB::get()->enum_fields("platform, DBNAME.app_version, DBNAME.app", "BoincPlatform", "platform.name, platform.user_friendly_name, plan_class", "app_version.platformid = platform.id and app_version.appid = app.id and app_version.deprecated=0 and app.deprecated=0 group by platform.name, plan_class", ""); |
| 33 | 33 | $xmlFragment = " <platforms>"; |
| 34 | - foreach ($platforms as $platform){ |
|
| 34 | + foreach ($platforms as $platform) { |
|
| 35 | 35 | $xmlFragment .= " |
| 36 | 36 | <platform> |
| 37 | 37 | <platform_name>$platform->name</platform_name> |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | </select>"); |
| 57 | 57 | |
| 58 | 58 | $forumid = null; |
| 59 | -if (get_str("forumid",true)){ |
|
| 59 | +if (get_str("forumid",true)) { |
|
| 60 | 60 | $forumid = get_str("forumid"); |
| 61 | 61 | } |
| 62 | 62 | $forumlist="<option value=\"-1\">".tra("All")."</option>"; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | foreach ($categories as $category) { |
| 65 | 65 | $forums = BoincForum::enum("parent_type=0 and category=$category->id"); |
| 66 | 66 | foreach ($forums as $forum) { |
| 67 | - if ($forum->id==$forumid){ |
|
| 67 | + if ($forum->id==$forumid) { |
|
| 68 | 68 | $forumlist.="<option selected value=\"".$forum->id."\">".$forum->title."</option>"; |
| 69 | 69 | } else { |
| 70 | 70 | $forumlist.="<option value=\"".$forum->id."\">".$forum->title."</option>"; |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | '<select class="form-control" name="search_forum">'.$forumlist.'</select'); |
| 77 | 77 | |
| 78 | 78 | $sortlist = null; |
| 79 | -foreach ($thread_sort_styles as $id => $style){ |
|
| 80 | - if ($id == CREATE_TIME_NEW){ |
|
| 79 | +foreach ($thread_sort_styles as $id => $style) { |
|
| 80 | + if ($id == CREATE_TIME_NEW) { |
|
| 81 | 81 | $sortlist.="<option selected value=\"".$id."\">".$style."</option>"; |
| 82 | 82 | } else { |
| 83 | 83 | $sortlist.="<option value=\"".$id."\">".$style."</option>"; |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | $now = time(); |
| 71 | 71 | $post->update("signature=$add_signature, content='$content', modified=$now"); |
| 72 | 72 | |
| 73 | - if ($can_edit_title){ |
|
| 73 | + if ($can_edit_title) { |
|
| 74 | 74 | $title = trim($title); |
| 75 | 75 | $title = sanitize_tags($title); |
| 76 | 76 | $title = BoincDb::escape_string($title); |
@@ -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; |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | // Some of this should be merged with translation.inc |
| 21 | 21 | |
| 22 | 22 | function get_lang_list() { |
| 23 | - if (isset($_COOKIE['lang'])){ |
|
| 23 | + if (isset($_COOKIE['lang'])) { |
|
| 24 | 24 | $language_string = $_COOKIE['lang'].","; |
| 25 | 25 | } else { |
| 26 | 26 | $language_string = ''; |
@@ -33,8 +33,7 @@ discard block |
||
| 33 | 33 | $lang_list = array(); |
| 34 | 34 | for ($i=0; $i<sizeof($client_languages); $i++) { |
| 35 | 35 | if ((strlen($client_languages[$i])>2) |
| 36 | - && (substr($client_languages[$i],2,1)=="_" || substr($client_languages[$i],2,1)=="-")) |
|
| 37 | - { |
|
| 36 | + && (substr($client_languages[$i],2,1)=="_" || substr($client_languages[$i],2,1)=="-")) { |
|
| 38 | 37 | // If this is defined as primary-secondary, represent it as xx_YY |
| 39 | 38 | // |
| 40 | 39 | $language = substr( |
@@ -31,8 +31,7 @@ |
||
| 31 | 31 | |
| 32 | 32 | if ((1.0-$weight)>0.000001) { |
| 33 | 33 | $avg += (1.0-$weight)*($work/$diff_days); |
| 34 | - } |
|
| 35 | - else { |
|
| 34 | + } else { |
|
| 36 | 35 | $avg += M_LN2*$work*86400/CREDIT_HALF_LIFE; |
| 37 | 36 | } |
| 38 | 37 | } else if ($work) { |