@@ -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 | } |
@@ -35,23 +35,23 @@ discard block |
||
35 | 35 | $openid = new LightOpenID; |
36 | 36 | echo "<pre>"; |
37 | 37 | print_r($openid); exit; |
38 | - if(!$openid->mode) { |
|
39 | - if(isset($_POST['openid_identifier'])) { |
|
38 | + if (!$openid->mode) { |
|
39 | + if (isset($_POST['openid_identifier'])) { |
|
40 | 40 | $openid->identity = $_POST['openid_identifier']; |
41 | 41 | $openid->required = array('namePerson/friendly', 'contact/email'); |
42 | 42 | $openid->optional = array('contact/country/home'); |
43 | - header('Location: ' . $openid->authUrl()); |
|
43 | + header('Location: '.$openid->authUrl()); |
|
44 | 44 | } |
45 | - if(isset($_GET['openid_identifier'])) { |
|
45 | + if (isset($_GET['openid_identifier'])) { |
|
46 | 46 | $openid->identity = $_GET['openid_identifier']; |
47 | 47 | $openid->required = array('namePerson/friendly', 'contact/email'); |
48 | 48 | $openid->optional = array('contact/country/home'); |
49 | - header('Location: ' . $openid->authUrl()); |
|
49 | + header('Location: '.$openid->authUrl()); |
|
50 | 50 | } |
51 | - } elseif($openid->mode == 'cancel') { |
|
51 | + } elseif ($openid->mode == 'cancel') { |
|
52 | 52 | echo 'User has canceled authentication!'; |
53 | 53 | } else { |
54 | - echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.'; |
|
54 | + echo 'User '.($openid->validate() ? $openid->identity.' has ' : 'has not ').'logged in.'; |
|
55 | 55 | //print_r($openid->getAttributes()); |
56 | 56 | // Create the user in the DB |
57 | 57 | $data = $openid->getAttributes(); |
@@ -125,13 +125,13 @@ discard block |
||
125 | 125 | |
126 | 126 | $user = make_user( |
127 | 127 | $new_email_addr, $new_name, $passwd_hash, |
128 | - $country, '', $project_prefs="", $teamid=0 |
|
128 | + $country, '', $project_prefs = "", $teamid = 0 |
|
129 | 129 | ); |
130 | 130 | if (!$user) { |
131 | 131 | show_error("Couldn't create account"); |
132 | 132 | } |
133 | 133 | |
134 | - if(defined('INVITE_CODES')) { |
|
134 | + if (defined('INVITE_CODES')) { |
|
135 | 135 | error_log("Account '$new_email_addr' created using invitation code '$invite_code'"); |
136 | 136 | } |
137 | 137 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | send_cookie('auth', $user->authenticator, true); |
154 | 154 | |
155 | 155 | } |
156 | -} catch(ErrorException $e) { |
|
156 | +} catch (ErrorException $e) { |
|
157 | 157 | echo $e->getMessage(); |
158 | 158 | } |
159 | 159 |
@@ -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 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | start_table(); |
42 | 42 | |
43 | 43 | $today = getdate(time()); |
44 | -$UOTD_heading = tra("User of the Day")." -- " . $today['month'] . " " . $today['mday'] . ", " . $today['year']; |
|
44 | +$UOTD_heading = tra("User of the Day")." -- ".$today['month']." ".$today['mday'].", ".$today['year']; |
|
45 | 45 | row1($UOTD_heading); |
46 | 46 | echo "<tr><td>"; |
47 | 47 | $profile = get_current_uotd(); |
@@ -59,15 +59,15 @@ discard block |
||
59 | 59 | row1(tra("User Profile Explorer")); |
60 | 60 | echo "<tr><td> |
61 | 61 | <ul> |
62 | - <li>".tra("View the %1 User Picture Gallery %2.", "<a href=\"" . url_base() . "user_profile/user_gallery_1.html\">", "</a>")."</li> |
|
63 | - <li>".tra("Browse profiles %1 by country %2.", "<a href=\"" . url_base() . "user_profile/profile_country.html\">", "</a>")."</li> |
|
62 | + <li>".tra("View the %1 User Picture Gallery %2.", "<a href=\"".url_base()."user_profile/user_gallery_1.html\">", "</a>")."</li> |
|
63 | + <li>".tra("Browse profiles %1 by country %2.", "<a href=\"".url_base()."user_profile/profile_country.html\">", "</a>")."</li> |
|
64 | 64 | <li>".tra("Browse profiles %1 at random %2, %3 at random with pictures %2, or %4 at random without pictures %2.", "<a href=\"?cmd=rand&pic=-1\">", "</a>", |
65 | 65 | "<a href=\"?cmd=rand&pic=1\">", "<a href=\"?cmd=rand&pic=0\">")."</li> |
66 | 66 | "; |
67 | -if (file_exists(PROFILE_PATH . "profile_alpha.html")) { |
|
67 | +if (file_exists(PROFILE_PATH."profile_alpha.html")) { |
|
68 | 68 | echo "<li>".tra("Alphabetical profile listings:")."<br>"; |
69 | 69 | |
70 | - include( PROFILE_PATH . "profile_alpha.html" ); |
|
70 | + include(PROFILE_PATH."profile_alpha.html"); |
|
71 | 71 | } |
72 | 72 | echo "</ul></td></tr>"; |
73 | 73 | |
@@ -110,5 +110,5 @@ discard block |
||
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
113 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
113 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
114 | 114 | ?> |
@@ -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) { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ) { |
78 | 78 | $badges = array(); |
79 | 79 | $limit = count($badge_level_names); |
80 | - for ($i=0; $i < $limit; $i++) { |
|
80 | + for ($i = 0; $i < $limit; $i++) { |
|
81 | 81 | $badges[$i] = get_badge($badge_name_prefix."_".$sub_project["short_name"]."_".$i, "$badge_level_names[$i] in ".$sub_project["name"]." credit", $sub_project["short_name"].$badge_images[$i]); |
82 | 82 | } |
83 | 83 | return $badges; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | // count from highest to lowest level, so the user get's assigned the |
91 | 91 | // highest possible level and the lower levels get removed |
92 | 92 | // |
93 | - for ($i=count($levels)-1; $i>=0; $i--) { |
|
93 | + for ($i = count($levels) - 1; $i >= 0; $i--) { |
|
94 | 94 | if ($item->total_credit >= $levels[$i]) { |
95 | 95 | assign_badge($is_user, $item, $badges[$i]); |
96 | 96 | unassign_badges($is_user, $item, $badges, $i); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | // count from highest to lowest level, so the user get's assigned the |
115 | 115 | // highest possible level and the lower levels get removed |
116 | 116 | // |
117 | - for ($i=count($levels)-1; $i>=0; $i--) { |
|
117 | + for ($i = count($levels) - 1; $i >= 0; $i--) { |
|
118 | 118 | if ($sub_total >= $levels[$i]) { |
119 | 119 | assign_badge($is_user, $item, $badges[$i]); |
120 | 120 | unassign_badges($is_user, $item, $badges, $i); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $is_user, $badge_levels, $badge_level_names, $badge_images, |
135 | 135 | $subprojects_list |
136 | 136 | ) { |
137 | - $kind = $is_user?"user":"team"; |
|
137 | + $kind = $is_user ? "user" : "team"; |
|
138 | 138 | |
139 | 139 | // get badges for all subprojects including total |
140 | 140 | // |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | $n = 0; |
146 | - $maxid = $is_user?BoincUser::max("id"):BoincTeam::max("id"); |
|
146 | + $maxid = $is_user ?BoincUser::max("id") : BoincTeam::max("id"); |
|
147 | 147 | while ($n <= $maxid) { |
148 | 148 | $m = $n + 1000; |
149 | 149 | if ($is_user) { |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | assign_tot_badge($is_user, $item, $badge_levels, $badges["total"]); |
162 | 162 | } else { |
163 | 163 | // appids come from project/project.inc |
164 | - $where_clause = "appid in (". implode(',', $sp["appids"]) .")"; |
|
164 | + $where_clause = "appid in (".implode(',', $sp["appids"]).")"; |
|
165 | 165 | assign_sub_badge( |
166 | 166 | $is_user, $item, $badge_levels, $badges[$sp["short_name"]], |
167 | 167 | $where_clause |