@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | echo "</tr>"; |
| 59 | 59 | |
| 60 | 60 | echo "<tr>"; |
| 61 | - echo "<th>" . tra("Rank") . "</th><th>" . tra("Name") . "</th>\n"; |
|
| 61 | + echo "<th>".tra("Rank")."</th><th>".tra("Name")."</th>\n"; |
|
| 62 | 62 | foreach ($apps as $app) { |
| 63 | 63 | for ($i = 0; $i < 2; $i++) { |
| 64 | 64 | $x = col_title($is_team, $app, $appid, $is_total, $i); |
@@ -78,13 +78,13 @@ discard block |
||
| 78 | 78 | echo "<tr>"; |
| 79 | 79 | echo "<td>$i</td>"; |
| 80 | 80 | |
| 81 | - echo "<td>" . $item[0][$x] . "</td>"; |
|
| 81 | + echo "<td>".$item[0][$x]."</td>"; |
|
| 82 | 82 | $y = 1; |
| 83 | 83 | foreach ($apps as $app) { |
| 84 | 84 | $z = 0; |
| 85 | - echo "<td>" . format_credit($item[$y][$x][$z]) . "</td>"; |
|
| 85 | + echo "<td>".format_credit($item[$y][$x][$z])."</td>"; |
|
| 86 | 86 | $z++; |
| 87 | - echo "<td>" . format_credit_large($item[$y][$x][$z]) . "</td>"; |
|
| 87 | + echo "<td>".format_credit_large($item[$y][$x][$z])."</td>"; |
|
| 88 | 88 | $y++; |
| 89 | 89 | } |
| 90 | 90 | echo "</tr>"; |
@@ -179,10 +179,10 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | if ($is_team) { |
| 181 | 181 | |
| 182 | - $data = BoincCreditTeam::get_list("appid=$appid", $x, $offset . ", " . $items_per_page); |
|
| 182 | + $data = BoincCreditTeam::get_list("appid=$appid", $x, $offset.", ".$items_per_page); |
|
| 183 | 183 | $store = retrieve_credit_team($data); |
| 184 | 184 | } else { |
| 185 | - $data = BoincCreditUser::get_list("appid=$appid", $x, $offset . ", " . $items_per_page); |
|
| 185 | + $data = BoincCreditUser::get_list("appid=$appid", $x, $offset.", ".$items_per_page); |
|
| 186 | 186 | $store = retrieve_credit_user($data); |
| 187 | 187 | } |
| 188 | 188 | |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | if (!$offset) |
| 199 | 199 | $offset = 0; |
| 200 | -if ($offset % $items_per_page) |
|
| 200 | +if ($offset%$items_per_page) |
|
| 201 | 201 | $offset = 0; |
| 202 | 202 | |
| 203 | 203 | $x = $is_team ? tra("Top teams by application") : tra("Top participants by application"); |
@@ -245,12 +245,12 @@ discard block |
||
| 245 | 245 | |
| 246 | 246 | if ($offset > 0) { |
| 247 | 247 | $new_offset = $offset - $items_per_page; |
| 248 | - echo "<a href=per_app_list.php?appid=$appid&is_team=$is_team&is_total=$is_total&offset=$new_offset>" . tra("Previous %1", $items_per_page) . "</a> · "; |
|
| 248 | + echo "<a href=per_app_list.php?appid=$appid&is_team=$is_team&is_total=$is_total&offset=$new_offset>".tra("Previous %1", $items_per_page)."</a> · "; |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | if (sizeof($data[0]) == $items_per_page) { |
| 252 | 252 | $new_offset = $offset + $items_per_page; |
| 253 | - echo "<a href=per_app_list.php?appid=$appid&is_team=$is_team&is_total=$is_total&offset=$new_offset>" . tra("Next %1", $items_per_page) . "</a>"; |
|
| 253 | + echo "<a href=per_app_list.php?appid=$appid&is_team=$is_team&is_total=$is_total&offset=$new_offset>".tra("Next %1", $items_per_page)."</a>"; |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | page_tail(); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | $stats_xml = NULL; |
| 75 | 75 | |
| 76 | - switch($chart_size) { |
|
| 76 | + switch ($chart_size) { |
|
| 77 | 77 | case 'small': |
| 78 | 78 | $cache_name .= "{$cpid}_small"; |
| 79 | 79 | $dataset_size = 30; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | // Initialize the cache object and flush stale images |
| 102 | - $myCache = new pCache(array('CacheFolder' => realpath('.') . '/' . conf_path() . '/files/cache')); |
|
| 102 | + $myCache = new pCache(array('CacheFolder' => realpath('.').'/'.conf_path().'/files/cache')); |
|
| 103 | 103 | $myCache->removeOlderThan(60*60*24); |
| 104 | 104 | |
| 105 | 105 | if ($myCache->isInCache($cache_name)) { |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | if ($stats_xml) { |
| 113 | 113 | // Get the last 60 days of stats for the chart |
| 114 | 114 | for ($j = 30; $j < 90; $j++) { |
| 115 | - $dataset[] = (int) $stats_xml->records->record[$j]; |
|
| 115 | + $dataset[] = (int)$stats_xml->records->record[$j]; |
|
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | else { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | $MyData->addPoints($dataset, 'series1'); |
| 133 | 133 | $MyData->setPalette('series1', $palette_color); |
| 134 | - $MyData->setAxisPosition(0,AXIS_POSITION_RIGHT); |
|
| 134 | + $MyData->setAxisPosition(0, AXIS_POSITION_RIGHT); |
|
| 135 | 135 | |
| 136 | 136 | // Create the pChart object |
| 137 | 137 | $myPicture = new pImage($chart_width, $chart_height, $MyData); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | if ($label_x_axis) { |
| 177 | 177 | for ($i = 5; $i >= 0; $i--) { |
| 178 | 178 | $label = ($i) ? -10*$i : 'Today'; |
| 179 | - $myPicture->drawText(589-587*($i/6)-5, 2, $label, array('Align' => TEXT_ALIGN_TOPRIGHT)); |
|
| 179 | + $myPicture->drawText(589 - 587*($i/6) - 5, 2, $label, array('Align' => TEXT_ALIGN_TOPRIGHT)); |
|
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | // Initialize the cache object and flush stale images |
| 224 | - $myCache = new pCache(array('CacheFolder' => realpath('.') . '/' . conf_path() . '/files/cache')); |
|
| 224 | + $myCache = new pCache(array('CacheFolder' => realpath('.').'/'.conf_path().'/files/cache')); |
|
| 225 | 225 | $myCache->removeOlderThan(60*60*24); |
| 226 | 226 | |
| 227 | 227 | if ($myCache->isInCache($cache_name)) { |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | if ($stats_xml) { |
| 235 | 235 | // Get the last 60 days of stats for the chart |
| 236 | 236 | for ($j = 30; $j < 90; $j++) { |
| 237 | - $dataset[] = (int) $stats_xml->records->record[$j]; |
|
| 237 | + $dataset[] = (int)$stats_xml->records->record[$j]; |
|
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | else { |
@@ -246,10 +246,10 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | $MyData->addPoints($dataset, 'series1'); |
| 248 | 248 | $MyData->setPalette('series1', $palette_color); |
| 249 | - $MyData->setAxisPosition(0,AXIS_POSITION_RIGHT); |
|
| 249 | + $MyData->setAxisPosition(0, AXIS_POSITION_RIGHT); |
|
| 250 | 250 | |
| 251 | 251 | // Create the pChart object |
| 252 | - $myPicture = new pImage(266,80,$MyData); |
|
| 252 | + $myPicture = new pImage(266, 80, $MyData); |
|
| 253 | 253 | |
| 254 | 254 | // Turn on Antialiasing |
| 255 | 255 | $myPicture->Antialias = true; |
@@ -258,8 +258,8 @@ discard block |
||
| 258 | 258 | //$myPicture->setFontProperties(array('FontName' => '../fonts/pf_arma_five.ttf','FontSize' => 6)); |
| 259 | 259 | |
| 260 | 260 | // Define the chart area |
| 261 | - $myPicture->setGraphArea(0,0,266,80); |
|
| 262 | - $myPicture->drawFilledRectangle(0,0,266,80,$backdrop_color); |
|
| 261 | + $myPicture->setGraphArea(0, 0, 266, 80); |
|
| 262 | + $myPicture->drawFilledRectangle(0, 0, 266, 80, $backdrop_color); |
|
| 263 | 263 | |
| 264 | 264 | // Draw the scale |
| 265 | 265 | $scaleSettings = array( |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | * |
| 308 | 308 | */ |
| 309 | 309 | function boincstats_check_cache_dir($cache_path = 'files/cache') { |
| 310 | - $cache_dir = realpath('.') . '/' . conf_path() . '/' . $cache_path; |
|
| 310 | + $cache_dir = realpath('.').'/'.conf_path().'/'.$cache_path; |
|
| 311 | 311 | if (!is_writeable($cache_dir)) { |
| 312 | 312 | if (!is_dir($cache_dir)) { |
| 313 | 313 | if (!is_writeable(dirname($cache_dir))) { |
@@ -369,13 +369,13 @@ discard block |
||
| 369 | 369 | $args = array(); |
| 370 | 370 | foreach ($get as $arg => $value) { |
| 371 | 371 | if ($value !== NULL) { |
| 372 | - $args[] = "{$arg}=" . rawurlencode($value); |
|
| 372 | + $args[] = "{$arg}=".rawurlencode($value); |
|
| 373 | 373 | } |
| 374 | 374 | else { |
| 375 | 375 | $args[] = $arg; |
| 376 | 376 | } |
| 377 | 377 | } |
| 378 | - $query = '?' . implode('&', $args); |
|
| 378 | + $query = '?'.implode('&', $args); |
|
| 379 | 379 | |
| 380 | 380 | // Load XML from RPC |
| 381 | 381 | $stats_xml = NULL; |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | function boincstats_get_project_total_credit() { |
| 395 | 395 | $stats_xml = boincstats_get_project_stats(); |
| 396 | 396 | $last_record = end($stats_xml->records->record); |
| 397 | - return ($last_record) ? (int) $last_record : 0; |
|
| 397 | + return ($last_record) ? (int)$last_record : 0; |
|
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | /* |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | * |
| 410 | 410 | */ |
| 411 | 411 | function boincstats_credit_to_ghours($credit) { |
| 412 | - return $credit / (100 * 365); |
|
| 412 | + return $credit/(100*365); |
|
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | /* |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | 't' => 6, |
| 423 | 423 | 'p' => 9 |
| 424 | 424 | ); |
| 425 | - return $credit / (pow(10, (int) $factor[$prefix]) / 10); |
|
| 425 | + return $credit/(pow(10, (int)$factor[$prefix])/10); |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | |
@@ -435,14 +435,14 @@ discard block |
||
| 435 | 435 | $output = ''; |
| 436 | 436 | switch ($type) { |
| 437 | 437 | case 'basic': |
| 438 | - $output .= '<div class="overlay"><span>(' . bts('Credits per day', array(), NULL, 'boinc:front-page') . ')</span></div>' . "\n"; |
|
| 439 | - $output .= '<div class="chart"><img src="' . $base_path . 'charts/project" /></div>' . "\n"; |
|
| 438 | + $output .= '<div class="overlay"><span>('.bts('Credits per day', array(), NULL, 'boinc:front-page').')</span></div>'."\n"; |
|
| 439 | + $output .= '<div class="chart"><img src="'.$base_path.'charts/project" /></div>'."\n"; |
|
| 440 | 440 | break; |
| 441 | 441 | case 'detailed': |
| 442 | - $output .= '<div class="stats"><label>' . bts('Total G-hours', array(), NULL, 'boinc:front-page') . ': </label><span>' . number_format(boincstats_credit_to_ghours(boincstats_get_project_total_credit())) . '</span></div>' . "\n"; |
|
| 443 | - $output .= '<div class="stats"><label>' . bts('Avg TFlops', array(), NULL, 'boinc:front-page') . ': </label><span>' . number_format(boincstats_credit_to_flops(boincstats_get_project_avg_credit(), 't')) . '</span></div>' . "\n"; |
|
| 442 | + $output .= '<div class="stats"><label>'.bts('Total G-hours', array(), NULL, 'boinc:front-page').': </label><span>'.number_format(boincstats_credit_to_ghours(boincstats_get_project_total_credit())).'</span></div>'."\n"; |
|
| 443 | + $output .= '<div class="stats"><label>'.bts('Avg TFlops', array(), NULL, 'boinc:front-page').': </label><span>'.number_format(boincstats_credit_to_flops(boincstats_get_project_avg_credit(), 't')).'</span></div>'."\n"; |
|
| 444 | 444 | //$output .= '<div class="stats"><a href="#">' . bts('Pending credits', array(), NULL, 'boinc:front-page') . '</a></div>' . "\n"; |
| 445 | - $output .= '<div class="chart"><img src="' . $base_path . 'charts/project" /></div>' . "\n"; |
|
| 445 | + $output .= '<div class="chart"><img src="'.$base_path.'charts/project" /></div>'."\n"; |
|
| 446 | 446 | break; |
| 447 | 447 | default: |
| 448 | 448 | } |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | case 'insert': |
| 31 | 31 | module_load_include('inc', 'drupal_queue', 'drupal_queue'); |
| 32 | 32 | $queue = DrupalQueue::get('flag_comment_notify'); |
| 33 | - $subscribed_users = array_keys((array) flag_get_content_flags('node', $a1['nid'], 'subscriptions')); |
|
| 33 | + $subscribed_users = array_keys((array)flag_get_content_flags('node', $a1['nid'], 'subscriptions')); |
|
| 34 | 34 | foreach ($subscribed_users as $uid) { |
| 35 | - $queue->createItem(array('uid' => $uid, 'cid' => (int) $a1['cid'])); |
|
| 35 | + $queue->createItem(array('uid' => $uid, 'cid' => (int)$a1['cid'])); |
|
| 36 | 36 | } |
| 37 | 37 | break; |
| 38 | 38 | default: |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | ); |
| 87 | 87 | $variables['!topic_name'] = $params['node']->title; |
| 88 | 88 | $variables['!author'] = $params['author']->name; |
| 89 | - switch($key) { |
|
| 89 | + switch ($key) { |
|
| 90 | 90 | case 'comment_posted': |
| 91 | 91 | $message['subject'] = bts('!site: comment posted to "!topic_name"', $variables, |
| 92 | 92 | $language->language, 'boinc:forum-topic-subscription-email-notification'); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | '#suffix' => '</li>', |
| 87 | 87 | ); |
| 88 | 88 | $form['form control tabs'] = array( |
| 89 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum/add', TRUE)) . '</li>' |
|
| 89 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum/add', TRUE)).'</li>' |
|
| 90 | 90 | ); |
| 91 | 91 | |
| 92 | 92 | $form['#redirect'] = "community/teams/{$account->team}"; |
@@ -152,9 +152,9 @@ discard block |
||
| 152 | 152 | updated = UNIX_TIMESTAMP()", |
| 153 | 153 | $account->team, |
| 154 | 154 | $values['title'], |
| 155 | - (int) $values['min_time_between_posts'], |
|
| 156 | - (int) $values['min_total_credit_to_post'], |
|
| 157 | - (int) $values['min_avg_credit_to_post'], |
|
| 155 | + (int)$values['min_time_between_posts'], |
|
| 156 | + (int)$values['min_total_credit_to_post'], |
|
| 157 | + (int)$values['min_avg_credit_to_post'], |
|
| 158 | 158 | ($values['public']) ? 1 : 0, |
| 159 | 159 | $values['description'] |
| 160 | 160 | ); |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | '#suffix' => '</li>', |
| 244 | 244 | ); |
| 245 | 245 | $form['form control tabs'] = array( |
| 246 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum', TRUE)) . '</li>' |
|
| 246 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum', TRUE)).'</li>' |
|
| 247 | 247 | ); |
| 248 | 248 | |
| 249 | 249 | $form['#redirect'] = "community/teams/{$boincteam_forum->nid}"; |
@@ -305,9 +305,9 @@ discard block |
||
| 305 | 305 | updated = UNIX_TIMESTAMP() |
| 306 | 306 | WHERE tfid='%d'", |
| 307 | 307 | $values['title'], |
| 308 | - (int) $values['min_time_between_posts'], |
|
| 309 | - (int) $values['min_total_credit_to_post'], |
|
| 310 | - (int) $values['min_avg_credit_to_post'], |
|
| 308 | + (int)$values['min_time_between_posts'], |
|
| 309 | + (int)$values['min_total_credit_to_post'], |
|
| 310 | + (int)$values['min_avg_credit_to_post'], |
|
| 311 | 311 | ($values['public']) ? 1 : 0, |
| 312 | 312 | $values['description'], |
| 313 | 313 | $tfid |
@@ -27,19 +27,19 @@ discard block |
||
| 27 | 27 | exit("Error: couldn't get log_dir from config file."); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -if( isset($_GET["f"]) ){ |
|
| 30 | +if (isset($_GET["f"])) { |
|
| 31 | 31 | $f = $_GET["f"]; |
| 32 | 32 | $f = escapeshellcmd($f); |
| 33 | 33 | } else { |
| 34 | 34 | $f = ""; |
| 35 | 35 | } |
| 36 | -if( isset($_GET["s"]) ){ |
|
| 36 | +if (isset($_GET["s"])) { |
|
| 37 | 37 | $s = $_GET["s"]; |
| 38 | 38 | $s = escapeshellcmd($s); |
| 39 | 39 | } else { |
| 40 | 40 | $s = ""; |
| 41 | 41 | } |
| 42 | -if( isset($_GET["l"]) ){ |
|
| 42 | +if (isset($_GET["l"])) { |
|
| 43 | 43 | $l = (int)$_GET["l"]; |
| 44 | 44 | } else { |
| 45 | 45 | $l = 0; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | echo 'Hint: Example greps: "RESULT#106876", "26fe99aa_25636_00119.wu_1", "WU#8152", "too many errors", "2003-07-17", "CRITICAL" <br>'; |
| 61 | 61 | |
| 62 | 62 | if (strlen($f)) { |
| 63 | - $f = "../log*/". $f; |
|
| 63 | + $f = "../log*/".$f; |
|
| 64 | 64 | } else { |
| 65 | 65 | $f = "../log*/*.log"; |
| 66 | 66 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | // changing the tree in a loop has strange results so do it separately |
| 77 | 77 | $to_remove = array(); |
| 78 | 78 | $ids = array(); |
| 79 | - foreach($appids as $elem) { |
|
| 79 | + foreach ($appids as $elem) { |
|
| 80 | 80 | $ids[] = $elem->nodeValue; |
| 81 | 81 | $to_remove[] = $elem; |
| 82 | 82 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | exit(1); |
| 95 | 95 | } |
| 96 | 96 | $appids = $node->getElementsByTagName("app_id"); |
| 97 | - if ($appids->length == 0 ) return; |
|
| 97 | + if ($appids->length == 0) return; |
|
| 98 | 98 | // changing the tree in a loop has strange results so do it separately |
| 99 | 99 | $to_remove = array(); |
| 100 | 100 | $ids = array(); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $to_remove = array(); |
| 130 | 130 | foreach ($subNodes as $subNode) { |
| 131 | 131 | // ignore empty text nodes which are basically whitespace from indentation (only relevant if preserveWhiteSpace is set to true above) |
| 132 | - if (($subNode->nodeType != XML_TEXT_NODE) || (($subNode->nodeType == XML_TEXT_NODE) &&(strlen(trim($subNode->wholeText))>=1))) { |
|
| 132 | + if (($subNode->nodeType != XML_TEXT_NODE) || (($subNode->nodeType == XML_TEXT_NODE) && (strlen(trim($subNode->wholeText)) >= 1))) { |
|
| 133 | 133 | if ($subNode->nodeName == "venue") { |
| 134 | 134 | if (!$subNode->hasChildNodes()) { |
| 135 | 135 | // empty venue tag, clean this up too |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | // In Drupal 7, these operation cases will all exist as their own hooks, |
| 80 | 80 | // so let's approximate that here so that this function can simply be removed |
| 81 | 81 | // upon migration to 7 |
| 82 | - switch($op) { |
|
| 82 | + switch ($op) { |
|
| 83 | 83 | case 'update': |
| 84 | 84 | boinctranslate_node_update($node); |
| 85 | 85 | break; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | function boinctranslate_node_update($node) { |
| 99 | 99 | // Only process nodes of certain types as defined by the individual |
| 100 | 100 | // node's setting for field_boinctranslate_transifex. |
| 101 | - if ( ($node->field_boinctranslate_transifex) and ($node->field_boinctranslate_transifex[0]['value']=='1') ) { |
|
| 101 | + if (($node->field_boinctranslate_transifex) and ($node->field_boinctranslate_transifex[0]['value'] == '1')) { |
|
| 102 | 102 | // Add page content to translation table. |
| 103 | 103 | $textgroup = 'project'; |
| 104 | 104 | $location = "node:{$node->nid}:body"; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | // Only process this chunk if there is a hash associated with it. |
| 127 | 127 | if ($chunk['hash']) { |
| 128 | - $chunkloc = $location . ":{$chunk['hash']}"; |
|
| 128 | + $chunkloc = $location.":{$chunk['hash']}"; |
|
| 129 | 129 | |
| 130 | 130 | // If the hash for this chunk is in the hash table, logically |
| 131 | 131 | // the chunk is already in the database locales_source table. As |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | * is viewed (forward compatible to Drupal 7) |
| 180 | 180 | */ |
| 181 | 181 | function boinctranslate_node_view($node, $view_mode, $langcode) { |
| 182 | - switch($node->type) { |
|
| 182 | + switch ($node->type) { |
|
| 183 | 183 | case 'page': |
| 184 | 184 | break; |
| 185 | 185 | default: |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | array( |
| 203 | 203 | '!token' => l('#SPLIT_TOKEN#', "filter/tips/$format", |
| 204 | 204 | array( |
| 205 | - 'fragment' => 'filter-boinctranslate-' . $delta, |
|
| 205 | + 'fragment' => 'filter-boinctranslate-'.$delta, |
|
| 206 | 206 | 'attributes' => |
| 207 | 207 | array( |
| 208 | 208 | 'target'=>'_blank', |
@@ -238,14 +238,14 @@ discard block |
||
| 238 | 238 | return $text; |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - if ( ($node->field_boinctranslate_transifex) and ($node->field_boinctranslate_transifex[0]['value']=='1') ) { |
|
| 241 | + if (($node->field_boinctranslate_transifex) and ($node->field_boinctranslate_transifex[0]['value'] == '1')) { |
|
| 242 | 242 | if (variable_get("boinctranslate_filter_debug_$format", 0)) { |
| 243 | 243 | $timing_start = explode(' ', microtime()); |
| 244 | 244 | $ret = _boinctranslate_filter_process($text, $format, $mynid); |
| 245 | 245 | $timing_stop = explode(' ', microtime()); |
| 246 | 246 | $elapsed = $timing_stop[1] - $timing_start[1]; |
| 247 | 247 | $elapsed += $timing_stop[0] - $timing_start[0]; |
| 248 | - $mess = 'DEBUG ' . l('BOINC translate', "filter/tips/$format") .' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.'; |
|
| 248 | + $mess = 'DEBUG '.l('BOINC translate', "filter/tips/$format").' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.'; |
|
| 249 | 249 | drupal_set_message($mess, 'warning'); |
| 250 | 250 | return $ret; |
| 251 | 251 | } |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $chunks = array(); |
| 309 | 309 | foreach ($parts as $key => $value) { |
| 310 | 310 | if (preg_match('/(#SPLIT_TOKEN#)/', $value)) { |
| 311 | - $chunks[] = array ('delimiter' => $value,); |
|
| 311 | + $chunks[] = array('delimiter' => $value,); |
|
| 312 | 312 | } |
| 313 | 313 | else { |
| 314 | 314 | $cleaned = preg_replace('/\s|\n/', '', $value); |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | // (so that bad guys can't tell if they have an unreplicated job) |
| 66 | 66 | |
| 67 | 67 | $config = get_config(); |
| 68 | - if ($app->target_nresults>0 && !$wu->canonical_resultid && !$wu->error_mask && !parse_bool($config, "dont_suppress_pending")) { |
|
| 68 | + if ($app->target_nresults > 0 && !$wu->canonical_resultid && !$wu->error_mask && !parse_bool($config, "dont_suppress_pending")) { |
|
| 69 | 69 | row2(tra("Tasks in progress"), tra("suppressed pending completion")); |
| 70 | 70 | end_table(); |
| 71 | 71 | } else { |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | // |
| 33 | 33 | function get_pct_badges($badge_name_prefix, $badge_pctiles, $badge_images) { |
| 34 | 34 | $badges = array(); |
| 35 | - for ($i=0; $i<3; $i++) { |
|
| 35 | + for ($i = 0; $i < 3; $i++) { |
|
| 36 | 36 | $badges[$i] = get_badge($badge_name_prefix."_".$i, "Top ".$badge_pctiles[$i]."% in average credit", $badge_images[$i]); |
| 37 | 37 | } |
| 38 | 38 | return $badges; |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | // |
| 43 | 43 | function get_percentiles($is_user, $badge_pctiles) { |
| 44 | 44 | $percentiles = array(); |
| 45 | - for ($i=0; $i<3; $i++) { |
|
| 45 | + for ($i = 0; $i < 3; $i++) { |
|
| 46 | 46 | if ($is_user) { |
| 47 | - $percentiles[$i] = BoincUser::percentile("expavg_credit", "expavg_credit>1", 100-$badge_pctiles[$i]); |
|
| 47 | + $percentiles[$i] = BoincUser::percentile("expavg_credit", "expavg_credit>1", 100 - $badge_pctiles[$i]); |
|
| 48 | 48 | } else { |
| 49 | - $percentiles[$i] = BoincTeam::percentile("expavg_credit", "expavg_credit>1", 100-$badge_pctiles[$i]); |
|
| 49 | + $percentiles[$i] = BoincTeam::percentile("expavg_credit", "expavg_credit>1", 100 - $badge_pctiles[$i]); |
|
| 50 | 50 | } |
| 51 | 51 | if ($percentiles[$i] === false) { |
| 52 | 52 | die("Can't get percentiles\n"); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | // Unassign other badges. |
| 60 | 60 | // |
| 61 | 61 | function assign_pct_badge($is_user, $item, $percentiles, $badges) { |
| 62 | - for ($i=0; $i<3; $i++) { |
|
| 62 | + for ($i = 0; $i < 3; $i++) { |
|
| 63 | 63 | if ($item->expavg_credit >= $percentiles[$i]) { |
| 64 | 64 | assign_badge($is_user, $item, $badges[$i]); |
| 65 | 65 | unassign_badges($is_user, $item, $badges, $i); |
@@ -73,13 +73,13 @@ discard block |
||
| 73 | 73 | // and assign/unassign RAC badges |
| 74 | 74 | // |
| 75 | 75 | function assign_badges($is_user, $badge_pctiles, $badge_images) { |
| 76 | - $kind = $is_user?"user":"team"; |
|
| 76 | + $kind = $is_user ? "user" : "team"; |
|
| 77 | 77 | $badges = get_pct_badges($kind."_pct", $badge_pctiles, $badge_images); |
| 78 | 78 | $pctiles = get_percentiles($is_user, $badge_pctiles); |
| 79 | 79 | //echo "thresholds for $kind badges: $pctiles[0] $pctiles[1] $pctiles[2]\n"; |
| 80 | 80 | |
| 81 | 81 | $n = 0; |
| 82 | - $maxid = $is_user?BoincUser::max("id"):BoincTeam::max("id"); |
|
| 82 | + $maxid = $is_user ?BoincUser::max("id") : BoincTeam::max("id"); |
|
| 83 | 83 | while ($n <= $maxid) { |
| 84 | 84 | $m = $n + 1000; |
| 85 | 85 | if ($is_user) { |