@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function zen_theme(&$existing, $type, $theme, $path) { |
24 | 24 | // When #341140 is fixed, replace _zen_path() with drupal_get_path(). |
25 | - include_once './' . _zen_path() . '/zen-internals/template.theme-registry.inc'; |
|
25 | + include_once './'._zen_path().'/zen-internals/template.theme-registry.inc'; |
|
26 | 26 | return _zen_theme($existing, $type, $theme, $path); |
27 | 27 | } |
28 | 28 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | elseif (theme_get_setting('zen_breadcrumb_trailing')) { |
58 | 58 | $trailing_separator = $breadcrumb_separator; |
59 | 59 | } |
60 | - return '<div class="breadcrumb">' . implode($breadcrumb_separator, $breadcrumb) . "$trailing_separator$title</div>"; |
|
60 | + return '<div class="breadcrumb">'.implode($breadcrumb_separator, $breadcrumb)."$trailing_separator$title</div>"; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | // Otherwise, return an empty string. |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | 'level' => 'h2', |
107 | 107 | ); |
108 | 108 | } |
109 | - $output .= '<' . $heading['level']; |
|
109 | + $output .= '<'.$heading['level']; |
|
110 | 110 | if (!empty($heading['class'])) { |
111 | 111 | $output .= drupal_attributes(array('class' => $heading['class'])); |
112 | 112 | } |
113 | - $output .= '>' . check_plain($heading['text']) . '</' . $heading['level'] . '>'; |
|
113 | + $output .= '>'.check_plain($heading['text']).'</'.$heading['level'].'>'; |
|
114 | 114 | } |
115 | 115 | |
116 | - $output .= '<ul'. drupal_attributes($attributes) .'>'; |
|
116 | + $output .= '<ul'.drupal_attributes($attributes).'>'; |
|
117 | 117 | |
118 | 118 | $num_links = count($links); |
119 | 119 | $i = 1; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | && (empty($link['language']) || $link['language']->language == $language->language)) { |
133 | 133 | $class .= ' active'; |
134 | 134 | } |
135 | - $output .= '<li'. drupal_attributes(array('class' => $class)) .'>'; |
|
135 | + $output .= '<li'.drupal_attributes(array('class' => $class)).'>'; |
|
136 | 136 | |
137 | 137 | if (isset($link['href'])) { |
138 | 138 | // Pass in $link as $options, they share the same keys. |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | if (isset($link['attributes'])) { |
148 | 148 | $span_attributes = drupal_attributes($link['attributes']); |
149 | 149 | } |
150 | - $output .= '<span'. $span_attributes .'>'. $link['title'] .'</span>'; |
|
150 | + $output .= '<span'.$span_attributes.'>'.$link['title'].'</span>'; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | $i++; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | // If an item is a LOCAL TASK, render it as a tab |
172 | 172 | if ($link['type'] & MENU_IS_LOCAL_TASK) { |
173 | - $link['title'] = '<span class="tab">' . check_plain($link['title']) . '</span>'; |
|
173 | + $link['title'] = '<span class="tab">'.check_plain($link['title']).'</span>'; |
|
174 | 174 | $link['localized_options']['html'] = TRUE; |
175 | 175 | } |
176 | 176 | |
@@ -195,10 +195,10 @@ discard block |
||
195 | 195 | } |
196 | 196 | |
197 | 197 | if ($primary) { |
198 | - $output .= '<ul class="tabs primary clearfix">' . $primary . '</ul>'; |
|
198 | + $output .= '<ul class="tabs primary clearfix">'.$primary.'</ul>'; |
|
199 | 199 | } |
200 | 200 | if ($secondary) { |
201 | - $output .= '<ul class="tabs secondary clearfix">' . $secondary . '</ul>'; |
|
201 | + $output .= '<ul class="tabs secondary clearfix">'.$secondary.'</ul>'; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | return $output; |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $elements['#region'] = $region; |
254 | 254 | |
255 | 255 | // Set the theme hook suggestions. |
256 | - $hook = array('region_' . $region); |
|
256 | + $hook = array('region_'.$region); |
|
257 | 257 | if (strpos($region, 'sidebar_') === 0) { |
258 | 258 | $hook[] = 'region_sidebar'; |
259 | 259 | } |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | // Views (and possibly other modules) have templates with a $classes |
296 | 296 | // variable that isn't a string, so we leave those variables alone. |
297 | 297 | if (is_string($vars[$key])) { |
298 | - $vars['classes_array'] = explode(' ', $hook . ' ' . $vars[$key]); |
|
298 | + $vars['classes_array'] = explode(' ', $hook.' '.$vars[$key]); |
|
299 | 299 | unset($vars[$key]); |
300 | 300 | } |
301 | 301 | } |
@@ -319,37 +319,37 @@ discard block |
||
319 | 319 | function zen_preprocess_page(&$vars, $hook) { |
320 | 320 | // If the user is silly and enables Zen as the theme, add some styles. |
321 | 321 | if ($GLOBALS['theme'] == 'zen') { |
322 | - include_once './' . _zen_path() . '/zen-internals/template.zen.inc'; |
|
322 | + include_once './'._zen_path().'/zen-internals/template.zen.inc'; |
|
323 | 323 | _zen_preprocess_page($vars, $hook); |
324 | 324 | } |
325 | 325 | // Add conditional stylesheets. |
326 | 326 | elseif (!module_exists('conditional_styles')) { |
327 | 327 | $language = $GLOBALS['language']->direction == LANGUAGE_RTL ? '_rtl' : ''; |
328 | - $vars['conditional_styles'] = variable_get('conditional_styles_' . $GLOBALS['theme'] . $language, ''); |
|
328 | + $vars['conditional_styles'] = variable_get('conditional_styles_'.$GLOBALS['theme'].$language, ''); |
|
329 | 329 | $vars['styles'] .= $vars['conditional_styles']; |
330 | 330 | } |
331 | 331 | |
332 | 332 | // Classes for body element. Allows advanced theming based on context |
333 | 333 | // (home page, node of certain type, etc.) |
334 | 334 | // Remove the mostly useless page-ARG0 class. |
335 | - if ($index = array_search(preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-'. drupal_strtolower(arg(0))), $vars['classes_array'])) { |
|
335 | + if ($index = array_search(preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-'.drupal_strtolower(arg(0))), $vars['classes_array'])) { |
|
336 | 336 | unset($vars['classes_array'][$index]); |
337 | 337 | } |
338 | 338 | if (!$vars['is_front']) { |
339 | 339 | // Add unique class for each page. |
340 | 340 | $path = drupal_get_path_alias($_GET['q']); |
341 | - $vars['classes_array'][] = drupal_html_class('page-' . $path); |
|
341 | + $vars['classes_array'][] = drupal_html_class('page-'.$path); |
|
342 | 342 | // Add unique class for each website section. |
343 | - list($section, ) = explode('/', $path, 2); |
|
343 | + list($section,) = explode('/', $path, 2); |
|
344 | 344 | if (arg(0) == 'node') { |
345 | 345 | if (arg(1) == 'add') { |
346 | 346 | $section = 'node-add'; |
347 | 347 | } |
348 | 348 | elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) { |
349 | - $section = 'node-' . arg(2); |
|
349 | + $section = 'node-'.arg(2); |
|
350 | 350 | } |
351 | 351 | } |
352 | - $vars['classes_array'][] = drupal_html_class('section-' . $section); |
|
352 | + $vars['classes_array'][] = drupal_html_class('section-'.$section); |
|
353 | 353 | } |
354 | 354 | if (theme_get_setting('zen_wireframes')) { |
355 | 355 | $vars['classes_array'][] = 'with-wireframes'; // Optionally add the wireframes style. |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | } |
377 | 377 | else { |
378 | 378 | $vars['classes_array'][] = 'one-sidebar'; |
379 | - $vars['classes_array'][] = 'sidebar-' . $vars['layout']; |
|
379 | + $vars['classes_array'][] = 'sidebar-'.$vars['layout']; |
|
380 | 380 | } |
381 | 381 | } |
382 | 382 | // Store the menu item since it has some useful information. |
@@ -406,13 +406,13 @@ discard block |
||
406 | 406 | function zen_preprocess_maintenance_page(&$vars, $hook) { |
407 | 407 | // If Zen is the maintenance theme, add some styles. |
408 | 408 | if ($GLOBALS['theme'] == 'zen') { |
409 | - include_once './' . _zen_path() . '/zen-internals/template.zen.inc'; |
|
409 | + include_once './'._zen_path().'/zen-internals/template.zen.inc'; |
|
410 | 410 | _zen_preprocess_page($vars, $hook); |
411 | 411 | } |
412 | 412 | // Add conditional stylesheets. |
413 | 413 | elseif (!module_exists('conditional_styles')) { |
414 | 414 | $language = $GLOBALS['language']->direction == LANGUAGE_RTL ? '_rtl' : ''; |
415 | - $vars['conditional_styles'] = variable_get('conditional_styles_' . $GLOBALS['theme'] . $language, ''); |
|
415 | + $vars['conditional_styles'] = variable_get('conditional_styles_'.$GLOBALS['theme'].$language, ''); |
|
416 | 416 | $vars['styles'] .= $vars['conditional_styles']; |
417 | 417 | } |
418 | 418 | } |
@@ -459,11 +459,11 @@ discard block |
||
459 | 459 | $vars['user_picture'] = $vars['picture']; |
460 | 460 | |
461 | 461 | // Create the Drupal 7 $display_submitted variable. |
462 | - $vars['display_submitted'] = theme_get_setting('toggle_node_info_' . $vars['node']->type); |
|
462 | + $vars['display_submitted'] = theme_get_setting('toggle_node_info_'.$vars['node']->type); |
|
463 | 463 | |
464 | 464 | // Special classes for nodes. |
465 | 465 | // Class for node type: "node-type-page", "node-type-story", "node-type-my-custom-type", etc. |
466 | - $vars['classes_array'][] = drupal_html_class('node-type-' . $vars['type']); |
|
466 | + $vars['classes_array'][] = drupal_html_class('node-type-'.$vars['type']); |
|
467 | 467 | if ($vars['promote']) { |
468 | 468 | $vars['classes_array'][] = 'node-promoted'; |
469 | 469 | } |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | if (isset($vars['preview'])) { |
487 | 487 | $vars['classes_array'][] = 'node-preview'; |
488 | 488 | } |
489 | - $vars['classes_array'][] = 'build-mode-' . $vars['build_mode'] ; |
|
489 | + $vars['classes_array'][] = 'build-mode-'.$vars['build_mode']; |
|
490 | 490 | } |
491 | 491 | |
492 | 492 | /** |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | * The name of the template being rendered ("comment" in this case.) |
499 | 499 | */ |
500 | 500 | function zen_preprocess_comment(&$vars, $hook) { |
501 | - include_once './' . _zen_path() . '/zen-internals/template.comment.inc'; |
|
501 | + include_once './'._zen_path().'/zen-internals/template.comment.inc'; |
|
502 | 502 | _zen_preprocess_comment($vars, $hook); |
503 | 503 | } |
504 | 504 | |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | $vars['region'] = $vars['elements']['#region']; |
517 | 517 | |
518 | 518 | // Setup the default classes. |
519 | - $vars['classes_array'] = array('region', 'region-' . str_replace('_', '-', $vars['region'])); |
|
519 | + $vars['classes_array'] = array('region', 'region-'.str_replace('_', '-', $vars['region'])); |
|
520 | 520 | |
521 | 521 | // Sidebar regions get a couple extra classes. |
522 | 522 | if (strpos($vars['region'], 'sidebar_') === 0) { |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | $vars['title'] = $block->subject; |
543 | 543 | |
544 | 544 | // Special classes for blocks. |
545 | - $vars['classes_array'][] = 'block-' . $block->module; |
|
545 | + $vars['classes_array'][] = 'block-'.$block->module; |
|
546 | 546 | // Classes describing the position of the block within the region. |
547 | 547 | if ($vars['block_id'] == 1) { |
548 | 548 | $vars['classes_array'][] = 'first'; |
@@ -550,17 +550,17 @@ discard block |
||
550 | 550 | if (!function_exists('context_blocks') && count(block_list($vars['block']->region)) == $vars['block_id']) { |
551 | 551 | $vars['classes_array'][] = 'last'; |
552 | 552 | } |
553 | - $vars['classes_array'][] = 'region-' . $vars['block_zebra']; |
|
553 | + $vars['classes_array'][] = 'region-'.$vars['block_zebra']; |
|
554 | 554 | $vars['classes_array'][] = $vars['zebra']; |
555 | - $vars['classes_array'][] = 'region-count-' . $vars['block_id']; |
|
556 | - $vars['classes_array'][] = 'count-' . $vars['id']; |
|
555 | + $vars['classes_array'][] = 'region-count-'.$vars['block_id']; |
|
556 | + $vars['classes_array'][] = 'count-'.$vars['id']; |
|
557 | 557 | |
558 | 558 | // Create the block ID. |
559 | - $vars['block_html_id'] = 'block-' . $block->module . '-' . $block->delta; |
|
559 | + $vars['block_html_id'] = 'block-'.$block->module.'-'.$block->delta; |
|
560 | 560 | |
561 | 561 | $vars['edit_links_array'] = array(); |
562 | 562 | if (theme_get_setting('zen_block_editing') && user_access('administer blocks')) { |
563 | - include_once './' . _zen_path() . '/zen-internals/template.block-editing.inc'; |
|
563 | + include_once './'._zen_path().'/zen-internals/template.block-editing.inc'; |
|
564 | 564 | zen_preprocess_block_editing($vars, $hook); |
565 | 565 | $vars['classes_array'][] = 'with-block-editing'; |
566 | 566 | } |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | * The name of the template being rendered ("block" in this case.) |
591 | 591 | */ |
592 | 592 | function zen_process_block(&$vars, $hook) { |
593 | - $vars['edit_links'] = !empty($vars['edit_links_array']) ? '<div class="edit">' . implode(' ', $vars['edit_links_array']) . '</div>' : ''; |
|
593 | + $vars['edit_links'] = !empty($vars['edit_links_array']) ? '<div class="edit">'.implode(' ', $vars['edit_links_array']).'</div>' : ''; |
|
594 | 594 | } |
595 | 595 | |
596 | 596 | if (!function_exists('drupal_html_class')) { |
@@ -32,7 +32,7 @@ |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | $offset = get_int("offset", true); |
35 | -if (!$offset) $offset=0; |
|
35 | +if (!$offset) $offset = 0; |
|
36 | 36 | |
37 | 37 | if ($offset > 1000) { |
38 | 38 | error_page(tra("Limit exceeded: Can only display the first 1000 members.")); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | function show_forum_rss_item($thread, $userid, $threads_only, $no_images) { |
33 | - $unique_url=secure_url_base()."forum_thread.php?id=".$thread->id; |
|
33 | + $unique_url = secure_url_base()."forum_thread.php?id=".$thread->id; |
|
34 | 34 | |
35 | 35 | $clause2 = " and hidden=0 "; |
36 | 36 | if ($userid) $clause2 .= "and user=$userid"; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | if (!count($posts)) return; |
43 | 43 | $post = $posts[0]; |
44 | - $post_date = gmdate('D, d M Y H:i:s',$post->timestamp).' GMT'; |
|
44 | + $post_date = gmdate('D, d M Y H:i:s', $post->timestamp).' GMT'; |
|
45 | 45 | $post_user = BOincUser::lookup_id($post->user); |
46 | 46 | BoincForumPrefs::lookup($post_user); |
47 | 47 | $options = new output_options(); |
@@ -84,25 +84,25 @@ discard block |
||
84 | 84 | |
85 | 85 | // Now construct header |
86 | 86 | // |
87 | - header ("Expires: " . gmdate('D, d M Y H:i:s', time()+86400) . " GMT"); |
|
87 | + header("Expires: ".gmdate('D, d M Y H:i:s', time() + 86400)." GMT"); |
|
88 | 88 | if (sizeof($threads)) { |
89 | 89 | $t = $threads[0]; |
90 | - $last_mod_time = $threads_only?$t->create_time:$t->timestamp; |
|
91 | - $create_date = gmdate('D, d M Y H:i:s', $last_mod_time) . ' GMT'; |
|
92 | - header ("Last-Modified: " . $create_date); |
|
90 | + $last_mod_time = $threads_only ? $t->create_time : $t->timestamp; |
|
91 | + $create_date = gmdate('D, d M Y H:i:s', $last_mod_time).' GMT'; |
|
92 | + header("Last-Modified: ".$create_date); |
|
93 | 93 | } else { |
94 | - $create_date = gmdate('D, d M Y H:i:s') . ' GMT'; |
|
94 | + $create_date = gmdate('D, d M Y H:i:s').' GMT'; |
|
95 | 95 | } |
96 | - header ("Content-Type: application/xml"); |
|
96 | + header("Content-Type: application/xml"); |
|
97 | 97 | |
98 | - $forum=BoincForum::lookup_id($forumid); |
|
98 | + $forum = BoincForum::lookup_id($forumid); |
|
99 | 99 | // Create channel header and open XML content |
100 | 100 | // |
101 | 101 | $description = PROJECT.": $forum->title"; |
102 | 102 | if ($userid) { |
103 | 103 | $description .= " (posts by $user->name)"; |
104 | 104 | } |
105 | - $channel_image = secure_url_base() . "rss_image.gif"; |
|
105 | + $channel_image = secure_url_base()."rss_image.gif"; |
|
106 | 106 | $language = "en-us"; |
107 | 107 | echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> |
108 | 108 | <rss version=\"2.0\"> |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | "Zimbabwe" |
258 | 258 | ); |
259 | 259 | |
260 | -$country_to_iso3166_2 = array ( |
|
260 | +$country_to_iso3166_2 = array( |
|
261 | 261 | "Afghanistan" => "af", |
262 | 262 | "Albania" => "al", |
263 | 263 | "Algeria" => "dz", |
@@ -493,25 +493,25 @@ discard block |
||
493 | 493 | |
494 | 494 | // return a list of country options for a <select> |
495 | 495 | // |
496 | -function country_select_options($selected_country="None") { |
|
496 | +function country_select_options($selected_country = "None") { |
|
497 | 497 | global $countries; |
498 | 498 | |
499 | 499 | require_once("../inc/geoip.inc"); |
500 | 500 | |
501 | 501 | // See if we can find the user's country and select it as default: |
502 | 502 | // |
503 | - $gi = geoip_open("../inc/GeoIP.dat",GEOIP_STANDARD); |
|
504 | - $geoip_country = geoip_country_name_by_addr($gi,$_SERVER["REMOTE_ADDR"]); |
|
503 | + $gi = geoip_open("../inc/GeoIP.dat", GEOIP_STANDARD); |
|
504 | + $geoip_country = geoip_country_name_by_addr($gi, $_SERVER["REMOTE_ADDR"]); |
|
505 | 505 | geoip_close($gi); |
506 | 506 | |
507 | - if ($selected_country=="") $selected_country="None"; |
|
508 | - if ($selected_country=="None" and $geoip_country!=""){ |
|
509 | - $selected_country=$geoip_country; |
|
507 | + if ($selected_country == "") $selected_country = "None"; |
|
508 | + if ($selected_country == "None" and $geoip_country != "") { |
|
509 | + $selected_country = $geoip_country; |
|
510 | 510 | } |
511 | 511 | |
512 | 512 | $x = ""; |
513 | 513 | foreach ($countries as $country) { |
514 | - $selected = ($selected_country == $country ? "selected":""); |
|
514 | + $selected = ($selected_country == $country ? "selected" : ""); |
|
515 | 515 | $x .= "<option value=\"$country\" $selected>$country</option>\n"; |
516 | 516 | } |
517 | 517 | return $x; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | new NUM_SPEC(tra("% of the CPUs"), 1, 100, 0) |
109 | 109 | ), |
110 | 110 | new PREF_NUM( |
111 | - tra("Use at most") ."<br><font size=-2>Requires BOINC 7.20.3+</font>", |
|
111 | + tra("Use at most")."<br><font size=-2>Requires BOINC 7.20.3+</font>", |
|
112 | 112 | // xgettext:no-php-format |
113 | 113 | tra("Suspend/resume computing every few seconds to reduce CPU temperature and energy usage. Example: 75% means compute for 3 seconds, wait for 1 second, and repeat."), |
114 | 114 | "niu_cpu_usage_limit", |
@@ -295,9 +295,9 @@ discard block |
||
295 | 295 | $dp->disk_max_used_pct = parse_config($config, "<default_disk_max_used_pct>"); |
296 | 296 | $dp->disk_min_free_gb = parse_config($config, "<default_disk_min_free_gb>"); |
297 | 297 | // set some defaults if not found |
298 | - if (!$dp->disk_max_used_gb) $dp->disk_max_used_gb = 0; // no limit |
|
298 | + if (!$dp->disk_max_used_gb) $dp->disk_max_used_gb = 0; // no limit |
|
299 | 299 | if (!$dp->disk_max_used_pct) $dp->disk_max_used_pct = 90; // 90 percent |
300 | - if (!$dp->disk_min_free_gb) $dp->disk_min_free_gb = 1; // 1 GB |
|
300 | + if (!$dp->disk_min_free_gb) $dp->disk_min_free_gb = 1; // 1 GB |
|
301 | 301 | // set mininimum free space scheduler allows |
302 | 302 | // - depends on which scheduler is running |
303 | 303 | $dp->new_sched_flag = 1; |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | global $text; |
324 | 324 | global $venue_name; |
325 | 325 | |
326 | - switch($name) { |
|
326 | + switch ($name) { |
|
327 | 327 | case "venue": |
328 | 328 | if (array_key_exists("name", $attrs)) { |
329 | 329 | $venue_name = $attrs["name"]; |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | return; |
374 | 374 | } |
375 | 375 | } |
376 | - switch($name) { |
|
376 | + switch ($name) { |
|
377 | 377 | case "venue": |
378 | 378 | $top_parse_result->$venue_name = $parse_result; |
379 | 379 | $parse_result = $top_parse_result; |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | } |
548 | 548 | } |
549 | 549 | |
550 | -function print_prefs_display_global($user, $columns=false) { |
|
550 | +function print_prefs_display_global($user, $columns = false) { |
|
551 | 551 | $global_prefs = prefs_parse_global($user->global_prefs); |
552 | 552 | |
553 | 553 | echo tra("These settings apply to all computers using this account except") |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | .tra("Android devices") |
558 | 558 | ."</ul> |
559 | 559 | "; |
560 | - $switch_link = " <font size=\"-1\"><a href=prefs.php?subset=global&cols=". (int)!$columns .">".tra("(Switch view)")."</a></font>"; |
|
560 | + $switch_link = " <font size=\"-1\"><a href=prefs.php?subset=global&cols=".(int)!$columns.">".tra("(Switch view)")."</a></font>"; |
|
561 | 561 | if ($columns) { |
562 | 562 | echo "<h3>".tra("Combined preferences").$switch_link."</h3>"; |
563 | 563 | start_table(); |
@@ -594,9 +594,9 @@ discard block |
||
594 | 594 | // otherwise false |
595 | 595 | // |
596 | 596 | function print_prefs_form( |
597 | - $action, $subset, $venue, $user, $prefs, $cols, $error=false, |
|
598 | - $project_error=false |
|
599 | -){ |
|
597 | + $action, $subset, $venue, $user, $prefs, $cols, $error = false, |
|
598 | + $project_error = false |
|
599 | +) { |
|
600 | 600 | if ($action == "add") { |
601 | 601 | $script = "add_venue.php"; |
602 | 602 | $submit_value = tra("Add preferences"); |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | // |
637 | 637 | // Functions to display preference subsets as forms |
638 | 638 | // |
639 | -function prefs_form_global($user, $prefs, $error=false) { |
|
639 | +function prefs_form_global($user, $prefs, $error = false) { |
|
640 | 640 | global $in_use_prefs; |
641 | 641 | global $not_in_use_prefs; |
642 | 642 | global $job_prefs; |
@@ -673,9 +673,9 @@ discard block |
||
673 | 673 | // |
674 | 674 | function prefs_form_radio_buttons($name, $yesno) { |
675 | 675 | $rb = tra("yes")." <input type=radio name=$name value=yes " |
676 | - .($yesno?"checked":"") |
|
676 | + .($yesno ? "checked" : "") |
|
677 | 677 | ."> ".tra("no")." <input type=radio name=$name value=no " |
678 | - .($yesno?"":"checked") |
|
678 | + .($yesno ? "" : "checked") |
|
679 | 679 | .">\n"; |
680 | 680 | return $rb; |
681 | 681 | } |
@@ -694,12 +694,12 @@ discard block |
||
694 | 694 | } |
695 | 695 | function venue_show($user) { |
696 | 696 | $venue = $user->venue; |
697 | - if ($venue =='') $venue = '---'; |
|
697 | + if ($venue == '') $venue = '---'; |
|
698 | 698 | tooltip_row2(VENUE_TOOLTIP, VENUE_DESC, $venue); |
699 | 699 | } |
700 | 700 | |
701 | 701 | function venue_form($user) { |
702 | - $n=$h=$w=$s=$m=''; |
|
702 | + $n = $h = $w = $s = $m = ''; |
|
703 | 703 | if ($user->venue == '') $n = 'selected'; |
704 | 704 | if ($user->venue == 'home') $h = 'selected'; |
705 | 705 | if ($user->venue == 'work') $w = 'selected'; |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | // |
758 | 758 | // convert prefs from structure to XML |
759 | 759 | // |
760 | -function global_prefs_make_xml($prefs, $primary=true) { |
|
760 | +function global_prefs_make_xml($prefs, $primary = true) { |
|
761 | 761 | global $in_use_prefs; |
762 | 762 | global $not_in_use_prefs; |
763 | 763 | global $job_prefs; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | db_init(); |
27 | 27 | |
28 | 28 | function current_tally($voteid) { |
29 | - $query="select sum(yes) as ayes,count(id)-sum(yes) as nays from banishment_votes where voteid=".$voteid; |
|
29 | + $query = "select sum(yes) as ayes,count(id)-sum(yes) as nays from banishment_votes where voteid=".$voteid; |
|
30 | 30 | $result = _mysql_query($query); |
31 | 31 | $foobar = _mysql_fetch_object($result); |
32 | 32 | echo "<b>Current Tally</b> Ayes: ".$foobar->ayes." Nays: ".$foobar->nays."<p>"; |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | |
36 | 36 | function vote_is_in_progress($userid) { |
37 | 37 | // check whether a vote is already ongoing |
38 | - $now=time(); |
|
39 | - $query="select count(id) as count from banishment_vote where userid=".$userid." and end_time>".$now; |
|
38 | + $now = time(); |
|
39 | + $query = "select count(id) as count from banishment_vote where userid=".$userid." and end_time>".$now; |
|
40 | 40 | $result = _mysql_query($query); |
41 | 41 | if (!$result) { |
42 | 42 | echo "Database error attempting to read banishment_vote table 1.<p>"; |
@@ -51,56 +51,56 @@ discard block |
||
51 | 51 | return $foobar->count; |
52 | 52 | } |
53 | 53 | |
54 | -function start_vote($config,$logged_in_user,$user,$category,$reason) { |
|
55 | - $now=time(); |
|
56 | - $fin=$now+21600; |
|
54 | +function start_vote($config, $logged_in_user, $user, $category, $reason) { |
|
55 | + $now = time(); |
|
56 | + $fin = $now + 21600; |
|
57 | 57 | |
58 | 58 | |
59 | - if ( vote_is_in_progress($user->id) !=0 ) { |
|
59 | + if (vote_is_in_progress($user->id) != 0) { |
|
60 | 60 | echo "A banishment vote is already underway for this user.<p>"; |
61 | 61 | return 0; |
62 | 62 | } |
63 | - $query="insert into banishment_vote (userid,modid,start_time,end_time) values (".$user->id.",".$logged_in_user->id.",".$now.",".$fin.")"; |
|
63 | + $query = "insert into banishment_vote (userid,modid,start_time,end_time) values (".$user->id.",".$logged_in_user->id.",".$now.",".$fin.")"; |
|
64 | 64 | $result = _mysql_query($query); |
65 | 65 | if (!$result) { |
66 | 66 | echo "Database error attempting to insert to banishment_vote table.<p>"; |
67 | 67 | return 0; |
68 | 68 | } |
69 | 69 | |
70 | - $voteid=_mysql_insert_id(); |
|
71 | - $query="insert into banishment_votes (voteid,modid,time,yes) values (". $voteid .",". $logged_in_user->id .",". $now .",1)"; |
|
70 | + $voteid = _mysql_insert_id(); |
|
71 | + $query = "insert into banishment_votes (voteid,modid,time,yes) values (".$voteid.",".$logged_in_user->id.",".$now.",1)"; |
|
72 | 72 | $result = _mysql_query($query); |
73 | 73 | if (!$result) { |
74 | 74 | echo "Database error attempting to insert to banishment_votes table.<p>"; |
75 | 75 | return 0; |
76 | 76 | } |
77 | 77 | |
78 | - $query="update forum_preferences set banished_until=".$fin." where userid=".$user->id; |
|
78 | + $query = "update forum_preferences set banished_until=".$fin." where userid=".$user->id; |
|
79 | 79 | $result = _mysql_query($query); |
80 | 80 | |
81 | 81 | echo "Banishment vote started.<p><p>"; |
82 | 82 | current_tally($voteid); |
83 | - return send_banish_vote_email($user, 86400*14, $reason, $now+21600); |
|
83 | + return send_banish_vote_email($user, 86400*14, $reason, $now + 21600); |
|
84 | 84 | } |
85 | 85 | |
86 | -function vote_yes($config,$logged_in_user,$user) { |
|
87 | - $now=time(); |
|
86 | +function vote_yes($config, $logged_in_user, $user) { |
|
87 | + $now = time(); |
|
88 | 88 | // Check that a vote is underway. |
89 | - if (vote_is_in_progress($user->id)<1) { |
|
89 | + if (vote_is_in_progress($user->id) < 1) { |
|
90 | 90 | echo "No banishment vote is underway for this user.<p><p>"; |
91 | 91 | return 0; |
92 | 92 | } |
93 | 93 | // Find the voteid |
94 | - $query="select id as voteid from banishment_vote where userid=".$user->id." and end_time>".$now; |
|
94 | + $query = "select id as voteid from banishment_vote where userid=".$user->id." and end_time>".$now; |
|
95 | 95 | $result = _mysql_query($query); |
96 | 96 | $foobar = _mysql_fetch_object($result); |
97 | 97 | if (!$foobar) { |
98 | 98 | echo "Database error attempting to read banishment_vote table.<p>"; |
99 | 99 | return 0; |
100 | 100 | } |
101 | - $voteid=$foobar->voteid; |
|
101 | + $voteid = $foobar->voteid; |
|
102 | 102 | // Check whether mod has voted already. |
103 | - $query="select count(id) as count from banishment_votes where voteid=".$voteid." and modid=".$logged_in_user->id; |
|
103 | + $query = "select count(id) as count from banishment_votes where voteid=".$voteid." and modid=".$logged_in_user->id; |
|
104 | 104 | $result = _mysql_query($query); |
105 | 105 | $foobar = _mysql_fetch_object($result); |
106 | 106 | if (!$foobar) { |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | return 0; |
114 | 114 | } |
115 | 115 | // insert the vote |
116 | - $query="insert into banishment_votes (voteid,modid,time,yes) values (" . $voteid .",". $logged_in_user->id .",". $now .",1)"; |
|
116 | + $query = "insert into banishment_votes (voteid,modid,time,yes) values (".$voteid.",".$logged_in_user->id.",".$now.",1)"; |
|
117 | 117 | $result = _mysql_query($query); |
118 | 118 | if (!$result) { |
119 | 119 | echo "Database error attempting to insert to banishment_votes table.<p>"; |
@@ -124,24 +124,24 @@ discard block |
||
124 | 124 | return 1; |
125 | 125 | } |
126 | 126 | |
127 | -function vote_no($config,$logged_in_user,$user) { |
|
127 | +function vote_no($config, $logged_in_user, $user) { |
|
128 | 128 | // Check that a vote is underway. |
129 | - $now=time(); |
|
130 | - if (vote_is_in_progress($user->id)<1) { |
|
129 | + $now = time(); |
|
130 | + if (vote_is_in_progress($user->id) < 1) { |
|
131 | 131 | echo "No banishment vote is underway for this user.<p>"; |
132 | 132 | return 0; |
133 | 133 | } |
134 | 134 | // Find the voteid |
135 | - $query="select id as voteid from banishment_vote where userid=".$user->id." and end_time>".$now; |
|
135 | + $query = "select id as voteid from banishment_vote where userid=".$user->id." and end_time>".$now; |
|
136 | 136 | $result = _mysql_query($query); |
137 | 137 | $foobar = _mysql_fetch_object($result); |
138 | 138 | if (!$foobar) { |
139 | 139 | echo "Database error attempting to read banishment_vote table.<p>"; |
140 | 140 | return 0; |
141 | 141 | } |
142 | - $voteid=$foobar->voteid; |
|
142 | + $voteid = $foobar->voteid; |
|
143 | 143 | // Check whether mod has voted already. |
144 | - $query="select count(id) as count from banishment_votes where voteid=".$voteid ." and modid=".$logged_in_user->id; |
|
144 | + $query = "select count(id) as count from banishment_votes where voteid=".$voteid." and modid=".$logged_in_user->id; |
|
145 | 145 | $result = _mysql_query($query); |
146 | 146 | $foobar = _mysql_fetch_object($result); |
147 | 147 | if (!$foobar) { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | return 0; |
155 | 155 | } |
156 | 156 | // insert the vote |
157 | - $query="insert into banishment_votes (voteid,modid,time,yes) values (" . $voteid .",". $logged_in_user->id .",". $now .",0)"; |
|
157 | + $query = "insert into banishment_votes (voteid,modid,time,yes) values (".$voteid.",".$logged_in_user->id.",".$now.",0)"; |
|
158 | 158 | $result = _mysql_query($query); |
159 | 159 | if (!$result) { |
160 | 160 | echo "Database error attempting to insert to banishment_votes table.<p>"; |
@@ -25,17 +25,17 @@ |
||
25 | 25 | page_head(tra("Download BOINC add-on software")); |
26 | 26 | echo " |
27 | 27 | <p>" . |
28 | - tra("You can download applications in several categories.") ." |
|
28 | + tra("You can download applications in several categories.")." |
|
29 | 29 | <ul> |
30 | 30 | <li>". |
31 | - tra("These applications are not endorsed by %1 and you use them at your own risk.", PROJECT) ." |
|
31 | + tra("These applications are not endorsed by %1 and you use them at your own risk.", PROJECT)." |
|
32 | 32 | <li>" . |
33 | 33 | tra("We do not provide instructions for installing these applications. |
34 | 34 | However, the author may have provided some help on installing or uninstalling the application. |
35 | 35 | If this is not enough you should contact the author."). |
36 | 36 | tra("Instructions for installing and running BOINC are %1 here %2.", "<a href=https://boinc.berkeley.edu/download.php>", "</a>") |
37 | - . "<li>" . |
|
38 | - tra("This list is managed centrally at %1 the BOINC website %2.", "<a href=\"https://boinc.berkeley.edu/addons.php\">", "</a>") ." |
|
37 | + . "<li>". |
|
38 | + tra("This list is managed centrally at %1 the BOINC website %2.", "<a href=\"https://boinc.berkeley.edu/addons.php\">", "</a>")." |
|
39 | 39 | </ul> |
40 | 40 | "; |
41 | 41 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | // where team includes a field "refcnt". |
32 | 32 | // |
33 | 33 | function merge_lists($list1, &$list2, $weight) { |
34 | - foreach($list1 as $team) { |
|
34 | + foreach ($list1 as $team) { |
|
35 | 35 | $id = $team->id; |
36 | 36 | if (array_key_exists($id, $list2)) { |
37 | 37 | $list2[$id]->refcnt += $weight; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if (defined("SHOW_NONVALIDATED_TEAMS")) { |
98 | 98 | $user = BoincUser::lookup_id($team->userid); |
99 | 99 | echo "<td>"; |
100 | - echo $user->email_validated?"Yes":"No"; |
|
100 | + echo $user->email_validated ? "Yes" : "No"; |
|
101 | 101 | echo "</td>\n"; |
102 | 102 | } |
103 | 103 | echo " |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | xml_header(); |
138 | 138 | echo "<teams>\n"; |
139 | 139 | sort_list($list); |
140 | - foreach($list as $team) { |
|
140 | + foreach ($list as $team) { |
|
141 | 141 | show_team_xml($team); |
142 | 142 | } |
143 | 143 | echo "</teams>\n"; |
@@ -164,14 +164,14 @@ discard block |
||
164 | 164 | merge_lists($list2, $list, 3); |
165 | 165 | $tried = true; |
166 | 166 | } |
167 | - if (strlen($params->country) && $params->country!='None') { |
|
167 | + if (strlen($params->country) && $params->country != 'None') { |
|
168 | 168 | $country = BoincDb::escape_string($params->country); |
169 | 169 | $list2 = get_teams("country = '$country'", $params->active); |
170 | 170 | //echo "<br>country matches: ",sizeof($list2); |
171 | 171 | merge_lists($list2, $list, 1); |
172 | 172 | $tried = true; |
173 | 173 | } |
174 | - if ($params->type and $params->type>1) { |
|
174 | + if ($params->type and $params->type > 1) { |
|
175 | 175 | $list2 = get_teams("type=$params->type", $params->active); |
176 | 176 | //echo "<br>type matches: ",sizeof($list2); |
177 | 177 | merge_lists($list2, $list, 2); |
@@ -35,14 +35,14 @@ |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | $owner = BoincUser::lookup_id($thread->owner); |
38 | -if ($logged_in_user->id == $owner->id){ |
|
38 | +if ($logged_in_user->id == $owner->id) { |
|
39 | 39 | $action = get_str("action"); |
40 | 40 | if ($action == "set") { |
41 | 41 | $ret = $thread->update("status=1"); |
42 | 42 | } else { |
43 | 43 | $ret = $thread->update("status=0"); |
44 | 44 | } |
45 | - if (!$ret){ |
|
45 | + if (!$ret) { |
|
46 | 46 | error_page("Could not update the status of the thread: ".$thread->id); |
47 | 47 | } |
48 | 48 | } else { |