Passed
Pull Request — master (#3196)
by Christian
10:54
created
html/user/forum_search_action.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 // Optionally filters by forum, user, time, or hidden if specified.
32 32
 //
33 33
 function search_thread_titles(
34
-    $keyword_list, $forum="", $user="", $time="", $limit=200,
35
-    $sort_style=CREATE_TIME_NEW, $show_hidden = false
36
-){
37
-    $search_string="%";
34
+    $keyword_list, $forum = "", $user = "", $time = "", $limit = 200,
35
+    $sort_style = CREATE_TIME_NEW, $show_hidden = false
36
+) {
37
+    $search_string = "%";
38 38
     foreach ($keyword_list as $key => $word) {
39 39
         $search_string .= BoincDb::escape_string($word)."%";
40 40
     }        
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     if (!$show_hidden) {
52 52
         $query .= " and thread.hidden = 0";
53 53
     }
54
-    switch($sort_style) {
54
+    switch ($sort_style) {
55 55
     case MODIFIED_NEW:
56 56
         $query .= ' ORDER BY timestamp DESC';
57 57
         break;
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
 //
85 85
 function search_post_content(
86 86
     $keyword_list, $forum, $user, $time, $limit, $sort_style, $show_hidden
87
-){
87
+) {
88 88
     $db = BoincDb::get();
89 89
 
90
-    $search_string="%";
91
-    foreach ($keyword_list as $key => $word){
90
+    $search_string = "%";
91
+    foreach ($keyword_list as $key => $word) {
92 92
         $search_string .= BoincDb::escape_string($word)."%";
93 93
     } 
94 94
     $optional_join = "";
@@ -100,20 +100,20 @@  discard block
 block discarded – undo
100 100
     }
101 101
     $query = "select post.* from ".$db->db_name.".post".$optional_join." where content like '".$search_string."'";
102 102
     if ($forum) {
103
-        $query.=" and forum = $forum->id";
103
+        $query .= " and forum = $forum->id";
104 104
     }
105 105
     if ($user) {
106
-        $query.=" and post.user = $user->id ";
106
+        $query .= " and post.user = $user->id ";
107 107
     }
108 108
     if ($time) {
109
-        $query.=" and post.timestamp > $time";
109
+        $query .= " and post.timestamp > $time";
110 110
     }
111 111
     if (!$show_hidden) {
112 112
         $query .= " AND post.hidden = 0";
113 113
     }
114
-    switch($sort_style) {
114
+    switch ($sort_style) {
115 115
     case VIEWS_MOST:
116
-        $query.= ' ORDER BY views DESC';
116
+        $query .= ' ORDER BY views DESC';
117 117
         break;
118 118
     case CREATE_TIME_NEW:
119 119
         $query .= ' ORDER by post.timestamp desc';
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
         $query .= ' ORDER BY post.timestamp DESC';
129 129
         break;
130 130
     }
131
-    $query.= " limit $limit";
131
+    $query .= " limit $limit";
132 132
     return BoincPost::enum_general($query);
133 133
 }
134 134
 
135 135
 $logged_in_user = get_logged_in_user(false);
136 136
 BoincForumPrefs::lookup($logged_in_user);
137
-if ($logged_in_user && $logged_in_user->prefs->privilege(S_MODERATOR)){
137
+if ($logged_in_user && $logged_in_user->prefs->privilege(S_MODERATOR)) {
138 138
     $show_hidden_posts = true;
139 139
 } else {
140 140
     $show_hidden_posts = false;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 $search_max_time = post_int("search_max_time");
148 148
 $search_forum = post_int("search_forum");
149 149
 $search_sort = post_int("search_sort");
150
-$search_list = explode(" ",$search_keywords);
150
+$search_list = explode(" ", $search_keywords);
151 151
 if ($search_max_time) {
152 152
     $min_timestamp = time() - ($search_max_time*3600*24);
153 153
 } else {
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
 $limit = 100;
158 158
 
159
-if ($search_forum==-1){
159
+if ($search_forum == -1) {
160 160
     $forum = null;
161 161
 } else if ($search_forum) {
162 162
     $forum = BoincForum::lookup_id($search_forum);
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
 
174 174
 // Display the threads while we search for posts
175 175
 //
176
-if (count($threads)){
177
-    echo "<h3>" . tra("Thread titles matching your query:") . "</h3>";
176
+if (count($threads)) {
177
+    echo "<h3>".tra("Thread titles matching your query:")."</h3>";
178 178
     show_thread_and_context_header();
179
-    foreach ($threads as $thread){
179
+    foreach ($threads as $thread) {
180 180
         if ($thread->hidden) continue;
181 181
         show_thread_and_context($thread, $logged_in_user);
182 182
     }
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
     $show_hidden_posts
193 193
 );
194 194
 
195
-if (count($posts)){
196
-    echo "<h3>" . tra("Messages matching your query:") . "</h3>";
195
+if (count($posts)) {
196
+    echo "<h3>".tra("Messages matching your query:")."</h3>";
197 197
     start_table();
198 198
     $n = 1;
199 199
     $options = get_output_options($logged_in_user);
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
     end_table();
216 216
 }
217 217
 
218
-if (!count($threads) && !count($posts)){
218
+if (!count($threads) && !count($posts)) {
219 219
     echo "<p>".tra("Sorry, couldn't find anything matching your search query. You can try to broaden your search by using less words (or less specific words).")."</p>
220 220
     <p>"
221 221
     .tra("You can also %1 try the same search on Google. %2",
@@ -226,5 +226,5 @@  discard block
 block discarded – undo
226 226
 echo "<p><a href=\"forum_search.php\">".tra("Perform another search")."</a></p>";
227 227
 page_tail();
228 228
 
229
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
229
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
230 230
 ?>
Please login to merge, or discard this patch.
html/user/download_network.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,17 +25,17 @@
 block discarded – undo
25 25
 page_head(tra("Download BOINC add-on software"));
26 26
 echo "
27 27
     <p>" .
28
-    tra("You can download applications in several categories.") ."
28
+    tra("You can download applications in several categories.")."
29 29
     <ul>
30 30
     <li>".
31
-    tra("These applications are not endorsed by %1 and you use them at your own risk.", PROJECT) ."
31
+    tra("These applications are not endorsed by %1 and you use them at your own risk.", PROJECT)."
32 32
     <li>" .
33 33
     tra("We do not provide instructions for installing these applications.
34 34
 However, the author may have provided some help on installing or uninstalling the application. 
35 35
 If this is not enough you should contact the author.").
36 36
     tra("Instructions for installing and running BOINC are %1 here %2.", "<a href=https://boinc.berkeley.edu/download.php>", "</a>")
37
-    . "<li>" . 
38
-    tra("This list is managed centrally at %1 the BOINC website %2.", "<a href=\"https://boinc.berkeley.edu/addons.php\">", "</a>") ."
37
+    . "<li>". 
38
+    tra("This list is managed centrally at %1 the BOINC website %2.", "<a href=\"https://boinc.berkeley.edu/addons.php\">", "</a>")."
39 39
     </ul>
40 40
 ";
41 41
 
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincteam/boincteam_forum.module 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
   // In Drupal 7, these operation cases will all exist as their own hooks,
60 60
   // so let's approximate that here so that this function can simply be removed
61 61
   // upon migration to 7
62
-  switch($op) {
62
+  switch ($op) {
63 63
   case 'insert':
64 64
     boincteam_forum_node_insert($node);
65 65
     break;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
  * is inserted (forward compatible to Drupal 7)
85 85
  */
86 86
 function boincteam_forum_node_insert($node) {
87
-  switch($node->type) {
87
+  switch ($node->type) {
88 88
   case 'team_forum':
89 89
     $account = user_load($node->uid);
90 90
     $team_id = boincteam_forum_lookup_nid($node->tfid);
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
  * is loaded (forward compatible to Drupal 7)
108 108
  */
109 109
 function boincteam_forum_node_load($node) {
110
-  switch($node->type) {
110
+  switch ($node->type) {
111 111
   case 'team_forum':
112 112
     $node->tfid = db_result(db_query("
113 113
       SELECT tfid FROM {boincteam_forum_node}
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
  * is updated (forward compatible to Drupal 7)
126 126
  */
127 127
 function boincteam_forum_node_update($node) {
128
-  switch($node->type) {
128
+  switch ($node->type) {
129 129
   case 'team_forum':
130 130
     
131 131
     break;
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
  * is validated (forward compatible to Drupal 7)
141 141
  */
142 142
 function boincteam_forum_node_validate($node) {
143
-  switch($node->type) {
143
+  switch ($node->type) {
144 144
   case 'team_forum':
145 145
     $account = user_load($node->uid);
146 146
     // Get tfid from node, but if empty/null, get it from the database
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
  * is viewed (forward compatible to Drupal 7)
168 168
  */
169 169
 function boincteam_forum_node_view($node) {
170
-  switch($node->type) {
170
+  switch ($node->type) {
171 171
   case 'team_forum':
172 172
     $team_id = boincteam_forum_lookup_nid($node->tfid);
173 173
     $public_forum = boincteam_forum_is_public($node->tfid);
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
     while ($team_forum = db_fetch_object($result)) {
257 257
       
258 258
       $team_forum->link = url("community/teams/{$team_id}/forum/{$team_forum->tfid}");
259
-      $team_forum->zebra = $row % 2 ? 'even' : 'odd';
259
+      $team_forum->zebra = $row%2 ? 'even' : 'odd';
260 260
       $team_forum->new_topics = 0; // TODO: Track user views of team topics
261 261
       $team_forum->new_text = '';
262 262
       $team_forum->new_url = '';
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
  */
325 325
 function boincteam_forum_create_form_panel() {
326 326
   $output = '';
327
-  $output .= '<h2 class="pane-title">' . bts('Create team message board', array(), NULL, 'boinc:team-forum')
327
+  $output .= '<h2 class="pane-title">'.bts('Create team message board', array(), NULL, 'boinc:team-forum')
328 328
     . '</h2>';
329 329
   $output .= drupal_get_form('boincteam_forum_create_form');
330 330
   
@@ -337,8 +337,8 @@  discard block
 block discarded – undo
337 337
 function boincteam_forum_edit_form_panel($tfid) {
338 338
   $team_forum = boincteam_forum_load($tfid);
339 339
   $output = '';
340
-  $output .= '<h2 class="pane-title">' . bts('Edit message board', array(), NULL, 'boinc:team-forum') . ': ' . 
341
-    $team_forum->title . '</h2>';
340
+  $output .= '<h2 class="pane-title">'.bts('Edit message board', array(), NULL, 'boinc:team-forum').': '. 
341
+    $team_forum->title.'</h2>';
342 342
   $output .= drupal_get_form('boincteam_forum_edit_form', $tfid);
343 343
   
344 344
   return $output;
@@ -354,19 +354,19 @@  discard block
 block discarded – undo
354 354
   );
355 355
   $forums = boincteam_forum_list($team_id);
356 356
   $output = '';
357
-  $output .= '<h2 class="pane-title">' . bts('Team forum', array(), NULL, 'boinc:team-forum') . '</h2>';
357
+  $output .= '<h2 class="pane-title">'.bts('Team forum', array(), NULL, 'boinc:team-forum').'</h2>';
358 358
   $output .= '<p>'
359 359
     . bts('A discussion forum has been set up for team members.', array(), NULL, 'boinc:team-forum')
360 360
     . '</p>';
361 361
   $output .= '<ul class="tab-list action-list">';
362 362
   foreach ($forums as $forum) {
363 363
     if (!$show_public_only OR $forum->public) {
364
-      $output .= '  <li class="tab primary">' . 
364
+      $output .= '  <li class="tab primary">'. 
365 365
         l(
366 366
           //$forum->title,
367 367
           bts('Enter forum', array(), NULL, 'boinc:team-forum'),
368 368
           "community/teams/{$team_id}/forum/{$forum->tfid}"
369
-        ) . '</li>';
369
+        ).'</li>';
370 370
       // Since we're only supporting one team forum for now, we've labeled the
371 371
       // link in a generic way above and will now just break out of the loop
372 372
       break;
@@ -381,20 +381,20 @@  discard block
 block discarded – undo
381 381
  */                                         
382 382
 function boincteam_forum_topic_overview_panel($nid = NULL) {
383 383
   $output = '';
384
-  $output .= '<h2 class="pane-title">' . bts('About message boards', array(), NULL, 'boinc:team-forum') . '</h2>';
384
+  $output .= '<h2 class="pane-title">'.bts('About message boards', array(), NULL, 'boinc:team-forum').'</h2>';
385 385
   $output .= '<div>';
386 386
   if ($nid) {
387 387
     $team = node_load($nid);
388
-    $output .= '<p>' . bts('You may create a message board for use by @team',
389
-      array('@team' => $team->title), NULL, 'boinc:team-forum') . ':</p>';
388
+    $output .= '<p>'.bts('You may create a message board for use by @team',
389
+      array('@team' => $team->title), NULL, 'boinc:team-forum').':</p>';
390 390
   }
391 391
   else {
392
-    $output .= '<p>' . bts('This is a team-only message board', array(), NULL, 'boinc:team-forum') . ':</p>';
392
+    $output .= '<p>'.bts('This is a team-only message board', array(), NULL, 'boinc:team-forum').':</p>';
393 393
   }
394 394
   $output .= '<ul>';
395
-  $output .= '  <li>' . bts('Only members may post', array(), NULL, 'boinc:team-forum') . '</li>';
396
-  $output .= '  <li>' . bts('Only members may read (optional)', array(), NULL, 'boinc:team-forum') . '</li>';
397
-  $output .= '  <li>' . bts('Founder & Team Admins have moderator privileges', array(), NULL, 'boinc:team-forum') .
395
+  $output .= '  <li>'.bts('Only members may post', array(), NULL, 'boinc:team-forum').'</li>';
396
+  $output .= '  <li>'.bts('Only members may read (optional)', array(), NULL, 'boinc:team-forum').'</li>';
397
+  $output .= '  <li>'.bts('Founder & Team Admins have moderator privileges', array(), NULL, 'boinc:team-forum').
398 398
     '</li>';
399 399
   $output .= '</ul>';
400 400
   $output .= '</div>';
Please login to merge, or discard this patch.
html/user/friend.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         if ($notify) {
39 39
             page_head(tra("Request pending"));
40 40
             $t = date_str($friend->create_time);
41
-            echo tra("You requested friendship with %1 on %2.", $destuser->name,$t) . "
41
+            echo tra("You requested friendship with %1 on %2.", $destuser->name, $t)."
42 42
                 <p>" .
43 43
                 tra("This request is still pending confirmation.");
44 44
             page_tail();
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 function check_ignoring($srcuser, $destuser) {
52 52
     BoincForumPrefs::lookup($destuser);
53 53
     if (is_ignoring($destuser, $srcuser)) {
54
-        error_page(tra("%1 is not accepting friendship requests from you",$destuser->name));
54
+        error_page(tra("%1 is not accepting friendship requests from you", $destuser->name));
55 55
     }
56 56
 }
57 57
 
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
     echo "
73 73
         <form method=post action=friend.php>
74 74
         <input type=hidden name=userid value=$destid>
75
-        <input type=hidden name=action value=add_confirm>" .
75
+        <input type=hidden name=action value=add_confirm>".
76 76
         tra("You have asked to add %1 as a friend. We will notify %1 and will ask him/her to confirm that you are friends.",
77
-        "<b>".$destuser->name."</b>") ."
77
+        "<b>".$destuser->name."</b>")."
78 78
         <p>" .
79
-        tra("Add an optional message here:") ."
79
+        tra("Add an optional message here:")."
80 80
         <br>
81 81
         ".textarea_with_counter("message", 250, "")."
82 82
         <p>
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         send_friend_request_email($user, $destuser, $msg);
116 116
     }
117 117
     page_head(tra("Friend request sent"));
118
-    echo tra("We have notified %1 of your request.","<b>".$destuser->name."</b>");
118
+    echo tra("We have notified %1 of your request.", "<b>".$destuser->name."</b>");
119 119
     page_tail();
120 120
 }
121 121
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     }
187 187
 
188 188
     page_head(tra("Friendship confirmed"));
189
-    echo tra("Your friendship with %1 has been confirmed.","<b>" . $srcuser->name ."</b>");
189
+    echo tra("Your friendship with %1 has been confirmed.", "<b>".$srcuser->name."</b>");
190 190
     page_tail();
191 191
 }
192 192
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         $notify->delete();
206 206
     }
207 207
     page_head(tra("Friendship declined"));
208
-    echo tra("You have declined friendship with %1","<b>".$srcuser->name."</b>");
208
+    echo tra("You have declined friendship with %1", "<b>".$srcuser->name."</b>");
209 209
     page_tail();
210 210
 }
211 211
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
         echo tra("Notification not found");
224 224
     }
225 225
     page_head(tra("Friend confirmed"));
226
-    echo tra("You are now friends with %1.",$destuser->name);
226
+    echo tra("You are now friends with %1.", $destuser->name);
227 227
     page_tail();
228 228
 }
229 229
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
     echo
236 236
         tra("Are you sure you want to cancel your friendship with %1?",
237 237
             $destuser->name
238
-        ) ."<p>\n"
238
+        )."<p>\n"
239 239
     ;
240 240
     show_button("friend.php?action=cancel&userid=$destid", tra("Yes"), tra("Cancel friendship"));
241 241
     show_button(USER_HOME, tra("No"), tra("Stay friends"));
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
     if (!$destuser) error_page("No such user");
250 250
     BoincFriend::delete($user->id, $destid);
251 251
     page_head(tra("Friendship cancelled"));
252
-    echo tra("Your friendship with %1 has been cancelled.",$destuser->name);
252
+    echo tra("Your friendship with %1 has been cancelled.", $destuser->name);
253 253
     page_tail();
254 254
 }
255 255
 
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boinctranslate/boinctranslate.module 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
   // In Drupal 7, these operation cases will all exist as their own hooks,
80 80
   // so let's approximate that here so that this function can simply be removed
81 81
   // upon migration to 7
82
-  switch($op) {
82
+  switch ($op) {
83 83
   case 'update':
84 84
     boinctranslate_node_update($node);
85 85
     break;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 function boinctranslate_node_update($node) {
99 99
   // Only process nodes of certain types as defined by the individual
100 100
   // node's setting for field_boinctranslate_transifex.
101
-  if ( ($node->field_boinctranslate_transifex) and ($node->field_boinctranslate_transifex[0]['value']=='1') ) {
101
+  if (($node->field_boinctranslate_transifex) and ($node->field_boinctranslate_transifex[0]['value'] == '1')) {
102 102
     // Add page content to translation table.
103 103
     $textgroup = 'project';
104 104
     $location = "node:{$node->nid}:body";
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
       // Only process this chunk if there is a hash associated with it.
127 127
       if ($chunk['hash']) {
128
-        $chunkloc = $location . ":{$chunk['hash']}";
128
+        $chunkloc = $location.":{$chunk['hash']}";
129 129
 
130 130
         // If the hash for this chunk is in the hash table, logically
131 131
         // the chunk is already in the database locales_source table. As
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
  * is viewed (forward compatible to Drupal 7)
180 180
  */
181 181
 function boinctranslate_node_view($node, $view_mode, $langcode) {
182
-  switch($node->type) {
182
+  switch ($node->type) {
183 183
   case 'page':
184 184
     break;
185 185
   default:
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
       array(
203 203
         '!token' =>  l('#SPLIT_TOKEN#', "filter/tips/$format",
204 204
         array(
205
-          'fragment' => 'filter-boinctranslate-' . $delta,
205
+          'fragment' => 'filter-boinctranslate-'.$delta,
206 206
           'attributes' =>
207 207
             array(
208 208
               'target'=>'_blank',
@@ -238,14 +238,14 @@  discard block
 block discarded – undo
238 238
       return $text;
239 239
     }
240 240
 
241
-    if ( ($node->field_boinctranslate_transifex) and ($node->field_boinctranslate_transifex[0]['value']=='1') ) {
241
+    if (($node->field_boinctranslate_transifex) and ($node->field_boinctranslate_transifex[0]['value'] == '1')) {
242 242
       if (variable_get("boinctranslate_filter_debug_$format", 0)) {
243 243
         $timing_start = explode(' ', microtime());
244 244
         $ret = _boinctranslate_filter_process($text, $format, $mynid);
245 245
         $timing_stop = explode(' ', microtime());
246 246
         $elapsed = $timing_stop[1] - $timing_start[1];
247 247
         $elapsed += $timing_stop[0] - $timing_start[0];
248
-        $mess = 'DEBUG ' . l('BOINC translate', "filter/tips/$format") .' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.';
248
+        $mess = 'DEBUG '.l('BOINC translate', "filter/tips/$format").' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.';
249 249
         drupal_set_message($mess, 'warning');
250 250
         return $ret;
251 251
       }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
   $chunks = array();
309 309
   foreach ($parts as $key => $value) {
310 310
     if (preg_match('/(#SPLIT_TOKEN#)/', $value)) {
311
-      $chunks[] = array ('delimiter' => $value,);
311
+      $chunks[] = array('delimiter' => $value,);
312 312
     }
313 313
     else {
314 314
       $cleaned = preg_replace('/\s|\n/', '', $value);
Please login to merge, or discard this patch.
html/user/workunit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
     // (so that bad guys can't tell if they have an unreplicated job)
66 66
 
67 67
     $config = get_config();
68
-    if ($app->target_nresults>0 && !$wu->canonical_resultid && !$wu->error_mask && !parse_bool($config, "dont_suppress_pending")) {
68
+    if ($app->target_nresults > 0 && !$wu->canonical_resultid && !$wu->error_mask && !parse_bool($config, "dont_suppress_pending")) {
69 69
         row2(tra("Tasks in progress"), tra("suppressed pending completion"));
70 70
         end_table();
71 71
     } else {
Please login to merge, or discard this patch.
html/ops/badge_assign.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 //
33 33
 function get_pct_badges($badge_name_prefix, $badge_pctiles, $badge_images) {
34 34
     $badges = array();
35
-    for ($i=0; $i<3; $i++) {
35
+    for ($i = 0; $i < 3; $i++) {
36 36
         $badges[$i] = get_badge($badge_name_prefix."_".$i, "Top ".$badge_pctiles[$i]."% in average credit", $badge_images[$i]);
37 37
     }
38 38
     return $badges;
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 //
43 43
 function get_percentiles($is_user, $badge_pctiles) {
44 44
     $percentiles = array();
45
-    for ($i=0; $i<3; $i++) {
45
+    for ($i = 0; $i < 3; $i++) {
46 46
         if ($is_user) {
47
-            $percentiles[$i] = BoincUser::percentile("expavg_credit", "expavg_credit>1", 100-$badge_pctiles[$i]);
47
+            $percentiles[$i] = BoincUser::percentile("expavg_credit", "expavg_credit>1", 100 - $badge_pctiles[$i]);
48 48
         } else {
49
-            $percentiles[$i] = BoincTeam::percentile("expavg_credit", "expavg_credit>1", 100-$badge_pctiles[$i]);
49
+            $percentiles[$i] = BoincTeam::percentile("expavg_credit", "expavg_credit>1", 100 - $badge_pctiles[$i]);
50 50
         }
51 51
         if ($percentiles[$i] === false) {
52 52
             die("Can't get percentiles\n");
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 // Unassign other badges.
60 60
 //
61 61
 function assign_pct_badge($is_user, $item, $percentiles, $badges) {
62
-    for ($i=0; $i<3; $i++) {
62
+    for ($i = 0; $i < 3; $i++) {
63 63
         if ($item->expavg_credit >= $percentiles[$i]) {
64 64
             assign_badge($is_user, $item, $badges[$i]);
65 65
             unassign_badges($is_user, $item, $badges, $i);
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
 // and assign/unassign RAC badges
74 74
 //
75 75
 function assign_badges($is_user, $badge_pctiles, $badge_images) {
76
-    $kind = $is_user?"user":"team";
76
+    $kind = $is_user ? "user" : "team";
77 77
     $badges = get_pct_badges($kind."_pct", $badge_pctiles, $badge_images);
78 78
     $pctiles = get_percentiles($is_user, $badge_pctiles);
79 79
     //echo "thresholds for $kind badges: $pctiles[0] $pctiles[1] $pctiles[2]\n";
80 80
 
81 81
     $n = 0;
82
-    $maxid = $is_user?BoincUser::max("id"):BoincTeam::max("id");
82
+    $maxid = $is_user ?BoincUser::max("id") : BoincTeam::max("id");
83 83
     while ($n <= $maxid) {
84 84
         $m = $n + 1000;
85 85
         if ($is_user) {
Please login to merge, or discard this patch.
html/ops/bolt_map.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
 function spaces($level) {
105 105
     $x = "";
106
-    for ($i=0; $i<$level; $i++) {
106
+    for ($i = 0; $i < $level; $i++) {
107 107
         $x .= "&nbsp;&nbsp;&nbsp;&nbsp;";
108 108
     }
109 109
     return $x;
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 function avg_score($array) {
137 137
     $sum = 0;
138 138
     $n = count($array);
139
-    if ($n ==0) return 0;
139
+    if ($n == 0) return 0;
140 140
     foreach ($array as $a) {
141 141
         $sum += $a->score;
142 142
     }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             $n++;
153 153
         }
154 154
     }
155
-    if ($n ==0) return 0;
155
+    if ($n == 0) return 0;
156 156
     return $sum/$n;
157 157
 }
158 158
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
     global $breakdown, $breakdown_cat;
236 236
     global $rownum, $course_id;
237 237
 
238
-    $a = $is_answer?" (answer)":"";
238
+    $a = $is_answer ? " (answer)" : "";
239 239
     $j = ($rownum++)%2;
240 240
     echo "<tr class=row$j>";
241 241
     if ($breakdown && $breakdown_cat) {
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
             <td><br></td>
244 244
             <td><br></td>
245 245
         ";
246
-    } else  {
246
+    } else {
247 247
         $c = class_name($class);
248 248
         echo "
249 249
             <td><b>".spaces($level)."$unit->name</b></td>
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         echo time_graph($t, 200);
278 278
         break;
279 279
     case "BoltExercise":
280
-        $mode = $is_answer?BOLT_MODE_ANSWER:BOLT_MODE_SHOW;
280
+        $mode = $is_answer ?BOLT_MODE_ANSWER:BOLT_MODE_SHOW;
281 281
         $views = get_views($unit, $mode);
282 282
         $n = count($views);
283 283
         $out = outcomes($views);
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
     show_unit($unit, $level);
361 361
     if ($unit->is_item) return;
362 362
     foreach ($unit->units as $u) {
363
-        show_unit_recurse($u, $level+1);
363
+        show_unit_recurse($u, $level + 1);
364 364
     }
365 365
 }
366 366
 
@@ -402,9 +402,9 @@  discard block
 block discarded – undo
402 402
         <input type=hidden name=course_id value=$course_id>
403 403
         <table width=600><tr><td valign=top>
404 404
     ";
405
-    filter_form($filter?$filter->name():"", $filter_cat);
405
+    filter_form($filter ? $filter->name() : "", $filter_cat);
406 406
     echo "</td><td valign=top>";
407
-    breakdown_form($breakdown?$breakdown->name():"");
407
+    breakdown_form($breakdown ? $breakdown->name() : "");
408 408
     echo "
409 409
         </td></tr></table>
410 410
         <p>
Please login to merge, or discard this patch.
html/ops/badge_assign_custom.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 ) {
78 78
     $badges = array();
79 79
     $limit = count($badge_level_names);
80
-    for ($i=0; $i < $limit; $i++) {
80
+    for ($i = 0; $i < $limit; $i++) {
81 81
         $badges[$i] = get_badge($badge_name_prefix."_".$sub_project["short_name"]."_".$i, "$badge_level_names[$i] in ".$sub_project["name"]." credit", $sub_project["short_name"].$badge_images[$i]);
82 82
     }
83 83
     return $badges;
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     // count from highest to lowest level, so the user get's assigned the
91 91
     // highest possible level and the lower levels get removed
92 92
     //
93
-    for ($i=count($levels)-1; $i>=0; $i--) {
93
+    for ($i = count($levels) - 1; $i >= 0; $i--) {
94 94
         if ($item->total_credit >= $levels[$i]) {
95 95
             assign_badge($is_user, $item, $badges[$i]);
96 96
             unassign_badges($is_user, $item, $badges, $i);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     // count from highest to lowest level, so the user get's assigned the
115 115
     // highest possible level and the lower levels get removed
116 116
     //
117
-    for ($i=count($levels)-1; $i>=0; $i--) {
117
+    for ($i = count($levels) - 1; $i >= 0; $i--) {
118 118
         if ($sub_total >= $levels[$i]) {
119 119
             assign_badge($is_user, $item, $badges[$i]);
120 120
             unassign_badges($is_user, $item, $badges, $i);
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     $is_user, $badge_levels, $badge_level_names, $badge_images,
135 135
     $subprojects_list
136 136
 ) {
137
-    $kind = $is_user?"user":"team";
137
+    $kind = $is_user ? "user" : "team";
138 138
 
139 139
     // get badges for all subprojects including total
140 140
     //
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     }
144 144
 
145 145
     $n = 0;
146
-    $maxid = $is_user?BoincUser::max("id"):BoincTeam::max("id");
146
+    $maxid = $is_user ?BoincUser::max("id") : BoincTeam::max("id");
147 147
     while ($n <= $maxid) {
148 148
         $m = $n + 1000;
149 149
         if ($is_user) {
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                     assign_tot_badge($is_user, $item, $badge_levels, $badges["total"]);
162 162
                 } else {
163 163
                     // appids come from project/project.inc
164
-                    $where_clause = "appid in (". implode(',', $sp["appids"]) .")";
164
+                    $where_clause = "appid in (".implode(',', $sp["appids"]).")";
165 165
                     assign_sub_badge(
166 166
                         $is_user, $item, $badge_levels, $badges[$sp["short_name"]],
167 167
                         $where_clause
Please login to merge, or discard this patch.