@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | // In Drupal 7, these operation cases will all exist as their own hooks, |
| 60 | 60 | // so let's approximate that here so that this function can simply be removed |
| 61 | 61 | // upon migration to 7 |
| 62 | - switch($op) { |
|
| 62 | + switch ($op) { |
|
| 63 | 63 | case 'insert': |
| 64 | 64 | boincteam_forum_node_insert($node); |
| 65 | 65 | break; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * is inserted (forward compatible to Drupal 7) |
| 85 | 85 | */ |
| 86 | 86 | function boincteam_forum_node_insert($node) { |
| 87 | - switch($node->type) { |
|
| 87 | + switch ($node->type) { |
|
| 88 | 88 | case 'team_forum': |
| 89 | 89 | $account = user_load($node->uid); |
| 90 | 90 | $team_id = boincteam_forum_lookup_nid($node->tfid); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | * is loaded (forward compatible to Drupal 7) |
| 108 | 108 | */ |
| 109 | 109 | function boincteam_forum_node_load($node) { |
| 110 | - switch($node->type) { |
|
| 110 | + switch ($node->type) { |
|
| 111 | 111 | case 'team_forum': |
| 112 | 112 | $node->tfid = db_result(db_query(" |
| 113 | 113 | SELECT tfid FROM {boincteam_forum_node} |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * is updated (forward compatible to Drupal 7) |
| 126 | 126 | */ |
| 127 | 127 | function boincteam_forum_node_update($node) { |
| 128 | - switch($node->type) { |
|
| 128 | + switch ($node->type) { |
|
| 129 | 129 | case 'team_forum': |
| 130 | 130 | |
| 131 | 131 | break; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * is validated (forward compatible to Drupal 7) |
| 141 | 141 | */ |
| 142 | 142 | function boincteam_forum_node_validate($node) { |
| 143 | - switch($node->type) { |
|
| 143 | + switch ($node->type) { |
|
| 144 | 144 | case 'team_forum': |
| 145 | 145 | $account = user_load($node->uid); |
| 146 | 146 | // Get tfid from node, but if empty/null, get it from the database |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | * is viewed (forward compatible to Drupal 7) |
| 168 | 168 | */ |
| 169 | 169 | function boincteam_forum_node_view($node) { |
| 170 | - switch($node->type) { |
|
| 170 | + switch ($node->type) { |
|
| 171 | 171 | case 'team_forum': |
| 172 | 172 | $team_id = boincteam_forum_lookup_nid($node->tfid); |
| 173 | 173 | $public_forum = boincteam_forum_is_public($node->tfid); |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | while ($team_forum = db_fetch_object($result)) { |
| 257 | 257 | |
| 258 | 258 | $team_forum->link = url("community/teams/{$team_id}/forum/{$team_forum->tfid}"); |
| 259 | - $team_forum->zebra = $row % 2 ? 'even' : 'odd'; |
|
| 259 | + $team_forum->zebra = $row%2 ? 'even' : 'odd'; |
|
| 260 | 260 | $team_forum->new_topics = 0; // TODO: Track user views of team topics |
| 261 | 261 | $team_forum->new_text = ''; |
| 262 | 262 | $team_forum->new_url = ''; |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | */ |
| 325 | 325 | function boincteam_forum_create_form_panel() { |
| 326 | 326 | $output = ''; |
| 327 | - $output .= '<h2 class="pane-title">' . bts('Create team message board', array(), NULL, 'boinc:team-forum') |
|
| 327 | + $output .= '<h2 class="pane-title">'.bts('Create team message board', array(), NULL, 'boinc:team-forum') |
|
| 328 | 328 | . '</h2>'; |
| 329 | 329 | $output .= drupal_get_form('boincteam_forum_create_form'); |
| 330 | 330 | |
@@ -337,8 +337,8 @@ discard block |
||
| 337 | 337 | function boincteam_forum_edit_form_panel($tfid) { |
| 338 | 338 | $team_forum = boincteam_forum_load($tfid); |
| 339 | 339 | $output = ''; |
| 340 | - $output .= '<h2 class="pane-title">' . bts('Edit message board', array(), NULL, 'boinc:team-forum') . ': ' . |
|
| 341 | - $team_forum->title . '</h2>'; |
|
| 340 | + $output .= '<h2 class="pane-title">'.bts('Edit message board', array(), NULL, 'boinc:team-forum').': '. |
|
| 341 | + $team_forum->title.'</h2>'; |
|
| 342 | 342 | $output .= drupal_get_form('boincteam_forum_edit_form', $tfid); |
| 343 | 343 | |
| 344 | 344 | return $output; |
@@ -354,19 +354,19 @@ discard block |
||
| 354 | 354 | ); |
| 355 | 355 | $forums = boincteam_forum_list($team_id); |
| 356 | 356 | $output = ''; |
| 357 | - $output .= '<h2 class="pane-title">' . bts('Team forum', array(), NULL, 'boinc:team-forum') . '</h2>'; |
|
| 357 | + $output .= '<h2 class="pane-title">'.bts('Team forum', array(), NULL, 'boinc:team-forum').'</h2>'; |
|
| 358 | 358 | $output .= '<p>' |
| 359 | 359 | . bts('A discussion forum has been set up for team members.', array(), NULL, 'boinc:team-forum') |
| 360 | 360 | . '</p>'; |
| 361 | 361 | $output .= '<ul class="tab-list action-list">'; |
| 362 | 362 | foreach ($forums as $forum) { |
| 363 | 363 | if (!$show_public_only OR $forum->public) { |
| 364 | - $output .= ' <li class="tab primary">' . |
|
| 364 | + $output .= ' <li class="tab primary">'. |
|
| 365 | 365 | l( |
| 366 | 366 | //$forum->title, |
| 367 | 367 | bts('Enter forum', array(), NULL, 'boinc:team-forum'), |
| 368 | 368 | "community/teams/{$team_id}/forum/{$forum->tfid}" |
| 369 | - ) . '</li>'; |
|
| 369 | + ).'</li>'; |
|
| 370 | 370 | // Since we're only supporting one team forum for now, we've labeled the |
| 371 | 371 | // link in a generic way above and will now just break out of the loop |
| 372 | 372 | break; |
@@ -381,20 +381,20 @@ discard block |
||
| 381 | 381 | */ |
| 382 | 382 | function boincteam_forum_topic_overview_panel($nid = NULL) { |
| 383 | 383 | $output = ''; |
| 384 | - $output .= '<h2 class="pane-title">' . bts('About message boards', array(), NULL, 'boinc:team-forum') . '</h2>'; |
|
| 384 | + $output .= '<h2 class="pane-title">'.bts('About message boards', array(), NULL, 'boinc:team-forum').'</h2>'; |
|
| 385 | 385 | $output .= '<div>'; |
| 386 | 386 | if ($nid) { |
| 387 | 387 | $team = node_load($nid); |
| 388 | - $output .= '<p>' . bts('You may create a message board for use by @team', |
|
| 389 | - array('@team' => $team->title), NULL, 'boinc:team-forum') . ':</p>'; |
|
| 388 | + $output .= '<p>'.bts('You may create a message board for use by @team', |
|
| 389 | + array('@team' => $team->title), NULL, 'boinc:team-forum').':</p>'; |
|
| 390 | 390 | } |
| 391 | 391 | else { |
| 392 | - $output .= '<p>' . bts('This is a team-only message board', array(), NULL, 'boinc:team-forum') . ':</p>'; |
|
| 392 | + $output .= '<p>'.bts('This is a team-only message board', array(), NULL, 'boinc:team-forum').':</p>'; |
|
| 393 | 393 | } |
| 394 | 394 | $output .= '<ul>'; |
| 395 | - $output .= ' <li>' . bts('Only members may post', array(), NULL, 'boinc:team-forum') . '</li>'; |
|
| 396 | - $output .= ' <li>' . bts('Only members may read (optional)', array(), NULL, 'boinc:team-forum') . '</li>'; |
|
| 397 | - $output .= ' <li>' . bts('Founder & Team Admins have moderator privileges', array(), NULL, 'boinc:team-forum') . |
|
| 395 | + $output .= ' <li>'.bts('Only members may post', array(), NULL, 'boinc:team-forum').'</li>'; |
|
| 396 | + $output .= ' <li>'.bts('Only members may read (optional)', array(), NULL, 'boinc:team-forum').'</li>'; |
|
| 397 | + $output .= ' <li>'.bts('Founder & Team Admins have moderator privileges', array(), NULL, 'boinc:team-forum'). |
|
| 398 | 398 | '</li>'; |
| 399 | 399 | $output .= '</ul>'; |
| 400 | 400 | $output .= '</div>'; |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | $node = node_load($nid); |
| 20 | 20 | if ($node->comment !== 0 AND user_access('post comments', $user)) { |
| 21 | 21 | $block['subject'] = NULL; // This should be NULL otherwise there will be duplicate h2 elements. |
| 22 | - $block['content'] = '<h2>' . bts('Post new comment', array(), NULL, 'boinc:forum-post-new-comment') . '</h2>'; |
|
| 22 | + $block['content'] = '<h2>'.bts('Post new comment', array(), NULL, 'boinc:forum-post-new-comment').'</h2>'; |
|
| 23 | 23 | $block['content'] .= drupal_get_form('comment_form', array('nid' => $nid)); |
| 24 | 24 | } |
| 25 | 25 | } |
@@ -311,8 +311,8 @@ discard block |
||
| 311 | 311 | // RFC2616 mandates that the decimal part is no more than three digits, |
| 312 | 312 | // so we multiply the qvalue by 1000 to avoid floating point comparisons. |
| 313 | 313 | $langcode = strtolower($match[1]); |
| 314 | - $qvalue = isset($match[2]) ? (float) $match[2] : 1; |
|
| 315 | - $browser_langcodes[$langcode] = (int) ($qvalue * 1000); |
|
| 314 | + $qvalue = isset($match[2]) ? (float)$match[2] : 1; |
|
| 315 | + $browser_langcodes[$langcode] = (int)($qvalue*1000); |
|
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | global $base_url; |
| 378 | 378 | global $base_path; |
| 379 | 379 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
| 380 | - $site_url = $base_url . $base_path; |
|
| 380 | + $site_url = $base_url.$base_path; |
|
| 381 | 381 | $settings = array( |
| 382 | 382 | 'from' => '', |
| 383 | 383 | 'subject' => "Content at {$site_name} is awaiting moderation", |
@@ -437,11 +437,11 @@ discard block |
||
| 437 | 437 | $user_info .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
| 438 | 438 | } |
| 439 | 439 | elseif (is_string($user_image)) { |
| 440 | - $user_info .= '<img src="' . $user_image . '"/>'; |
|
| 440 | + $user_info .= '<img src="'.$user_image.'"/>'; |
|
| 441 | 441 | } |
| 442 | 442 | $user_info .= ' </div>'; |
| 443 | 443 | } |
| 444 | - $user_info .= ' <div class="name">' . theme('username', $account) . '</div>'; |
|
| 444 | + $user_info .= ' <div class="name">'.theme('username', $account).'</div>'; |
|
| 445 | 445 | if ($account->uid) { |
| 446 | 446 | //$user_info .= ' <div class="join-date">Joined: ' . date('j M y', $account->created) . '</div>'; |
| 447 | 447 | //$user_info .= ' <div class="post-count">Posts: ' . $account->post_count . '</div>'; |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | $form['buttons']['preview']['#suffix'] = '</li>'; |
| 506 | 506 | $form['buttons']['preview']['#weight'] = 1003; |
| 507 | 507 | $form['buttons']['cancel'] = array( |
| 508 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_url) . '</li>', |
|
| 508 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_url).'</li>', |
|
| 509 | 509 | '#weight' => 1004, |
| 510 | 510 | ); |
| 511 | 511 | $form['buttons']['form control tabs suffix'] = array( |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | $node = node_load($form['nid']['#value']); |
| 526 | 526 | $community_role = array_search('community member', user_roles(true)); |
| 527 | 527 | $unrestricted_role = array_search('verified contributor', user_roles(true)); |
| 528 | - if ( (isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role])) ) { |
|
| 528 | + if ((isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role]))) { |
|
| 529 | 529 | if ($node->type == 'forum') { |
| 530 | 530 | if (module_exists('captcha')) { |
| 531 | 531 | $form['comment_captcha'] = array( |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
| 571 | 571 | $form['buttons']['preview_changes']['#weight'] = 1004; |
| 572 | 572 | $form['buttons']['cancel'] = array( |
| 573 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "community/forum/{$forum_id}") . '</li>', |
|
| 573 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "community/forum/{$forum_id}").'</li>', |
|
| 574 | 574 | '#weight' => 1005, |
| 575 | 575 | ); |
| 576 | 576 | $form['buttons']['form control tabs suffix'] = array( |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | // Add captcha for role='community member' |
| 582 | 582 | $community_role = array_search('community member', user_roles(true)); |
| 583 | 583 | $unrestricted_role = array_search('verified contributor', user_roles(true)); |
| 584 | - if ( (isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role])) ) { |
|
| 584 | + if ((isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role]))) { |
|
| 585 | 585 | if (module_exists('captcha')) { |
| 586 | 586 | $form['comment_captcha'] = array( |
| 587 | 587 | '#type' => 'captcha', |
@@ -673,8 +673,8 @@ discard block |
||
| 673 | 673 | function boinccore_link($type, $object, $teaser = FALSE) { |
| 674 | 674 | // Add custom links with this hook |
| 675 | 675 | |
| 676 | - if ($type=='node') { |
|
| 677 | - if ( ($object->type=='forum') OR ($object->type=='team_forum') ) { |
|
| 676 | + if ($type == 'node') { |
|
| 677 | + if (($object->type == 'forum') OR ($object->type == 'team_forum')) { |
|
| 678 | 678 | // Add topic moderator controls |
| 679 | 679 | if (user_access('edit any forum topic')) { |
| 680 | 680 | $node_control = "node_control/{$object->nid}"; |
@@ -735,7 +735,7 @@ discard block |
||
| 735 | 735 | }// if user_access('edit any forum topic') |
| 736 | 736 | } |
| 737 | 737 | } |
| 738 | - else if ($type=='comment') { |
|
| 738 | + else if ($type == 'comment') { |
|
| 739 | 739 | $node = node_load($object->nid); |
| 740 | 740 | $nid = $object->nid; |
| 741 | 741 | $cid = $object->cid; |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | if (user_access('administer comments')) { |
| 758 | 758 | $comment_control = "comment_control/{$cid}"; |
| 759 | 759 | // Add link to convert comment into a new topic |
| 760 | - $reply_count = db_result(db_query(' SELECT COUNT(*) FROM comments WHERE pid = %d', $cid )); |
|
| 760 | + $reply_count = db_result(db_query(' SELECT COUNT(*) FROM comments WHERE pid = %d', $cid)); |
|
| 761 | 761 | if ($reply_count == 0) { |
| 762 | 762 | $links['convert'] = array( |
| 763 | 763 | 'title' => bts('Convert', array(), NULL, 'boinc:forum-convert-comment-to-topic'), |
@@ -802,7 +802,7 @@ discard block |
||
| 802 | 802 | */ |
| 803 | 803 | $message['headers']['Content-Transfer-Encoding'] = 'Quoted-Printable'; |
| 804 | 804 | if (is_array($message['body'])) { |
| 805 | - $message['body'] = array_map( "quoted_printable_encode", $message['body'] ); |
|
| 805 | + $message['body'] = array_map("quoted_printable_encode", $message['body']); |
|
| 806 | 806 | } else { |
| 807 | 807 | $message['body'] = quoted_printable_encode($message['body']); |
| 808 | 808 | } |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | // If hiding a forum topic (node) and not an administrator, go to |
| 854 | 854 | // the forum page. Otherwise the user will reach an access-denied |
| 855 | 855 | // page. |
| 856 | - if (($action=="hide") and (!user_access('administer forums'))) { |
|
| 856 | + if (($action == "hide") and (!user_access('administer forums'))) { |
|
| 857 | 857 | drupal_goto("community/forum/{$node->tid}"); |
| 858 | 858 | } |
| 859 | 859 | drupal_goto("node/{$nid}"); |
@@ -895,8 +895,8 @@ discard block |
||
| 895 | 895 | $node->created = $comment->timestamp; |
| 896 | 896 | $node->changed = $node->created; |
| 897 | 897 | $node->promote = 0; // Display on front page? |
| 898 | - $node->sticky = 0; // Display top of page? |
|
| 899 | - $node->status = 1; // Published? |
|
| 898 | + $node->sticky = 0; // Display top of page? |
|
| 899 | + $node->status = 1; // Published? |
|
| 900 | 900 | $node->comment = 2; |
| 901 | 901 | //$node->language = 'en'; |
| 902 | 902 | $node->uid = $comment->uid; |
@@ -981,16 +981,16 @@ discard block |
||
| 981 | 981 | $xml->loadXML($global_prefs, LIBXML_NOBLANKS); |
| 982 | 982 | if ($errors = libxml_get_errors($xml)) { |
| 983 | 983 | $lines = explode("\r", $global_prefs); |
| 984 | - watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 985 | - ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
|
| 984 | + watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}". |
|
| 985 | + ': <br/>'.htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
|
| 986 | 986 | } |
| 987 | 987 | } |
| 988 | 988 | elseif ($project_prefs) { |
| 989 | 989 | $xml->loadXML($project_prefs, LIBXML_NOBLANKS); |
| 990 | 990 | if ($errors = libxml_get_errors($xml)) { |
| 991 | 991 | $lines = explode("\r", $project_prefs); |
| 992 | - watchdog('am_set_info', "XML validation error in project_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 993 | - ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
|
| 992 | + watchdog('am_set_info', "XML validation error in project_prefs: {$errors[0]->message} at line {$errors[0]->line}". |
|
| 993 | + ': <br/>'.htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
|
| 994 | 994 | } |
| 995 | 995 | } |
| 996 | 996 | if (!$errors) { |
@@ -1033,8 +1033,8 @@ discard block |
||
| 1033 | 1033 | $xml = array( |
| 1034 | 1034 | 'error' => array( |
| 1035 | 1035 | 'error_num' => -112, |
| 1036 | - 'error_msg' => "{$errors[0]->message} at line {$errors[0]->line}" . |
|
| 1037 | - ': <br/>' . htmlentities($lines[$errors[0]->line - 1]) |
|
| 1036 | + 'error_msg' => "{$errors[0]->message} at line {$errors[0]->line}". |
|
| 1037 | + ': <br/>'.htmlentities($lines[$errors[0]->line - 1]) |
|
| 1038 | 1038 | ), |
| 1039 | 1039 | ); |
| 1040 | 1040 | } |
@@ -1142,10 +1142,10 @@ discard block |
||
| 1142 | 1142 | 'teaser' => $teaser, |
| 1143 | 1143 | 'uid' => $team_owner_uid, |
| 1144 | 1144 | 'path' => null, |
| 1145 | - 'status' => 1, // published or not - always publish |
|
| 1145 | + 'status' => 1, // published or not - always publish |
|
| 1146 | 1146 | 'promote' => 0, |
| 1147 | 1147 | 'created' => $created_time, |
| 1148 | - 'comment' => 0, // comments disabled |
|
| 1148 | + 'comment' => 0, // comments disabled |
|
| 1149 | 1149 | 'moderate' => 0, |
| 1150 | 1150 | 'sticky' => 0, |
| 1151 | 1151 | 'format' => $input_format |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | module_load_include('inc', 'pathauto', 'pathauto'); |
| 1157 | 1157 | $node['path'] = pathauto_cleanstring($values['name']); |
| 1158 | 1158 | |
| 1159 | - $node = (object) $node; // node_save requires an object form |
|
| 1159 | + $node = (object)$node; // node_save requires an object form |
|
| 1160 | 1160 | $team_categories = taxonomy_get_term_by_name($values['type']); |
| 1161 | 1161 | $node->taxonomy[] = $team_categories[0]; |
| 1162 | 1162 | |
@@ -1315,7 +1315,7 @@ discard block |
||
| 1315 | 1315 | while ($member = db_fetch_object($result)) { |
| 1316 | 1316 | $team_members[$member->boinc_id]['country'] = $member->field_country_value; |
| 1317 | 1317 | $team_members[$member->boinc_id]['url'] = $member->field_url_value; |
| 1318 | - $team_members[$member->boinc_id]['has_profile'] = isset($member->nid) ? 1: 0; |
|
| 1318 | + $team_members[$member->boinc_id]['has_profile'] = isset($member->nid) ? 1 : 0; |
|
| 1319 | 1319 | $xml['users']['user'][] = $team_members[$member->boinc_id]; |
| 1320 | 1320 | } |
| 1321 | 1321 | } // end if credit_only |
@@ -1365,7 +1365,7 @@ discard block |
||
| 1365 | 1365 | if ($profile_nid = content_profile_profile_exists($profile, $account->uid)) { |
| 1366 | 1366 | $profile_node = node_load($profile_nid); |
| 1367 | 1367 | if ($profile_node) { |
| 1368 | - $avatar_image = get_cck_image_object(file_directory_path() . '/' . $image_path, 'field_image', 'profile', TRUE); |
|
| 1368 | + $avatar_image = get_cck_image_object(file_directory_path().'/'.$image_path, 'field_image', 'profile', TRUE); |
|
| 1369 | 1369 | if ($avatar_image) { |
| 1370 | 1370 | $profile_node->field_image[0] = $avatar_image; |
| 1371 | 1371 | node_save($profile_node); |
@@ -1479,7 +1479,7 @@ discard block |
||
| 1479 | 1479 | WHERE (n.status = 1) AND (c.uid = '%d') |
| 1480 | 1480 | ORDER BY timestamp DESC |
| 1481 | 1481 | LIMIT %d", |
| 1482 | - $uid, (int) $count |
|
| 1482 | + $uid, (int)$count |
|
| 1483 | 1483 | ); |
| 1484 | 1484 | $xml = array( |
| 1485 | 1485 | 'rpc_response' => array( |
@@ -1522,7 +1522,7 @@ discard block |
||
| 1522 | 1522 | WHERE (n.status = 1) AND (n.uid = '%d') |
| 1523 | 1523 | ORDER BY changed DESC |
| 1524 | 1524 | LIMIT %d", |
| 1525 | - $uid, (int) $count |
|
| 1525 | + $uid, (int)$count |
|
| 1526 | 1526 | ); |
| 1527 | 1527 | $xml = array( |
| 1528 | 1528 | 'rpc_response' => array( |
@@ -1691,7 +1691,7 @@ discard block |
||
| 1691 | 1691 | ); |
| 1692 | 1692 | } |
| 1693 | 1693 | // Determine which page to display in order to show the given comment |
| 1694 | - $page = floor($comment_offset / $comments_per_page); |
|
| 1694 | + $page = floor($comment_offset/$comments_per_page); |
|
| 1695 | 1695 | if ($page) { |
| 1696 | 1696 | $params = array('page' => $page); |
| 1697 | 1697 | } |
@@ -2083,7 +2083,7 @@ discard block |
||
| 2083 | 2083 | * Overview of moderation queues |
| 2084 | 2084 | */ |
| 2085 | 2085 | function boinccore_moderation_overview_panel() { |
| 2086 | - $output = '<h2 class="pane-title">' . bts('Moderation', array(), NULL, 'boinc:moderate-profiles') . '</h2>'; |
|
| 2086 | + $output = '<h2 class="pane-title">'.bts('Moderation', array(), NULL, 'boinc:moderate-profiles').'</h2>'; |
|
| 2087 | 2087 | $output .= '<ul class="tab-list action-list">'; |
| 2088 | 2088 | if (module_exists('user_profiles')) { |
| 2089 | 2089 | $profile_count = db_result(db_query(" |
@@ -2094,7 +2094,7 @@ discard block |
||
| 2094 | 2094 | $output .= '<li class="tab primary">'; |
| 2095 | 2095 | $output .= l(bts('Unvetted profiles', array(), NULL, 'boinc:moderate-profiles'), 'moderate/profiles'); |
| 2096 | 2096 | $output .= '<div class="item-count-wrapper">'; |
| 2097 | - $output .= '<span class="item-count">' . $profile_count . '</span>'; |
|
| 2097 | + $output .= '<span class="item-count">'.$profile_count.'</span>'; |
|
| 2098 | 2098 | $output .= '</div>'; |
| 2099 | 2099 | $output .= '</li>'; |
| 2100 | 2100 | } |
@@ -2112,7 +2112,7 @@ discard block |
||
| 2112 | 2112 | require_boinc('boinc_db'); |
| 2113 | 2113 | |
| 2114 | 2114 | $num_deleted = BoincToken::delete_expired(); |
| 2115 | - if ($num_deleted>0) { |
|
| 2115 | + if ($num_deleted > 0) { |
|
| 2116 | 2116 | watchdog('boinccore', "Deleted ${num_deleted} tokens from table token", WATCHDOG_NOTICE); |
| 2117 | 2117 | } |
| 2118 | 2118 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | function boinc_links__system_main_menu($links, $menu, $element) { |
| 84 | 84 | $html = ''; |
| 85 | - $html .= '<ul id="' . $menu['id'] . '" class="' . $menu['class'] . '">' . "\n"; |
|
| 85 | + $html .= '<ul id="'.$menu['id'].'" class="'.$menu['class'].'">'."\n"; |
|
| 86 | 86 | $item_count = count($links); |
| 87 | 87 | $i = 1; |
| 88 | 88 | foreach ($links as $key => $link) { |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | if (strpos($key, 'active-trail')) $classes[] = 'active'; |
| 91 | 91 | if ($i == 1) $classes[] = 'first'; |
| 92 | 92 | if ($i == $item_count) $classes[] = 'last'; |
| 93 | - $html .= '<li class="' . implode(' ', $classes) .'">'; |
|
| 93 | + $html .= '<li class="'.implode(' ', $classes).'">'; |
|
| 94 | 94 | if ($link['title'] == 'Home') { |
| 95 | 95 | $link['title'] = bts('Home', array(), NULL, 'boinc:menu-link'); |
| 96 | 96 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | if ($link['href'] == 'dashboard') { |
| 100 | 100 | $item_count = privatemsg_unread_count(); |
| 101 | 101 | if ($item_count) { |
| 102 | - $link['title'] .= '</a> <a href="' . url('messages') . '" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
| 102 | + $link['title'] .= '</a> <a href="'.url('messages').'" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">'.$item_count.'</span></div>'; |
|
| 103 | 103 | $link['html'] = TRUE; |
| 104 | 104 | $link['attributes']['class'] = 'compound'; |
| 105 | 105 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | if ($link['href'] == 'moderate') { |
| 110 | 110 | $item_count = boincuser_moderation_queue_count(); |
| 111 | 111 | if ($item_count) { |
| 112 | - $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
| 112 | + $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">'.$item_count.'</span></div>'; |
|
| 113 | 113 | $link['html'] = TRUE; |
| 114 | 114 | } |
| 115 | 115 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $html .= '</li>'; |
| 118 | 118 | $i++; |
| 119 | 119 | } |
| 120 | - $html .= '</ul>' . "\n"; |
|
| 120 | + $html .= '</ul>'."\n"; |
|
| 121 | 121 | return $html; |
| 122 | 122 | } |
| 123 | 123 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | return ''; |
| 133 | 133 | } |
| 134 | 134 | else { |
| 135 | - return '<li '. ($active ? 'class="active" ' : '') .'>'. $link ."</li>\n"; |
|
| 135 | + return '<li '.($active ? 'class="active" ' : '').'>'.$link."</li>\n"; |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | if (empty($locality)) { |
| 198 | 198 | $locality = "en"; |
| 199 | 199 | } |
| 200 | - $vars['flag_path'] = base_path() . path_to_theme() . "/images/flags/{$locality}.png"; |
|
| 200 | + $vars['flag_path'] = base_path().path_to_theme()."/images/flags/{$locality}.png"; |
|
| 201 | 201 | |
| 202 | 202 | $server_status_url = variable_get('boinc_server_status_url', ''); |
| 203 | 203 | if (!$server_status_url) { |
@@ -219,16 +219,16 @@ discard block |
||
| 219 | 219 | if (arg(0) == 'search') { |
| 220 | 220 | unset($vars['title']); |
| 221 | 221 | } |
| 222 | - else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
| 222 | + else if ((arg(0) == 'account') AND (is_numeric(arg(1))) AND (empty(arg(2)))) { |
|
| 223 | 223 | unset($vars['title']); |
| 224 | 224 | } |
| 225 | - else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
| 225 | + else if ((arg(0) == 'account') AND (arg(1) == 'profile')) { |
|
| 226 | 226 | unset($vars['title']); |
| 227 | 227 | } |
| 228 | - else if ( (arg(0)=='dashboard') ) { |
|
| 228 | + else if ((arg(0) == 'dashboard')) { |
|
| 229 | 229 | unset($vars['title']); |
| 230 | 230 | } |
| 231 | - else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
| 231 | + else if ((arg(0) == 'community') AND ((arg(1) == 'teams') OR (arg(1) == 'stats'))) { |
|
| 232 | 232 | unset($vars['title']); |
| 233 | 233 | } |
| 234 | 234 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | $tab = str_replace('li class="', 'li class="first ', $tab); |
| 245 | 245 | } |
| 246 | 246 | if ($key == $last_key) { |
| 247 | - $tab = str_replace('li class="', 'li class="last ', $tab) . '</ul>'; |
|
| 247 | + $tab = str_replace('li class="', 'li class="last ', $tab).'</ul>'; |
|
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | elseif (strpos($tab, 'li ')) { |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $tab = str_replace('li ', 'li class="first" ', $tab); |
| 253 | 253 | } |
| 254 | 254 | if ($key == $last_key) { |
| 255 | - $tab = str_replace('li ', 'li class="last" ', $tab) . '</ul>'; |
|
| 255 | + $tab = str_replace('li ', 'li class="last" ', $tab).'</ul>'; |
|
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | // Optionally, run node-type-specific preprocess functions, like |
| 291 | 291 | // boinc_preprocess_node_page() or boinc_preprocess_node_story(). |
| 292 | - $function = __FUNCTION__ . '_' . $vars['node']->type; |
|
| 292 | + $function = __FUNCTION__.'_'.$vars['node']->type; |
|
| 293 | 293 | if (function_exists($function)) { |
| 294 | 294 | $function($vars, $hook); |
| 295 | 295 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | $vars['node']->comment = 0; |
| 341 | 341 | |
| 342 | 342 | $vars['first_page'] = (!isset($_GET['page']) OR ($_GET['page'] < 1)); |
| 343 | - $page_count = max(ceil($vars['comment_count'] / $comments_per_page), 1); |
|
| 343 | + $page_count = max(ceil($vars['comment_count']/$comments_per_page), 1); |
|
| 344 | 344 | $vars['last_page'] = ($page_count == 1 OR ($page_count > 1 AND $_GET['page'] == $page_count - 1)); |
| 345 | 345 | |
| 346 | 346 | $links = $vars['links']; |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | case 'boinc_host': |
| 453 | 453 | $view = views_get_current_view(); |
| 454 | 454 | if (!($view->result)) { |
| 455 | - $vars['footer'] = '<h3>' . bts ('Host not found in database.', array(), NULL, 'boinc:host-details') . '</h3>'; |
|
| 455 | + $vars['footer'] = '<h3>'.bts('Host not found in database.', array(), NULL, 'boinc:host-details').'</h3>'; |
|
| 456 | 456 | } |
| 457 | 457 | break; |
| 458 | 458 | case 'boinc_host_list': |
@@ -471,10 +471,10 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | if ($result) { |
| 473 | 473 | // Display the stderr output in the footer |
| 474 | - $vars['footer'] = '<h3>' . bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog') .'</h3>'; |
|
| 475 | - $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>'; |
|
| 474 | + $vars['footer'] = '<h3>'.bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog').'</h3>'; |
|
| 475 | + $vars['footer'] .= '<pre>'.htmlspecialchars($result->result_stderr_out).'</pre>'; |
|
| 476 | 476 | } else { |
| 477 | - $vars['footer'] = '<h3>' . bts ('Task not found in database.', array(), NULL, 'boinc:task-details') . '</h3>'; |
|
| 477 | + $vars['footer'] = '<h3>'.bts('Task not found in database.', array(), NULL, 'boinc:task-details').'</h3>'; |
|
| 478 | 478 | } |
| 479 | 479 | break; |
| 480 | 480 | case 'boinc_teams': |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | ob_start(); |
| 488 | 488 | // Get the workunit ID from the URL |
| 489 | 489 | $result_id = arg(1); |
| 490 | - require_boinc(array('util','boinc_db')); |
|
| 490 | + require_boinc(array('util', 'boinc_db')); |
|
| 491 | 491 | $wu = BoincWorkunit::lookup_id($result_id); |
| 492 | 492 | if ($wu) { |
| 493 | 493 | // Output from admin defined BOINC project-specific function |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | // Output of project_workunit() gets caught in the buffer |
| 496 | 496 | $vars['footer'] = ob_get_clean(); |
| 497 | 497 | } else { |
| 498 | - $vars['footer'] = '<h3>' . bts ('Workunit not found in database.', array(), NULL, 'boinc:workunit-details') . '</h3>'; |
|
| 498 | + $vars['footer'] = '<h3>'.bts('Workunit not found in database.', array(), NULL, 'boinc:workunit-details').'</h3>'; |
|
| 499 | 499 | } |
| 500 | 500 | default: |
| 501 | 501 | } |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | $author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
| 518 | 518 | } |
| 519 | 519 | elseif (is_string($user_image)) { |
| 520 | - $author_picture .= '<img src="' . $user_image . '"/>'; |
|
| 520 | + $author_picture .= '<img src="'.$user_image.'"/>'; |
|
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | 523 | $author_picture .= '</div>'; |
@@ -556,14 +556,14 @@ discard block |
||
| 556 | 556 | case 'profile': |
| 557 | 557 | case 'user': |
| 558 | 558 | $node = $variables['result']['node']; |
| 559 | - $variables['url'] = url('account/' . $node->is_uid); |
|
| 559 | + $variables['url'] = url('account/'.$node->is_uid); |
|
| 560 | 560 | $variables['title'] = $node->tos_name; |
| 561 | 561 | $variables['user_image'] = boincuser_get_user_profile_image($node->is_uid); |
| 562 | 562 | $variables['account'] = user_load($node->is_uid); |
| 563 | 563 | break; |
| 564 | 564 | case 'team': |
| 565 | 565 | $node = $variables['result']['node']; |
| 566 | - $variables['url'] = url('/community/teams/' . $node->entity_id);; |
|
| 566 | + $variables['url'] = url('/community/teams/'.$node->entity_id); ; |
|
| 567 | 567 | break; |
| 568 | 568 | case 'forum': |
| 569 | 569 | $node = $variables['result']['node']; |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | // Parent forum topic title |
| 582 | 582 | $variables['parent_title'] = $drupalnode->title; |
| 583 | 583 | // Link to the parent forum topic |
| 584 | - $variables['parent_topic'] = l($drupalnode->title, drupal_get_path_alias('node/' . $nid) ); |
|
| 584 | + $variables['parent_topic'] = l($drupalnode->title, drupal_get_path_alias('node/'.$nid)); |
|
| 585 | 585 | // Get the taxonomy for the node, creates a link to the parent forum |
| 586 | 586 | $taxonomy = reset($drupalnode->taxonomy); |
| 587 | 587 | if ($vocab = taxonomy_vocabulary_load($taxonomy->vid)) { |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | if (!arg(2)) { |
| 600 | 600 | $message = ''; |
| 601 | 601 | } |
| 602 | - return '<p>' . $message . '</p>'; |
|
| 602 | + return '<p>'.$message.'</p>'; |
|
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | /** |
@@ -615,11 +615,11 @@ discard block |
||
| 615 | 615 | |
| 616 | 616 | // Shorten the name when it is too long or it will break many tables. |
| 617 | 617 | if (drupal_strlen($name) > 20) { |
| 618 | - $name = drupal_substr($name, 0, 15) . '...'; |
|
| 618 | + $name = drupal_substr($name, 0, 15).'...'; |
|
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | if (user_access('access user profiles')) { |
| 622 | - $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
| 622 | + $output = l($name, 'account/'.$object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
| 623 | 623 | } |
| 624 | 624 | else { |
| 625 | 625 | $output = check_plain($name); |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | $output = check_plain($object->name); |
| 638 | 638 | } |
| 639 | 639 | |
| 640 | - $output .= ' (' . bts('not verified', array(), NULL, 'boinc:user-not-found') . ')'; |
|
| 640 | + $output .= ' ('.bts('not verified', array(), NULL, 'boinc:user-not-found').')'; |
|
| 641 | 641 | } |
| 642 | 642 | else { |
| 643 | 643 | $output = check_plain(variable_get('anonymous', bts('Anonymous', array(), NULL, 'boinc:anonymous-user'))); |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | * Remove the link under text areas that reads: |
| 651 | 651 | * "More information about formatting options" |
| 652 | 652 | */ |
| 653 | -function boinc_filter_tips_more_info () { |
|
| 653 | +function boinc_filter_tips_more_info() { |
|
| 654 | 654 | return ''; |
| 655 | 655 | } |
| 656 | 656 | |
@@ -692,8 +692,8 @@ discard block |
||
| 692 | 692 | The !site team', array( |
| 693 | 693 | '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
| 694 | 694 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
| 695 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 696 | - '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
| 695 | + '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message').': '.$flag->friend_message : '', |
|
| 696 | + '!link' => url('account/'.$sender->uid, array('absolute' => TRUE)), |
|
| 697 | 697 | ), array(), NULL, 'boinc:friend-request-email'); |
| 698 | 698 | break; |
| 699 | 699 | |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | The !site team', array( |
| 712 | 712 | '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
| 713 | 713 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
| 714 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 714 | + '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message').': '.$flag->friend_message : '', |
|
| 715 | 715 | '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
| 716 | 716 | ), |
| 717 | 717 | array(), NULL, 'boinc:friend-request-email'); |
@@ -724,13 +724,13 @@ discard block |
||
| 724 | 724 | * Edit action links |
| 725 | 725 | */ |
| 726 | 726 | function phptemplate_links($links, $attributes = array('class' => 'links')) { |
| 727 | - if ($links){ |
|
| 727 | + if ($links) { |
|
| 728 | 728 | // Remove flag-subscriptions link. It will be placed elsewhere. |
| 729 | 729 | if (isset($links['flag-subscriptions'])) { |
| 730 | 730 | unset($links['flag-subscriptions']); |
| 731 | 731 | } |
| 732 | 732 | // Reorder the links however you need them. |
| 733 | - $links = reorder_links($links, array('comment_edit','quote','comment_add','comment_reply','flag-abuse_comment','flag-abuse_node'), array('comment_delete')); |
|
| 733 | + $links = reorder_links($links, array('comment_edit', 'quote', 'comment_add', 'comment_reply', 'flag-abuse_comment', 'flag-abuse_node'), array('comment_delete')); |
|
| 734 | 734 | // Use the built-in theme_links() function to format the $links array. |
| 735 | 735 | return theme_links($links, $attributes); |
| 736 | 736 | } |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | // are the class attribute for the <li> tags. |
| 814 | 814 | $dom = new DOMDocument; |
| 815 | 815 | $dom->loadHTML(mb_convert_encoding($links, 'HTML-ENTITIES', 'UTF-8')); |
| 816 | - foreach($dom->getElementsByTagName('li') as $node) { |
|
| 816 | + foreach ($dom->getElementsByTagName('li') as $node) { |
|
| 817 | 817 | $key = $node->getAttribute("class"); |
| 818 | 818 | $alllinks[$key] = $dom->saveHTML($node); |
| 819 | 819 | } |
@@ -826,7 +826,7 @@ discard block |
||
| 826 | 826 | "hide", "unhide", |
| 827 | 827 | "comment_delete", |
| 828 | 828 | ); |
| 829 | - foreach(array_keys($alllinks) as $key1) { |
|
| 829 | + foreach (array_keys($alllinks) as $key1) { |
|
| 830 | 830 | // Select string up to first space, if present. |
| 831 | 831 | $class1 = strtok($key1, ' '); |
| 832 | 832 | if (in_array($class1, $selected_classes)) { |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | $dom->loadHTML(mb_convert_encoding($alink, 'HTML-ENTITIES', 'UTF-8')); |
| 856 | 856 | |
| 857 | 857 | $myli = $dom->getElementsByTagName('li'); |
| 858 | - if ($myli->length>0) { |
|
| 858 | + if ($myli->length > 0) { |
|
| 859 | 859 | $newclasses = trim(($myli[0]->getAttribute("class"))." first"); |
| 860 | 860 | $myli[0]->setAttribute("class", $newclasses); |
| 861 | 861 | $alink = $dom->saveHTML($myli[0]); |
@@ -872,13 +872,13 @@ discard block |
||
| 872 | 872 | |
| 873 | 873 | $output = '<ul class="menu"><li class="first">'; |
| 874 | 874 | if ($user->uid) { |
| 875 | - $output .= '<a href="' . url('logout') . '">' . bts('Logout', array(), NULL, 'boinc:menu-link') . '</a>'; |
|
| 875 | + $output .= '<a href="'.url('logout').'">'.bts('Logout', array(), NULL, 'boinc:menu-link').'</a>'; |
|
| 876 | 876 | } else { |
| 877 | - $output .= '<a href="' . url('user/login', array('query' => drupal_get_destination()) ) . '">' . bts('Login', array(), NULL, 'boinc:menu-link') . '</a>'; |
|
| 877 | + $output .= '<a href="'.url('user/login', array('query' => drupal_get_destination())).'">'.bts('Login', array(), NULL, 'boinc:menu-link').'</a>'; |
|
| 878 | 878 | } |
| 879 | 879 | $output .= '</li>'; |
| 880 | 880 | if (module_exists('global_search') OR module_exists('global_search_solr')) { |
| 881 | - $output .= '<li class="last"> <a class="search" href="' . url('search/site') . '">' . bts('search', array(), NULL, 'boinc:menu-link') .'</a> </l1>'; |
|
| 881 | + $output .= '<li class="last"> <a class="search" href="'.url('search/site').'">'.bts('search', array(), NULL, 'boinc:menu-link').'</a> </l1>'; |
|
| 882 | 882 | } |
| 883 | 883 | $output .= '</ul>'; |
| 884 | 884 | return $output; |
@@ -905,8 +905,8 @@ discard block |
||
| 905 | 905 | if ($ignored[$object->uid] == 0) { |
| 906 | 906 | $links['ignore_user'] = array( |
| 907 | 907 | 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
| 908 | - 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
|
| 909 | - 'query' => 'destination='. $_GET['q'], |
|
| 908 | + 'href' => 'account/prefs/privacy/ignore_user/add/'.$object->uid, |
|
| 909 | + 'query' => 'destination='.$_GET['q'], |
|
| 910 | 910 | 'attributes' => array( |
| 911 | 911 | 'class' => 'ignore-user', |
| 912 | 912 | 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
@@ -921,8 +921,8 @@ discard block |
||
| 921 | 921 | if ($ignored[$object->uid] == 0) { |
| 922 | 922 | $links['ignore_user'] = array( |
| 923 | 923 | 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
| 924 | - 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
|
| 925 | - 'query' => 'destination='. $_GET['q'], |
|
| 924 | + 'href' => 'account/prefs/privacy/ignore_user/add/'.$object->uid, |
|
| 925 | + 'query' => 'destination='.$_GET['q'], |
|
| 926 | 926 | 'attributes' => array( |
| 927 | 927 | 'class' => 'ignore-user', |
| 928 | 928 | 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
@@ -42,15 +42,15 @@ |
||
| 42 | 42 | $start_id = 0; //Set this to something else if you like |
| 43 | 43 | $profiles = _mysql_query("select * from profile where userid>$start_id order by userid"); |
| 44 | 44 | echo _mysql_error(); |
| 45 | - $i=0; |
|
| 46 | - while ($profile = _mysql_fetch_object($profiles)){ |
|
| 45 | + $i = 0; |
|
| 46 | + while ($profile = _mysql_fetch_object($profiles)) { |
|
| 47 | 47 | $i++; |
| 48 | 48 | if ($i%100 == 0) { //For every 100 profiles |
| 49 | - echo $profile->userid.". "; flush(); // print out where we are |
|
| 49 | + echo $profile->userid.". "; flush(); // print out where we are |
|
| 50 | 50 | //usleep(200000); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if ($profile->userid > $start_id){ |
|
| 53 | + if ($profile->userid > $start_id) { |
|
| 54 | 54 | fix_profile($profile); |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } else { |
| 68 | 68 | sort($files); |
| 69 | 69 | start_table(); |
| 70 | - table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete","Download"); |
|
| 70 | + table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete", "Download"); |
|
| 71 | 71 | foreach ($files as $f) { |
| 72 | 72 | $path = "$dir/$f"; |
| 73 | 73 | list($error, $size, $md5) = sandbox_parse_link_file($path); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $s = stat($tmp_name); |
| 118 | 118 | $size = $s['size']; |
| 119 | 119 | [$exists, $elf] = sandbox_lf_exists($user, $md5); |
| 120 | - if (!$exists){ |
|
| 120 | + if (!$exists) { |
|
| 121 | 121 | // move file to download dir |
| 122 | 122 | // |
| 123 | 123 | $phys_path = sandbox_physical_path($user, $md5); |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | error_page("physical file is missing"); |
| 151 | 151 | } |
| 152 | 152 | $bused = sandbox_file_in_use($user, $name); |
| 153 | - if ($bused){ |
|
| 153 | + if ($bused) { |
|
| 154 | 154 | $notice = "<strong>$name</strong> is being used by batch(es), you can not delete it now!<br/>"; |
| 155 | - } else{ |
|
| 155 | + } else { |
|
| 156 | 156 | unlink("$dir/$name"); |
| 157 | 157 | $notice = "<strong>$name</strong> was deleted from your sandbox<br/>"; |
| 158 | 158 | [$exists, $elf] = sandbox_lf_exists($user, $md5); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | if (!$action) $action = post_str('action', true); |
| 197 | 197 | |
| 198 | 198 | switch ($action) { |
| 199 | -case '': list_files($user,""); break; |
|
| 199 | +case '': list_files($user, ""); break; |
|
| 200 | 200 | case 'upload_file': upload_file($user); break; |
| 201 | 201 | case 'delete_file': delete_file($user); break; |
| 202 | 202 | case 'download_file': download_file($user); break; |
@@ -23,15 +23,15 @@ |
||
| 23 | 23 | admin_page_head("Account Ownership Keys"); |
| 24 | 24 | |
| 25 | 25 | if (!file_exists($account_ownership_private_key_file_path)) { |
| 26 | - echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
| 26 | + echo "<p>The account ownership private key '".$account_ownership_private_key_file_name."' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
| 27 | 27 | } else { |
| 28 | - echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' exists.</p>"; |
|
| 28 | + echo "<p>The account ownership private key '".$account_ownership_private_key_file_name."' exists.</p>"; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | if (!file_exists($account_ownership_public_key_file_path)) { |
| 32 | - echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
| 32 | + echo "<p>The account ownership public key '".$account_ownership_public_key_file_name."' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>"; |
|
| 33 | 33 | } else { |
| 34 | - echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' exists.</p>"; |
|
| 34 | + echo "<p>The account ownership public key '".$account_ownership_public_key_file_name."' exists.</p>"; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | echo "<p>For more info see the related wiki page: <a href=\"https://github.com/BOINC/boinc/wiki/ProofOfOwnership\">ProofOfOwnership</a></p>"; |
@@ -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/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 | ?> |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | define("FORUM_QA_MERGED_MODE", true); |
| 58 | 58 | // Set to true to merge Message boards and Q&A section |
| 59 | -define ("DISABLE_PROFILES", true); |
|
| 59 | +define("DISABLE_PROFILES", true); |
|
| 60 | 60 | // enable profiles only after enabling reCAPTCHA |
| 61 | 61 | // https://github.com/BOINC/boinc/wiki/ProtectionFromSpam |
| 62 | 62 | define("USE_STOPFORUMSPAM", true); |
@@ -193,15 +193,15 @@ discard block |
||
| 193 | 193 | </ol>", PROJECT); |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | -function project_workunit($wu){ |
|
| 196 | +function project_workunit($wu) { |
|
| 197 | 197 | // shown in the workunit page |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | -function project_user_summary($user){ |
|
| 200 | +function project_user_summary($user) { |
|
| 201 | 201 | // shown in the user summary page |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | -function project_user_page_private($user){ |
|
| 204 | +function project_user_page_private($user) { |
|
| 205 | 205 | // shown in the private account page |
| 206 | 206 | } |
| 207 | 207 | |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | array("name" => "Uppercase", "short_name" => "UC", "appids" => array(1, 25)), |
| 276 | 276 | ); |
| 277 | 277 | |
| 278 | -function project_user_credit($user){ |
|
| 278 | +function project_user_credit($user) { |
|
| 279 | 279 | global $sub_projects; |
| 280 | 280 | foreach ($sub_projects as $sp) { |
| 281 | 281 | show_app_credit_user($user, $sp["name"], $sp["appids"]); |