Passed
Pull Request — master (#3196)
by Christian
10:54
created
drupal/sites/default/boinc/modules/boincstats/boincstats.module 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
   
74 74
   $stats_xml = NULL;
75 75
   
76
-  switch($chart_size) {
76
+  switch ($chart_size) {
77 77
   case 'small':
78 78
     $cache_name .= "{$cpid}_small";
79 79
     $dataset_size = 30;
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
   }
100 100
   
101 101
   // Initialize the cache object and flush stale images
102
-  $myCache = new pCache(array('CacheFolder' => realpath('.') . '/' . conf_path() . '/files/cache'));
102
+  $myCache = new pCache(array('CacheFolder' => realpath('.').'/'.conf_path().'/files/cache'));
103 103
   $myCache->removeOlderThan(60*60*24);
104 104
   
105 105
   if ($myCache->isInCache($cache_name)) {
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     if ($stats_xml) {
113 113
       // Get the last 60 days of stats for the chart
114 114
       for ($j = 30; $j < 90; $j++) {
115
-        $dataset[] = (int) $stats_xml->records->record[$j];
115
+        $dataset[] = (int)$stats_xml->records->record[$j];
116 116
       }
117 117
     }
118 118
     else {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     
132 132
     $MyData->addPoints($dataset, 'series1');
133 133
     $MyData->setPalette('series1', $palette_color);
134
-    $MyData->setAxisPosition(0,AXIS_POSITION_RIGHT);
134
+    $MyData->setAxisPosition(0, AXIS_POSITION_RIGHT);
135 135
     
136 136
     // Create the pChart object
137 137
     $myPicture = new pImage($chart_width, $chart_height, $MyData);
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     if ($label_x_axis) {
177 177
       for ($i = 5; $i >= 0; $i--) {
178 178
         $label = ($i) ? -10*$i : 'Today';
179
-        $myPicture->drawText(589-587*($i/6)-5, 2, $label, array('Align' => TEXT_ALIGN_TOPRIGHT));
179
+        $myPicture->drawText(589 - 587*($i/6) - 5, 2, $label, array('Align' => TEXT_ALIGN_TOPRIGHT));
180 180
       }
181 181
     }
182 182
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
   }
222 222
   
223 223
   // Initialize the cache object and flush stale images
224
-  $myCache = new pCache(array('CacheFolder' => realpath('.') . '/' . conf_path() . '/files/cache'));
224
+  $myCache = new pCache(array('CacheFolder' => realpath('.').'/'.conf_path().'/files/cache'));
225 225
   $myCache->removeOlderThan(60*60*24);
226 226
   
227 227
   if ($myCache->isInCache($cache_name)) {
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
     if ($stats_xml) {
235 235
       // Get the last 60 days of stats for the chart
236 236
       for ($j = 30; $j < 90; $j++) {
237
-        $dataset[] = (int) $stats_xml->records->record[$j];
237
+        $dataset[] = (int)$stats_xml->records->record[$j];
238 238
       }
239 239
     }
240 240
     else {
@@ -246,10 +246,10 @@  discard block
 block discarded – undo
246 246
     
247 247
     $MyData->addPoints($dataset, 'series1');
248 248
     $MyData->setPalette('series1', $palette_color);
249
-    $MyData->setAxisPosition(0,AXIS_POSITION_RIGHT);
249
+    $MyData->setAxisPosition(0, AXIS_POSITION_RIGHT);
250 250
 
251 251
     // Create the pChart object
252
-    $myPicture = new pImage(266,80,$MyData);
252
+    $myPicture = new pImage(266, 80, $MyData);
253 253
 
254 254
     // Turn on Antialiasing
255 255
     $myPicture->Antialias = true;
@@ -258,8 +258,8 @@  discard block
 block discarded – undo
258 258
     //$myPicture->setFontProperties(array('FontName' => '../fonts/pf_arma_five.ttf','FontSize' => 6));
259 259
 
260 260
     // Define the chart area
261
-    $myPicture->setGraphArea(0,0,266,80);
262
-    $myPicture->drawFilledRectangle(0,0,266,80,$backdrop_color);
261
+    $myPicture->setGraphArea(0, 0, 266, 80);
262
+    $myPicture->drawFilledRectangle(0, 0, 266, 80, $backdrop_color);
263 263
 
264 264
     // Draw the scale
265 265
     $scaleSettings = array(
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
  *
308 308
  */
309 309
 function boincstats_check_cache_dir($cache_path = 'files/cache') {
310
-  $cache_dir = realpath('.') . '/' . conf_path() . '/' . $cache_path;
310
+  $cache_dir = realpath('.').'/'.conf_path().'/'.$cache_path;
311 311
   if (!is_writeable($cache_dir)) {
312 312
     if (!is_dir($cache_dir)) {
313 313
       if (!is_writeable(dirname($cache_dir))) {
@@ -369,13 +369,13 @@  discard block
 block discarded – undo
369 369
   $args = array();
370 370
   foreach ($get as $arg => $value) {
371 371
     if ($value !== NULL) {
372
-      $args[] = "{$arg}=" . rawurlencode($value);
372
+      $args[] = "{$arg}=".rawurlencode($value);
373 373
     }
374 374
     else {
375 375
       $args[] = $arg;
376 376
     }
377 377
   }
378
-  $query = '?' . implode('&', $args);
378
+  $query = '?'.implode('&', $args);
379 379
   
380 380
   // Load XML from RPC
381 381
   $stats_xml = NULL;
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 function boincstats_get_project_total_credit() {
395 395
   $stats_xml = boincstats_get_project_stats();
396 396
   $last_record = end($stats_xml->records->record);
397
-  return ($last_record) ? (int) $last_record : 0;
397
+  return ($last_record) ? (int)$last_record : 0;
398 398
 }
399 399
 
400 400
 /*
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
  *
410 410
  */
411 411
 function boincstats_credit_to_ghours($credit) {
412
-  return $credit / (100 * 365);
412
+  return $credit/(100*365);
413 413
 }
414 414
 
415 415
 /*
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
     't' => 6,
423 423
     'p' => 9
424 424
   );
425
-  return $credit / (pow(10, (int) $factor[$prefix]) / 10);
425
+  return $credit/(pow(10, (int)$factor[$prefix])/10);
426 426
 }
427 427
 
428 428
 
@@ -435,14 +435,14 @@  discard block
 block discarded – undo
435 435
   $output = '';
436 436
   switch ($type) {
437 437
   case 'basic':
438
-    $output .= '<div class="overlay"><span>(' . bts('Credits per day', array(), NULL, 'boinc:front-page') . ')</span></div>' . "\n";
439
-    $output .= '<div class="chart"><img src="' . $base_path . 'charts/project" /></div>' . "\n";
438
+    $output .= '<div class="overlay"><span>('.bts('Credits per day', array(), NULL, 'boinc:front-page').')</span></div>'."\n";
439
+    $output .= '<div class="chart"><img src="'.$base_path.'charts/project" /></div>'."\n";
440 440
     break;
441 441
   case 'detailed':
442
-    $output .= '<div class="stats"><label>' . bts('Total G-hours', array(), NULL, 'boinc:front-page') . ': </label><span>' . number_format(boincstats_credit_to_ghours(boincstats_get_project_total_credit())) . '</span></div>' . "\n";
443
-    $output .= '<div class="stats"><label>' . bts('Avg TFlops', array(), NULL, 'boinc:front-page') . ': </label><span>' . number_format(boincstats_credit_to_flops(boincstats_get_project_avg_credit(), 't')) . '</span></div>' . "\n";
442
+    $output .= '<div class="stats"><label>'.bts('Total G-hours', array(), NULL, 'boinc:front-page').': </label><span>'.number_format(boincstats_credit_to_ghours(boincstats_get_project_total_credit())).'</span></div>'."\n";
443
+    $output .= '<div class="stats"><label>'.bts('Avg TFlops', array(), NULL, 'boinc:front-page').': </label><span>'.number_format(boincstats_credit_to_flops(boincstats_get_project_avg_credit(), 't')).'</span></div>'."\n";
444 444
     //$output .= '<div class="stats"><a href="#">' . bts('Pending credits', array(), NULL, 'boinc:front-page') . '</a></div>' . "\n";
445
-    $output .= '<div class="chart"><img src="' . $base_path . 'charts/project" /></div>' . "\n";
445
+    $output .= '<div class="chart"><img src="'.$base_path.'charts/project" /></div>'."\n";
446 446
     break;
447 447
   default:
448 448
   }
Please login to merge, or discard this patch.
modules/boinc_solr_search/boinc_solr_comments/boinc_solr_comments.module 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
   foreach ($documents as $document) {
79 79
     //dd($document, "index documents alter - document");
80 80
 
81
-    $to_process = ( array_key_exists($document->bundle, $node_types) AND $node_types[$document->bundle] );
82
-    if ( $document->entity_type=='node' AND $to_process) {
81
+    $to_process = (array_key_exists($document->bundle, $node_types) AND $node_types[$document->bundle]);
82
+    if ($document->entity_type == 'node' AND $to_process) {
83 83
       
84 84
       // Remove ts_comments if present.
85 85
       if (isset($document->ts_comments)) {
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         $comment_document->bundle = 'Comment';
111 111
         $comment_document->bundle_name = 'Comment';
112 112
 
113
-        $comment_document->path = 'goto/comment/' . $comment->cid;
113
+        $comment_document->path = 'goto/comment/'.$comment->cid;
114 114
         $comment_document->url = url($comment_document->path, $url_options);
115 115
 
116 116
         // Comment object has no language
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
         // Index formatted username so it can be searched and sorted
142 142
         // on.
143
-        $account = (object) array('uid' => $comment->uid, 'name' => $comment->name);
143
+        $account = (object)array('uid' => $comment->uid, 'name' => $comment->name);
144 144
         $username = check_plain($account->name);
145 145
         $comment_document->ss_name_formatted = $username;
146 146
         $comment_document->tos_name_formatted = $username;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
           // Copy over fields [im_taxonomy_vid_1], [tid], [im_vid_1],
186 186
           // [im_vid_Forums], [tm_vid_1_names]
187
-          if ( ( preg_match('/tid/', $fieldName) OR preg_match('/vid/', $fieldName) ) AND is_array($fieldValue) ) {
187
+          if ((preg_match('/tid/', $fieldName) OR preg_match('/vid/', $fieldName)) AND is_array($fieldValue)) {
188 188
             foreach ($fieldValue as $subkey => $subvalue) {
189 189
               $comment_document->addField($fieldName, $subvalue);
190 190
             }
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
  */
227 227
 function boinc_solr_comments_apachesolr_process_results(&$results, DrupalSolrQueryInterface $query) {
228 228
   //dpm($query->getSolrParams(), "process_results query getSolrParams");
229
-  foreach($results as $id => $result) {
230
-    if ($result['entity_type']=='comment') {
229
+  foreach ($results as $id => $result) {
230
+    if ($result['entity_type'] == 'comment') {
231 231
         $results[$id]['type'] = 'Comment';
232 232
         $results[$id]['date'] = $result['fields']['changed'];
233 233
         if (isset($result['fields']['is_uid'])) {
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
  */
253 253
 function boinc_solr_comments_apachesolr_query_alter($query) {
254 254
   // Add custom field to query results
255
-  $query->addParam('fl','tos_content_extra');
255
+  $query->addParam('fl', 'tos_content_extra');
256 256
 }
257 257
 
258 258
 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
   switch ($op) {
283 283
     case 'delete':
284 284
       // Only call delete function on certain node types
285
-      if (in_array( $node->type, $node_types)) {
285
+      if (in_array($node->type, $node_types)) {
286 286
         boinc_solr_comments_delete($node);
287 287
       }
288 288
       break;
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
   try {
315 315
     $solr = apachesolr_get_solr($env_id);
316 316
     // Custom query to find all comments with parent nid of the node bing deleted.
317
-    $query = "entity_type:comment AND tos_content_extra:" . $node->nid;
317
+    $query = "entity_type:comment AND tos_content_extra:".$node->nid;
318 318
     $solr->deleteByQuery($query);
319 319
     // Log the query used for deletion.
320 320
     watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO);
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
  */
400 400
 
401 401
 function boinc_solr_comments_enable() {
402
-  drupal_set_message( bts('Warning: Your content <a href="@url">must be re-indexed</a> before Apache Solr will search comments.', array('@url' => url('admin/settings/apachesolr/index')), NULL, 'boinc:admin-solr-index-comments-message'), 'warning');
402
+  drupal_set_message(bts('Warning: Your content <a href="@url">must be re-indexed</a> before Apache Solr will search comments.', array('@url' => url('admin/settings/apachesolr/index')), NULL, 'boinc:admin-solr-index-comments-message'), 'warning');
403 403
 }
404 404
 
405 405
 /** 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
  *   The comment to be published (unhidden).
411 411
  */
412 412
 function boinc_solr_comments_publish($comment) {
413
-  if ( ($comment->cid) AND ($comment->nid) ) {
413
+  if (($comment->cid) AND ($comment->nid)) {
414 414
     $node = node_load($comment->nid);
415 415
     // Tell Solr that the node has been updated, so the comment can be
416 416
     // indexed.
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
  *   The comment to be unpublished (hidden). 
427 427
  */
428 428
 function boinc_solr_comments_unpublish($comment) {
429
-  if ( ($comment->cid) ) {
429
+  if (($comment->cid)) {
430 430
     // Call the deletecomment function for hook comment.
431 431
     boinc_solr_comments_deletecomment($comment);
432 432
   }
Please login to merge, or discard this patch.
sites/default/boinc/modules/flag_comment_notify/flag_comment_notify.module 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
   case 'insert':
31 31
     module_load_include('inc', 'drupal_queue', 'drupal_queue');
32 32
     $queue = DrupalQueue::get('flag_comment_notify');
33
-    $subscribed_users = array_keys((array) flag_get_content_flags('node', $a1['nid'], 'subscriptions'));
33
+    $subscribed_users = array_keys((array)flag_get_content_flags('node', $a1['nid'], 'subscriptions'));
34 34
     foreach ($subscribed_users as $uid) {
35
-      $queue->createItem(array('uid' => $uid, 'cid' => (int) $a1['cid']));
35
+      $queue->createItem(array('uid' => $uid, 'cid' => (int)$a1['cid']));
36 36
     }
37 37
     break;
38 38
   default:
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
   );
87 87
   $variables['!topic_name'] = $params['node']->title;
88 88
   $variables['!author'] = $params['author']->name;
89
-  switch($key) {
89
+  switch ($key) {
90 90
   case 'comment_posted':
91 91
     $message['subject'] = bts('!site: comment posted to "!topic_name"', $variables,
92 92
       $language->language, 'boinc:forum-topic-subscription-email-notification');
Please login to merge, or discard this patch.
sites/default/boinc/modules/boincteam/includes/boincteam_forum.forms.inc 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     '#suffix' => '</li>',
87 87
   );
88 88
   $form['form control tabs'] = array(
89
-    '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum/add', TRUE)) . '</li>'
89
+    '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum/add', TRUE)).'</li>'
90 90
   );
91 91
   
92 92
   $form['#redirect'] = "community/teams/{$account->team}";
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
       updated = UNIX_TIMESTAMP()",
153 153
     $account->team,
154 154
     $values['title'],
155
-    (int) $values['min_time_between_posts'],
156
-    (int) $values['min_total_credit_to_post'],
157
-    (int) $values['min_avg_credit_to_post'],
155
+    (int)$values['min_time_between_posts'],
156
+    (int)$values['min_total_credit_to_post'],
157
+    (int)$values['min_avg_credit_to_post'],
158 158
     ($values['public']) ? 1 : 0,
159 159
     $values['description']
160 160
   );
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     '#suffix' => '</li>',
244 244
   );
245 245
   $form['form control tabs'] = array(
246
-    '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum', TRUE)) . '</li>'
246
+    '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum', TRUE)).'</li>'
247 247
   );
248 248
   
249 249
   $form['#redirect'] = "community/teams/{$boincteam_forum->nid}";
@@ -305,9 +305,9 @@  discard block
 block discarded – undo
305 305
       updated = UNIX_TIMESTAMP()
306 306
     WHERE tfid='%d'",
307 307
     $values['title'],
308
-    (int) $values['min_time_between_posts'],
309
-    (int) $values['min_total_credit_to_post'],
310
-    (int) $values['min_avg_credit_to_post'],
308
+    (int)$values['min_time_between_posts'],
309
+    (int)$values['min_total_credit_to_post'],
310
+    (int)$values['min_avg_credit_to_post'],
311 311
     ($values['public']) ? 1 : 0,
312 312
     $values['description'],
313 313
     $tfid
Please login to merge, or discard this patch.
html/ops/show_log.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,19 +27,19 @@  discard block
 block discarded – undo
27 27
     exit("Error: couldn't get log_dir from config file.");
28 28
 }
29 29
 
30
-if( isset($_GET["f"]) ){
30
+if (isset($_GET["f"])) {
31 31
     $f = $_GET["f"];
32 32
     $f = escapeshellcmd($f);
33 33
 } else {
34 34
     $f = "";
35 35
 }
36
-if( isset($_GET["s"]) ){
36
+if (isset($_GET["s"])) {
37 37
     $s = $_GET["s"];
38 38
     $s = escapeshellcmd($s);
39 39
 } else {
40 40
     $s = "";
41 41
 }
42
-if( isset($_GET["l"]) ){
42
+if (isset($_GET["l"])) {
43 43
     $l = (int)$_GET["l"];
44 44
 } else {
45 45
     $l = 0;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 echo 'Hint: Example greps: "RESULT#106876", "26fe99aa_25636_00119.wu_1", "WU#8152", "too many errors", "2003-07-17", "CRITICAL" <br>';
61 61
 
62 62
 if (strlen($f)) {
63
-	$f = "../log*/". $f;
63
+	$f = "../log*/".$f;
64 64
 } else {
65 65
     $f = "../log*/*.log";
66 66
 }
Please login to merge, or discard this patch.
html/user/openid_login.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,23 +35,23 @@  discard block
 block discarded – undo
35 35
     $openid = new LightOpenID;
36 36
     echo "<pre>";
37 37
     print_r($openid); exit;
38
-    if(!$openid->mode) {
39
-        if(isset($_POST['openid_identifier'])) {
38
+    if (!$openid->mode) {
39
+        if (isset($_POST['openid_identifier'])) {
40 40
             $openid->identity = $_POST['openid_identifier'];
41 41
             $openid->required = array('namePerson/friendly', 'contact/email');
42 42
             $openid->optional = array('contact/country/home');
43
-            header('Location: ' . $openid->authUrl());
43
+            header('Location: '.$openid->authUrl());
44 44
         }
45
-        if(isset($_GET['openid_identifier'])) {
45
+        if (isset($_GET['openid_identifier'])) {
46 46
             $openid->identity = $_GET['openid_identifier'];
47 47
             $openid->required = array('namePerson/friendly', 'contact/email');
48 48
             $openid->optional = array('contact/country/home');
49
-            header('Location: ' . $openid->authUrl());
49
+            header('Location: '.$openid->authUrl());
50 50
         }
51
-    } elseif($openid->mode == 'cancel') {
51
+    } elseif ($openid->mode == 'cancel') {
52 52
         echo 'User has canceled authentication!';
53 53
     } else {
54
-        echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
54
+        echo 'User '.($openid->validate() ? $openid->identity.' has ' : 'has not ').'logged in.';
55 55
         //print_r($openid->getAttributes());
56 56
         // Create the user in the DB
57 57
         $data = $openid->getAttributes();
@@ -125,13 +125,13 @@  discard block
 block discarded – undo
125 125
             
126 126
             $user = make_user(
127 127
                 $new_email_addr, $new_name, $passwd_hash,
128
-                $country, '', $project_prefs="", $teamid=0
128
+                $country, '', $project_prefs = "", $teamid = 0
129 129
             );
130 130
             if (!$user) {
131 131
                 show_error("Couldn't create account");
132 132
             }
133 133
             
134
-            if(defined('INVITE_CODES')) {
134
+            if (defined('INVITE_CODES')) {
135 135
                 error_log("Account '$new_email_addr' created using invitation code '$invite_code'");
136 136
             }
137 137
         }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         send_cookie('auth', $user->authenticator, true);
154 154
 
155 155
     }
156
-} catch(ErrorException $e) {
156
+} catch (ErrorException $e) {
157 157
     echo $e->getMessage();
158 158
 }
159 159
 
Please login to merge, or discard this patch.
html/ops/fix_project_prefs.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             // changing the tree in a loop has strange results so do it separately
77 77
             $to_remove = array();
78 78
             $ids = array();
79
-            foreach($appids as $elem) {
79
+            foreach ($appids as $elem) {
80 80
                 $ids[] = $elem->nodeValue;
81 81
                 $to_remove[] = $elem;
82 82
             }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         exit(1);
95 95
     }
96 96
     $appids = $node->getElementsByTagName("app_id");
97
-    if ($appids->length == 0 ) return;
97
+    if ($appids->length == 0) return;
98 98
     // changing the tree in a loop has strange results so do it separately
99 99
     $to_remove = array();
100 100
     $ids = array();
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         $to_remove = array();
130 130
         foreach ($subNodes as $subNode) {
131 131
             // ignore empty text nodes which are basically whitespace from indentation (only relevant if preserveWhiteSpace is set to true above)
132
-            if (($subNode->nodeType != XML_TEXT_NODE) || (($subNode->nodeType == XML_TEXT_NODE) &&(strlen(trim($subNode->wholeText))>=1))) {
132
+            if (($subNode->nodeType != XML_TEXT_NODE) || (($subNode->nodeType == XML_TEXT_NODE) && (strlen(trim($subNode->wholeText)) >= 1))) {
133 133
                 if ($subNode->nodeName == "venue") {
134 134
                     if (!$subNode->hasChildNodes()) {
135 135
                         // empty venue tag, clean this up too
Please login to merge, or discard this patch.
html/user/edit_forum_preferences_form.php 1 patch
Spacing   +19 added lines, -19 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
 row2(
86 86
     tra("Signature for message board posts")
87 87
     .bbcode_info()
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     textarea_with_counter("signature", 250, $signature)
93 93
     ."<br><input type=\"checkbox\" name=\"signature_by_default\" ".$signature_by_default."> ".tra("Attach signature by default")
94 94
 );
95
-if ($user->prefs->signature!=""){
95
+if ($user->prefs->signature != "") {
96 96
     row2(tra("Signature preview").
97 97
         "<br><p class=\"text-muted\">".tra("This is how your signature will look in the forums")."</p>",
98 98
         output_transform($user->prefs->signature)
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
 
102 102
 // ------------ Message display  -----------
103 103
 
104
-$forum_hide_avatars = $user->prefs->hide_avatars?"checked=\"checked\"":"";
105
-$forum_hide_signatures = $user->prefs->hide_signatures?"checked=\"checked\"":"";
106
-$forum_link_popup = $user->prefs->link_popup?"checked=\"checked\"":""; 
107
-$forum_image_as_link = $user->prefs->images_as_links?"checked=\"checked\"":"";
108
-$forum_jump_to_unread = $user->prefs->jump_to_unread?"checked=\"checked\"":"";
109
-$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts?"checked=\"checked\"":"";
110
-$forum_highlight_special = $user->prefs->highlight_special?"checked=\"checked\"":"";
104
+$forum_hide_avatars = $user->prefs->hide_avatars ? "checked=\"checked\"" : "";
105
+$forum_hide_signatures = $user->prefs->hide_signatures ? "checked=\"checked\"" : "";
106
+$forum_link_popup = $user->prefs->link_popup ? "checked=\"checked\"" : ""; 
107
+$forum_image_as_link = $user->prefs->images_as_links ? "checked=\"checked\"" : "";
108
+$forum_jump_to_unread = $user->prefs->jump_to_unread ? "checked=\"checked\"" : "";
109
+$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts ? "checked=\"checked\"" : "";
110
+$forum_highlight_special = $user->prefs->highlight_special ? "checked=\"checked\"" : "";
111 111
 
112 112
 $forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount);
113 113
 $forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
 $filtered_userlist = get_ignored_list($user);
140 140
 $forum_filtered_userlist = "";
141
-for ($i=0; $i<sizeof($filtered_userlist); $i++){
141
+for ($i = 0; $i < sizeof($filtered_userlist); $i++) {
142 142
     $id = (int)$filtered_userlist[$i];
143 143
     if ($id) {
144 144
         $filtered_user = BoincUser::lookup_id($id);
@@ -168,5 +168,5 @@  discard block
 block discarded – undo
168 168
 end_table();
169 169
 page_tail();
170 170
 
171
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
171
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
172 172
 ?>
Please login to merge, or discard this patch.
html/inc/pm.inc 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     return $x;
49 49
 }
50 50
 
51
-function pm_team_form($user, $teamid, $error=null) {
51
+function pm_team_form($user, $teamid, $error = null) {
52 52
     global $bbcode_html, $bbcode_js;
53 53
     $team = BoincTeam::lookup_id($teamid);
54 54
     if (!$team) {
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         error_page("not admin");
59 59
     }
60 60
 
61
-    page_head(tra("Send message to team"),'','','', $bbcode_js);
61
+    page_head(tra("Send message to team"), '', '', '', $bbcode_js);
62 62
 
63 63
     $subject = post_str("subject", true);
64 64
     $content = post_str("content", true);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 function pm_form($replyto, $userid, $error = null) {
103 103
     global $bbcode_html, $bbcode_js;
104 104
     global $g_logged_in_user;
105
-    page_head(tra("Send private message"),'','','', $bbcode_js);
105
+    page_head(tra("Send private message"), '', '', '', $bbcode_js);
106 106
     
107 107
     if (post_str("preview", true) == tra("Preview")) {
108 108
         $content = post_str("content", true);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 function send_pm_notification_email(
185 185
     $logged_in_user, $to_user, $subject, $content
186 186
 ) {
187
-    $message  = "
187
+    $message = "
188 188
 You have received a new private message at ".PROJECT.".
189 189
 
190 190
 From: $logged_in_user->name (ID $logged_in_user->id)
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     $pm = BoincPrivateMessage::lookup_id($notify->opaque);
215 215
     $from_user = BoincUser::lookup_id($pm->senderid);
216 216
     if (!$pm || !$from_user) return null;
217
-    return "<a href=pm.php>".tra("Private message%1 from %2, subject:" , "</a>", $from_user->name )." $pm->subject";
217
+    return "<a href=pm.php>".tra("Private message%1 from %2, subject:", "</a>", $from_user->name)." $pm->subject";
218 218
 }
219 219
 
220 220
 function pm_send_msg($from_user, $to_user, $subject, $content, $send_email) {
@@ -278,11 +278,11 @@  discard block
 block discarded – undo
278 278
 
279 279
 function pm_email_remind($user) {
280 280
     if (!$user->prefs->pm_notification) {
281
-        return "<br><small>" .
281
+        return "<br><small>".
282 282
             tra(
283 283
                 "For email notification, %1 edit community prefs %2",
284 284
                 '<a href="edit_forum_preferences_form.php">', '</a>'
285
-            ) .
285
+            ).
286 286
             "</small>"
287 287
         ;
288 288
     }
@@ -308,5 +308,5 @@  discard block
 block discarded – undo
308 308
     }
309 309
 }
310 310
 
311
-$cvs_version_tracker[]="\$Id: pm.inc 14019 2007-11-01 23:04:39Z davea $";
311
+$cvs_version_tracker[] = "\$Id: pm.inc 14019 2007-11-01 23:04:39Z davea $";
312 312
 ?>
Please login to merge, or discard this patch.