Completed
Pull Request — master (#2135)
by Christian
14:18 queued 04:05
created
html/user/job_file.php 2 patches
Switch Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -80,20 +80,20 @@
 block discarded – undo
80 80
 
81 81
 function upload_error_description($errno) {
82 82
     switch($errno) {
83
-        case UPLOAD_ERR_INI_SIZE:
84
-            return "The uploaded file exceeds upload_max_filesize of php.ini."; break;
85
-        case UPLOAD_ERR_FORM_SIZE:
86
-            return "The uploaded file exceeds the MAX_FILE_SIZE specified in the HTML form."; break;
87
-        case UPLOAD_ERR_PARTIAL:
88
-            return "The uploaded file was only partially uploaded."; break;
89
-        case UPLOAD_ERR_NO_FILE:
90
-            return "No file was uploaded."; break;
91
-        case UPLOAD_ERR_NO_TMP_DIR:
92
-            return "Missing a temporary folder."; break;
93
-        case UPLOAD_ERR_CANT_WRITE:
94
-            return "Failed to write file to disk."; break;
95
-        case UPLOAD_ERR_EXTENSION:
96
-            return "A PHP extension stopped the file upload."; break;
83
+    case UPLOAD_ERR_INI_SIZE:
84
+        return "The uploaded file exceeds upload_max_filesize of php.ini."; break;
85
+    case UPLOAD_ERR_FORM_SIZE:
86
+        return "The uploaded file exceeds the MAX_FILE_SIZE specified in the HTML form."; break;
87
+    case UPLOAD_ERR_PARTIAL:
88
+        return "The uploaded file was only partially uploaded."; break;
89
+    case UPLOAD_ERR_NO_FILE:
90
+        return "No file was uploaded."; break;
91
+    case UPLOAD_ERR_NO_TMP_DIR:
92
+        return "Missing a temporary folder."; break;
93
+    case UPLOAD_ERR_CANT_WRITE:
94
+        return "Failed to write file to disk."; break;
95
+    case UPLOAD_ERR_EXTENSION:
96
+        return "A PHP extension stopped the file upload."; break;
97 97
     }
98 98
 }
99 99
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 require_once("../inc/submit_util.inc");
80 80
 
81 81
 function upload_error_description($errno) {
82
-    switch($errno) {
82
+    switch ($errno) {
83 83
         case UPLOAD_ERR_INI_SIZE:
84 84
             return "The uploaded file exceeds upload_max_filesize of php.ini."; break;
85 85
         case UPLOAD_ERR_FORM_SIZE:
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
     $delete_time = (int)$r->delete_time;
106 106
     $batch_id = (int)$r->batch_id;
107 107
     $fanout = parse_config(get_config(), "<uldl_dir_fanout>");
108
-    $phys_names= array();
109
-    foreach($r->phys_name as $f) {
108
+    $phys_names = array();
109
+    foreach ($r->phys_name as $f) {
110 110
         $phys_names[] = (string)$f;
111 111
     }
112 112
     $i = 0;
113
-    foreach($phys_names as $fname) {
114
-        $path = dir_hier_path($fname, project_dir() . "/download", $fanout);
113
+    foreach ($phys_names as $fname) {
114
+        $path = dir_hier_path($fname, project_dir()."/download", $fanout);
115 115
 
116 116
         // if the job_file record is there,
117 117
         // update the delete time first to avoid race condition
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
     foreach ($_FILES as $f) {
217 217
         $tmp_name = $f['tmp_name'];
218 218
         $fname = $phys_names[$i];
219
-        $path = dir_hier_path($fname, project_dir() . "/download", $fanout);
219
+        $path = dir_hier_path($fname, project_dir()."/download", $fanout);
220 220
 
221
-        switch(check_download_file($tmp_name, $path)) {
221
+        switch (check_download_file($tmp_name, $path)) {
222 222
         case 0:
223 223
             break;
224 224
         case 1:
@@ -266,10 +266,10 @@  discard block
 block discarded – undo
266 266
 if ($request_log) {
267 267
     $request_log_dir = parse_config(get_config(), "<log_dir>");
268 268
     if ($request_log_dir) {
269
-        $request_log = $request_log_dir . "/" . $request_log;
269
+        $request_log = $request_log_dir."/".$request_log;
270 270
     }
271 271
     if ($file = fopen($request_log, "a+")) {
272
-        fwrite($file, "\n<job_file date=\"" . date(DATE_ATOM) . "\">\n" . $_POST['request'] . "\n</job_file>\n");
272
+        fwrite($file, "\n<job_file date=\"".date(DATE_ATOM)."\">\n".$_POST['request']."\n</job_file>\n");
273 273
         fclose($file);
274 274
     }
275 275
 }
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
     xml_error(-1, "can't parse request message: $req", __FILE__, __LINE__);
282 282
 }
283 283
 
284
-switch($r->getName()) {
284
+switch ($r->getName()) {
285 285
 case 'query_files':
286 286
     query_files($r);
287 287
     break;
Please login to merge, or discard this patch.
html/user/team_quit_form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,5 +44,5 @@
 block discarded – undo
44 44
 ";
45 45
 page_tail();
46 46
 
47
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
47
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
48 48
 ?>
Please login to merge, or discard this patch.
html/user/ffmail_action.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 page_head(tra("Sending emails"));
29 29
 $found = false;
30
-for ($i=0; $i<6; $i++) {
30
+for ($i = 0; $i < 6; $i++) {
31 31
     $e = get_str("e$i", true);
32 32
     if (!$e) continue;
33 33
     $found = true;
Please login to merge, or discard this patch.
html/user/forum_report_post.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,21 +44,21 @@  discard block
 block discarded – undo
44 44
 // Using the same rules as for rating (at least for now)
45 45
 //
46 46
 
47
-if ($user->total_credit<$forum->rate_min_total_credit || $user->expavg_credit<$forum->rate_min_expavg_credit) {
47
+if ($user->total_credit < $forum->rate_min_total_credit || $user->expavg_credit < $forum->rate_min_expavg_credit) {
48 48
     error_page(tra("You need more average or total credit to report a post."));
49 49
 }
50 50
 
51 51
 // Action part
52 52
 //
53
-$success_page=0;
54
-if (get_str("submit",true)){
53
+$success_page = 0;
54
+if (get_str("submit", true)) {
55 55
     check_tokens($user->authenticator);
56 56
     $reason = get_str("reason");
57
-    if (send_report_post_email($user, $forum, $thread, $post, $reason)){
58
-        $success_page=1;
57
+    if (send_report_post_email($user, $forum, $thread, $post, $reason)) {
58
+        $success_page = 1;
59 59
     } else {
60 60
         echo "send email failed";
61
-        $success_page=-1;
61
+        $success_page = -1;
62 62
     }
63 63
 }
64 64
 
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 
67 67
 // Display part
68 68
 //
69
-if ($success_page==1) {
69
+if ($success_page == 1) {
70 70
     page_head(tra("Report Registered"));
71 71
     echo tra("Your report has been recorded. Thanks for your input.")."<p>"
72 72
         .tra("A moderator will now look at your report and decide what will happen - this may take a little while, so please be patient");
73 73
 
74 74
     echo "<p><a href=\"forum_thread.php?id=$thread->id&postid=$post->id\">".tra("Return to thread")."</a>";
75
-} elseif ($success_page==0){
75
+} elseif ($success_page == 0) {
76 76
     page_head(tra("Report a forum post"));
77 77
     if (!$no_forum_rating) {
78 78
         echo "<p>".tra("Before reporting this post, consider using the +/- rating system instead. If enough users rate a post negatively it will eventually be hidden.<br />You can find the rating system at the bottom of the post.")."</p>
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     echo "</td></tr>";
101 101
     end_table();
102 102
     echo "</form>";
103
-} elseif ($success_page==-1) {
103
+} elseif ($success_page == -1) {
104 104
     page_head(tra("Report not registered"));
105 105
     echo "<p>".tra("Your report could not be recorded. Please wait a while and try again.")."</p>
106 106
         <p>".tra("If this is not a temporary error, please report it to the project developers.")."</p>
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
 // Action part
52 52
 //
53 53
 $success_page=0;
54
-if (get_str("submit",true)){
54
+if (get_str("submit",true)) {
55 55
     check_tokens($user->authenticator);
56 56
     $reason = get_str("reason");
57
-    if (send_report_post_email($user, $forum, $thread, $post, $reason)){
57
+    if (send_report_post_email($user, $forum, $thread, $post, $reason)) {
58 58
         $success_page=1;
59 59
     } else {
60 60
         echo "send email failed";
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         .tra("A moderator will now look at your report and decide what will happen - this may take a little while, so please be patient");
73 73
 
74 74
     echo "<p><a href=\"forum_thread.php?id=$thread->id&postid=$post->id\">".tra("Return to thread")."</a>";
75
-} elseif ($success_page==0){
75
+} elseif ($success_page==0) {
76 76
     page_head(tra("Report a forum post"));
77 77
     if (!$no_forum_rating) {
78 78
         echo "<p>".tra("Before reporting this post, consider using the +/- rating system instead. If enough users rate a post negatively it will eventually be hidden.<br />You can find the rating system at the bottom of the post.")."</p>
Please login to merge, or discard this patch.
html/user/pending.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     $sum = 0;
48 48
     echo "<pending_credit>\n";
49 49
     $results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0");
50
-    foreach($results as $result) {
50
+    foreach ($results as $result) {
51 51
         echo "<result>\n";
52 52
         echo "    <resultid>".$result->id."</resultid>\n";
53 53
         echo "    <workunitid>".$result->workunitid."</workunitid>\n";
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     start_table();
68 68
     echo "<tr><th>".tra("Result ID")."</th><th>".tra("Workunit ID")."</th><th>".tra("Host ID")."</th><th>".tra("Claimed credit")."</th></tr>\n";
69 69
     $results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0");
70
-    foreach($results as $result) {
70
+    foreach ($results as $result) {
71 71
         echo "<tr>\n";
72 72
         echo "<td><a href=\"result.php?resultid=$result->id\">$result->id</a></td>\n";
73 73
         echo "<td><a href=\"workunit.php?wuid=$result->workunitid\">$result->workunitid</a></td>\n";
@@ -82,5 +82,5 @@  discard block
 block discarded – undo
82 82
     page_tail();
83 83
 }
84 84
 
85
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
85
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
86 86
 ?>
Please login to merge, or discard this patch.
html/user/donations.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
         $acquired = $acquired - $required;
74 74
         $progress = 100;
75 75
     } else {
76
-        $progress = round($acquired / ($required) * 100);
77
-        $progress2 = round($acquired / ($required) * 100,1);
76
+        $progress = round($acquired/($required)*100);
77
+        $progress2 = round($acquired/($required)*100, 1);
78 78
     }
79 79
     
80 80
     $col2 = "<input style=\"float: left\" type=\"radio\" name=\"item_id\" value=\"".$row->id."\"";
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     } elseif ($progress == 100) {
90 90
         $col2 .= "<div style=\"float: left; width: 300px; height: 18px; background-color: green; border: 1px solid #000000\">";
91 91
     } else {
92
-        $col2 .= "<div style=\"float: left; width: ".($progress*3 - 1)."px; height: 18px; background-color: green; border: 1px solid #000000;\" align=\"right\"><b>".$progress2."</b>%</div><div style=\"float: left; width: ".((100-$progress)*3 - 1)."px; height: 18px; background-color: red; border: 1px solid #000000;\">";
92
+        $col2 .= "<div style=\"float: left; width: ".($progress*3 - 1)."px; height: 18px; background-color: green; border: 1px solid #000000;\" align=\"right\"><b>".$progress2."</b>%</div><div style=\"float: left; width: ".((100 - $progress)*3 - 1)."px; height: 18px; background-color: red; border: 1px solid #000000;\">";
93 93
     }
94 94
     
95 95
     row2($col1, $col2);
Please login to merge, or discard this patch.
Braces   +15 added lines, -30 removed lines patch added patch discarded remove patch
@@ -98,50 +98,35 @@
 block discarded – undo
98 98
 $amount = "<select class=\"form-control\" name=\"from\" onchange=\"Cvalue();numberFormat();\" style=\"width: 200px;\">\n";
99 99
 if (DONATION_CURRENCY == "EUR") {
100 100
     $amount .= "<option value=\"51\">Euros</option>\n";
101
-}
102
-elseif (DONATION_CURRENCY == "CAD") {
101
+} elseif (DONATION_CURRENCY == "CAD") {
103 102
     $amount .= "<option value=\"30\">Canadian Dollars</option>\n";
104
-}
105
-elseif (DONATION_CURRENCY == "GBP") {
103
+} elseif (DONATION_CURRENCY == "GBP") {
106 104
     $amount .= "<option value=\"24\">Pounds Sterling</option>\n";
107
-}
108
-elseif (DONATION_CURRENCY == "USD") {
105
+} elseif (DONATION_CURRENCY == "USD") {
109 106
     $amount .= "<option value=\"3\">U.S. Dollars</option>\n";
110
-}
111
-elseif (DONATION_CURRENCY == "JPY") {
107
+} elseif (DONATION_CURRENCY == "JPY") {
112 108
     $amount .= "<option value=\"72\">Yen</option>\n";
113
-}
114
-elseif (DONATION_CURRENCY == "AUD") {
109
+} elseif (DONATION_CURRENCY == "AUD") {
115 110
     $amount .= "<option value=\"9\">Australian Dollars</option>\n";
116
-}
117
-elseif (DONATION_CURRENCY == "NZD") {
111
+} elseif (DONATION_CURRENCY == "NZD") {
118 112
     $amount .= "<option value=\"102\">New Zealand Dollars</option>\n";
119
-}
120
-elseif (DONATION_CURRENCY == "CHF") {
113
+} elseif (DONATION_CURRENCY == "CHF") {
121 114
     $amount .= "<option value=\"139\">Swiss Francs</option>\n";
122
-}
123
-elseif (DONATION_CURRENCY == "HKD") {
115
+} elseif (DONATION_CURRENCY == "HKD") {
124 116
     $amount .= "<option value=\"63\">Hong Kong Dollars</option>\n";
125
-}
126
-elseif (DONATION_CURRENCY == "SGD") {
117
+} elseif (DONATION_CURRENCY == "SGD") {
127 118
     $amount .= "<option value=\"126\">Singapore Dollars</option>\n";
128
-}
129
-elseif (DONATION_CURRENCY == "SEK") {
119
+} elseif (DONATION_CURRENCY == "SEK") {
130 120
     $amount .= "<option value=\"138\">Swedish Kronor</option>\n";
131
-}
132
-elseif (DONATION_CURRENCY == "DKK") {
121
+} elseif (DONATION_CURRENCY == "DKK") {
133 122
     $amount .= "<option value=\"42\">Danish Kroner</option>\n";
134
-}
135
-elseif (DONATION_CURRENCY == "PLN") {
123
+} elseif (DONATION_CURRENCY == "PLN") {
136 124
     $amount .= "<option value=\"114\">Polish Zloty</option>\n";
137
-}
138
-elseif (DONATION_CURRENCY == "NOK") {
125
+} elseif (DONATION_CURRENCY == "NOK") {
139 126
     $amount .= "<option value=\"106\">Norwegian Kroner</option>\n";
140
-}
141
-elseif (DONATION_CURRENCY == "HUF") {
127
+} elseif (DONATION_CURRENCY == "HUF") {
142 128
     $amount .= "<option value=\"64\">Hungarian Forint</option>\n";
143
-}
144
-elseif (DONATION_CURRENCY == "CZK") {
129
+} elseif (DONATION_CURRENCY == "CZK") {
145 130
     $amount .= "<option value=\"41\">Czech Koruna</option>\n";
146 131
 }
147 132
 $amount .= "</select>\n";
Please login to merge, or discard this patch.
html/user/edit_forum_preferences_action.php 2 patches
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 }
30 30
 BoincForumPrefs::lookup($user);
31 31
 
32
-if (post_str("action", true)=="reset_confirm"){
32
+if (post_str("action", true) == "reset_confirm") {
33 33
     page_head(tra("Confirm reset"));
34 34
     echo tra("This action will erase any changes you have made in your community preferences. To cancel, click your browser's Back button.")."
35 35
         <p>
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 // If the user has requested a reset of preferences;
46 46
 // preserve a few fields.
47 47
 //
48
-if (post_str("action", true)=="reset"){
48
+if (post_str("action", true) == "reset") {
49 49
     $posts = $user->prefs->posts;
50 50
     $last_post = $user->prefs->last_post;
51 51
     $rated_posts = $user->prefs->rated_posts;
@@ -67,30 +67,30 @@  discard block
 block discarded – undo
67 67
 if (!DISABLE_FORUMS) {
68 68
 
69 69
 $avatar_type = post_int("avatar_select");
70
-$newfile=IMAGE_PATH.$user->id."_avatar.jpg";
70
+$newfile = IMAGE_PATH.$user->id."_avatar.jpg";
71 71
 
72 72
 // Update the user avatar
73
-if ($avatar_type<0 or $avatar_type>3) $avatar_type=0;
74
-if ($avatar_type==0){
75
-    if (file_exists($newfile)){
73
+if ($avatar_type < 0 or $avatar_type > 3) $avatar_type = 0;
74
+if ($avatar_type == 0) {
75
+    if (file_exists($newfile)) {
76 76
         // Delete the file on the server if the user
77 77
         // decides not to use an avatar
78 78
         //
79 79
         unlink($newfile);
80 80
     }
81
-    $avatar_url="";
81
+    $avatar_url = "";
82 82
 } elseif ($avatar_type == 1) {
83 83
     $avatar_url = "//www.gravatar.com/avatar/".md5($user->email_addr)."?s=100&amp;d=identicon";
84
-} elseif ($avatar_type==2){
85
-    if (($rpc && (post_str("avatar_url", true) != null)) || ($_FILES['picture']['tmp_name']!="")) {
86
-        if ($_FILES['picture']['tmp_name']!="") {
84
+} elseif ($avatar_type == 2) {
85
+    if (($rpc && (post_str("avatar_url", true) != null)) || ($_FILES['picture']['tmp_name'] != "")) {
86
+        if ($_FILES['picture']['tmp_name'] != "") {
87 87
             $file = $_FILES['picture']['tmp_name'];
88 88
         } else {
89 89
             // Remote image. Download and store locally
90 90
             $file = post_str("avatar_url");
91 91
         }
92 92
         $size = getImageSize($file);
93
-        if ($size[2]!=2 and $size[2]!=3){
93
+        if ($size[2] != 2 and $size[2] != 3) {
94 94
             //Not the right kind of file
95 95
             error_page(tra("Error: Not the right kind of file, only PNG and JPEG are supported."));
96 96
         }
@@ -99,30 +99,30 @@  discard block
 block discarded – undo
99 99
         $image2 = intelligently_scale_image($file, 100, 100);
100 100
         ImageJPEG($image2, $newfile);
101 101
     }
102
-    if (file_exists($newfile)){
103
-        $avatar_url=IMAGE_URL.$user->id."_avatar.jpg"; //$newfile;
102
+    if (file_exists($newfile)) {
103
+        $avatar_url = IMAGE_URL.$user->id."_avatar.jpg"; //$newfile;
104 104
     } else {
105 105
         //User didn't upload a compatible file or it went lost on the server
106
-        $avatar_url="";
106
+        $avatar_url = "";
107 107
     }
108 108
 }
109 109
 
110
-$images_as_links = (isset($_POST["forum_images_as_links"]) && $_POST["forum_images_as_links"]!="")?1:0;
111
-$link_popup = (isset($_POST["forum_link_popup"]) && $_POST["forum_link_popup"]!="")?1:0;
112
-$hide_avatars = (isset($_POST["forum_hide_avatars"]) && $_POST["forum_hide_avatars"]!="")?1:0;
113
-$hide_signatures = (isset($_POST["forum_hide_signatures"]) && $_POST["forum_hide_signatures"]!="")?1:0;
114
-$highlight_special = (isset($_POST["forum_highlight_special"]) && $_POST["forum_highlight_special"]!="")?1:0;
115
-$jump_to_unread = (isset($_POST["forum_jump_to_unread"]) && $_POST["forum_jump_to_unread"]!="")?1:0;
116
-$ignore_sticky_posts = (isset($_POST["forum_ignore_sticky_posts"]) && $_POST["forum_ignore_sticky_posts"]!="")?1:0;
117
-$no_signature_by_default = (isset($_POST["signature_by_default"]) && $_POST["signature_by_default"]!="")?0:1;
110
+$images_as_links = (isset($_POST["forum_images_as_links"]) && $_POST["forum_images_as_links"] != "") ? 1 : 0;
111
+$link_popup = (isset($_POST["forum_link_popup"]) && $_POST["forum_link_popup"] != "") ? 1 : 0;
112
+$hide_avatars = (isset($_POST["forum_hide_avatars"]) && $_POST["forum_hide_avatars"] != "") ? 1 : 0;
113
+$hide_signatures = (isset($_POST["forum_hide_signatures"]) && $_POST["forum_hide_signatures"] != "") ? 1 : 0;
114
+$highlight_special = (isset($_POST["forum_highlight_special"]) && $_POST["forum_highlight_special"] != "") ? 1 : 0;
115
+$jump_to_unread = (isset($_POST["forum_jump_to_unread"]) && $_POST["forum_jump_to_unread"] != "") ? 1 : 0;
116
+$ignore_sticky_posts = (isset($_POST["forum_ignore_sticky_posts"]) && $_POST["forum_ignore_sticky_posts"] != "") ? 1 : 0;
117
+$no_signature_by_default = (isset($_POST["signature_by_default"]) && $_POST["signature_by_default"] != "") ? 0 : 1;
118 118
 $signature = post_str("signature", true);
119
-if (strlen($signature)>250) {
119
+if (strlen($signature) > 250) {
120 120
     error_page(tra("Your signature was too long, please keep it less than 250 characters."));
121 121
 }
122 122
 $forum_sort = post_int("forum_sort");
123 123
 $thread_sort = post_int("thread_sort");
124 124
 $display_wrap_postcount = post_int("forum_display_wrap_postcount");
125
-if ($display_wrap_postcount<1) $display_wrap_postcount=1;
125
+if ($display_wrap_postcount < 1) $display_wrap_postcount = 1;
126 126
 
127 127
 $signature = BoincDb::escape_string($signature);
128 128
 
@@ -130,10 +130,10 @@  discard block
 block discarded – undo
130 130
 
131 131
 }   // DISABLE_FORUMS
132 132
 
133
-$add_user_to_filter = (isset($_POST["add_user_to_filter"]) && $_POST["add_user_to_filter"]!="");
134
-if ($add_user_to_filter){
133
+$add_user_to_filter = (isset($_POST["add_user_to_filter"]) && $_POST["add_user_to_filter"] != "");
134
+if ($add_user_to_filter) {
135 135
     $user_to_add = trim($_POST["forum_filter_user"]);
136
-    if ($user_to_add!="" and $user_to_add==strval(intval($user_to_add))){
136
+    if ($user_to_add != "" and $user_to_add == strval(intval($user_to_add))) {
137 137
         $other_user = BoincUser::lookup_id($user_to_add);
138 138
         if (!$other_user) {
139 139
             echo tra("No such user:")." ".$user_to_add;
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
 // Or remove some from the ignore list
147 147
 //
148 148
 $ignored_users = get_ignored_list($user);
149
-for ($i=0;$i<sizeof($ignored_users);$i++){
149
+for ($i = 0; $i < sizeof($ignored_users); $i++) {
150 150
     $remove = "remove".trim($ignored_users[$i]);
151
-    if (isset($_POST[$remove]) && $_POST[$remove]!=""){
151
+    if (isset($_POST[$remove]) && $_POST[$remove] != "") {
152 152
         $other_user = BoincUser::lookup_id($ignored_users[$i]);
153 153
         if (!$other_user) {
154 154
             echo tra("No such user:")." ".$ignored_users[$j];
Please login to merge, or discard this patch.
Braces   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 }
30 30
 BoincForumPrefs::lookup($user);
31 31
 
32
-if (post_str("action", true)=="reset_confirm"){
32
+if (post_str("action", true)=="reset_confirm") {
33 33
     page_head(tra("Confirm reset"));
34 34
     echo tra("This action will erase any changes you have made in your community preferences. To cancel, click your browser's Back button.")."
35 35
         <p>
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 // If the user has requested a reset of preferences;
46 46
 // preserve a few fields.
47 47
 //
48
-if (post_str("action", true)=="reset"){
48
+if (post_str("action", true)=="reset") {
49 49
     $posts = $user->prefs->posts;
50 50
     $last_post = $user->prefs->last_post;
51 51
     $rated_posts = $user->prefs->rated_posts;
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 
72 72
 // Update the user avatar
73 73
 if ($avatar_type<0 or $avatar_type>3) $avatar_type=0;
74
-if ($avatar_type==0){
75
-    if (file_exists($newfile)){
74
+if ($avatar_type==0) {
75
+    if (file_exists($newfile)) {
76 76
         // Delete the file on the server if the user
77 77
         // decides not to use an avatar
78 78
         //
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     $avatar_url="";
82 82
 } elseif ($avatar_type == 1) {
83 83
     $avatar_url = "//www.gravatar.com/avatar/".md5($user->email_addr)."?s=100&amp;d=identicon";
84
-} elseif ($avatar_type==2){
84
+} elseif ($avatar_type==2) {
85 85
     if (($rpc && (post_str("avatar_url", true) != null)) || ($_FILES['picture']['tmp_name']!="")) {
86 86
         if ($_FILES['picture']['tmp_name']!="") {
87 87
             $file = $_FILES['picture']['tmp_name'];
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             $file = post_str("avatar_url");
91 91
         }
92 92
         $size = getImageSize($file);
93
-        if ($size[2]!=2 and $size[2]!=3){
93
+        if ($size[2]!=2 and $size[2]!=3) {
94 94
             //Not the right kind of file
95 95
             error_page(tra("Error: Not the right kind of file, only PNG and JPEG are supported."));
96 96
         }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $image2 = intelligently_scale_image($file, 100, 100);
100 100
         ImageJPEG($image2, $newfile);
101 101
     }
102
-    if (file_exists($newfile)){
102
+    if (file_exists($newfile)) {
103 103
         $avatar_url=IMAGE_URL.$user->id."_avatar.jpg"; //$newfile;
104 104
     } else {
105 105
         //User didn't upload a compatible file or it went lost on the server
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
 }   // DISABLE_FORUMS
132 132
 
133 133
 $add_user_to_filter = (isset($_POST["add_user_to_filter"]) && $_POST["add_user_to_filter"]!="");
134
-if ($add_user_to_filter){
134
+if ($add_user_to_filter) {
135 135
     $user_to_add = trim($_POST["forum_filter_user"]);
136
-    if ($user_to_add!="" and $user_to_add==strval(intval($user_to_add))){
136
+    if ($user_to_add!="" and $user_to_add==strval(intval($user_to_add))) {
137 137
         $other_user = BoincUser::lookup_id($user_to_add);
138 138
         if (!$other_user) {
139 139
             echo tra("No such user:")." ".$user_to_add;
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
 // Or remove some from the ignore list
147 147
 //
148 148
 $ignored_users = get_ignored_list($user);
149
-for ($i=0;$i<sizeof($ignored_users);$i++){
149
+for ($i=0;$i<sizeof($ignored_users);$i++) {
150 150
     $remove = "remove".trim($ignored_users[$i]);
151
-    if (isset($_POST[$remove]) && $_POST[$remove]!=""){
151
+    if (isset($_POST[$remove]) && $_POST[$remove]!="") {
152 152
         $other_user = BoincUser::lookup_id($ignored_users[$i]);
153 153
         if (!$other_user) {
154 154
             echo tra("No such user:")." ".$ignored_users[$j];
Please login to merge, or discard this patch.
html/user/gpu_ratios.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,23 +32,23 @@
 block discarded – undo
32 32
 $nvidia_credit_sum = 0;
33 33
 $intel_gpu_scale_sum = 0;
34 34
 $intel_gpu_credit_sum = 0;
35
-$total_credit_sum= 0;
35
+$total_credit_sum = 0;
36 36
 
37 37
 $apps = BoincApp::enum("deprecated=0");
38 38
 foreach ($apps as $app) {
39 39
     $avs = BoincAppVersion::enum("appid=$app->id and deprecated=0");
40 40
     foreach ($avs as $av) {
41 41
         if (strstr($av->plan_class, "ati")) {
42
-            $ati_scale_sum += $av->pfc_scale * $av->expavg_credit;
42
+            $ati_scale_sum += $av->pfc_scale*$av->expavg_credit;
43 43
             $ati_credit_sum += $av->expavg_credit;
44 44
         } else if (strstr($av->plan_class, "nvidia") || strstr($av->plan_class, "cuda")) {
45
-            $nvidia_scale_sum += $av->pfc_scale * $av->expavg_credit;
45
+            $nvidia_scale_sum += $av->pfc_scale*$av->expavg_credit;
46 46
             $nvidia_credit_sum += $av->expavg_credit;
47 47
         } else if (strstr($av->plan_class, "intel_gpu")) {
48
-            $intel_gpu_scale_sum += $av->pfc_scale * $av->expavg_credit;
48
+            $intel_gpu_scale_sum += $av->pfc_scale*$av->expavg_credit;
49 49
             $intel_gpu_credit_sum += $av->expavg_credit;
50 50
         } else {
51
-            $cpu_scale_sum += $av->pfc_scale * $av->expavg_credit;
51
+            $cpu_scale_sum += $av->pfc_scale*$av->expavg_credit;
52 52
             $cpu_credit_sum += $av->expavg_credit;
53 53
         }
54 54
         $total_credit_sum += $av->expavg_credit;
Please login to merge, or discard this patch.
html/user/team_change_founder_form.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     if ($user->id != $team->userid) {       //don't show current founder
96 96
         $user_total_credit = format_credit($user->total_credit);
97 97
         $user_expavg_credit = format_credit($user->expavg_credit);
98
-        $selected = ($user->id == $team->ping_user)?"selected":"";
98
+        $selected = ($user->id == $team->ping_user) ? "selected" : "";
99 99
         echo '
100 100
             <tr>
101 101
             <td><input type="radio" name="userid" value="'.$user->id.'">
@@ -121,5 +121,5 @@  discard block
 block discarded – undo
121 121
 echo "</form>";
122 122
 page_tail();
123 123
 
124
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
124
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
125 125
 ?>
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,8 @@
 block discarded – undo
92 92
 
93 93
 $navailable_users = 0;
94 94
 foreach ($users as $user) {
95
-    if ($user->id != $team->userid) {       //don't show current founder
95
+    if ($user->id != $team->userid) {
96
+//don't show current founder
96 97
         $user_total_credit = format_credit($user->total_credit);
97 98
         $user_expavg_credit = format_credit($user->expavg_credit);
98 99
         $selected = ($user->id == $team->ping_user)?"selected":"";
Please login to merge, or discard this patch.