@@ -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>"; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | } |
137 | 137 | } |
138 | 138 | if ($fp_total) { |
139 | - $batch->fraction_done = $fp_done / $fp_total; |
|
139 | + $batch->fraction_done = $fp_done/$fp_total; |
|
140 | 140 | } |
141 | 141 | if ($completed && $batch->state == BATCH_STATE_IN_PROGRESS) { |
142 | 142 | $batch->state = BATCH_STATE_COMPLETE; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | // get the total size of output files of a batch |
228 | 228 | // |
229 | 229 | function batch_output_file_size($batchid) { |
230 | - $batch_td_size=0; |
|
230 | + $batch_td_size = 0; |
|
231 | 231 | $wus = BoincWorkunit::enum("batch=$batchid"); |
232 | 232 | $fanout = parse_config(get_config(), "<uldl_dir_fanout>"); |
233 | 233 | $upload_dir = parse_config(get_config(), "<upload_dir>"); |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | } |
258 | 258 | |
259 | 259 | function boinc_get_wu_output_files_url($user, $wu_id) { |
260 | - $auth_str = md5($user->authenticator.$wu_id); |
|
260 | + $auth_str = md5($user->authenticator.$wu_id); |
|
261 | 261 | return "get_output.php?cmd=workunit_files&wu_id=$wu_id&auth_str=$auth_str"; |
262 | 262 | } |
263 | 263 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | function upload_path($filename) { |
40 | - static $upload_dir=null; |
|
40 | + static $upload_dir = null; |
|
41 | 41 | if (!$upload_dir) { |
42 | 42 | $config = get_config(); |
43 | 43 | $upload_dir = parse_config($config, '<upload_dir>'); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | if ($user->authenticator != $auth) die('bad auth'); |
52 | 52 | } |
53 | 53 | |
54 | -function do_result_aux($result, $batch, $file_num=null) { |
|
54 | +function do_result_aux($result, $batch, $file_num = null) { |
|
55 | 55 | $phys_names = get_outfile_names($result); |
56 | 56 | $log_names = get_outfile_log_names($result); |
57 | 57 | if ($file_num !== null) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $dir_path = "submit/$batch->id/$result->name"; |
72 | 72 | system("rm -r $dir_path"); |
73 | 73 | mkdir($dir_path); |
74 | - for ($i=0; $i<count($phys_names); $i++) { |
|
74 | + for ($i = 0; $i < count($phys_names); $i++) { |
|
75 | 75 | $cmd = sprintf('ln -s %s %s/%s', |
76 | 76 | upload_path($phys_names[$i]), |
77 | 77 | $dir_path, |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | -function do_result($result_id, $auth, $file_num=null) { |
|
91 | +function do_result($result_id, $auth, $file_num = null) { |
|
92 | 92 | $result = BoincResult::lookup_id($result_id); |
93 | 93 | if (!$result) die("no result $result_id"); |
94 | 94 | $workunit = BoincWorkunit::lookup_id($result->workunitid); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | system($cmd); |
136 | 136 | } else { |
137 | 137 | mkdir(sprintf('%s/%s', $dir_path, $result->name)); |
138 | - for ($i=0; $i<count($phys_names); $i++) { |
|
138 | + for ($i = 0; $i < count($phys_names); $i++) { |
|
139 | 139 | $cmd = sprintf('ln -s %s %s/%s/%s', |
140 | 140 | upload_path($phys_names[$i]), |
141 | 141 | $dir_path, |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | credit_to_ops($credit, $ops, $unit); |
44 | 44 | |
45 | 45 | if ($bolden) { |
46 | - $lbold="[["; |
|
47 | - $rbold="]]"; |
|
46 | + $lbold = "[["; |
|
47 | + $rbold = "]]"; |
|
48 | 48 | } else { |
49 | - $lbold=""; $rbold=""; |
|
49 | + $lbold = ""; $rbold = ""; |
|
50 | 50 | } |
51 | 51 | return " $lbold$cobbs Cobblestones$rbold of computation ($ops $unit floating-point operations)"; |
52 | 52 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | // |
87 | 87 | function show_share_buttons() { |
88 | 88 | echo '<p>'; |
89 | - $current_url = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; |
|
89 | + $current_url = (empty($_SERVER['HTTPS']) ? 'http' : 'https')."://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; |
|
90 | 90 | $cert_url = urlencode($current_url); |
91 | 91 | |
92 | 92 | // Share on Facebook |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | if (DISABLE_TEAMS) error_page("Teams are disabled"); |
28 | 28 | |
29 | 29 | $border = get_str("border", true); |
30 | -if ($border=="no") { |
|
31 | - $border=0; |
|
30 | +if ($border == "no") { |
|
31 | + $border = 0; |
|
32 | 32 | } else { |
33 | - $border=8; |
|
33 | + $border = 8; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // Make sure user_id is in the URL so that share functions work |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | if (!$user_id) { |
40 | 40 | $user = get_logged_in_user(); |
41 | 41 | Header(sprintf('Location: %s/cert_team.php?user_id=%d%s', |
42 | - url_base(), $user->id, $border==0?'&border=no':'' |
|
42 | + url_base(), $user->id, $border == 0 ? '&border=no' : '' |
|
43 | 43 | )); |
44 | 44 | exit; |
45 | 45 | } |