@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | // Consistency checks |
101 | 101 | // |
102 | 102 | if (!check_termsofuse()) { |
103 | - error_log("Project configuration error! " . |
|
103 | + error_log("Project configuration error! ". |
|
104 | 104 | "Terms of use undefined while 'account_creation_rpc_require_consent' enabled!" |
105 | 105 | ); |
106 | 106 | } |
107 | 107 | if (!$checkct) { |
108 | - error_log("Project configuration error! " . |
|
108 | + error_log("Project configuration error! ". |
|
109 | 109 | "'CONSENT_TYPE_ENROLL' disabled while 'account_creation_rpc_require_consent' enabled!" |
110 | 110 | ); |
111 | 111 | } |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | // |
115 | 115 | if (is_null($consent_flag) or !$source) { |
116 | 116 | xml_error(ERR_ACCT_REQUIRE_CONSENT, |
117 | - "This project requires you to consent to its terms of use. " . |
|
118 | - "Please update your BOINC software " . |
|
119 | - "or register via the project's website " . |
|
117 | + "This project requires you to consent to its terms of use. ". |
|
118 | + "Please update your BOINC software ". |
|
119 | + "or register via the project's website ". |
|
120 | 120 | "or contact your account manager's provider." |
121 | 121 | ); |
122 | 122 | } |
@@ -152,13 +152,13 @@ discard block |
||
152 | 152 | // * not agree. |
153 | 153 | // -> no create account RPC at all |
154 | 154 | // |
155 | - if ( (!is_null($consent_flag)) and $source) { |
|
155 | + if ((!is_null($consent_flag)) and $source) { |
|
156 | 156 | // Record the user giving consent in database - if consent_flag is 0, |
157 | 157 | // this is an 'anonymous account' and consent_not_required is |
158 | 158 | // set to 1. |
159 | - if ($consent_flag==0) { |
|
159 | + if ($consent_flag == 0) { |
|
160 | 160 | $rc = consent_to_a_policy($user, $ctid, 0, 1, $source); |
161 | - } else { |
|
161 | + } else { |
|
162 | 162 | $rc = consent_to_a_policy($user, $ctid, 1, 0, $source); |
163 | 163 | } |
164 | 164 | if (!$rc) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | }// switch |
72 | 72 | } else { |
73 | 73 | $form_state['storage']['wip'] = TRUE; |
74 | - if ( !in_array($prefs_preset, array('standard','maximum','green','minimum','custom')) ) { |
|
74 | + if (!in_array($prefs_preset, array('standard', 'maximum', 'green', 'minimum', 'custom'))) { |
|
75 | 75 | if ($established) { |
76 | 76 | $prefs_preset = 'custom'; |
77 | 77 | } else { |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | ); |
142 | 142 | $form['hour_options'] = array( |
143 | 143 | '#type' => 'value', |
144 | - '#value' => array('0:00','1:00','2:00','3:00','4:00', |
|
145 | - '5:00','6:00','7:00','8:00','9:00','10:00','11:00', |
|
146 | - '12:00','13:00','14:00','15:00','16:00','17:00', |
|
147 | - '18:00','19:00','20:00','21:00','22:00','23:00') |
|
144 | + '#value' => array('0:00', '1:00', '2:00', '3:00', '4:00', |
|
145 | + '5:00', '6:00', '7:00', '8:00', '9:00', '10:00', '11:00', |
|
146 | + '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', |
|
147 | + '18:00', '19:00', '20:00', '21:00', '22:00', '23:00') |
|
148 | 148 | ); |
149 | 149 | |
150 | 150 | // Identify preference sets that are established to distinguish what has been |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | '#description' => bts('Suspend computing when your computer is busy running other programs.', array(), NULL, 'boinc:account-preferences-computing'), |
282 | 282 | ); |
283 | 283 | $form['prefs']['advanced']['processor']['hour_label'] = array( |
284 | - '#value' => '<div class="form-item"><label>' . bts('Compute only between:', array(), NULL, 'boinc:account-preferences-computing') . '</label></div>' |
|
284 | + '#value' => '<div class="form-item"><label>'.bts('Compute only between:', array(), NULL, 'boinc:account-preferences-computing').'</label></div>' |
|
285 | 285 | ); |
286 | 286 | $form['prefs']['advanced']['processor']['start_hour'] = array( |
287 | 287 | '#type' => 'select', |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | '#default_value' => $default['start_hour'] |
290 | 290 | ); |
291 | 291 | $form['prefs']['advanced']['processor']['hour_delimiter'] = array( |
292 | - '#value' => '<span>' . bts('and', array(), NULL, 'boinc:account-preference') . '</span>' |
|
292 | + '#value' => '<span>'.bts('and', array(), NULL, 'boinc:account-preference').'</span>' |
|
293 | 293 | ); |
294 | 294 | $form['prefs']['advanced']['processor']['end_hour'] = array( |
295 | 295 | '#type' => 'select', |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | '#default_value' => $default['end_hour'] |
298 | 298 | ); |
299 | 299 | $form['prefs']['advanced']['processor']['hour_description'] = array( |
300 | - '#value' => '<div class="form-item slim"><div class="description">' . bts('Compute only during a particular period each day.', array(), NULL, 'boinc:account-preferences-computing') . '</div></div>' |
|
300 | + '#value' => '<div class="form-item slim"><div class="description">'.bts('Compute only during a particular period each day.', array(), NULL, 'boinc:account-preferences-computing').'</div></div>' |
|
301 | 301 | ); |
302 | 302 | $form['prefs']['advanced']['processor']['leave_apps_in_memory'] = array( |
303 | 303 | '#title' => bts('Leave non-GPU tasks in memory while suspended?', array(), NULL, 'boinc:account-preferences-computing'), |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | '#description' => bts('Limit the upload rate of file transfers.', array(), NULL, 'boinc:account-preferences-computing') |
455 | 455 | ); |
456 | 456 | $form['prefs']['advanced']['network']['hour_label'] = array( |
457 | - '#value' => '<div class="form-item"><label>' . bts('Transfer files only between', array(), NULL, 'boinc:account-preferences-computing') . '</label></div>' |
|
457 | + '#value' => '<div class="form-item"><label>'.bts('Transfer files only between', array(), NULL, 'boinc:account-preferences-computing').'</label></div>' |
|
458 | 458 | ); |
459 | 459 | $form['prefs']['advanced']['network']['net_start_hour'] = array( |
460 | 460 | '#type' => 'select', |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | '#default_value' => $default['net_start_hour'] |
463 | 463 | ); |
464 | 464 | $form['prefs']['advanced']['network']['hour_delimiter'] = array( |
465 | - '#value' => '<span>' . bts('and', array(), NULL, 'boinc:account-preference') . '</span>' |
|
465 | + '#value' => '<span>'.bts('and', array(), NULL, 'boinc:account-preference').'</span>' |
|
466 | 466 | ); |
467 | 467 | $form['prefs']['advanced']['network']['net_end_hour'] = array( |
468 | 468 | '#type' => 'select', |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | '#default_value' => $default['net_end_hour'] |
471 | 471 | ); |
472 | 472 | $form['prefs']['advanced']['network']['hour_description'] = array( |
473 | - '#value' => '<div class="form-item slim"><div class="description">' . bts('Transfer files only during a particular period each day.', array(), NULL, 'boinc:account-preferences-computing') . '</div></div>' |
|
473 | + '#value' => '<div class="form-item slim"><div class="description">'.bts('Transfer files only during a particular period each day.', array(), NULL, 'boinc:account-preferences-computing').'</div></div>' |
|
474 | 474 | ); |
475 | 475 | $form['prefs']['advanced']['network']['daily_xfer_limit_mb'] = array( |
476 | 476 | '#title' => bts('Limit usage to', array(), NULL, 'boinc:account-preferences-computing'), |
@@ -530,23 +530,23 @@ discard block |
||
530 | 530 | '#suffix' => '</li>' |
531 | 531 | ); |
532 | 532 | $form['prefs']['form control tabs'] = array( |
533 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), drupal_get_path_alias("account/prefs/computing/edit")) . '</li>' |
|
533 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), drupal_get_path_alias("account/prefs/computing/edit")).'</li>' |
|
534 | 534 | ); |
535 | 535 | if ($venue AND $venue != 'generic') { |
536 | 536 | global $base_path; |
537 | - $form['prefs']['form control tabs']['#value'] .= '<li class="tab">' . |
|
537 | + $form['prefs']['form control tabs']['#value'] .= '<li class="tab">'. |
|
538 | 538 | l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/computing/clear/{$venue}", |
539 | 539 | array( |
540 | - 'query' => 'destination=' . urlencode(drupal_get_path_alias('account/prefs/computing/combined')), |
|
540 | + 'query' => 'destination='.urlencode(drupal_get_path_alias('account/prefs/computing/combined')), |
|
541 | 541 | 'attributes' => array( |
542 | - 'onclick' => 'return confirm(\'' . bts('This will remove all of your settings from the @name preference set. Are you sure?', |
|
543 | - array('@name' => $venue), NULL, 'boinc:account-preferences') . '\')' |
|
542 | + 'onclick' => 'return confirm(\''.bts('This will remove all of your settings from the @name preference set. Are you sure?', |
|
543 | + array('@name' => $venue), NULL, 'boinc:account-preferences').'\')' |
|
544 | 544 | ) |
545 | 545 | ) |
546 | - ) . '</li>'; |
|
546 | + ).'</li>'; |
|
547 | 547 | } |
548 | 548 | $form['prefs']['view control'] = array( |
549 | - '#value' => '<li class="first alt tab">' . l('(' . bts('Show comparison view', array(), NULL, 'boinc:account-preferences') . ')', 'account/prefs/computing/combined') . '</li>' |
|
549 | + '#value' => '<li class="first alt tab">'.l('('.bts('Show comparison view', array(), NULL, 'boinc:account-preferences').')', 'account/prefs/computing/combined').'</li>' |
|
550 | 550 | ); |
551 | 551 | $form['prefs']['form control tabs suffix'] = array( |
552 | 552 | '#value' => '</ul>' |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | return FALSE; |
785 | 785 | } |
786 | 786 | |
787 | - if ($new_host->userid==0) { |
|
787 | + if ($new_host->userid == 0) { |
|
788 | 788 | rules_invoke_event('boincwork_zombie_merge_error', $old_host->id, $new_host->id, variable_get('boinc_admin_mailing_list_subject_tag', '')); |
789 | 789 | watchdog('boincwork', |
790 | 790 | 'Zombie merge attempted, target host has userid=0: old host id=%old_host, target host id=%new_host', |
@@ -880,9 +880,9 @@ discard block |
||
880 | 880 | } |
881 | 881 | |
882 | 882 | $form['overview'] = array( |
883 | - '#value' => '<p>' . bts('Sometimes BOINC assigns separate identities to' |
|
883 | + '#value' => '<p>'.bts('Sometimes BOINC assigns separate identities to' |
|
884 | 884 | . ' the same computer by mistake. You can correct this by merging old' |
885 | - . ' identities with the newest one.', array(), NULL, 'boinc:account-host-merge') . '</p>' |
|
885 | + . ' identities with the newest one.', array(), NULL, 'boinc:account-host-merge').'</p>' |
|
886 | 886 | . '<p>' |
887 | 887 | . bts('Check the computers that are the same as @name' |
888 | 888 | . ' (created on @date at @time with computer ID @id)', |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | '@time' => date('G:i:s T', $current_host->create_time), |
893 | 893 | '@id' => $current_host->id, |
894 | 894 | ), |
895 | - NULL, 'boinc:account-host-merge') . '</p>', |
|
895 | + NULL, 'boinc:account-host-merge').'</p>', |
|
896 | 896 | ); |
897 | 897 | |
898 | 898 | $options = array(); |
@@ -926,7 +926,7 @@ discard block |
||
926 | 926 | '#suffix' => '</li>' |
927 | 927 | ); |
928 | 928 | $form['prefs']['form control tabs'] = array( |
929 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "host/{$host_id}") . '</li>' |
|
929 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "host/{$host_id}").'</li>' |
|
930 | 930 | ); |
931 | 931 | |
932 | 932 | return $form; |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | if (count($merged) == 2) { |
972 | 972 | $oxford_comma = ''; |
973 | 973 | } |
974 | - $list = implode(', ', $list) . $oxford_comma . ' ' . $conjunction . ' ' . $last; |
|
974 | + $list = implode(', ', $list).$oxford_comma.' '.$conjunction.' '.$last; |
|
975 | 975 | } |
976 | 976 | else { |
977 | 977 | $list = $last; |
@@ -1220,23 +1220,23 @@ discard block |
||
1220 | 1220 | '#suffix' => '</li>' |
1221 | 1221 | ); |
1222 | 1222 | $form['prefs']['form control tabs'] = array( |
1223 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>' |
|
1223 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>' |
|
1224 | 1224 | ); |
1225 | 1225 | if ($venue AND $venue != 'generic') { |
1226 | 1226 | global $base_path; |
1227 | - $form['prefs']['form control tabs']['#value'] .= '<li class="tab">' . |
|
1227 | + $form['prefs']['form control tabs']['#value'] .= '<li class="tab">'. |
|
1228 | 1228 | l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/project/clear/{$venue}", |
1229 | 1229 | array( |
1230 | - 'query' => 'destination=' . urlencode(drupal_get_path_alias('account/prefs/project/combined')), |
|
1230 | + 'query' => 'destination='.urlencode(drupal_get_path_alias('account/prefs/project/combined')), |
|
1231 | 1231 | 'attributes' => array( |
1232 | - 'onclick' => 'return confirm(\'' . bts('This will remove all of your settings from the @name preference set. Are you sure?', |
|
1233 | - array('@name' => $venue), NULL, 'boinc:account-preferences') . '\')' |
|
1232 | + 'onclick' => 'return confirm(\''.bts('This will remove all of your settings from the @name preference set. Are you sure?', |
|
1233 | + array('@name' => $venue), NULL, 'boinc:account-preferences').'\')' |
|
1234 | 1234 | ) |
1235 | 1235 | ) |
1236 | - ) . '</li>'; |
|
1236 | + ).'</li>'; |
|
1237 | 1237 | } |
1238 | 1238 | $form['prefs']['view control'] = array( |
1239 | - '#value' => '<li class="first alt tab">' . l('(' . bts('Show comparison view', array(), NULL, 'boinc:account-preferences') . ')', 'account/prefs/project/combined') . '</li>' |
|
1239 | + '#value' => '<li class="first alt tab">'.l('('.bts('Show comparison view', array(), NULL, 'boinc:account-preferences').')', 'account/prefs/project/combined').'</li>' |
|
1240 | 1240 | ); |
1241 | 1241 | $form['prefs']['form control tabs suffix'] = array( |
1242 | 1242 | '#value' => '</ul>' |
@@ -1279,7 +1279,7 @@ discard block |
||
1279 | 1279 | |
1280 | 1280 | foreach ($xml['project_specific_preferences'] as $wrapped_element) { |
1281 | 1281 | $type = key($wrapped_element); |
1282 | - $element= reset($wrapped_element); |
|
1282 | + $element = reset($wrapped_element); |
|
1283 | 1283 | boincwork_generate_prefs_element($form, $type, $element, $prefs['project_specific']); |
1284 | 1284 | } |
1285 | 1285 | } |
@@ -1505,7 +1505,7 @@ discard block |
||
1505 | 1505 | $names = array(); |
1506 | 1506 | foreach ($languages as $langcode => $item) { |
1507 | 1507 | $name = t($item->name); |
1508 | - $names[check_plain($langcode)] = check_plain($name . ($item->native != $name ? ' ('. $item->native .')' : '')); |
|
1508 | + $names[check_plain($langcode)] = check_plain($name.($item->native != $name ? ' ('.$item->native.')' : '')); |
|
1509 | 1509 | } |
1510 | 1510 | $form['locale'] = array( |
1511 | 1511 | '#type' => 'fieldset', |
@@ -1530,20 +1530,20 @@ discard block |
||
1530 | 1530 | // Avatar options |
1531 | 1531 | $form['gravatar'] = array( |
1532 | 1532 | '#type' => 'item', |
1533 | - '#value' => bts('If you have a <a href="@gravatar-check">valid Gravatar</a> associated with your e-mail address, it will be used for your user picture.', array('@gravatar-check' => 'http://en.gravatar.com/site/check/' . $account->mail), NULL, 'boinc:account-preferences-community'), |
|
1533 | + '#value' => bts('If you have a <a href="@gravatar-check">valid Gravatar</a> associated with your e-mail address, it will be used for your user picture.', array('@gravatar-check' => 'http://en.gravatar.com/site/check/'.$account->mail), NULL, 'boinc:account-preferences-community'), |
|
1534 | 1534 | '#description' => bts('Your Gravatar will not be shown if you upload a user picture.', array(), NULL, 'boinc:account-preferences-community'), |
1535 | 1535 | ); |
1536 | 1536 | if (user_access('disable own gravatar', $account)) { |
1537 | 1537 | $form['gravatar'] = array( |
1538 | 1538 | '#type' => 'checkbox', |
1539 | - '#title' => bts('If you have a <a href="@gravatar-check">valid Gravatar</a> associated with your e-mail address, use it for your user picture.', array('@gravatar-check' => 'http://en.gravatar.com/site/check/' . $account->mail), NULL, 'boinc:account-preferences-community'), |
|
1539 | + '#title' => bts('If you have a <a href="@gravatar-check">valid Gravatar</a> associated with your e-mail address, use it for your user picture.', array('@gravatar-check' => 'http://en.gravatar.com/site/check/'.$account->mail), NULL, 'boinc:account-preferences-community'), |
|
1540 | 1540 | '#description' => bts('Gravatar will not be shown if an avatar is uploaded.', array(), NULL, 'boinc:account-preferences-community'), |
1541 | 1541 | '#default_value' => isset($account->gravatar) ? $account->gravatar : 0, |
1542 | 1542 | '#disabled' => !empty($account->picture), |
1543 | 1543 | ); |
1544 | 1544 | } |
1545 | 1545 | $form['gravatar']['#weight'] = 15; |
1546 | - $form['gravatar']['#prefix'] = '<fieldset class="collapsible"><legend><a href="#">' . bts('Avatar settings', array(), NULL, 'boinc:account-preferences-community') . '</a></legend>'; |
|
1546 | + $form['gravatar']['#prefix'] = '<fieldset class="collapsible"><legend><a href="#">'.bts('Avatar settings', array(), NULL, 'boinc:account-preferences-community').'</a></legend>'; |
|
1547 | 1547 | // Upload an avatar (pulled from profile_node_form): |
1548 | 1548 | if (!empty($profile_form['field_image'])) { |
1549 | 1549 | $form['field_image'] = $profile_form['field_image']; |
@@ -1578,7 +1578,7 @@ discard block |
||
1578 | 1578 | ); |
1579 | 1579 | // Can't have a typical Drupal form suffix on a select box? |
1580 | 1580 | $form['forums']['comments_per_page_suffix'] = array( |
1581 | - '#value' => '<span>' . bts('comments per page', array(), NULL, 'boinc:account-preferences-community') . '</span>' |
|
1581 | + '#value' => '<span>'.bts('comments per page', array(), NULL, 'boinc:account-preferences-community').'</span>' |
|
1582 | 1582 | ); |
1583 | 1583 | $form['forums']['comments_order'] = array( |
1584 | 1584 | '#type' => 'select', |
@@ -1631,7 +1631,7 @@ discard block |
||
1631 | 1631 | '#weight' => 1002, |
1632 | 1632 | ); |
1633 | 1633 | $form['form control tabs'] = array( |
1634 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>', |
|
1634 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>', |
|
1635 | 1635 | '#weight' => 1003, |
1636 | 1636 | ); |
1637 | 1637 | $form['form control tabs suffix'] = array( |
@@ -1717,10 +1717,10 @@ discard block |
||
1717 | 1717 | if ($user->language != $edit['language']) { |
1718 | 1718 | global $base_url; |
1719 | 1719 | if ($edit['language'] != language_default('language')) { |
1720 | - $form_state['redirect'] = $base_url . '/' . $edit['language'] . '/' . $_GET['q']; |
|
1720 | + $form_state['redirect'] = $base_url.'/'.$edit['language'].'/'.$_GET['q']; |
|
1721 | 1721 | } |
1722 | 1722 | else { |
1723 | - $form_state['redirect'] = $base_url . '/' . $_GET['q']; |
|
1723 | + $form_state['redirect'] = $base_url.'/'.$_GET['q']; |
|
1724 | 1724 | } |
1725 | 1725 | } |
1726 | 1726 | } |
@@ -1790,7 +1790,7 @@ discard block |
||
1790 | 1790 | // option that deals with privacy. |
1791 | 1791 | foreach ($privacy_consent_types as $ct) { |
1792 | 1792 | |
1793 | - $currstate = (check_user_consent($boincuser, $ct['shortname'])) ? 1 : 0 ; |
|
1793 | + $currstate = (check_user_consent($boincuser, $ct['shortname'])) ? 1 : 0; |
|
1794 | 1794 | // Set name to 'privacyconsent_SHORTNAME', which can be parsed |
1795 | 1795 | // later in the submit function. |
1796 | 1796 | $form['privacy']['privacyconsent_'.$ct['shortname']] = array( |
@@ -1804,7 +1804,7 @@ discard block |
||
1804 | 1804 | // Add a description with link to the question 'Do you consent to |
1805 | 1805 | // exporting your data...'. |
1806 | 1806 | $mypatt = '/Do you consent to exporting your data/'; |
1807 | - if (preg_match($mypatt, $ct['description']) ) { |
|
1807 | + if (preg_match($mypatt, $ct['description'])) { |
|
1808 | 1808 | $form['privacy']['privacyconsent_'.$ct['shortname']]['#description'] = bts('See our !privacy_policy_link for the current list of statistics exports.', |
1809 | 1809 | array( |
1810 | 1810 | '!privacy_policy_link' => l( |
@@ -1843,7 +1843,7 @@ discard block |
||
1843 | 1843 | $form['ignoreblock']['delete'][$ignored_user['iuid']] = array( |
1844 | 1844 | '#value' => l( |
1845 | 1845 | bts('delete', array(), NULL, 'boinc:ignore-user-delete-button'), |
1846 | - 'account/prefs/privacy/ignore_user/remove/'. $ignored_user['iuid'], |
|
1846 | + 'account/prefs/privacy/ignore_user/remove/'.$ignored_user['iuid'], |
|
1847 | 1847 | array() |
1848 | 1848 | ), |
1849 | 1849 | ); |
@@ -1894,7 +1894,7 @@ discard block |
||
1894 | 1894 | '#suffix' => '</li>' |
1895 | 1895 | ); |
1896 | 1896 | $form['prefs']['form control tabs'] = array( |
1897 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>' |
|
1897 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>' |
|
1898 | 1898 | ); |
1899 | 1899 | $form['prefs']['form control tabs suffix'] = array( |
1900 | 1900 | '#value' => '</ul>' |
@@ -1981,7 +1981,7 @@ discard block |
||
1981 | 1981 | $privacyconsent_prefs = array_intersect_key($form_state['values'], array_flip($result)); |
1982 | 1982 | foreach ($privacyconsent_prefs as $name => $newstate) { |
1983 | 1983 | $subname = explode('_', $name)[1]; |
1984 | - $currstate = (check_user_consent($boincuser, $subname)) ? 1 : 0 ; |
|
1984 | + $currstate = (check_user_consent($boincuser, $subname)) ? 1 : 0; |
|
1985 | 1985 | list($checkct, $ctid) = check_consent_type($subname); |
1986 | 1986 | if ($checkct && ($currstate != $newstate)) { |
1987 | 1987 | consent_to_a_policy($boincuser, $ctid, $newstate, 0, 'Webform', time()); |
@@ -2047,7 +2047,7 @@ discard block |
||
2047 | 2047 | function boincwork_selectapp_form_submit($form, &$form_state) { |
2048 | 2048 | $myargs = arg(); |
2049 | 2049 | array_pop($myargs); |
2050 | - $newpath = implode('/', $myargs ) . '/' . $form['selectapp']['#value']; |
|
2050 | + $newpath = implode('/', $myargs).'/'.$form['selectapp']['#value']; |
|
2051 | 2051 | $form_state['redirect'] = $newpath; |
2052 | 2052 | } |
2053 | 2053 |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | require_once('../inc/sanitize_html.inc'); |
27 | 27 | |
28 | 28 | class output_options { |
29 | - var $bb2html; // BBCode as HTML? (on) |
|
30 | - var $images_as_links; // Images as hyperlinks? (off) |
|
31 | - var $link_popup; // Links in new windows? (off) |
|
32 | - var $nl2br; // Convert newlines to <br>'s? (on) |
|
33 | - var $htmlitems; // Convert special chars to HTML entities? (on) |
|
34 | - var $htmlscrub; // Scrub "bad" HTML tags? (off) |
|
35 | - var $highlight_terms;// Array of terms to be highlighted (off) |
|
29 | + var $bb2html; // BBCode as HTML? (on) |
|
30 | + var $images_as_links; // Images as hyperlinks? (off) |
|
31 | + var $link_popup; // Links in new windows? (off) |
|
32 | + var $nl2br; // Convert newlines to <br>'s? (on) |
|
33 | + var $htmlitems; // Convert special chars to HTML entities? (on) |
|
34 | + var $htmlscrub; // Scrub "bad" HTML tags? (off) |
|
35 | + var $highlight_terms; // Array of terms to be highlighted (off) |
|
36 | 36 | |
37 | 37 | // Constructor - set the defaults. |
38 | 38 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $options = new output_options; // Defaults in the class definition |
69 | 69 | } |
70 | 70 | if ($options->htmlitems) { |
71 | - $text = htmlspecialchars($text, ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE); |
|
71 | + $text = htmlspecialchars($text, ENT_COMPAT|ENT_HTML401|ENT_SUBSTITUTE); |
|
72 | 72 | } |
73 | 73 | if (is_array($options->highlight_terms)) { |
74 | 74 | $text = highlight_terms($text, $options->highlight_terms); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | if ($export) { |
110 | 110 | $text = preg_replace_callback( |
111 | 111 | "@\[pre\](.*?)\[/pre\]@is", |
112 | - function ($matches) { |
|
112 | + function($matches) { |
|
113 | 113 | $x = remove_br(substr($matches[0], 5, -6)); |
114 | 114 | $x = htmlspecialchars($x, ENT_COMPAT, "UTF-8", false); |
115 | 115 | $x = str_replace("[", "[", $x); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | ); |
120 | 120 | return preg_replace_callback( |
121 | 121 | "@\[code\](.*?)\[/code\]@is", |
122 | - function ($matches) { |
|
122 | + function($matches) { |
|
123 | 123 | $x = remove_br(substr($matches[0], 6, -7)); |
124 | 124 | $x = htmlspecialchars($x, ENT_COMPAT, "UTF-8", false); |
125 | 125 | $x = str_replace("[", "[", $x); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } else { |
131 | 131 | $text = preg_replace_callback( |
132 | 132 | "@\[pre\](.*?)\[/pre\]@is", |
133 | - function ($matches) { |
|
133 | + function($matches) { |
|
134 | 134 | $x = remove_br(substr($matches[0], 5, -6)); |
135 | 135 | $x = htmlspecialchars($x, ENT_COMPAT, "UTF-8", false); |
136 | 136 | $x = str_replace("[", "[", $x); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | ); |
141 | 141 | return preg_replace_callback( |
142 | 142 | "@\[code\](.*?)\[/code\]@is", |
143 | - function ($matches) { |
|
143 | + function($matches) { |
|
144 | 144 | $x = remove_br(substr($matches[0], 6, -7)); |
145 | 145 | $x = htmlspecialchars($x, ENT_COMPAT, "UTF-8", false); |
146 | 146 | $x = str_replace("[", "[", $x); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | } |
152 | 152 | } |
153 | 153 | |
154 | -function bb2html($text, $export=false) { |
|
154 | +function bb2html($text, $export = false) { |
|
155 | 155 | $urlregex = "(?:\"?)(?:(http\:\/\/)?)([^\[\"<\ ]+)(?:\"?)"; |
156 | 156 | // NOTE: |
157 | 157 | // This matches https:// too; I don't understand why. |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | $httpsregex = "(?:\"?)https\:\/\/([^\[\"<\ ]+)(?:\"?)"; |
173 | 173 | // List of allowable tags |
174 | - $bbtags = array ( |
|
174 | + $bbtags = array( |
|
175 | 175 | "@\[b\](.*?)\[/b\]@is", |
176 | 176 | "@\[i\](.*?)\[/i\]@is", |
177 | 177 | "@\[u\](.*?)\[/u\]@is", |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | |
201 | 201 | // What the above tags are turned in to |
202 | 202 | if ($export) { |
203 | - $htmltags = array ( |
|
203 | + $htmltags = array( |
|
204 | 204 | "<b>\\1</b>", |
205 | 205 | "<i>\\1</i>", |
206 | 206 | "<u>\\1</u>", |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | "<a href=\"https://github.com/BOINC/boinc-dev-doc/wiki/\\1\">\\1</a>", |
228 | 228 | ); |
229 | 229 | } else { |
230 | - $htmltags = array ( |
|
230 | + $htmltags = array( |
|
231 | 231 | "<b>\\1</b>", |
232 | 232 | "<i>\\1</i>", |
233 | 233 | "<u>\\1</u>", |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | $lasttext = ""; |
260 | 260 | $i = 0; |
261 | 261 | // $i<1000 to prevent DoS |
262 | - while ($text != $lasttext && $i<1000) { |
|
262 | + while ($text != $lasttext && $i < 1000) { |
|
263 | 263 | $lasttext = $text; |
264 | 264 | $text = replace_pre_code($text, $export); |
265 | 265 | $text = preg_replace($bbtags, $htmltags, $text); |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | // for example inside <pre> containers |
275 | 275 | // The original \n was retained after the br when it was added |
276 | 276 | // |
277 | -function remove_br($text){ |
|
277 | +function remove_br($text) { |
|
278 | 278 | return str_replace("<br />", "", $text); |
279 | 279 | } |
280 | 280 | |
@@ -282,19 +282,19 @@ discard block |
||
282 | 282 | // |
283 | 283 | function externalize_links($text) { |
284 | 284 | // TODO: Convert this to PCRE |
285 | - $i=0; |
|
286 | - $linkpos=true; |
|
285 | + $i = 0; |
|
286 | + $linkpos = true; |
|
287 | 287 | $out = ""; |
288 | - while (true){ |
|
288 | + while (true) { |
|
289 | 289 | //Find a link |
290 | 290 | // |
291 | - $linkpos=strpos($text, "<a ", $i); |
|
292 | - if ($linkpos===false) break; |
|
291 | + $linkpos = strpos($text, "<a ", $i); |
|
292 | + if ($linkpos === false) break; |
|
293 | 293 | |
294 | 294 | //Replace with target='_new' |
295 | 295 | // |
296 | - $out .= substr($text, $i, $linkpos-$i)."<a target=\"_new\" "; |
|
297 | - $i = $linkpos+3; |
|
296 | + $out .= substr($text, $i, $linkpos - $i)."<a target=\"_new\" "; |
|
297 | + $i = $linkpos + 3; |
|
298 | 298 | } |
299 | 299 | $out .= substr($text, $i); |
300 | 300 | return $out; |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | |
303 | 303 | // Converts image tags to links to the images. |
304 | 304 | |
305 | -function image_as_link($text){ |
|
305 | +function image_as_link($text) { |
|
306 | 306 | /* This function depends on sanitized HTML */ |
307 | 307 | // Build some regex (should be a *lot* faster) |
308 | 308 | $pattern = '@<img([\S\s]+?)src=([^>]+?)>@si'; |
@@ -327,5 +327,5 @@ discard block |
||
327 | 327 | } |
328 | 328 | } |
329 | 329 | |
330 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
330 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
331 | 331 | ?> |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | define('THREAD_SOLVED', 1); |
55 | 55 | |
56 | 56 | define('AVATAR_WIDTH', 100); |
57 | -define('AVATAR_HEIGHT',100); |
|
57 | +define('AVATAR_HEIGHT', 100); |
|
58 | 58 | |
59 | 59 | define('ST_NEW_TIME', 1209600); //3600*24*14 - 14 days |
60 | 60 | define('ST_NEW', 'New member'); |
61 | 61 | |
62 | -define('MAXIMUM_EDIT_TIME',3600); |
|
62 | +define('MAXIMUM_EDIT_TIME', 3600); |
|
63 | 63 | // allow edits of forums posts up till one hour after posting. |
64 | 64 | |
65 | 65 | define('MAX_FORUM_LOGGING_TIME', 2419200); //3600*24*28 - 28 days |
@@ -77,24 +77,24 @@ discard block |
||
77 | 77 | define('IMAGE_HIDDEN', 'img/hidden.png'); |
78 | 78 | define('IMAGE_STICKY_LOCKED', 'img/sticky_locked_post.png'); |
79 | 79 | define('IMAGE_POST', 'img/post.png'); |
80 | -define('NEW_IMAGE_HEIGHT','15'); |
|
80 | +define('NEW_IMAGE_HEIGHT', '15'); |
|
81 | 81 | define('EMPHASIZE_IMAGE', 'img/emphasized_post.png'); |
82 | -define('EMPHASIZE_IMAGE_HEIGHT','15'); |
|
82 | +define('EMPHASIZE_IMAGE_HEIGHT', '15'); |
|
83 | 83 | define('FILTER_IMAGE', 'img/filtered_post.png'); |
84 | -define('FILTER_IMAGE_HEIGHT','15'); |
|
84 | +define('FILTER_IMAGE_HEIGHT', '15'); |
|
85 | 85 | define('RATE_POSITIVE_IMAGE', 'img/rate_positive.png'); |
86 | -define('RATE_POSITIVE_IMAGE_HEIGHT','9'); |
|
86 | +define('RATE_POSITIVE_IMAGE_HEIGHT', '9'); |
|
87 | 87 | define('RATE_NEGATIVE_IMAGE', 'img/rate_negative.png'); |
88 | -define('RATE_NEGATIVE_IMAGE_HEIGHT','9'); |
|
88 | +define('RATE_NEGATIVE_IMAGE_HEIGHT', '9'); |
|
89 | 89 | define('REPORT_POST_IMAGE', 'img/report_post.png'); |
90 | -define('REPORT_POST_IMAGE_HEIGHT','9'); |
|
90 | +define('REPORT_POST_IMAGE_HEIGHT', '9'); |
|
91 | 91 | |
92 | 92 | define('SOLUTION', tra('This answered my question')); |
93 | 93 | define('SUFFERER', tra('I also have this question')); |
94 | 94 | define('OFF_TOPIC', tra('Off-topic')); |
95 | 95 | |
96 | -define ('DEFAULT_LOW_RATING_THRESHOLD', -25); |
|
97 | -define ('DEFAULT_HIGH_RATING_THRESHOLD', 5); |
|
96 | +define('DEFAULT_LOW_RATING_THRESHOLD', -25); |
|
97 | +define('DEFAULT_HIGH_RATING_THRESHOLD', 5); |
|
98 | 98 | |
99 | 99 | // special user attributes |
100 | 100 | // |
@@ -164,15 +164,15 @@ discard block |
||
164 | 164 | |
165 | 165 | // Output the forum/thread title. |
166 | 166 | // |
167 | -function show_forum_title($category, $forum, $thread, $link_thread=false) { |
|
167 | +function show_forum_title($category, $forum, $thread, $link_thread = false) { |
|
168 | 168 | if ($category) { |
169 | 169 | $is_helpdesk = $category->is_helpdesk; |
170 | 170 | } else { |
171 | 171 | $is_helpdesk = false; |
172 | 172 | } |
173 | 173 | |
174 | - $where = $is_helpdesk?tra("Questions and Answers"):tra("Message boards"); |
|
175 | - $top_url = $is_helpdesk?"forum_help_desk.php":"forum_index.php"; |
|
174 | + $where = $is_helpdesk ?tra("Questions and Answers") : tra("Message boards"); |
|
175 | + $top_url = $is_helpdesk ? "forum_help_desk.php" : "forum_index.php"; |
|
176 | 176 | |
177 | 177 | if (!$forum && !$thread) { |
178 | 178 | echo "<span class=\"title\">$where</span>\n"; |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } |
201 | 201 | } |
202 | 202 | |
203 | -function show_team_forum_title($forum, $thread=null, $link_thread=false) { |
|
203 | +function show_team_forum_title($forum, $thread = null, $link_thread = false) { |
|
204 | 204 | $team = BoincTeam::lookup_id($forum->category); |
205 | 205 | echo "<span class=title> |
206 | 206 | <a href=\"forum_index.php\">".tra("Message boards")."</a> : |
@@ -233,12 +233,12 @@ discard block |
||
233 | 233 | } |
234 | 234 | |
235 | 235 | function page_link($url, $page_num, $items_per_page, $text) { |
236 | - return " <a href=\"$url&start=" . $page_num*$items_per_page . "\">$text</a> "; |
|
236 | + return " <a href=\"$url&start=".$page_num*$items_per_page."\">$text</a> "; |
|
237 | 237 | } |
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; |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | $x = ""; |
247 | 247 | |
248 | 248 | if ($nitems <= $items_per_page) return ""; |
249 | - $npages = ceil($nitems / $items_per_page); |
|
250 | - $curpage = ceil($start / $items_per_page); |
|
249 | + $npages = ceil($nitems/$items_per_page); |
|
250 | + $curpage = ceil($start/$items_per_page); |
|
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 | - $url, $curpage-1, $items_per_page, |
|
256 | + $url, $curpage - 1, $items_per_page, |
|
257 | 257 | tra("Previous")." · " |
258 | 258 | ); |
259 | 259 | } |
@@ -268,8 +268,8 @@ 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++){ |
|
272 | - $page_str = (string)($i+1); |
|
271 | + for ($i = $curpage - $preshow; $i <= $curpage + $postshow; $i++) { |
|
272 | + $page_str = (string)($i + 1); |
|
273 | 273 | if ($i < 0) continue; |
274 | 274 | if ($i >= $npages) break; |
275 | 275 | |
@@ -278,20 +278,20 @@ discard block |
||
278 | 278 | } else { |
279 | 279 | $x .= page_link($url, $i, $items_per_page, $page_str); |
280 | 280 | } |
281 | - if ($i == $npages-1) break; |
|
282 | - if ($i == $curpage+$postshow) break; |
|
281 | + if ($i == $npages - 1) break; |
|
282 | + if ($i == $curpage + $postshow) break; |
|
283 | 283 | $x .= " · "; |
284 | 284 | } |
285 | 285 | |
286 | - if ($curpage + $postshow < $npages-1) { |
|
286 | + if ($curpage + $postshow < $npages - 1) { |
|
287 | 287 | $x .= " . . . "; |
288 | - $x .= page_link($url, $npages-1, $items_per_page, $npages); |
|
288 | + $x .= page_link($url, $npages - 1, $items_per_page, $npages); |
|
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 | - $url, $curpage+1, $items_per_page, |
|
294 | + $url, $curpage + 1, $items_per_page, |
|
295 | 295 | " · ".tra("Next") |
296 | 296 | ); |
297 | 297 | } |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | function cleanup_title($title) { |
313 | 313 | $x = sanitize_tags(bb2html($title)); |
314 | 314 | $x = trim($x); |
315 | - if (strlen($x)==0) return "(no title)"; |
|
315 | + if (strlen($x) == 0) return "(no title)"; |
|
316 | 316 | else return $x; |
317 | 317 | } |
318 | 318 | |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $i = 0; |
375 | 375 | foreach ($posts as $post) { |
376 | 376 | if ($post->id == $postid) { |
377 | - $start = $i - ($i % $num_to_show); |
|
377 | + $start = $i - ($i%$num_to_show); |
|
378 | 378 | $jump_to_post = $post; |
379 | 379 | break; |
380 | 380 | } |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | // if jump to post, figure out what page to show |
402 | 402 | // |
403 | 403 | if ($jump_to_post) { |
404 | - $start = $ibest - ($ibest % $num_to_show); |
|
404 | + $start = $ibest - ($ibest%$num_to_show); |
|
405 | 405 | } else { |
406 | 406 | $start = $default_start; |
407 | 407 | } |
@@ -509,8 +509,8 @@ discard block |
||
509 | 509 | // Generates a table row with two cells: author and message |
510 | 510 | // |
511 | 511 | function show_post( |
512 | - $post, $thread, $forum, $logged_in_user, $start=0, |
|
513 | - $latest_viewed=0, $controls=FORUM_CONTROLS, $filter=true |
|
512 | + $post, $thread, $forum, $logged_in_user, $start = 0, |
|
513 | + $latest_viewed = 0, $controls = FORUM_CONTROLS, $filter = true |
|
514 | 514 | ) { |
515 | 515 | global $country_to_iso3166_2; |
516 | 516 | |
@@ -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 | } |
@@ -555,8 +555,8 @@ discard block |
||
555 | 555 | if (is_moderator($logged_in_user, $forum)) { |
556 | 556 | $can_edit = true; |
557 | 557 | } else if (can_reply($thread, $forum, $logged_in_user)) { |
558 | - $time_limit = $post->timestamp+MAXIMUM_EDIT_TIME; |
|
559 | - $can_edit = time()<$time_limit; |
|
558 | + $time_limit = $post->timestamp + MAXIMUM_EDIT_TIME; |
|
559 | + $can_edit = time() < $time_limit; |
|
560 | 560 | } else { |
561 | 561 | $can_edit = false; |
562 | 562 | } |
@@ -566,24 +566,24 @@ discard block |
||
566 | 566 | // Print the special user lines, if any |
567 | 567 | // |
568 | 568 | global $special_user_bitfield; |
569 | - $fstatus=""; |
|
569 | + $fstatus = ""; |
|
570 | 570 | $keys = array_keys($special_user_bitfield); |
571 | 571 | $is_posted_by_special = false; |
572 | - for ($i=0; $i<sizeof($special_user_bitfield);$i++) { |
|
572 | + for ($i = 0; $i < sizeof($special_user_bitfield); $i++) { |
|
573 | 573 | if ($user->prefs && $user->prefs->privilege($keys[$i])) { |
574 | - $fstatus.="<nobr>".$special_user_bitfield[$keys[$i]]."<nobr><br>"; |
|
574 | + $fstatus .= "<nobr>".$special_user_bitfield[$keys[$i]]."<nobr><br>"; |
|
575 | 575 | $is_posted_by_special = true; |
576 | 576 | } |
577 | 577 | } |
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; |
585 | 585 | } |
586 | - $class = $highlight?' style="border-left: 5px solid LightGreen" ':''; |
|
586 | + $class = $highlight ? ' style="border-left: 5px solid LightGreen" ' : ''; |
|
587 | 587 | |
588 | 588 | // row and start of author col |
589 | 589 | // |
@@ -595,12 +595,12 @@ discard block |
||
595 | 595 | |
596 | 596 | echo user_links($user, 0, 30); |
597 | 597 | echo "<br>"; |
598 | - if ($user->create_time > time()-ST_NEW_TIME) $fstatus.=ST_NEW."<br>"; |
|
598 | + if ($user->create_time > time() - ST_NEW_TIME) $fstatus .= ST_NEW."<br>"; |
|
599 | 599 | echo "<span class=\"small\">"; |
600 | 600 | if ($fstatus) echo "$fstatus"; |
601 | 601 | |
602 | - if (!$filter || !$ignore_poster){ |
|
603 | - if ($user->prefs && $user->prefs->avatar!="" && (!$logged_in_user || ($logged_in_user->prefs->hide_avatars==false))) { |
|
602 | + if (!$filter || !$ignore_poster) { |
|
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 | } |
606 | 606 | } |
@@ -608,14 +608,14 @@ discard block |
||
608 | 608 | |
609 | 609 | $url = "pm.php?action=new&userid=".$user->id; |
610 | 610 | $name = $user->name; |
611 | - show_button_small($url, tra("Send message"), tra("Send %1 a private message",$name)); |
|
611 | + show_button_small($url, tra("Send message"), tra("Send %1 a private message", $name)); |
|
612 | 612 | echo '<br>'.tra("Joined: %1", gmdate('j M y', $user->create_time)), "<br>"; |
613 | 613 | |
614 | 614 | if (!isset($user->nposts)) { |
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>"; |
@@ -624,8 +624,8 @@ discard block |
||
624 | 624 | // |
625 | 625 | //echo "ID: ".$user->id."<br>"; |
626 | 626 | if (!NO_COMPUTING) { |
627 | - echo tra("Credit: %1", number_format($user->total_credit)) ."<br>"; |
|
628 | - echo tra("RAC: %1", number_format($user->expavg_credit))."<br>"; |
|
627 | + echo tra("Credit: %1", number_format($user->total_credit))."<br>"; |
|
628 | + echo tra("RAC: %1", number_format($user->expavg_credit))."<br>"; |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | // to use this feature: |
@@ -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,8 +674,8 @@ 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){ |
|
678 | - echo "<br>" .tra( |
|
677 | + if ($ignore_poster && $filter) { |
|
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."\">", |
681 | 681 | "</a>" |
@@ -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 | } |
@@ -730,10 +730,10 @@ discard block |
||
730 | 730 | } |
731 | 731 | if (($controls == FORUM_CONTROLS) && (can_reply($thread, $forum, $logged_in_user))) { |
732 | 732 | echo " "; |
733 | - $url = "forum_reply.php?thread=" . $thread->id . "&post=" . $post->id . "&no_quote=1#input"; |
|
733 | + $url = "forum_reply.php?thread=".$thread->id."&post=".$post->id."&no_quote=1#input"; |
|
734 | 734 | // "Reply" is used as a verb |
735 | 735 | show_button($url, tra("Reply"), tra("Post a reply to this message")); |
736 | - $url = "forum_reply.php?thread=" . $thread->id . "&post=" . $post->id . "#input"; |
|
736 | + $url = "forum_reply.php?thread=".$thread->id."&post=".$post->id."#input"; |
|
737 | 737 | // "Quote" is used as a verb |
738 | 738 | show_button($url, tra("Quote"), tra("Post a reply by quoting this message")); |
739 | 739 | } |
@@ -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 | |
@@ -810,9 +810,9 @@ discard block |
||
810 | 810 | |
811 | 811 | function post_rules() { |
812 | 812 | if (function_exists("project_forum_post_rules")) { |
813 | - $project_rules=project_forum_post_rules(); |
|
813 | + $project_rules = project_forum_post_rules(); |
|
814 | 814 | } else { |
815 | - $project_rules=""; |
|
815 | + $project_rules = ""; |
|
816 | 816 | } |
817 | 817 | return sprintf(" |
818 | 818 | <ul> |
@@ -841,7 +841,7 @@ discard block |
||
841 | 841 | ); |
842 | 842 | } |
843 | 843 | |
844 | -function post_warning($forum=null) { |
|
844 | +function post_warning($forum = null) { |
|
845 | 845 | $x = "<br><br> |
846 | 846 | <table><tr><td align=left> |
847 | 847 | "; |
@@ -901,7 +901,7 @@ discard block |
||
901 | 901 | $content = substr($content, 0, 64000); |
902 | 902 | $content = BoincDb::escape_string($content); |
903 | 903 | $now = time(); |
904 | - $sig = $signature?1:0; |
|
904 | + $sig = $signature ? 1 : 0; |
|
905 | 905 | $id = BoincPost::insert("(thread, user, timestamp, content, modified, parent_post, score, votes, signature, hidden) values ($thread->id, $user->id, $now, '$content', 0, $parent_id, 0, 0, $sig, 0)"); |
906 | 906 | if (!$id) { |
907 | 907 | $forum_error = "Failed to add post to DB."; |
@@ -921,7 +921,7 @@ discard block |
||
921 | 921 | // |
922 | 922 | function update_thread_timestamp($thread) { |
923 | 923 | $posts = BoincPost::enum("thread=$thread->id and hidden=0 order by timestamp desc limit 1"); |
924 | - if (count($posts)>0) { |
|
924 | + if (count($posts) > 0) { |
|
925 | 925 | $post = $posts[0]; |
926 | 926 | $thread->update("timestamp=$post->timestamp"); |
927 | 927 | } |
@@ -929,7 +929,7 @@ discard block |
||
929 | 929 | |
930 | 930 | function update_forum_timestamp($forum) { |
931 | 931 | $threads = BoincThread::enum("forum=$forum->id and hidden=0 order by timestamp desc limit 1"); |
932 | - if (count($threads)>0) { |
|
932 | + if (count($threads) > 0) { |
|
933 | 933 | $thread = $threads[0]; |
934 | 934 | $forum->update("timestamp=$thread->timestamp"); |
935 | 935 | } |
@@ -952,7 +952,7 @@ discard block |
||
952 | 952 | if (is_news_forum($forum) && !$export) { |
953 | 953 | $status = 1; |
954 | 954 | } |
955 | - $id = BoincThread::insert("(forum, owner, status, title, timestamp, views, replies, activity, sufferers, score, votes, create_time, hidden, sticky, locked) values ($forum->id, $user->id, $status, '$title', $now, 0, -1, 0, 0, 0, 0, $now, 0, 0, 0)"); |
|
955 | + $id = BoincThread::insert("(forum, owner, status, title, timestamp, views, replies, activity, sufferers, score, votes, create_time, hidden, sticky, locked) values ($forum->id, $user->id, $status, '$title', $now, 0, -1, 0, 0, 0, 0, $now, 0, 0, 0)"); |
|
956 | 956 | if (!$id) { |
957 | 957 | $forum_error = "Failed to add thread to DB."; |
958 | 958 | return null; |
@@ -1080,22 +1080,22 @@ discard block |
||
1080 | 1080 | // $sticky - bool (not directly passed to SQL) |
1081 | 1081 | // |
1082 | 1082 | function get_forum_threads( |
1083 | - $forumID, $start=-1, $nRec=-1, $sort_style=MODIFIED_NEW, |
|
1083 | + $forumID, $start = -1, $nRec = -1, $sort_style = MODIFIED_NEW, |
|
1084 | 1084 | $show_hidden = 0, $sticky = 1 |
1085 | 1085 | ) { |
1086 | 1086 | //if (! (is_numeric($forumID) && is_numeric($min) && is_numeric($nRec))) { |
1087 | 1087 | // return NULL; // Something is wrong here. |
1088 | 1088 | //} |
1089 | 1089 | |
1090 | - $sql = 'forum = ' . $forumID ; |
|
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) { |
1096 | 1096 | $sql .= ' AND hidden = 0'; |
1097 | 1097 | } |
1098 | - switch($sort_style) { |
|
1098 | + switch ($sort_style) { |
|
1099 | 1099 | case MODIFIED_NEW: |
1100 | 1100 | $sql .= ' ORDER BY '.$stickysql.'timestamp DESC'; |
1101 | 1101 | break; |
@@ -1148,7 +1148,7 @@ discard block |
||
1148 | 1148 | if (!$show_hidden) { |
1149 | 1149 | $sql .= ' AND hidden = 0'; |
1150 | 1150 | } |
1151 | - switch($sort_style) { |
|
1151 | + switch ($sort_style) { |
|
1152 | 1152 | case CREATE_TIME_NEW: |
1153 | 1153 | $sql .= ' ORDER BY timestamp desc'; |
1154 | 1154 | break; |
@@ -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 | |
@@ -1257,14 +1257,14 @@ discard block |
||
1257 | 1257 | // We do not tell the (ab)user how much this is - |
1258 | 1258 | // no need to make it easy for them to break the system. |
1259 | 1259 | // |
1260 | - if ($user->total_credit<$forum->post_min_total_credit || $user->expavg_credit<$forum->post_min_expavg_credit) { |
|
1260 | + if ($user->total_credit < $forum->post_min_total_credit || $user->expavg_credit < $forum->post_min_expavg_credit) { |
|
1261 | 1261 | error_page(tra("To create a new thread in %1 you must have a certain level of average credit. This is to protect against abuse of the system.", $forum->title)); |
1262 | 1262 | } |
1263 | 1263 | |
1264 | 1264 | // If the user is posting faster than forum regulations allow |
1265 | 1265 | // Tell the user to wait a while before creating any more posts |
1266 | 1266 | // |
1267 | - if (time()-$user->prefs->last_post <$forum->post_min_interval) { |
|
1267 | + if (time() - $user->prefs->last_post < $forum->post_min_interval) { |
|
1268 | 1268 | error_page(tra("You cannot create threads right now. Please wait before trying again. This is to protect against abuse of the system.")); |
1269 | 1269 | } |
1270 | 1270 | } |
@@ -1292,7 +1292,7 @@ discard block |
||
1292 | 1292 | |
1293 | 1293 | function is_moderator($user, $forum) { |
1294 | 1294 | if (!$user) return false; |
1295 | - $type = $forum?$forum->parent_type:0; |
|
1295 | + $type = $forum ? $forum->parent_type : 0; |
|
1296 | 1296 | switch ($type) { |
1297 | 1297 | case 0: |
1298 | 1298 | if ($user->prefs->privilege(S_MODERATOR)) return true; |
@@ -1330,7 +1330,7 @@ discard block |
||
1330 | 1330 | $owner = BoincUser::lookup_id($thread->owner); |
1331 | 1331 | if (!$owner) return; |
1332 | 1332 | echo "<tr><td>\n"; |
1333 | - switch($thread_forum->parent_type) { |
|
1333 | + switch ($thread_forum->parent_type) { |
|
1334 | 1334 | case 0: |
1335 | 1335 | $category = BoincCategory::lookup_id($thread_forum->category); |
1336 | 1336 | show_forum_title($category, $thread_forum, $thread, true); |
@@ -1340,7 +1340,7 @@ discard block |
||
1340 | 1340 | break; |
1341 | 1341 | } |
1342 | 1342 | echo ' |
1343 | - </td><td class="numbers">'.($thread->replies+1).'</td> |
|
1343 | + </td><td class="numbers">'.($thread->replies + 1).'</td> |
|
1344 | 1344 | <td>'.user_links($owner).'</td> |
1345 | 1345 | <td class="numbers">'.$thread->views.'</td> |
1346 | 1346 | <td class="lastpost">'.time_diff_str($thread->timestamp, time()).'</td> |
@@ -1374,13 +1374,13 @@ discard block |
||
1374 | 1374 | |
1375 | 1375 | function subscribed_post_web_line($notify) { |
1376 | 1376 | $thread = BoincThread::lookup_id($notify->opaque); |
1377 | - return tra("New posts in the thread %1","<a href=forum_thread.php?id=$thread->id>$thread->title</a>"); |
|
1377 | + return tra("New posts in the thread %1", "<a href=forum_thread.php?id=$thread->id>$thread->title</a>"); |
|
1378 | 1378 | } |
1379 | 1379 | |
1380 | 1380 | function subscribe_rss($notify, &$title, &$msg, &$url) { |
1381 | 1381 | $thread = BoincThread::lookup_id($notify->opaque); |
1382 | 1382 | $title = tra("New posts in subscribed thread"); |
1383 | - $msg = tra("There are new posts in the thread '%1'",$thread->title); |
|
1383 | + $msg = tra("There are new posts in the thread '%1'", $thread->title); |
|
1384 | 1384 | $url = secure_url_base()."forum_thread.php?id=$thread->id"; |
1385 | 1385 | } |
1386 | 1386 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $f->mode = "local_staged"; |
42 | 42 | $f->source = "input"; |
43 | 43 | |
44 | - for ($i=10; $i<20; $i++) { |
|
44 | + for ($i = 10; $i < 20; $i++) { |
|
45 | 45 | $job = new StdClass; |
46 | 46 | $job->input_files = array($f); |
47 | 47 | $job->rsc_fpops_est = $i*1e9; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | if ($template) { |
62 | 62 | $t = (double)$template->workunit->rsc_fpops_est; |
63 | 63 | } |
64 | - foreach($r->batch->job as $job) { |
|
64 | + foreach ($r->batch->job as $job) { |
|
65 | 65 | $y = (double)$job->rsc_fpops_est; |
66 | 66 | if ($y) { |
67 | 67 | $x += $y; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | function est_elapsed_time($r, $template) { |
88 | 88 | // crude estimate: batch FLOPs / project FLOPS |
89 | 89 | // |
90 | - return batch_flop_count($r, $template) / project_flops(); |
|
90 | + return batch_flop_count($r, $template)/project_flops(); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | // if batch-level input template filename was given, read it; |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | // |
98 | 98 | function read_input_template($app, $r) { |
99 | 99 | if ((isset($r->batch)) && (isset($r->batch->workunit_template_file)) && ($r->batch->workunit_template_file)) { |
100 | - $path = project_dir() . "/templates/".$r->batch->workunit_template_file; |
|
100 | + $path = project_dir()."/templates/".$r->batch->workunit_template_file; |
|
101 | 101 | } else { |
102 | - $path = project_dir() . "/templates/$app->name"."_in"; |
|
102 | + $path = project_dir()."/templates/$app->name"."_in"; |
|
103 | 103 | } |
104 | 104 | if (file_exists($path)) { |
105 | 105 | $x = simplexml_load_file($path); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | function validate_batch($jobs, $template) { |
145 | 145 | $i = 0; |
146 | 146 | $n = count($template->file_info); |
147 | - foreach($jobs as $job) { |
|
147 | + foreach ($jobs as $job) { |
|
148 | 148 | $m = count($job->input_files); |
149 | 149 | if ($n != $m) { |
150 | 150 | log_write("wrong # of input files for job $i: need $n, got $m"); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | // stage all the files |
206 | 206 | // |
207 | 207 | function stage_files(&$jobs) { |
208 | - foreach($jobs as $job) { |
|
208 | + foreach ($jobs as $job) { |
|
209 | 209 | foreach ($job->input_files as $file) { |
210 | 210 | if ($file->mode != "remote") { |
211 | 211 | $file->name = stage_file($file); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | // |
219 | 219 | function submit_jobs( |
220 | 220 | $jobs, $job_params, $app, $batch_id, $priority, $app_version_num, |
221 | - $input_template_filename, // batch-level; can also specify per job |
|
221 | + $input_template_filename, // batch-level; can also specify per job |
|
222 | 222 | $output_template_filename |
223 | 223 | ) { |
224 | 224 | global $input_templates, $output_templates; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | // one line per job |
228 | 228 | // |
229 | 229 | $x = ""; |
230 | - foreach($jobs as $job) { |
|
230 | + foreach ($jobs as $job) { |
|
231 | 231 | if ($job->name) { |
232 | 232 | $x .= " --wu_name $job->name"; |
233 | 233 | } |
@@ -262,8 +262,8 @@ discard block |
||
262 | 262 | $x .= "\n"; |
263 | 263 | } |
264 | 264 | |
265 | - $errfile = "/tmp/create_work_" . getmypid() . ".err"; |
|
266 | - $cmd = "cd " . project_dir() . "; ./bin/create_work --appname $app->name --batch $batch_id"; |
|
265 | + $errfile = "/tmp/create_work_".getmypid().".err"; |
|
266 | + $cmd = "cd ".project_dir()."; ./bin/create_work --appname $app->name --batch $batch_id"; |
|
267 | 267 | if ($priority !== null) { |
268 | 268 | $cmd .= " --priority $priority"; |
269 | 269 | } |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | // |
364 | 364 | function xml_get_jobs($r) { |
365 | 365 | $jobs = array(); |
366 | - foreach($r->batch->job as $j) { |
|
366 | + foreach ($r->batch->job as $j) { |
|
367 | 367 | $job = new StdClass; |
368 | 368 | $job->input_files = array(); |
369 | 369 | $job->command_line = (string)$j->command_line; |
@@ -414,16 +414,16 @@ discard block |
||
414 | 414 | // |
415 | 415 | function logical_end_time($r, $jobs, $user, $app) { |
416 | 416 | $total_flops = 0; |
417 | - foreach($jobs as $job) { |
|
417 | + foreach ($jobs as $job) { |
|
418 | 418 | //print_r($job); |
419 | 419 | if ($job->rsc_fpops_est) { |
420 | 420 | $total_flops += $job->rsc_fpops_est; |
421 | 421 | } else if ($job->input_template && $job->input_template->workunit->rsc_fpops_est) { |
422 | - $total_flops += (double) $job->input_template->workunit->rsc_fpops_est; |
|
422 | + $total_flops += (double)$job->input_template->workunit->rsc_fpops_est; |
|
423 | 423 | } else if ($r->batch->job_params->rsc_fpops_est) { |
424 | - $total_flops += (double) $r->batch->job_params->rsc_fpops_est; |
|
424 | + $total_flops += (double)$r->batch->job_params->rsc_fpops_est; |
|
425 | 425 | } else { |
426 | - $x = (double) $template->workunit->rsc_fpops_est; |
|
426 | + $x = (double)$template->workunit->rsc_fpops_est; |
|
427 | 427 | if ($x) { |
428 | 428 | $total_flops += $x; |
429 | 429 | } else { |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | } |
432 | 432 | } |
433 | 433 | } |
434 | - $cmd = "cd " . project_dir() . "/bin; ./adjust_user_priority --user $user->id --flops $total_flops --app $app->name"; |
|
434 | + $cmd = "cd ".project_dir()."/bin; ./adjust_user_priority --user $user->id --flops $total_flops --app $app->name"; |
|
435 | 435 | $x = exec($cmd); |
436 | 436 | if (!is_numeric($x) || (double)$x == 0) { |
437 | 437 | xml_error(-1, "$cmd returned $x"); |
@@ -508,15 +508,15 @@ discard block |
||
508 | 508 | } |
509 | 509 | |
510 | 510 | $job_params = new StdClass; |
511 | - $job_params->rsc_disk_bound = (double) $r->batch->job_params->rsc_disk_bound; |
|
512 | - $job_params->rsc_fpops_est = (double) $r->batch->job_params->rsc_fpops_est; |
|
513 | - $job_params->rsc_fpops_bound = (double) $r->batch->job_params->rsc_fpops_bound; |
|
514 | - $job_params->rsc_memory_bound = (double) $r->batch->job_params->rsc_memory_bound; |
|
515 | - $job_params->delay_bound = (double) $r->batch->job_params->delay_bound; |
|
511 | + $job_params->rsc_disk_bound = (double)$r->batch->job_params->rsc_disk_bound; |
|
512 | + $job_params->rsc_fpops_est = (double)$r->batch->job_params->rsc_fpops_est; |
|
513 | + $job_params->rsc_fpops_bound = (double)$r->batch->job_params->rsc_fpops_bound; |
|
514 | + $job_params->rsc_memory_bound = (double)$r->batch->job_params->rsc_memory_bound; |
|
515 | + $job_params->delay_bound = (double)$r->batch->job_params->delay_bound; |
|
516 | 516 | // could add quorum-related stuff |
517 | 517 | |
518 | - $input_template_filename = (string) $r->batch->input_template_filename; |
|
519 | - $output_template_filename = (string) $r->batch->output_template_filename; |
|
518 | + $input_template_filename = (string)$r->batch->input_template_filename; |
|
519 | + $output_template_filename = (string)$r->batch->output_template_filename; |
|
520 | 520 | // possibly empty |
521 | 521 | |
522 | 522 | submit_jobs( |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | } |
605 | 605 | |
606 | 606 | function n_outfiles($wu) { |
607 | - $path = project_dir() . "/$wu->output_template_filename"; |
|
607 | + $path = project_dir()."/$wu->output_template_filename"; |
|
608 | 608 | $r = simplexml_load_file($path); |
609 | 609 | return count($r->file_info); |
610 | 610 | } |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | "; |
812 | 812 | if ($result->server_state == 5) { // over? |
813 | 813 | $paths = get_outfile_paths($result); |
814 | - foreach($paths as $path) { |
|
814 | + foreach ($paths as $path) { |
|
815 | 815 | if (is_file($path)) { |
816 | 816 | $size = filesize($path); |
817 | 817 | echo " <outfile> |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | } else { |
856 | 856 | $results = BoincResult::enum("workunitid=$job_id"); |
857 | 857 | foreach ($results as $r) { |
858 | - switch($r->outcome) { |
|
858 | + switch ($r->outcome) { |
|
859 | 859 | case 1: |
860 | 860 | case 3: |
861 | 861 | case 6: |
@@ -970,8 +970,8 @@ discard block |
||
970 | 970 | } |
971 | 971 | |
972 | 972 | list($user, $user_submit) = authenticate_user($r, $app); |
973 | - $in = file_get_contents(project_dir() . "/templates/".$app->name."_in"); |
|
974 | - $out = file_get_contents(project_dir() . "/templates/".$app->name."_out"); |
|
973 | + $in = file_get_contents(project_dir()."/templates/".$app->name."_in"); |
|
974 | + $out = file_get_contents(project_dir()."/templates/".$app->name."_out"); |
|
975 | 975 | if ($in === false || $out === false) { |
976 | 976 | log_write("template file missing"); |
977 | 977 | xml_error(-1, "template file missing"); |
@@ -983,7 +983,7 @@ discard block |
||
983 | 983 | |
984 | 984 | function ping($r) { |
985 | 985 | xml_start_tag("ping"); |
986 | - BoincDb::get(); // errors out if DB down or web disabled |
|
986 | + BoincDb::get(); // errors out if DB down or web disabled |
|
987 | 987 | echo "<success>1</success> |
988 | 988 | </ping> |
989 | 989 | "; |
@@ -1050,9 +1050,9 @@ discard block |
||
1050 | 1050 | $request_log = parse_config(get_config(), "<remote_submit_request_log>"); |
1051 | 1051 | if ($request_log) { |
1052 | 1052 | $log_dir = parse_config(get_config(), "<log_dir>"); |
1053 | - $request_log = $log_dir . "/" . $request_log; |
|
1053 | + $request_log = $log_dir."/".$request_log; |
|
1054 | 1054 | if ($file = fopen($request_log, "a")) { |
1055 | - fwrite($file, "\n<submit_rpc_handler date=\"" . date(DATE_ATOM) . "\">\n" . $_POST['request'] . "\n</submit_rpc_handler>\n"); |
|
1055 | + fwrite($file, "\n<submit_rpc_handler date=\"".date(DATE_ATOM)."\">\n".$_POST['request']."\n</submit_rpc_handler>\n"); |
|
1056 | 1056 | fclose($file); |
1057 | 1057 | } |
1058 | 1058 | } |
@@ -24,71 +24,71 @@ |
||
24 | 24 | define('KW_CATEGORY_SCIENCE', 0); |
25 | 25 | define('KW_CATEGORY_LOC', 1); |
26 | 26 | |
27 | -define('KW_ASTRONOMY', 1); |
|
28 | -define('KW_SETI', 2); |
|
29 | -define('KW_PULSARS', 3); |
|
30 | -define('KW_GW', 4); |
|
31 | -define('KW_COSMOLOGY', 5); |
|
32 | -define('KW_PHYSICS', 6); |
|
27 | +define('KW_ASTRONOMY', 1); |
|
28 | +define('KW_SETI', 2); |
|
29 | +define('KW_PULSARS', 3); |
|
30 | +define('KW_GW', 4); |
|
31 | +define('KW_COSMOLOGY', 5); |
|
32 | +define('KW_PHYSICS', 6); |
|
33 | 33 | define('KW_PARTICLE_PHYSICS', 7); |
34 | -define('KW_NANOSCIENCE', 8); |
|
35 | -define('KW_BIOMED', 9); |
|
34 | +define('KW_NANOSCIENCE', 8); |
|
35 | +define('KW_BIOMED', 9); |
|
36 | 36 | define('KW_DRUG_DISCOVERY', 10); |
37 | -define('KW_PROTEINS', 11); |
|
38 | -define('KW_GENETICS', 12); |
|
39 | -define('KW_DISEASE', 13); |
|
40 | -define('KW_CANCER', 14); |
|
41 | -define('KW_MATH_CS', 15); |
|
42 | -define('KW_AI', 16); |
|
43 | -define('KW_OCEANIA', 17); |
|
44 | -define('KW_AUSTRALIA', 18); |
|
37 | +define('KW_PROTEINS', 11); |
|
38 | +define('KW_GENETICS', 12); |
|
39 | +define('KW_DISEASE', 13); |
|
40 | +define('KW_CANCER', 14); |
|
41 | +define('KW_MATH_CS', 15); |
|
42 | +define('KW_AI', 16); |
|
43 | +define('KW_OCEANIA', 17); |
|
44 | +define('KW_AUSTRALIA', 18); |
|
45 | 45 | |
46 | -define('KW_EUROPE', 20); |
|
47 | -define('KW_GERMANY', 21); |
|
48 | -define('KW_ASIA', 22); |
|
49 | -define('KW_AMERICAS', 23); |
|
50 | -define('KW_US', 24); |
|
51 | -define('KW_UCB', 25); |
|
52 | -define('KW_AEI', 26); |
|
53 | -define('KW_CERN', 27); |
|
54 | -define('KW_UW', 28); |
|
55 | -define('KW_EARTH_SCI', 29); |
|
56 | -define('KW_SPAIN', 30); |
|
57 | -define('KW_SAN_JORGE', 31); |
|
58 | -define('KW_NUMBER_THEORY', 32); |
|
59 | -define('KW_CRYPTO', 33); |
|
60 | -define('KW_ENV_RESEARCH', 34); |
|
61 | -define('KW_CLIMATE', 35); |
|
62 | -define('KW_CZECH', 36); |
|
46 | +define('KW_EUROPE', 20); |
|
47 | +define('KW_GERMANY', 21); |
|
48 | +define('KW_ASIA', 22); |
|
49 | +define('KW_AMERICAS', 23); |
|
50 | +define('KW_US', 24); |
|
51 | +define('KW_UCB', 25); |
|
52 | +define('KW_AEI', 26); |
|
53 | +define('KW_CERN', 27); |
|
54 | +define('KW_UW', 28); |
|
55 | +define('KW_EARTH_SCI', 29); |
|
56 | +define('KW_SPAIN', 30); |
|
57 | +define('KW_SAN_JORGE', 31); |
|
58 | +define('KW_NUMBER_THEORY', 32); |
|
59 | +define('KW_CRYPTO', 33); |
|
60 | +define('KW_ENV_RESEARCH', 34); |
|
61 | +define('KW_CLIMATE', 35); |
|
62 | +define('KW_CZECH', 36); |
|
63 | 63 | define('KW_CHARLES_PRAGUE', 37); |
64 | -define('KW_RECHENKRAFT', 38); |
|
65 | -define('KW_RHEINMAIN', 39); |
|
66 | -define('KW_HUNGARY', 40); |
|
67 | -define('KW_IRELAND', 41); |
|
68 | -define('KW_UC_DUBLIN', 42); |
|
69 | -define('KW_POLAND', 43); |
|
70 | -define('KW_RUSSIA', 44); |
|
64 | +define('KW_RECHENKRAFT', 38); |
|
65 | +define('KW_RHEINMAIN', 39); |
|
66 | +define('KW_HUNGARY', 40); |
|
67 | +define('KW_IRELAND', 41); |
|
68 | +define('KW_UC_DUBLIN', 42); |
|
69 | +define('KW_POLAND', 43); |
|
70 | +define('KW_RUSSIA', 44); |
|
71 | 71 | define('KW_SW_STATE_RUSSIA', 45); |
72 | -define('KW_RAS', 46); |
|
73 | -define('KW_PRBB', 47); |
|
74 | -define('KW_UK', 48); |
|
75 | -define('KW_OXFORD', 49); |
|
76 | -define('KW_CHINA', 50); |
|
77 | -define('KW_U_DAYTON', 51); |
|
78 | -define('KW_WRIGHT_STATE', 52); |
|
79 | -define('KW_USC', 53); |
|
80 | -define('KW_FULLERTON', 54); |
|
81 | -define('KW_ARIZONA_STATE', 55); |
|
82 | -define('KW_U_ILLINOIS', 56); |
|
83 | -define('KW_U_WARSAW', 57); |
|
84 | -define('KW_RPI', 58); |
|
85 | -define('KW_INTERNATIONAL', 59); |
|
86 | -define('KW_UND', 60); |
|
87 | -define('KW_HOLLAND', 61); |
|
88 | -define('KW_CHEMISTRY', 62); |
|
89 | -define('KW_GAMES', 63); |
|
90 | -define('KW_VIRUS', 64); |
|
91 | -define('KW_FRANCE', 65); |
|
72 | +define('KW_RAS', 46); |
|
73 | +define('KW_PRBB', 47); |
|
74 | +define('KW_UK', 48); |
|
75 | +define('KW_OXFORD', 49); |
|
76 | +define('KW_CHINA', 50); |
|
77 | +define('KW_U_DAYTON', 51); |
|
78 | +define('KW_WRIGHT_STATE', 52); |
|
79 | +define('KW_USC', 53); |
|
80 | +define('KW_FULLERTON', 54); |
|
81 | +define('KW_ARIZONA_STATE', 55); |
|
82 | +define('KW_U_ILLINOIS', 56); |
|
83 | +define('KW_U_WARSAW', 57); |
|
84 | +define('KW_RPI', 58); |
|
85 | +define('KW_INTERNATIONAL', 59); |
|
86 | +define('KW_UND', 60); |
|
87 | +define('KW_HOLLAND', 61); |
|
88 | +define('KW_CHEMISTRY', 62); |
|
89 | +define('KW_GAMES', 63); |
|
90 | +define('KW_VIRUS', 64); |
|
91 | +define('KW_FRANCE', 65); |
|
92 | 92 | |
93 | 93 | $job_keywords = array(); |
94 | 94 |