@@ -27,19 +27,19 @@ |
||
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; |
@@ -387,8 +387,7 @@ |
||
387 | 387 | $team = node_load($nid); |
388 | 388 | $output .= '<p>' . bts('You may create a message board for use by @team', |
389 | 389 | array('@team' => $team->title), NULL, 'boinc:team-forum') . ':</p>'; |
390 | - } |
|
391 | - else { |
|
390 | + } else { |
|
392 | 391 | $output .= '<p>' . bts('This is a team-only message board', array(), NULL, 'boinc:team-forum') . ':</p>'; |
393 | 392 | } |
394 | 393 | $output .= '<ul>'; |
@@ -136,8 +136,7 @@ discard block |
||
136 | 136 | $lidkey = array_search($chunk['hash'], $nodehashtable); |
137 | 137 | if ($lidkey) { |
138 | 138 | unset($nodehashtable[$lidkey]); |
139 | - } |
|
140 | - else { |
|
139 | + } else { |
|
141 | 140 | |
142 | 141 | $result = db_query(" |
143 | 142 | INSERT INTO {locales_source} |
@@ -150,8 +149,7 @@ discard block |
||
150 | 149 | 'Added translation source strings for node @nid chunk @chunk.', |
151 | 150 | array('@nid' => $node->nid, '@chunk' => $idx) |
152 | 151 | ); |
153 | - } |
|
154 | - else { |
|
152 | + } else { |
|
155 | 153 | drupal_set_message( |
156 | 154 | t('ERROR: Unable to add translation source strings.'), 'error' |
157 | 155 | ); |
@@ -248,12 +246,10 @@ discard block |
||
248 | 246 | $mess = 'DEBUG ' . l('BOINC translate', "filter/tips/$format") .' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.'; |
249 | 247 | drupal_set_message($mess, 'warning'); |
250 | 248 | return $ret; |
251 | - } |
|
252 | - else { |
|
249 | + } else { |
|
253 | 250 | return _boinctranslate_filter_process($text, $format, $mynid); |
254 | 251 | }// if debug |
255 | - } |
|
256 | - else { |
|
252 | + } else { |
|
257 | 253 | return $text; |
258 | 254 | }// if type |
259 | 255 | break; |
@@ -309,8 +305,7 @@ discard block |
||
309 | 305 | foreach ($parts as $key => $value) { |
310 | 306 | if (preg_match('/(#SPLIT_TOKEN#)/', $value)) { |
311 | 307 | $chunks[] = array ('delimiter' => $value,); |
312 | - } |
|
313 | - else { |
|
308 | + } else { |
|
314 | 309 | $cleaned = preg_replace('/\s|\n/', '', $value); |
315 | 310 | if (!empty($cleaned)) { |
316 | 311 | $chunks[] = array( |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $postid = get_int('postid', true); |
31 | 31 | $filter = get_str('filter', true); |
32 | 32 | |
33 | -if ($filter != "false"){ |
|
33 | +if ($filter != "false") { |
|
34 | 34 | $filter = true; |
35 | 35 | } else { |
36 | 36 | $filter = false; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $sort_style = $temp_sort_style; |
81 | 81 | } else if ($sort_style) { |
82 | 82 | $forum_style = 0; // this is deprecated |
83 | - if ($logged_in_user){ |
|
83 | + if ($logged_in_user) { |
|
84 | 84 | $logged_in_user->prefs->thread_sorting = $sort_style; |
85 | 85 | $logged_in_user->prefs->update("thread_sorting=$sort_style"); |
86 | 86 | } else { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | ); |
93 | 93 | } else { |
94 | 94 | // get the sorting style from the user or a cookie |
95 | - if ($logged_in_user){ |
|
95 | + if ($logged_in_user) { |
|
96 | 96 | $sort_style = $logged_in_user->prefs->thread_sorting; |
97 | 97 | } else { |
98 | 98 | list($forum_style, $sort_style) = parse_forum_cookie(); |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | |
121 | 121 | if (false) { |
122 | 122 | if ($forum->parent_type == 0) { |
123 | - if ($category->is_helpdesk && !$thread->status){ |
|
124 | - if ($logged_in_user){ |
|
125 | - if ($thread->owner == $logged_in_user->id){ |
|
123 | + if ($category->is_helpdesk && !$thread->status) { |
|
124 | + if ($logged_in_user) { |
|
125 | + if ($thread->owner == $logged_in_user->id) { |
|
126 | 126 | if ($thread->replies !=0) { |
127 | 127 | // Show a "this question has been answered" to the author |
128 | 128 | echo "<p>"; |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | // If logged in user is moderator, enable some extra features |
190 | 190 | // |
191 | 191 | if (is_moderator($logged_in_user, $forum)) { |
192 | - if ($thread->hidden){ |
|
192 | + if ($thread->hidden) { |
|
193 | 193 | show_button_small( |
194 | 194 | "forum_moderate_thread_action.php?action=unhide&thread=".$thread->id."$tokens", |
195 | 195 | tra("Unhide"), |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | tra("Hide this thread") |
203 | 203 | ); |
204 | 204 | } |
205 | - if ($thread->sticky){ |
|
205 | + if ($thread->sticky) { |
|
206 | 206 | show_button_small( |
207 | 207 | "forum_moderate_thread_action.php?action=desticky&thread=".$thread->id."$tokens", |
208 | 208 | tra("Make unsticky"), |
@@ -7,8 +7,7 @@ |
||
7 | 7 | list($module, $api) = func_get_args(); |
8 | 8 | if ($module == "panels_mini" && $api == "panels_default") { |
9 | 9 | return array("version" => 1); |
10 | - } |
|
11 | - else if ($module == "strongarm" && $api == "strongarm") { |
|
10 | + } else if ($module == "strongarm" && $api == "strongarm") { |
|
12 | 11 | return array("version" => 1); |
13 | 12 | } |
14 | 13 | } |
@@ -147,13 +147,11 @@ discard block |
||
147 | 147 | '@pages' => format_plural($pages_generated, 'page', 'pages'), |
148 | 148 | ) |
149 | 149 | )); |
150 | - } |
|
151 | - else { |
|
150 | + } else { |
|
152 | 151 | if ($option) { |
153 | 152 | drupal_set_message(t('The @specified page already exists.', |
154 | 153 | array('@specified' => $option)), 'warning'); |
155 | - } |
|
156 | - else { |
|
154 | + } else { |
|
157 | 155 | drupal_set_message(t('All pages already exist, so none can be recreated |
158 | 156 | automatically.'), 'warning'); |
159 | 157 | } |
@@ -174,8 +172,7 @@ discard block |
||
174 | 172 | 'rules', |
175 | 173 | 'moderation', |
176 | 174 | ); |
177 | - } |
|
178 | - elseif (!is_array($pages)) { |
|
175 | + } elseif (!is_array($pages)) { |
|
179 | 176 | $pages = array($pages); |
180 | 177 | } |
181 | 178 |
@@ -44,8 +44,7 @@ discard block |
||
44 | 44 | $nid = $existing_teams[$boinc_team->id]; |
45 | 45 | $success = boincteam_import($boinc_team, $nid); |
46 | 46 | } |
47 | - } |
|
48 | - else { |
|
47 | + } else { |
|
49 | 48 | // Import new teams created by RPC or ops/team_import.php |
50 | 49 | $success = boincteam_import($boinc_team); |
51 | 50 | } |
@@ -77,8 +76,7 @@ discard block |
||
77 | 76 | $node->body = $boincteam->description; |
78 | 77 | $node->teaser = $teaser; |
79 | 78 | $node->uid = boincuser_lookup_uid($boincteam->userid); |
80 | - } |
|
81 | - else { |
|
79 | + } else { |
|
82 | 80 | // Construct the team as a new node |
83 | 81 | $node = array( |
84 | 82 | 'type' => 'team', |
@@ -132,8 +130,7 @@ discard block |
||
132 | 130 | } |
133 | 131 | if ($boincid) { |
134 | 132 | return $ids; |
135 | - } |
|
136 | - else { |
|
133 | + } else { |
|
137 | 134 | return array_map('boincuser_lookup_uid', $ids); |
138 | 135 | } |
139 | 136 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | // with an existing web framework can more easily do so. |
208 | 208 | // To do so, define page_head() in the project include file. |
209 | 209 | // |
210 | -if (!function_exists("page_head")){ |
|
210 | +if (!function_exists("page_head")) { |
|
211 | 211 | function page_head( |
212 | 212 | $title, |
213 | 213 | // page title. Put in <title>, used as title for browser tab. |
@@ -293,7 +293,8 @@ discard block |
||
293 | 293 | echo '<div class="container-fluid"> |
294 | 294 | '; |
295 | 295 | |
296 | - switch($title) { //kludge |
|
296 | + switch($title) { |
|
297 | +//kludge |
|
297 | 298 | case tra("Log in"): |
298 | 299 | case tra("Create an account"): |
299 | 300 | case tra("Server status page"): |
@@ -309,7 +310,7 @@ discard block |
||
309 | 310 | |
310 | 311 | // See the comments for page_head() |
311 | 312 | // |
312 | -if (!function_exists("page_tail")){ |
|
313 | +if (!function_exists("page_tail")) { |
|
313 | 314 | function page_tail( |
314 | 315 | $show_date=false, |
315 | 316 | // true for pages that are generated periodically rather than on the fly |
@@ -330,7 +331,7 @@ discard block |
||
330 | 331 | } |
331 | 332 | } |
332 | 333 | |
333 | -function display_cvs_versions(){ |
|
334 | +function display_cvs_versions() { |
|
334 | 335 | global $cvs_version_tracker; |
335 | 336 | echo "\n<!-- SVN VERSIONS -->\n"; |
336 | 337 | for ($i=0;$i<sizeof($cvs_version_tracker);$i++) { |
@@ -816,7 +817,7 @@ discard block |
||
816 | 817 | return $str; |
817 | 818 | } |
818 | 819 | |
819 | -function strip_bbcode($string){ |
|
820 | +function strip_bbcode($string) { |
|
820 | 821 | return preg_replace("/((\[.+\])+?)(.+?)((\[\/.+\])+?)/","",$string); |
821 | 822 | } |
822 | 823 | |
@@ -1047,7 +1048,7 @@ discard block |
||
1047 | 1048 | // Otherwise return 0. |
1048 | 1049 | // Format of user agent string is "BOINC client (windows_x86_64 7.3.17)" |
1049 | 1050 | // |
1050 | -function boinc_client_version(){ |
|
1051 | +function boinc_client_version() { |
|
1051 | 1052 | if (!array_key_exists('HTTP_USER_AGENT', $_SERVER)) return 0; |
1052 | 1053 | $x = $_SERVER['HTTP_USER_AGENT']; |
1053 | 1054 | $e = "/BOINC client [^ ]* (\d+).(\d+).(\d+)\)/"; |
@@ -57,8 +57,7 @@ discard block |
||
57 | 57 | if (module_exists('pathauto')) { |
58 | 58 | module_load_include('inc', 'pathauto', 'pathauto'); |
59 | 59 | $node['path'] = pathauto_cleanstring($boincteam->name); |
60 | - } |
|
61 | - else { |
|
60 | + } else { |
|
62 | 61 | echo 'Pathauto module is required!'; |
63 | 62 | exit; |
64 | 63 | } |
@@ -77,7 +76,9 @@ discard block |
||
77 | 76 | // Determine team membership |
78 | 77 | db_set_active('boinc_rw'); |
79 | 78 | $boincteam_member_ids = array(); |
80 | - while ($boincuser = db_fetch_object($boincteam_members)) $boincteam_member_ids[] = $boincuser->id; |
|
79 | + while ($boincuser = db_fetch_object($boincteam_members)) { |
|
80 | + $boincteam_member_ids[] = $boincuser->id; |
|
81 | + } |
|
81 | 82 | db_set_active('default'); |
82 | 83 | if ($boincteam_member_ids) { |
83 | 84 | $team_members = db_query('SELECT uid FROM {boincuser} WHERE boinc_id IN(%s)', implode(',', $boincteam_member_ids)); |