Passed
Push — dpa_docker18 ( 99df08 )
by David
10:05
created
html/user/team_change_founder_form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 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.'">
Please login to merge, or discard this patch.
html/user/edit_forum_preferences_form.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 // ------------ Notification -----------
39 39
 
40 40
 row1(tra("Notifications"));
41
-$ch0 = $user->prefs->pm_notification==0?"checked":"";
42
-$ch1 = $user->prefs->pm_notification==1?"checked":"";
43
-$ch2 = $user->prefs->pm_notification==2?"checked":"";
41
+$ch0 = $user->prefs->pm_notification == 0 ? "checked" : "";
42
+$ch1 = $user->prefs->pm_notification == 1 ? "checked" : "";
43
+$ch2 = $user->prefs->pm_notification == 2 ? "checked" : "";
44 44
 row2(
45 45
     tra("How should we notify you of new private messages, friend requests, posts in subscribed threads, and other events?"),
46 46
     "<input type=radio name=pm_notification value=0 $ch0> ".tra("On my Account page (no email)")."
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 // ------------ Forum identity -----------
54 54
 
55 55
 $select_0 = $select_1 = $select_2 = "";
56
-if (strlen($user->prefs->avatar)){
57
-    if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { // Gravatar
56
+if (strlen($user->prefs->avatar)) {
57
+    if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18) == "//www.gravatar.com") { // Gravatar
58 58
         $select_1 = "checked=\"true\"";
59 59
     } else {
60 60
         $select_2 = "checked=\"true\"";
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
     <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" ".$select_2.">
74 74
         <label for=\"avatar_select_2\">".tra("Use this uploaded avatar:")."</label> <input type=\"file\" name=\"picture\">"
75 75
 );
76
-if (strlen($user->prefs->avatar)){
76
+if (strlen($user->prefs->avatar)) {
77 77
     row2(tra("Avatar preview")."<br><p class=\"text-muted\">".tra("This is how your avatar will look")."</p>",
78 78
     "<img src=\"".$user->prefs->avatar."\" width=\"100\" height=\"100\">");
79 79
 }
80 80
 
81
-$signature_by_default = $user->prefs->no_signature_by_default==false?"checked=\"checked\"":"";
81
+$signature_by_default = $user->prefs->no_signature_by_default == false ? "checked=\"checked\"" : "";
82 82
 
83
-$signature=$user->prefs->signature;
84
-$maxlen=250;
83
+$signature = $user->prefs->signature;
84
+$maxlen = 250;
85 85
 $x = '';
86 86
 if (!NO_COMPUTING) {
87 87
     $x = tra(
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         tra("Attach signature by default")
104 104
     )
105 105
 );
106
-if ($user->prefs->signature!=""){
106
+if ($user->prefs->signature != "") {
107 107
     row2(tra("Signature preview").
108 108
         "<br><p class=\"text-muted\">".tra("This is how your signature will look in the forums")."</p>",
109 109
         output_transform($user->prefs->signature)
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
 
113 113
 // ------------ Message display  -----------
114 114
 
115
-$forum_hide_avatars = $user->prefs->hide_avatars?"checked=\"checked\"":"";
116
-$forum_hide_signatures = $user->prefs->hide_signatures?"checked=\"checked\"":"";
117
-$forum_link_popup = $user->prefs->link_popup?"checked=\"checked\"":"";
118
-$forum_image_as_link = $user->prefs->images_as_links?"checked=\"checked\"":"";
119
-$forum_jump_to_unread = $user->prefs->jump_to_unread?"checked=\"checked\"":"";
120
-$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts?"checked=\"checked\"":"";
121
-$forum_highlight_special = $user->prefs->highlight_special?"checked=\"checked\"":"";
115
+$forum_hide_avatars = $user->prefs->hide_avatars ? "checked=\"checked\"" : "";
116
+$forum_hide_signatures = $user->prefs->hide_signatures ? "checked=\"checked\"" : "";
117
+$forum_link_popup = $user->prefs->link_popup ? "checked=\"checked\"" : "";
118
+$forum_image_as_link = $user->prefs->images_as_links ? "checked=\"checked\"" : "";
119
+$forum_jump_to_unread = $user->prefs->jump_to_unread ? "checked=\"checked\"" : "";
120
+$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts ? "checked=\"checked\"" : "";
121
+$forum_highlight_special = $user->prefs->highlight_special ? "checked=\"checked\"" : "";
122 122
 
123 123
 $forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount);
124 124
 $forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                 <input class="btn btn-default" type="submit" name="remove%d" value="%s">
165 165
                 <br>
166 166
             ',
167
-            UNIQUE_USER_NAME?'':"$blocked_user->id -",
167
+            UNIQUE_USER_NAME ? '' : "$blocked_user->id -",
168 168
             user_links($blocked_user),
169 169
             $blocked_user->id,
170 170
             tra("Unblock")
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         tra("Blocked users"),
179 179
         tra('Ignore message board posts and private messages from these users.')
180 180
     ),
181
-    $blocked_str?$blocked_str:'---'
181
+    $blocked_str ? $blocked_str : '---'
182 182
 );
183 183
 row2(
184 184
     tra('Block user'),
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             <input type="text" name="forum_filter_user" size=12>
189 189
             <input class="btn btn-default" type="submit" name="add_user_to_filter" value="%s">
190 190
         ',
191
-        UNIQUE_USER_NAME?tra('User name'):tra('User ID (For instance: 123456789)'),
191
+        UNIQUE_USER_NAME ?tra('User name') : tra('User ID (For instance: 123456789)'),
192 192
         tra("Block")
193 193
     )
194 194
 );
Please login to merge, or discard this patch.
html/user/forum_moderate_post_action.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
html/user/forum_edit.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 $post_owner = BoincUser::lookup_id($post->user);
44 44
 if (($logged_in_user->id != $post_owner->id) || (can_reply($thread, $forum, $logged_in_user) == false)) {
45
-    error_page (tra("You are not authorized to edit this post."));
45
+    error_page(tra("You are not authorized to edit this post."));
46 46
 }
47 47
 
48 48
 $thread_owner = BoincUser::lookup_id($thread->owner);
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 // (ie. not a response to another post)
52 52
 // allow the user to modify the thread title
53 53
 //
54
-$can_edit_title = ($post->parent_post==0 && $thread_owner->id==$logged_in_user->id && !is_banished($logged_in_user));
54
+$can_edit_title = ($post->parent_post == 0 && $thread_owner->id == $logged_in_user->id && !is_banished($logged_in_user));
55 55
 
56 56
 $content = post_str("content", true);
57 57
 $title = post_str("title", true);
58 58
 $preview = post_str("preview", true);
59 59
 
60
-if (post_str('submit',true) && (!$preview)) {
60
+if (post_str('submit', true) && (!$preview)) {
61 61
     if (POST_MAX_LINKS
62 62
         && link_count($content) > POST_MAX_LINKS
63 63
         && !is_moderator($logged_in_user, $forum)
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     }
67 67
     check_tokens($logged_in_user->authenticator);
68 68
 
69
-    $add_signature = (post_str('add_signature', true) == "1")?1:0;
69
+    $add_signature = (post_str('add_signature', true) == "1") ? 1 : 0;
70 70
     $content = substr($content, 0, 64000);
71 71
     $content = trim($content);
72 72
     if (strlen($content)) {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $now = time();
75 75
         $post->update("signature=$add_signature, content='$content', modified=$now");
76 76
 
77
-        if ($can_edit_title){
77
+        if ($can_edit_title) {
78 78
             $title = trim($title);
79 79
             $title = sanitize_tags($title);
80 80
             $title = BoincDb::escape_string($title);
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     }
88 88
 }
89 89
 
90
-page_head(tra("Edit post"),'','','', $bbcode_js);
90
+page_head(tra("Edit post"), '', '', '', $bbcode_js);
91 91
 
92 92
 switch ($forum->parent_type) {
93 93
 case 0:
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         sprintf(
123 123
             '<input type="text" size=%d name="title" value="%s">',
124 124
             80,
125
-            htmlspecialchars($preview?$title:$thread->title)
125
+            htmlspecialchars($preview ? $title : $thread->title)
126 126
         ),
127 127
         null, FORUM_LH_PCT
128 128
     );
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         $bbcode_html,
140 140
         12,
141 141
         80,
142
-        htmlspecialchars($preview?$content:$post->content)
142
+        htmlspecialchars($preview ? $content : $post->content)
143 143
     ),
144 144
     null, FORUM_LH_PCT
145 145
 );
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         '<input id="add_signature" name="add_signature" value="1" type="checkbox" %s>
150 150
         <label for="add_signature">%s</label>
151 151
         ',
152
-        $post->signature?'checked="true"':'',
152
+        $post->signature ? 'checked="true"' : '',
153 153
         tra("Add my signature to this post")
154 154
     ),
155 155
     null, FORUM_LH_PCT
Please login to merge, or discard this patch.
html/user/add_venue.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 $subset = sanitize_tags(get_str("subset"));
28 28
 $venue = sanitize_tags(get_str("venue"));
29 29
 $columns = get_int("cols", true);
30
-$c = $columns?"&cols=$columns":"";
30
+$c = $columns ? "&cols=$columns" : "";
31 31
 check_venue($venue);
32 32
 check_subset($subset);
33 33
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             $title = tra("Edit %1 preferences", subset_name($subset));
43 43
             if ($venue) $title = "$title for $venue";
44 44
             page_head($title);
45
-            $x = $venue?"&venue=$venue":"";
45
+            $x = $venue ? "&venue=$venue" : "";
46 46
 
47 47
             echo PREFS_FORM_DESC1;
48 48
             echo PREFS_FORM_ERROR_DESC;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             $title = tra("Edit %1 preferences", subset_name($subset));
68 68
             if ($venue) $title = "$title for $venue";
69 69
             page_head($title);
70
-            $x = $venue?"&venue=$venue":"";
70
+            $x = $venue ? "&venue=$venue" : "";
71 71
 
72 72
             echo PREFS_FORM_ERROR_DESC;
73 73
 
Please login to merge, or discard this patch.
html/user/forum_index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
         project_forum_index_intro();
59 59
     }
60 60
 
61
-    if (defined('FORUM_QA_MERGED_MODE') && FORUM_QA_MERGED_MODE){
61
+    if (defined('FORUM_QA_MERGED_MODE') && FORUM_QA_MERGED_MODE) {
62 62
         $categories = BoincCategory::enum("true order by orderID");
63 63
     } else {
64 64
         echo "<p>"
Please login to merge, or discard this patch.
html/user/pm.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -84,20 +84,20 @@  discard block
 block discarded – undo
84 84
             if ($offset === false) $offset = 0;
85 85
             if ($offset >= $nmsgs) $offset = 0;
86 86
             echo sprintf('Showing messages %d to %d of %d',
87
-                $offset+1,
88
-                min($offset+$nshow, $nmsgs),
87
+                $offset + 1,
88
+                min($offset + $nshow, $nmsgs),
89 89
                 $nmsgs
90 90
             );
91 91
             if ($offset) {
92 92
                 echo sprintf(
93 93
                     ' &middot; <a href=pm.php?action=inbox&offset=%d>Previous %d</a>',
94
-                    max(0, $offset-$nshow), $nshow
94
+                    max(0, $offset - $nshow), $nshow
95 95
                 );
96 96
             }
97
-            if ($offset+$nshow < $nmsgs) {
97
+            if ($offset + $nshow < $nmsgs) {
98 98
                 echo sprintf(
99 99
                     ' &middot; <a href=pm.php?action=inbox&offset=%d>Next %d</a>',
100
-                    $offset+$nshow, $nshow
100
+                    $offset + $nshow, $nshow
101 101
                 );
102 102
             }
103 103
         }
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
             array('style="width: 12em;"', 'style="width: 10em;"', "")
113 113
         );
114 114
         $i = 0;
115
-        foreach($msgs as $msg) {
116
-            if ($i<$offset) {
115
+        foreach ($msgs as $msg) {
116
+            if ($i < $offset) {
117 117
                 $i++;
118 118
                 continue;
119 119
             }
120
-            if ($i>=$offset+$nshow) break;
120
+            if ($i >= $offset + $nshow) break;
121 121
             $i++;
122 122
             $sender = BoincUser::lookup_id($msg->senderid);
123 123
             if (!$sender) {
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
     $msgs = BoincPrivateMessage::enum(
392 392
         "userid=$logged_in_user->id"
393 393
     );
394
-    foreach($msgs as $msg) {
394
+    foreach ($msgs as $msg) {
395 395
         $x = "pm_select_$msg->id";
396 396
         if (post_str($x, true)) {
397 397
             $msg = BoincPrivateMessage::lookup_id($msg->id);
Please login to merge, or discard this patch.
html/user/user_search.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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];
Please login to merge, or discard this patch.
html/user/forum_thread.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 $postid = get_int('postid', true);
31 31
 $filter = get_str('filter', true);
32 32
 
33
-if ($filter != "false"){
33
+if ($filter != "false") {
34 34
     $filter = true;
35 35
 } else {
36 36
     $filter = false;
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 if ($temp_sort_style) {
80 80
     $sort_style = $temp_sort_style;
81 81
 } else if ($sort_style) {
82
-    $forum_style = 0;   // this is deprecated
83
-    if ($logged_in_user){
82
+    $forum_style = 0; // this is deprecated
83
+    if ($logged_in_user) {
84 84
         $logged_in_user->prefs->thread_sorting = $sort_style;
85 85
         $logged_in_user->prefs->update("thread_sorting=$sort_style");
86 86
     } else {
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     );
93 93
 } else {
94 94
     // get the sorting style from the user or a cookie
95
-    if ($logged_in_user){
95
+    if ($logged_in_user) {
96 96
         $sort_style = $logged_in_user->prefs->thread_sorting;
97 97
     } else {
98 98
         list($forum_style, $sort_style) = parse_forum_cookie();
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
 
119 119
 if (false) {
120 120
 if ($forum->parent_type == 0) {
121
-    if ($category->is_helpdesk && !$thread->status){
122
-        if ($logged_in_user){
123
-            if ($thread->owner == $logged_in_user->id){
124
-                if ($thread->replies !=0) {
121
+    if ($category->is_helpdesk && !$thread->status) {
122
+        if ($logged_in_user) {
123
+            if ($thread->owner == $logged_in_user->id) {
124
+                if ($thread->replies != 0) {
125 125
                     // Show a "this question has been answered" to the author
126 126
                     echo "<p>";
127 127
                     show_button(
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     // If logged in user is moderator, enable some extra features
190 190
     //
191 191
     if (is_moderator($logged_in_user, $forum)) {
192
-        if ($thread->hidden){
192
+        if ($thread->hidden) {
193 193
             show_button_small(
194 194
                 "forum_moderate_thread_action.php?action=unhide&amp;thread=".$thread->id."$tokens",
195 195
                 tra("Unhide"),
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                 tra("Hide this thread")
203 203
             );
204 204
         }
205
-        if ($thread->sticky){
205
+        if ($thread->sticky) {
206 206
             show_button_small(
207 207
                 "forum_moderate_thread_action.php?action=desticky&amp;thread=".$thread->id."$tokens",
208 208
                 tra("Make unsticky"),
Please login to merge, or discard this patch.