@@ -7,7 +7,7 @@ |
||
7 | 7 | // add other criteria like # of countries (based on IP addr) |
8 | 8 | // consider only hosts with recent last RPC time |
9 | 9 | |
10 | -define ('MAX_HOSTS', 100); |
|
10 | +define('MAX_HOSTS', 100); |
|
11 | 11 | |
12 | 12 | require_once('../inc/boinc_db.inc'); |
13 | 13 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $parent_post_id = 0; |
57 | 57 | } |
58 | 58 | |
59 | -if ($filter != "false"){ |
|
59 | +if ($filter != "false") { |
|
60 | 60 | $filter = true; |
61 | 61 | } else { |
62 | 62 | $filter = false; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $warning = null; |
74 | -if ($content && (!$preview)){ |
|
74 | +if ($content && (!$preview)) { |
|
75 | 75 | check_tokens($logged_in_user->authenticator); |
76 | 76 | if (!akismet_check($logged_in_user, $content)) { |
77 | 77 | $warning = tra("Your post has been flagged as spam by the Akismet anti-spam system. Please modify your text and try again."); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $parent_post_id = 0; |
57 | 57 | } |
58 | 58 | |
59 | -if ($filter != "false"){ |
|
59 | +if ($filter != "false") { |
|
60 | 60 | $filter = true; |
61 | 61 | } else { |
62 | 62 | $filter = false; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $warning = null; |
74 | -if ($content && (!$preview)){ |
|
74 | +if ($content && (!$preview)) { |
|
75 | 75 | check_tokens($logged_in_user->authenticator); |
76 | 76 | if (!akismet_check($logged_in_user, $content)) { |
77 | 77 | $warning = tra("Your post has been flagged as spam by the Akismet anti-spam system. Please modify your text and try again."); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | -page_head(tra("Post to thread")." '$thread->title'",'','','', $bbcode_js); |
|
96 | +page_head(tra("Post to thread")." '$thread->title'", '', '', '', $bbcode_js); |
|
97 | 97 | |
98 | 98 | if ($parent_post) { |
99 | 99 | echo sprintf( |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $x2 .= " method=\"post\" name=\"post\" onsubmit=\"return checkForm(this)\">\n"; |
162 | 162 | $x2 .= form_tokens($logged_in_user->authenticator); |
163 | 163 | $x2 .= $bbcode_html."<textarea class=\"form-control\" name=\"content\" rows=\"18\">"; |
164 | - $no_quote = get_int("no_quote", true)==1; |
|
164 | + $no_quote = get_int("no_quote", true) == 1; |
|
165 | 165 | if ($preview) { |
166 | 166 | $x2 .= htmlspecialchars($content); |
167 | 167 | } else if (!$no_quote) { |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | } |
171 | 171 | } |
172 | 172 | if (!$logged_in_user->prefs->no_signature_by_default) { |
173 | - $enable_signature='checked="true"'; |
|
173 | + $enable_signature = 'checked="true"'; |
|
174 | 174 | } else { |
175 | - $enable_signature=""; |
|
175 | + $enable_signature = ""; |
|
176 | 176 | } |
177 | 177 | $x2 .= sprintf('</textarea><p> </p> |
178 | 178 | <input class="btn btn-sm" %s type="submit" name="preview" value="%s"> |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | return sprintf( |
201 | 201 | 'In reply to %s\'s message of %s: |
202 | 202 | [quote]%s[/quote]', |
203 | - $user?$user->name:'unknown user', |
|
203 | + $user ? $user->name : 'unknown user', |
|
204 | 204 | date_str($post->timestamp), |
205 | 205 | htmlspecialchars($post->content) |
206 | 206 | ); |
@@ -91,9 +91,9 @@ discard block |
||
91 | 91 | if ($forum->parent_type == 1) { |
92 | 92 | // post to team msg board |
93 | 93 | if ($forum->category == $teamid) { |
94 | - if ($thread->hidden && !$show_team_hidden) { |
|
95 | - continue; |
|
96 | - } |
|
94 | + if ($thread->hidden && !$show_team_hidden) { |
|
95 | + continue; |
|
96 | + } |
|
97 | 97 | if ($post->hidden && !$show_team_hidden) { |
98 | 98 | continue; |
99 | 99 | } |
@@ -101,18 +101,18 @@ discard block |
||
101 | 101 | continue; |
102 | 102 | } |
103 | 103 | } else { |
104 | - if ($thread->hidden && !$show_hidden) { |
|
105 | - continue; |
|
106 | - } |
|
104 | + if ($thread->hidden && !$show_hidden) { |
|
105 | + continue; |
|
106 | + } |
|
107 | 107 | if ($post->hidden && !$show_hidden) { |
108 | 108 | continue; |
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
112 | - if ($n == $offset + $items_per_page) { |
|
113 | - $show_next = true; |
|
114 | - break; |
|
115 | - } |
|
112 | + if ($n == $offset + $items_per_page) { |
|
113 | + $show_next = true; |
|
114 | + break; |
|
115 | + } |
|
116 | 116 | if ($n >= $offset) { |
117 | 117 | show_post_and_context($post, $thread, $forum, $options, $n+1); |
118 | 118 | } |
@@ -121,12 +121,12 @@ discard block |
||
121 | 121 | end_table(); |
122 | 122 | |
123 | 123 | if ($offset) { |
124 | - $x = $offset - $items_per_page; |
|
124 | + $x = $offset - $items_per_page; |
|
125 | 125 | echo "<a href=forum_user_posts.php?userid=$userid&offset=$x> |
126 | 126 | <b>".tra("Previous %1", $items_per_page)."</b> |
127 | 127 | </a> |
128 | 128 | "; |
129 | - if ($show_next) echo " · "; |
|
129 | + if ($show_next) echo " · "; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | if ($show_next) { |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $user = BoincUser::lookup_id($userid); |
30 | 30 | if (!$user) error_page('no such user'); |
31 | 31 | $offset = get_int("offset", true); |
32 | -if (!$offset) $offset=0; |
|
32 | +if (!$offset) $offset = 0; |
|
33 | 33 | $items_per_page = 20; |
34 | 34 | |
35 | 35 | $logged_in_user = get_logged_in_user(false); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | break; |
115 | 115 | } |
116 | 116 | if ($n >= $offset) { |
117 | - show_post_and_context($post, $thread, $forum, $options, $n+1); |
|
117 | + show_post_and_context($post, $thread, $forum, $options, $n + 1); |
|
118 | 118 | } |
119 | 119 | $n++; |
120 | 120 | } |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | $preview = post_str("preview", true); |
57 | 57 | $warning = null; |
58 | 58 | |
59 | -if ($content && $title && (!$preview)){ |
|
59 | +if ($content && $title && (!$preview)) { |
|
60 | 60 | if (post_str('add_signature', true)) { |
61 | 61 | $add_signature = true; // set a flag and concatenate later |
62 | - } else { |
|
62 | + } else { |
|
63 | 63 | $add_signature = false; |
64 | 64 | } |
65 | 65 | check_tokens($logged_in_user->authenticator); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>"; |
123 | 123 | } |
124 | 124 | |
125 | -if ($force_title && $title){ |
|
125 | +if ($force_title && $title) { |
|
126 | 126 | row2( |
127 | 127 | tra("Title"), |
128 | 128 | sprintf( |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | error_page("Forums are disabled"); |
44 | 44 | } |
45 | 45 | |
46 | -if (user_can_create_thread($logged_in_user, $forum)=='no') { |
|
46 | +if (user_can_create_thread($logged_in_user, $forum) == 'no') { |
|
47 | 47 | error_page(tra("Only project admins may create a thread here. However, you may reply to existing threads.")); |
48 | 48 | } |
49 | 49 | check_post_access($logged_in_user, $forum); |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | $preview = post_str("preview", true); |
57 | 57 | $warning = null; |
58 | 58 | |
59 | -if ($content && $title && (!$preview)){ |
|
59 | +if ($content && $title && (!$preview)) { |
|
60 | 60 | if (post_str('add_signature', true)) { |
61 | - $add_signature = true; // set a flag and concatenate later |
|
62 | - } else { |
|
61 | + $add_signature = true; // set a flag and concatenate later |
|
62 | + } else { |
|
63 | 63 | $add_signature = false; |
64 | 64 | } |
65 | 65 | check_tokens($logged_in_user->authenticator); |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | if (post_str('subscribe', true)) { |
75 | 75 | BoincSubscription::replace($logged_in_user->id, $thread->id); |
76 | 76 | } |
77 | - header('Location: forum_thread.php?id=' . $thread->id); |
|
77 | + header('Location: forum_thread.php?id='.$thread->id); |
|
78 | 78 | } else { |
79 | 79 | error_page("Can't create thread. $forum_error"); |
80 | 80 | } |
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | -page_head(tra("Create new thread"),'','','', $bbcode_js); |
|
84 | +page_head(tra("Create new thread"), '', '', '', $bbcode_js); |
|
85 | 85 | show_forum_header($logged_in_user); |
86 | 86 | |
87 | 87 | if ($warning) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>"; |
123 | 123 | } |
124 | 124 | |
125 | -if ($force_title && $title){ |
|
125 | +if ($force_title && $title) { |
|
126 | 126 | row2( |
127 | 127 | tra("Title"), |
128 | 128 | sprintf( |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | row2( |
137 | 137 | tra("Title").$submit_help, |
138 | 138 | sprintf('<input type="text" class="form-control" name="title" value="%s">', |
139 | - $title?htmlspecialchars($title):'' |
|
139 | + $title ?htmlspecialchars($title) : '' |
|
140 | 140 | ), |
141 | 141 | null, FORUM_LH_PCT |
142 | 142 | ); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | sprintf( |
148 | 148 | '%s <textarea class="form-control" name="content" rows="12" cols="80">%s</textarea>', |
149 | 149 | $bbcode_html, |
150 | - $content?htmlspecialchars($content):'' |
|
150 | + $content ?htmlspecialchars($content) : '' |
|
151 | 151 | ), |
152 | 152 | null, FORUM_LH_PCT |
153 | 153 | ); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | if (!$logged_in_user->prefs->no_signature_by_default) { |
156 | 156 | $enable_signature = 'checked="true"'; |
157 | 157 | } else { |
158 | - $enable_signature=''; |
|
158 | + $enable_signature = ''; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | if (is_news_forum($forum)) { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | if ($n === false) return ''; |
34 | 34 | $m = strpos($p, ']', $n); |
35 | 35 | if ($m === false) return ''; |
36 | - $x = substr($p, $n+5, $m-$n-5); |
|
36 | + $x = substr($p, $n + 5, $m - $n - 5); |
|
37 | 37 | |
38 | 38 | $n = strpos($x, ' '); |
39 | 39 | if ($n !== false) return substr($x, 0, $n); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if ($n === false) return ''; |
48 | 48 | $m = strpos($p, ']', $n); |
49 | 49 | if ($m === false) return ''; |
50 | - $x = substr($p, $n+5, $m-$n-5); |
|
50 | + $x = substr($p, $n + 5, $m - $n - 5); |
|
51 | 51 | $n = strpos($x, '_'); |
52 | 52 | if ($n !== false) return substr($x, 0, $n); |
53 | 53 | $n = strpos($x, 'r'); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | function main() { |
59 | 59 | global $max_days; |
60 | - $t = time()-$max_days*86400; |
|
60 | + $t = time() - $max_days*86400; |
|
61 | 61 | $hosts = BoincHost::enum("rpc_time>$t"); |
62 | 62 | $descs = []; |
63 | 63 | foreach ($hosts as $host) { |
@@ -22,12 +22,12 @@ discard block |
||
22 | 22 | // Intended to be subclassed (e.g., BoincDb, BossaDb) |
23 | 23 | // |
24 | 24 | class DbConn { |
25 | - var $db_conn; // a mysqli object |
|
26 | - var $db_name; // the DB name |
|
25 | + var $db_conn; // a mysqli object |
|
26 | + var $db_name; // the DB name |
|
27 | 27 | |
28 | 28 | function init_conn($user, $passwd, $host, $name) { |
29 | 29 | $x = explode(":", $host); |
30 | - if (sizeof($x)>1) { |
|
30 | + if (sizeof($x) > 1) { |
|
31 | 31 | $host = $x[0]; |
32 | 32 | $port = $x[1]; |
33 | 33 | } else { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | try { |
37 | 37 | $this->db_conn = @new mysqli($host, $user, $passwd, $name, $port); |
38 | - } catch(Exception $e) { |
|
38 | + } catch (Exception $e) { |
|
39 | 39 | return false; |
40 | 40 | } |
41 | 41 | if (mysqli_connect_error()) { |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | return $this->enum_general($classname, $query); |
137 | 137 | } |
138 | 138 | |
139 | - function enum($table, $classname, $where_clause=null, $order_clause=null) { |
|
139 | + function enum($table, $classname, $where_clause = null, $order_clause = null) { |
|
140 | 140 | return self::enum_fields( |
141 | 141 | $table, $classname, '*', $where_clause, $order_clause |
142 | 142 | ); |
@@ -181,15 +181,15 @@ discard block |
||
181 | 181 | if ($x) return (double)$x->$field; |
182 | 182 | return false; |
183 | 183 | } |
184 | - function count($table, $clause="TRUE") { |
|
184 | + function count($table, $clause = "TRUE") { |
|
185 | 185 | $query = "select count(*) as total from DBNAME.$table where $clause"; |
186 | 186 | return $this->get_int($query, 'total'); |
187 | 187 | } |
188 | - function sum($table, $field, $clause="") { |
|
188 | + function sum($table, $field, $clause = "") { |
|
189 | 189 | $query = "select sum($field) as total from DBNAME.$table $clause"; |
190 | 190 | return $this->get_double($query, 'total'); |
191 | 191 | } |
192 | - function max($table, $field, $clause="") { |
|
192 | + function max($table, $field, $clause = "") { |
|
193 | 193 | $query = "select max($field) as total from DBNAME.$table $clause"; |
194 | 194 | return $this->get_double($query, 'total'); |
195 | 195 | } |
@@ -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_phys_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, |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | // return list of files matching given pattern, |
92 | 92 | // in the format used for form_select() and form_select_multiple() |
93 | 93 | // |
94 | -function sandbox_select_items($user, $pattern=null) { |
|
94 | +function sandbox_select_items($user, $pattern = null) { |
|
95 | 95 | $sbfiles = sandbox_file_names($user); |
96 | 96 | $sbitems = []; |
97 | 97 | foreach ($sbfiles as $f) { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | $files = sandbox_file_names($user); |
114 | 114 | foreach ($files as $f) { |
115 | - if ($regexp && !preg_match("/$regexp/",$f)) continue; |
|
115 | + if ($regexp && !preg_match("/$regexp/", $f)) continue; |
|
116 | 116 | $x .= "<option value=\"$f\">$f</option>\n"; |
117 | 117 | } |
118 | 118 | $x .= "</select>\n"; |
@@ -160,8 +160,8 @@ discard block |
||
160 | 160 | '%s <a href="%s&sort_field=%s&sort_rev=%d">%s</a>', |
161 | 161 | $title, |
162 | 162 | $url, $sort_field, |
163 | - $sort_rev?0:1, |
|
164 | - $sort_rev?'↑':'↓' |
|
163 | + $sort_rev ? 0 : 1, |
|
164 | + $sort_rev ? '↑' : '↓' |
|
165 | 165 | ); |
166 | 166 | } else { |
167 | 167 | return sprintf( |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | if ($app_types->cpu) { |
73 | - $project_pref_descs[] = new PREF_BOOL ( |
|
73 | + $project_pref_descs[] = new PREF_BOOL( |
|
74 | 74 | tra("Allow CPU-only tasks"), |
75 | 75 | "Request CPU-only tasks from this project.", |
76 | 76 | "no_cpu", |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ); |
80 | 80 | } |
81 | 81 | if ($app_types->ati) { |
82 | - $project_pref_descs[] = new PREF_BOOL ( |
|
82 | + $project_pref_descs[] = new PREF_BOOL( |
|
83 | 83 | tra("Use AMD GPU"), |
84 | 84 | "Request AMD GPU tasks from this project.", |
85 | 85 | "no_ati", |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | ); |
89 | 89 | } |
90 | 90 | if ($app_types->cuda) { |
91 | - $project_pref_descs[] = new PREF_BOOL ( |
|
91 | + $project_pref_descs[] = new PREF_BOOL( |
|
92 | 92 | tra("Use NVIDIA GPU"), |
93 | 93 | "Request NVIDIA GPU tasks from this project.", |
94 | 94 | "no_cuda", |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | ); |
98 | 98 | } |
99 | 99 | if ($app_types->intel_gpu) { |
100 | - $project_pref_descs[] = new PREF_BOOL ( |
|
100 | + $project_pref_descs[] = new PREF_BOOL( |
|
101 | 101 | tra("Use Intel GPU"), |
102 | 102 | "Request Intel GPU tasks from this project.", |
103 | 103 | "no_intel_gpu", |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | ); |
107 | 107 | } |
108 | 108 | if ($app_types->apple_gpu) { |
109 | - $project_pref_descs[] = new PREF_BOOL ( |
|
109 | + $project_pref_descs[] = new PREF_BOOL( |
|
110 | 110 | tra("Use Apple GPU"), |
111 | 111 | "Request Apple GPU tasks from this project.", |
112 | 112 | "no_apple_gpu", |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $x = ""; |
132 | 132 | } |
133 | 133 | |
134 | -$privacy_pref_descs = array ( |
|
134 | +$privacy_pref_descs = array( |
|
135 | 135 | new PREF_BOOL( |
136 | 136 | tra("Is it OK for %1 and your team (if any) to email you?", PROJECT).$x, |
137 | 137 | "", |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | global $in_project_specific; |
180 | 180 | global $venue_name; |
181 | 181 | |
182 | - switch($name) { |
|
182 | + switch ($name) { |
|
183 | 183 | case "venue": |
184 | 184 | $venue_name = $attrs["name"]; |
185 | 185 | $top_parse_result = $parse_result; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | break; |
192 | 192 | default: |
193 | 193 | if ($in_project_specific) { |
194 | - $text= $text."<$name>"; |
|
194 | + $text = $text."<$name>"; |
|
195 | 195 | } else { |
196 | 196 | $text = ""; |
197 | 197 | } |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | global $venue_name; |
207 | 207 | global $project_pref_descs; |
208 | 208 | |
209 | - foreach($project_pref_descs as $p) { |
|
209 | + foreach ($project_pref_descs as $p) { |
|
210 | 210 | if ($p->xml_parse($parse_result, $name, $text)) { |
211 | 211 | return; |
212 | 212 | } |
213 | 213 | } |
214 | - switch($name) { |
|
214 | + switch ($name) { |
|
215 | 215 | case "venue": |
216 | 216 | $top_parse_result->$venue_name = $parse_result; |
217 | 217 | $parse_result = $top_parse_result; |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | return $parse_result; |
256 | 256 | } |
257 | 257 | |
258 | -function prefs_show_project($prefs, $columns=false) { |
|
258 | +function prefs_show_project($prefs, $columns = false) { |
|
259 | 259 | global $project_pref_descs; |
260 | 260 | if ($columns) { |
261 | 261 | foreach ($project_pref_descs as $p) { |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | } |
295 | 295 | } |
296 | 296 | |
297 | -function prefs_show_project_specific($prefs, $columns=false) { |
|
297 | +function prefs_show_project_specific($prefs, $columns = false) { |
|
298 | 298 | if ($columns) { |
299 | 299 | $project_specific_prefs = project_specific_prefs_parse($prefs->project_specific); |
300 | 300 | $project_specific_prefs->home = isset($prefs->home) ? project_specific_prefs_parse($prefs->home->project_specific) : ""; |
@@ -306,10 +306,10 @@ discard block |
||
306 | 306 | project_specific_prefs_show($project_specific_prefs, $columns); |
307 | 307 | } |
308 | 308 | |
309 | -function print_prefs_display_project($user, $columns=false) { |
|
309 | +function print_prefs_display_project($user, $columns = false) { |
|
310 | 310 | $project_prefs = prefs_parse_project($user->project_prefs); |
311 | 311 | |
312 | - $switch_link = " <font size=\"-1\"><a href=prefs.php?subset=project&cols=". (int)!$columns .">".tra("(Switch View)")."</a></font>"; |
|
312 | + $switch_link = " <font size=\"-1\"><a href=prefs.php?subset=project&cols=".(int)!$columns.">".tra("(Switch View)")."</a></font>"; |
|
313 | 313 | if ($columns) { |
314 | 314 | start_table(); |
315 | 315 | row_heading(tra("Combined preferences").$switch_link); |
@@ -360,14 +360,14 @@ discard block |
||
360 | 360 | } |
361 | 361 | } |
362 | 362 | |
363 | -function prefs_form_project($prefs, $error=false) { |
|
363 | +function prefs_form_project($prefs, $error = false) { |
|
364 | 364 | global $project_pref_descs; |
365 | 365 | foreach ($project_pref_descs as $p) { |
366 | 366 | $p->show_form_row($prefs, $error); |
367 | 367 | } |
368 | 368 | } |
369 | 369 | |
370 | -function prefs_form_project_specific($prefs_xml, $error=false) { |
|
370 | +function prefs_form_project_specific($prefs_xml, $error = false) { |
|
371 | 371 | $prefs = project_specific_prefs_parse($prefs_xml); |
372 | 372 | project_specific_prefs_edit($prefs, $error); |
373 | 373 | } |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | |
416 | 416 | // given a prefs structure, return the corresponding XML string |
417 | 417 | // |
418 | -function project_prefs_make_xml($prefs, $primary=true) { |
|
418 | +function project_prefs_make_xml($prefs, $primary = true) { |
|
419 | 419 | global $project_pref_descs; |
420 | 420 | $xml = ""; |
421 | 421 | if ($primary) { |
@@ -450,8 +450,8 @@ discard block |
||
450 | 450 | // |
451 | 451 | function project_prefs_update(&$user, $prefs) { |
452 | 452 | $prefs_xml = BoincDb::escape_string(project_prefs_make_xml($prefs)); |
453 | - $send_email = $user->send_email?1:0; |
|
454 | - $show_hosts = $user->show_hosts?1:0; |
|
453 | + $send_email = $user->send_email ? 1 : 0; |
|
454 | + $show_hosts = $user->show_hosts ? 1 : 0; |
|
455 | 455 | $retval = $user->update("project_prefs='$prefs_xml', send_email=$send_email, show_hosts=$show_hosts"); |
456 | 456 | if (!$retval) { |
457 | 457 | return 1; |