@@ -258,8 +258,7 @@ discard block |
||
| 258 | 258 | ), WATCHDOG_NOTICE |
| 259 | 259 | ); |
| 260 | 260 | } |
| 261 | - } |
|
| 262 | - else { |
|
| 261 | + } else { |
|
| 263 | 262 | drupal_set_message(t('You are not allowed to assume foundership of this |
| 264 | 263 | team.' |
| 265 | 264 | )); |
@@ -284,8 +283,7 @@ discard block |
||
| 284 | 283 | drupal_set_message(t('@team has been removed.', |
| 285 | 284 | array('@team' => $boincteam->name))); |
| 286 | 285 | drupal_goto('community/teams'); |
| 287 | - } |
|
| 288 | - else { |
|
| 286 | + } else { |
|
| 289 | 287 | drupal_set_message(t('All members must be removed from @team before the |
| 290 | 288 | team can be deleted.', array('@team' => $boincteam->name)), 'error'); |
| 291 | 289 | drupal_goto(strstr($_GET['q'], '/delete', TRUE)); |
@@ -519,8 +517,7 @@ discard block |
||
| 519 | 517 | array('@team' => $boincteam->name))); |
| 520 | 518 | watchdog('boincteam', 'added user @uid to team @nid', |
| 521 | 519 | array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_NOTICE); |
| 522 | - } |
|
| 523 | - else { |
|
| 520 | + } else { |
|
| 524 | 521 | // @todo - consider another rule/error event here |
| 525 | 522 | drupal_set_message(t('There was a problem joining @team, please try again |
| 526 | 523 | later', array('@team' => $boincteam->name))); |
@@ -548,8 +545,7 @@ discard block |
||
| 548 | 545 | array('@team' => $boincteam->name))); |
| 549 | 546 | watchdog('boincteam', 'removed user @uid from team @nid', |
| 550 | 547 | array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_NOTICE); |
| 551 | - } |
|
| 552 | - else { |
|
| 548 | + } else { |
|
| 553 | 549 | drupal_set_message(t('You are not a member of @team, so you cannot revoke |
| 554 | 550 | your membership to it.', array('@team' => $boincteam->name))); |
| 555 | 551 | } |
@@ -618,8 +614,7 @@ discard block |
||
| 618 | 614 | '@uid' => $account->uid, |
| 619 | 615 | '@nid' => $team_id |
| 620 | 616 | ), WATCHDOG_NOTICE); |
| 621 | - } |
|
| 622 | - else { |
|
| 617 | + } else { |
|
| 623 | 618 | drupal_set_message(t('@user is not a member of @team, so you cannot |
| 624 | 619 | revoke the membership.', array( |
| 625 | 620 | '@user' => $account->boincuser_name, |
@@ -648,14 +643,12 @@ discard block |
||
| 648 | 643 | '@user' => $account->boincuser_name |
| 649 | 644 | ) |
| 650 | 645 | ), 'warning'); |
| 651 | - } |
|
| 652 | - elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) { |
|
| 646 | + } elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) { |
|
| 653 | 647 | // It hasn't been long enough since the last transfer request |
| 654 | 648 | drupal_set_message(t('A foundership change was requested during the last 90 |
| 655 | 649 | days, so new requests are not allowed. Please try again later.' |
| 656 | 650 | ), 'warning'); |
| 657 | - } |
|
| 658 | - elseif (boincteam_is_member($team_id, $account->uid)) { |
|
| 651 | + } elseif (boincteam_is_member($team_id, $account->uid)) { |
|
| 659 | 652 | // Log the transfer request |
| 660 | 653 | db_set_active('boinc_rw'); |
| 661 | 654 | db_query(" |
@@ -861,8 +854,7 @@ discard block |
||
| 861 | 854 | $output .= '['; |
| 862 | 855 | if ($credit_needed == 1) { |
| 863 | 856 | $output .= bts('You must earn 1 more credit!', array(), NULL, 'boinc:create-team-panel'); |
| 864 | - } |
|
| 865 | - else { |
|
| 857 | + } else { |
|
| 866 | 858 | $output .= bts('You must earn @count more credits!', |
| 867 | 859 | array('@count' => $credit_needed), |
| 868 | 860 | NULL, 'boinc:create-team-panel' |
@@ -915,8 +907,7 @@ discard block |
||
| 915 | 907 | $output .= ' <label>' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . ': </label>'; |
| 916 | 908 | $output .= ' <span>' . number_format($team->total_credit, 0) . '</span>'; |
| 917 | 909 | $output .= '</div>' . "\n"; |
| 918 | - } |
|
| 919 | - else if ($user->uid == $account->uid) { |
|
| 910 | + } else if ($user->uid == $account->uid) { |
|
| 920 | 911 | $output .= '<h2 class="pane-title">' . bts('Team (None)', array(), NULL, 'boinc:team-dashboard') . '</h2>'; |
| 921 | 912 | $output .= '<ul class="tab-list action-list">'; |
| 922 | 913 | $output .= '<li class="tab primary">'; |
@@ -1123,8 +1114,7 @@ discard block |
||
| 1123 | 1114 | if ($request_age == 1) { |
| 1124 | 1115 | $output .= bts('1 day has elapsed since your request and' |
| 1125 | 1116 | . ' the founder has not responded.', array(), NULL, 'boinc:team-request-foundership'); |
| 1126 | - } |
|
| 1127 | - else { |
|
| 1117 | + } else { |
|
| 1128 | 1118 | $output .= bts('@count days have elapsed since your request and' |
| 1129 | 1119 | . ' the founder has not responded.', |
| 1130 | 1120 | array('@count' => $request_age), |
@@ -1134,8 +1124,7 @@ discard block |
||
| 1134 | 1124 | if ($days_to_respond == 1) { |
| 1135 | 1125 | $output .= bts('You now have 1 day to assume foundership before' |
| 1136 | 1126 | . ' another team member may submit a request.', array(), NULL, 'boinc:team-request-foundership'); |
| 1137 | - } |
|
| 1138 | - else { |
|
| 1127 | + } else { |
|
| 1139 | 1128 | $output .= bts('You now have @count days to assume foundership before' |
| 1140 | 1129 | . ' another team member may submit a request.', |
| 1141 | 1130 | array('@count' => $days_to_respond), |
@@ -1146,23 +1135,20 @@ discard block |
||
| 1146 | 1135 | $output .= ' <li class="first last tab">' . |
| 1147 | 1136 | l(bts('Assume foundership', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/assume-foundership") . '</li>'; |
| 1148 | 1137 | $output .= '</ul>'; |
| 1149 | - } |
|
| 1150 | - else { |
|
| 1138 | + } else { |
|
| 1151 | 1139 | $output .= '<p>'; |
| 1152 | 1140 | if ($days_to_deadline == 1) { |
| 1153 | 1141 | $output .= bts('The team founder has 1 day to respond to your' |
| 1154 | 1142 | . ' transfer request.', |
| 1155 | 1143 | NULL, 'boinc:team-request-foundership'); |
| 1156 | - } |
|
| 1157 | - else { |
|
| 1144 | + } else { |
|
| 1158 | 1145 | $output .= bts('The team founder has @count days to respond to your' |
| 1159 | 1146 | . ' transfer request.', array('@count' => $days_to_deadline), |
| 1160 | 1147 | NULL, 'boinc:team-request-foundership'); |
| 1161 | 1148 | } |
| 1162 | 1149 | $output .= '</p>'; |
| 1163 | 1150 | } |
| 1164 | - } |
|
| 1165 | - elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) { |
|
| 1151 | + } elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) { |
|
| 1166 | 1152 | // If this user does not have a transfer request pending, but new requests |
| 1167 | 1153 | // are not allowed, set the deadline to 90 days instead of 60 (as the user |
| 1168 | 1154 | // who made the request has 30 additional days to assume foundership if |
@@ -1175,15 +1161,13 @@ discard block |
||
| 1175 | 1161 | NULL, 'boinc:team-request-foundership'); |
| 1176 | 1162 | if ($days_to_deadline == 1) { |
| 1177 | 1163 | $output .= ' (' . bts('1 day remaining', array(), NULL, 'boinc:team-request-foundership') . ')'; |
| 1178 | - } |
|
| 1179 | - else { |
|
| 1164 | + } else { |
|
| 1180 | 1165 | $output .= ' (' . bts('@count days remaining', |
| 1181 | 1166 | array('@count' => $days_to_deadline), |
| 1182 | 1167 | NULL, 'boinc:team-request-foundership') . ')'; |
| 1183 | 1168 | } |
| 1184 | 1169 | $output .= '</p>'; |
| 1185 | - } |
|
| 1186 | - else { |
|
| 1170 | + } else { |
|
| 1187 | 1171 | $output .= '<p>' . bts('If the team founder is not active and you want to' |
| 1188 | 1172 | . ' assume the role of founder, click below to request foundership of' |
| 1189 | 1173 | . ' @this_team.', |
@@ -1229,8 +1213,7 @@ discard block |
||
| 1229 | 1213 | $boincteam_id |
| 1230 | 1214 | ); |
| 1231 | 1215 | db_set_active('default'); |
| 1232 | - } |
|
| 1233 | - else { |
|
| 1216 | + } else { |
|
| 1234 | 1217 | $member = user_load(boincuser_lookup_uid($boincteam->ping_user)); |
| 1235 | 1218 | $output .= '<h2 class="pane-title">' . bts('Respond to transfer request', array(), NULL, 'boinc:team-request-foundership-response') |
| 1236 | 1219 | . '</h2>'; |
@@ -135,8 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | if (!$name) { |
| 137 | 137 | form_set_error('name', bts('Team name is required.', array(), NULL, 'boinc:team-create/edit')); |
| 138 | - } |
|
| 139 | - else { |
|
| 138 | + } else { |
|
| 140 | 139 | require_boinc('boinc_db'); |
| 141 | 140 | if (BoincTeam::lookup_name($name)) { |
| 142 | 141 | form_set_error('name', bts('A team named "@name" already exists.', |
@@ -177,8 +176,7 @@ discard block |
||
| 177 | 176 | if ($boinc_team) { |
| 178 | 177 | $boinc_user = BoincUser::lookup_id($account->boincuser_id); |
| 179 | 178 | user_join_team($boinc_team, $boinc_user); |
| 180 | - } |
|
| 181 | - else { |
|
| 179 | + } else { |
|
| 182 | 180 | drupal_set_message(t('Teams cannot be created at this time. The @project administrators have been notified.', array('@project' => PROJECT))); |
| 183 | 181 | rules_invoke_event('boincteam_create_team_error', $values['name'], variable_get('boinc_admin_mailing_list_subject_tag', '')); |
| 184 | 182 | watchdog('BOINC team', 'BOINC teams cannot be created for an unknown |
@@ -212,8 +210,7 @@ discard block |
||
| 212 | 210 | if (module_exists('pathauto')) { |
| 213 | 211 | module_load_include('inc', 'pathauto', 'pathauto'); |
| 214 | 212 | $node['path'] = pathauto_cleanstring($values['name']); |
| 215 | - } |
|
| 216 | - else { |
|
| 213 | + } else { |
|
| 217 | 214 | drupal_set_message(t('Teams cannot be created at this time. The @project administrators have been notified.', array('@project' => PROJECT))); |
| 218 | 215 | rules_invoke_event('boincteam_create_team_nopathauto_error', $values['name'], variable_get('boinc_admin_mailing_list_subject_tag', '')); |
| 219 | 216 | watchdog('BOINC team', 'BOINC teams require the Pathauto module. Teams |
@@ -381,8 +378,7 @@ discard block |
||
| 381 | 378 | $form['form control tabs'] = array( |
| 382 | 379 | '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>' |
| 383 | 380 | ); |
| 384 | - } |
|
| 385 | - else { |
|
| 381 | + } else { |
|
| 386 | 382 | $form['description'] = array( |
| 387 | 383 | '#prefix' => '<div class="form-item"><label>' . bts('Description', array(), NULL, 'boinc:team-description') . ':</label></div><div class="form-item">', |
| 388 | 384 | '#value' => $default['description'], |
@@ -412,12 +408,10 @@ discard block |
||
| 412 | 408 | |
| 413 | 409 | if ($form_state['storage']['is_boinc_wide']) { |
| 414 | 410 | form_set_error('none', bts('This team is managed by the BOINC-wide teams system and cannot be updated here.', array(), NULL, 'boinc:team-create/edit')); |
| 415 | - } |
|
| 416 | - else { |
|
| 411 | + } else { |
|
| 417 | 412 | if (!$name) { |
| 418 | 413 | form_set_error('name', bts('Team name is required.', array(), NULL, 'boinc:team-create/edit')); |
| 419 | - } |
|
| 420 | - else { |
|
| 414 | + } else { |
|
| 421 | 415 | $team = node_load($form_state['storage']['team_id']); |
| 422 | 416 | if ($name != $team->title) { |
| 423 | 417 | // If changing the name ("title" in Drupal terms), check that the new name is available |
@@ -559,8 +553,7 @@ discard block |
||
| 559 | 553 | |
| 560 | 554 | if (!$values['username']) { |
| 561 | 555 | form_set_error('username', bts('BOINC username is required.', array(), NULL, 'boinc:team-add-admin')); |
| 562 | - } |
|
| 563 | - else { |
|
| 556 | + } else { |
|
| 564 | 557 | // Load user account associated with username |
| 565 | 558 | $account = boincuser_privatemsg_name_lookup($values['username']); |
| 566 | 559 | // Validate the account |
@@ -570,24 +563,21 @@ discard block |
||
| 570 | 563 | '@username' => $account->boincuser_name |
| 571 | 564 | ), |
| 572 | 565 | NULL, 'boinc:team-add-admin')); |
| 573 | - } |
|
| 574 | - elseif (boincteam_is_founder($team_id, $account->uid)) { |
|
| 566 | + } elseif (boincteam_is_founder($team_id, $account->uid)) { |
|
| 575 | 567 | form_set_error('username', bts('@user is the founder of @team! Team founder already have all admin privileges.', |
| 576 | 568 | array( |
| 577 | 569 | '@user' => $account->boincuser_name, |
| 578 | 570 | '@team' => $team->title, |
| 579 | 571 | ), |
| 580 | 572 | NULL, 'boinc:team-add-admin')); |
| 581 | - } |
|
| 582 | - elseif (boincteam_is_admin($team_id, $account->uid)) { |
|
| 573 | + } elseif (boincteam_is_admin($team_id, $account->uid)) { |
|
| 583 | 574 | form_set_error('username', bts('@user is already an admin of @team.', |
| 584 | 575 | array( |
| 585 | 576 | '@user' => $account->boincuser_name, |
| 586 | 577 | '@team' => $team->title, |
| 587 | 578 | ), |
| 588 | 579 | NULL, 'boinc:team-add-admin')); |
| 589 | - } |
|
| 590 | - else { |
|
| 580 | + } else { |
|
| 591 | 581 | $form_state['storage']['boincuser_id'] = $account->boincuser_id; |
| 592 | 582 | $form_state['storage']['boincuser_name'] = $account->boincuser_name; |
| 593 | 583 | } |
@@ -645,8 +635,7 @@ discard block |
||
| 645 | 635 | if (isset($form_state['values'])) { |
| 646 | 636 | $subject = $form_state['values']['subject']; |
| 647 | 637 | $body = $form_state['values']['body']; |
| 648 | - } |
|
| 649 | - else { |
|
| 638 | + } else { |
|
| 650 | 639 | $subject = ''; |
| 651 | 640 | $body = ''; |
| 652 | 641 | } |
@@ -71,8 +71,7 @@ discard block |
||
| 71 | 71 | unset($account->roles[$unrestricted_role]); |
| 72 | 72 | } |
| 73 | 73 | user_save($account, array('roles' => $account->roles)); |
| 74 | - } |
|
| 75 | - else { |
|
| 74 | + } else { |
|
| 76 | 75 | if (!isset($account->roles[$community_role])) { |
| 77 | 76 | // The user should be a 'community member' role. If the user was |
| 78 | 77 | // previously banned, this will restore that role. |
@@ -88,8 +87,7 @@ discard block |
||
| 88 | 87 | $account->roles[$unrestricted_role] = 'verified contributor'; |
| 89 | 88 | user_save($account, array('roles' => $account->roles)); |
| 90 | 89 | } |
| 91 | - } |
|
| 92 | - else { |
|
| 90 | + } else { |
|
| 93 | 91 | drupal_set_message(bts( |
| 94 | 92 | 'You must earn @count more credits to be able to post comments on this site and create or modify your user profile.', |
| 95 | 93 | array('@count' => $min_credit_to_post - $account->boincuser_total_credit) |
@@ -175,12 +173,10 @@ discard block |
||
| 175 | 173 | if ($never_been_picked) { |
| 176 | 174 | // Allow users who have been previously selected |
| 177 | 175 | $never_been_picked = FALSE; |
| 178 | - } |
|
| 179 | - elseif ($active_users) { |
|
| 176 | + } elseif ($active_users) { |
|
| 180 | 177 | // Allow users who are not even active (getting desperate) |
| 181 | 178 | $active_users = FALSE; |
| 182 | - } |
|
| 183 | - else { |
|
| 179 | + } else { |
|
| 184 | 180 | // Process failed... |
| 185 | 181 | return FALSE; |
| 186 | 182 | } |
@@ -235,8 +231,7 @@ discard block |
||
| 235 | 231 | $graf1 = "Your email address was changed from {$prev_email} to {$new_email} " |
| 236 | 232 | . "on {$changedate}. If you need to reverse this change, please look for " |
| 237 | 233 | . "an email send to the email address: {$prev_email}.\n"; |
| 238 | - } |
|
| 239 | - else { |
|
| 234 | + } else { |
|
| 240 | 235 | $graf1 = "Your email address was changed from {$prev_email} to {$new_email} " |
| 241 | 236 | . "on {$changedate}. You will not be able to change your email address " |
| 242 | 237 | . "until {$newdate}. If you need to reverse this change, please look for " |
@@ -357,8 +352,7 @@ discard block |
||
| 357 | 352 | rules_invoke_event('boincuser_general_consent_error', variable_get('boinc_admin_mailing_list_subject_tag', '')); |
| 358 | 353 | } |
| 359 | 354 | return $rc1; |
| 360 | - } |
|
| 361 | - else { |
|
| 355 | + } else { |
|
| 362 | 356 | drupal_set_message( |
| 363 | 357 | bts('ERROR: Consent type for enrollment not found. The @project administrators have been nofitifed.', |
| 364 | 358 | array('@project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:consent-termsofuse'), |
@@ -399,8 +393,7 @@ discard block |
||
| 399 | 393 | // If boincid or token is not present, then go to the home page. |
| 400 | 394 | if (empty($params['boincid']) or empty($params['token'])) { |
| 401 | 395 | $redirect = ''; |
| 402 | - } |
|
| 403 | - else { |
|
| 396 | + } else { |
|
| 404 | 397 | $uid = boincuser_lookup_uid($params['boincid']); |
| 405 | 398 | $redirect = "/user/${uid}/recoveremail/${params['token']}"; |
| 406 | 399 | } |
@@ -451,8 +444,7 @@ discard block |
||
| 451 | 444 | $dir = "boinc_{$type}_dir"; |
| 452 | 445 | if ($include_dir = variable_get("boinc_{$type}_dir", '')) { |
| 453 | 446 | return $include_dir; |
| 454 | - } |
|
| 455 | - else { |
|
| 447 | + } else { |
|
| 456 | 448 | // Don't show errors on blacklisted pages |
| 457 | 449 | $page_blacklist = array( |
| 458 | 450 | 'admin/boinc/environment' |
@@ -465,8 +457,7 @@ discard block |
||
| 465 | 457 | drupal_set_message(t('The BOINC environment is not configured. Please |
| 466 | 458 | !configure_it', array('!configure_it' => l(t('configure it now'), |
| 467 | 459 | 'admin/boinc/environment'))), 'warning', FALSE); |
| 468 | - } |
|
| 469 | - else { |
|
| 460 | + } else { |
|
| 470 | 461 | drupal_set_message(t('There is a problem with the site. Please contact |
| 471 | 462 | the system administrator.'), 'error', FALSE); |
| 472 | 463 | } |
@@ -481,8 +472,7 @@ discard block |
||
| 481 | 472 | if (!in_array($_GET['q'], $redirect_blacklist)) { |
| 482 | 473 | drupal_goto(''); |
| 483 | 474 | } |
| 484 | - } |
|
| 485 | - else { |
|
| 475 | + } else { |
|
| 486 | 476 | // Clear the messages on the environment config page |
| 487 | 477 | drupal_get_messages(); |
| 488 | 478 | } |
@@ -501,8 +491,7 @@ discard block |
||
| 501 | 491 | ); |
| 502 | 492 | if ($url_config = variable_get('boinc_scheduler_urls', '')) { |
| 503 | 493 | return explode("\r\n", $url_config); |
| 504 | - } |
|
| 505 | - elseif (!in_array($_GET['q'], $page_blacklist)) { |
|
| 494 | + } elseif (!in_array($_GET['q'], $page_blacklist)) { |
|
| 506 | 495 | watchdog('boincuser', 'The BOINC scheduling server settings are not yet |
| 507 | 496 | configured. Please !verify for the settings to become effective.', |
| 508 | 497 | array('!verify' => l(t('verify the default values') . ' <strong>' . |
@@ -120,7 +120,8 @@ |
||
| 120 | 120 | // GET request - the user has navigated to the page. |
| 121 | 121 | page_head(tra("Generate proof of account ownership"), null, null, null, boinc_recaptcha_get_head_extra()); |
| 122 | 122 | |
| 123 | - if ($user) { // Verify the user is logged in |
|
| 123 | + if ($user) { |
|
| 124 | +// Verify the user is logged in |
|
| 124 | 125 | require_once("../inc/account_ownership.inc"); |
| 125 | 126 | |
| 126 | 127 | if (!file_exists($account_ownership_private_key_file_path)) { |
@@ -66,8 +66,7 @@ discard block |
||
| 66 | 66 | $vars['action'] = 'none'; |
| 67 | 67 | $vars['link_text'] = t('Reset Completely'); |
| 68 | 68 | $vars['link_title'] = t('Reset everying, allows users to re-flag content.'); |
| 69 | - } |
|
| 70 | - else { |
|
| 69 | + } else { |
|
| 71 | 70 | $vars['action'] = 'none'; |
| 72 | 71 | $vars['link_text'] = t('Locked'); |
| 73 | 72 | $vars['link_title'] = t('Reporting locked by moderator.'); |
@@ -75,8 +74,7 @@ discard block |
||
| 75 | 74 | $vars['link_href'] = ''; |
| 76 | 75 | $vars['flag_classes'] = 'flag style-like-link'; |
| 77 | 76 | } |
| 78 | - } |
|
| 79 | - else { |
|
| 77 | + } else { |
|
| 80 | 78 | // If there are flags on this content, clear the flags and |
| 81 | 79 | // lock the content. |
| 82 | 80 | if (user_access('reset abuse flags', $myuser)) { |
@@ -121,8 +119,7 @@ discard block |
||
| 121 | 119 | drupal_set_message(bts('INFO: Reset everything. Users may reflag this content.', array(), NULL, 'boinc:flag-abuse-reset'), 'info'); |
| 122 | 120 | // unlock flag; effectively resets flags for this content |
| 123 | 121 | variable_del($flag->name.'-'.$content_id); |
| 124 | - } |
|
| 125 | - else { |
|
| 122 | + } else { |
|
| 126 | 123 | // Clear and Lock all flags on this content. |
| 127 | 124 | $dbresult = db_query("SELECT DISTINCT fid FROM {flag_content} WHERE content_id = %d", $content_id); |
| 128 | 125 | $rows = 0; |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | // return a string for navigating pages |
| 240 | 240 | // |
| 241 | -function page_links($url, $nitems, $items_per_page, $start){ |
|
| 241 | +function page_links($url, $nitems, $items_per_page, $start) { |
|
| 242 | 242 | // How many pages to potentially show before and after this one: |
| 243 | 243 | $preshow = 3; |
| 244 | 244 | $postshow = 3; |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | // If this is not the first page, display "previous" |
| 253 | 253 | // |
| 254 | - if ($curpage > 0){ |
|
| 254 | + if ($curpage > 0) { |
|
| 255 | 255 | $x .= page_link( |
| 256 | 256 | $url, $curpage-1, $items_per_page, |
| 257 | 257 | tra("Previous")." · " |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | } |
| 269 | 269 | // Display a list of pages surrounding this one |
| 270 | 270 | // |
| 271 | - for ($i=$curpage-$preshow; $i<=$curpage+$postshow; $i++){ |
|
| 271 | + for ($i=$curpage-$preshow; $i<=$curpage+$postshow; $i++) { |
|
| 272 | 272 | $page_str = (string)($i+1); |
| 273 | 273 | if ($i < 0) continue; |
| 274 | 274 | if ($i >= $npages) break; |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | } |
| 290 | 290 | // If there is a next page |
| 291 | 291 | // |
| 292 | - if ($curpage < $npages-1){ |
|
| 292 | + if ($curpage < $npages-1) { |
|
| 293 | 293 | $x .= page_link( |
| 294 | 294 | $url, $curpage+1, $items_per_page, |
| 295 | 295 | " · ".tra("Next") |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | |
| 519 | 519 | // If the user no longer exists, skip the post |
| 520 | 520 | // |
| 521 | - if (!$user){ |
|
| 521 | + if (!$user) { |
|
| 522 | 522 | return; |
| 523 | 523 | } |
| 524 | 524 | |
@@ -539,9 +539,9 @@ discard block |
||
| 539 | 539 | // check whether the poster is on the list of people to ignore |
| 540 | 540 | // |
| 541 | 541 | $ignore_poster = false; |
| 542 | - if ($logged_in_user){ |
|
| 542 | + if ($logged_in_user) { |
|
| 543 | 543 | $tokens = url_tokens($logged_in_user->authenticator); |
| 544 | - if (is_ignoring($logged_in_user, $user)){ |
|
| 544 | + if (is_ignoring($logged_in_user, $user)) { |
|
| 545 | 545 | $ignore_poster = true; |
| 546 | 546 | } |
| 547 | 547 | } |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | // Highlight special users if set in prefs; |
| 580 | 580 | // |
| 581 | - if ($logged_in_user && $logged_in_user->prefs){ |
|
| 581 | + if ($logged_in_user && $logged_in_user->prefs) { |
|
| 582 | 582 | $highlight = $logged_in_user->prefs->highlight_special && $is_posted_by_special; |
| 583 | 583 | } else { |
| 584 | 584 | $highlight = $is_posted_by_special; |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | echo "<span class=\"small\">"; |
| 600 | 600 | if ($fstatus) echo "$fstatus"; |
| 601 | 601 | |
| 602 | - if (!$filter || !$ignore_poster){ |
|
| 602 | + if (!$filter || !$ignore_poster) { |
|
| 603 | 603 | if ($user->prefs && $user->prefs->avatar!="" && (!$logged_in_user || ($logged_in_user->prefs->hide_avatars==false))) { |
| 604 | 604 | echo "<img width=\"".AVATAR_WIDTH."\" height=\"".AVATAR_HEIGHT."\" src=\"".avatar_url($user->prefs->avatar)."\" alt=\"Avatar\"><br>"; |
| 605 | 605 | } |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | $user->nposts = BoincPost::count("user=$user->id"); |
| 616 | 616 | } |
| 617 | 617 | |
| 618 | - if (function_exists('project_forum_user_info')){ |
|
| 618 | + if (function_exists('project_forum_user_info')) { |
|
| 619 | 619 | project_forum_user_info($user); |
| 620 | 620 | } else { |
| 621 | 621 | echo tra("Posts: %1", $user->nposts)."<br>"; |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | echo "<form action=\"forum_rate.php?post=", $post->id, "\" method=\"post\">"; |
| 655 | 655 | } |
| 656 | 656 | |
| 657 | - if ($logged_in_user && $post->timestamp > $latest_viewed){ |
|
| 657 | + if ($logged_in_user && $post->timestamp > $latest_viewed) { |
|
| 658 | 658 | show_image(NEW_IMAGE, tra("You haven't read this message yet"), tra("Unread"), NEW_IMAGE_HEIGHT); |
| 659 | 659 | } |
| 660 | 660 | |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | if ($post->modified) { |
| 675 | 675 | echo "<br>".tra("Last modified: %1", pretty_time_Str($post->modified)); |
| 676 | 676 | } |
| 677 | - if ($ignore_poster && $filter){ |
|
| 677 | + if ($ignore_poster && $filter) { |
|
| 678 | 678 | echo "<br>" .tra( |
| 679 | 679 | "This post is hidden because the sender is on your 'ignore' list. Click %1 here %2 to view hidden posts", |
| 680 | 680 | "<a href=\"?id=".$thread->id."&filter=false&start=$start#".$post->id."\">", |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | <p> |
| 689 | 689 | "; |
| 690 | 690 | |
| 691 | - if (!$filter || !$ignore_poster){ |
|
| 691 | + if (!$filter || !$ignore_poster) { |
|
| 692 | 692 | $posttext = $post->content; |
| 693 | 693 | |
| 694 | 694 | // If the creator of this post has a signature and |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | // user has signatures enabled: show it |
| 697 | 697 | // |
| 698 | 698 | $posttext = output_transform($posttext, $options); |
| 699 | - if ($post->signature && (!$logged_in_user || !$logged_in_user->prefs->hide_signatures)){ |
|
| 699 | + if ($post->signature && (!$logged_in_user || !$logged_in_user->prefs->hide_signatures)) { |
|
| 700 | 700 | $sig = output_transform($user->prefs->signature, $options); |
| 701 | 701 | $posttext .= "<hr>$sig\n"; |
| 702 | 702 | } |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | $content = output_transform($post->content, $options); |
| 756 | 756 | $when = time_diff_str($post->timestamp, time()); |
| 757 | 757 | $user = BoincUser::lookup_id($post->user); |
| 758 | - if (!$user){ |
|
| 758 | + if (!$user) { |
|
| 759 | 759 | return; |
| 760 | 760 | } |
| 761 | 761 | |
@@ -1089,7 +1089,7 @@ discard block |
||
| 1089 | 1089 | |
| 1090 | 1090 | $sql = 'forum = ' . $forumID ; |
| 1091 | 1091 | $stickysql = ""; |
| 1092 | - if ($sticky){ |
|
| 1092 | + if ($sticky) { |
|
| 1093 | 1093 | $stickysql = "sticky DESC, "; |
| 1094 | 1094 | } |
| 1095 | 1095 | if (!$show_hidden) { |
@@ -1170,7 +1170,7 @@ discard block |
||
| 1170 | 1170 | // |
| 1171 | 1171 | function show_post_moderation_links( |
| 1172 | 1172 | $config, $logged_in_user, $post, $forum, $tokens |
| 1173 | -){ |
|
| 1173 | +) { |
|
| 1174 | 1174 | $moderators_allowed_to_ban = parse_bool($config, "moderators_allowed_to_ban"); |
| 1175 | 1175 | $moderators_vote_to_ban = parse_bool($config, "moderators_vote_to_ban"); |
| 1176 | 1176 | |
@@ -7,14 +7,11 @@ |
||
| 7 | 7 | list($module, $api) = func_get_args(); |
| 8 | 8 | if ($module == "input_formats" && $api == "input_formats") { |
| 9 | 9 | return array("version" => 1); |
| 10 | - } |
|
| 11 | - elseif ($module == "page_manager" && $api == "pages_default") { |
|
| 10 | + } elseif ($module == "page_manager" && $api == "pages_default") { |
|
| 12 | 11 | return array("version" => 1); |
| 13 | - } |
|
| 14 | - elseif ($module == "panels_mini" && $api == "panels_default") { |
|
| 12 | + } elseif ($module == "panels_mini" && $api == "panels_default") { |
|
| 15 | 13 | return array("version" => 1); |
| 16 | - } |
|
| 17 | - elseif ($module == "strongarm" && $api == "strongarm") { |
|
| 14 | + } elseif ($module == "strongarm" && $api == "strongarm") { |
|
| 18 | 15 | return array("version" => 1); |
| 19 | 16 | } |
| 20 | 17 | } |