@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if (!$user->has_profile) return null; |
72 | 72 | $profile = BoincProfile::lookup("userid=$user->id"); |
73 | 73 | if (!$profile->has_picture) return null; |
74 | - if (profile_screening() && $profile->verification!=1) return null; |
|
74 | + if (profile_screening() && $profile->verification != 1) return null; |
|
75 | 75 | return profile_thumb_url($user->id); |
76 | 76 | } |
77 | 77 | |
@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | return $image; |
126 | 126 | } |
127 | 127 | |
128 | - ($origWidth > $origHeight)? $scalar = ($origWidth / $targetWidth) : $scalar = ($origHeight / $targetHeight); |
|
128 | + ($origWidth > $origHeight) ? $scalar = ($origWidth/$targetWidth) : $scalar = ($origHeight/$targetHeight); |
|
129 | 129 | |
130 | 130 | if ($scalar != 0) { |
131 | - $destWidth = $origWidth / $scalar; |
|
132 | - $destHeight = $origHeight / $scalar; |
|
131 | + $destWidth = $origWidth/$scalar; |
|
132 | + $destHeight = $origHeight/$scalar; |
|
133 | 133 | } else { |
134 | 134 | $destWidth = $origWidth; |
135 | 135 | $destHeight = $origHeight; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $gd_info = gd_info(); |
139 | 139 | $v = $gd_info["GD Version"]; |
140 | 140 | $v = explode('.', $v); |
141 | - $v = (int)$v[0]; // major version |
|
141 | + $v = (int)$v[0]; // major version |
|
142 | 142 | if ($v >= 2) { |
143 | 143 | // If you are using a modern PHP/GD installation that does |
144 | 144 | // 'truecolor' images, this is what's needed. |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $options->htmlitems = false; |
182 | 182 | $temp = output_transform($profile->response1, $options); |
183 | 183 | $temp = sanitize_tags($temp); |
184 | - $description = "(\"" . sub_sentence($temp, ' ', MAX_DESC_LENGTH, true) . "\")"; |
|
184 | + $description = "(\"".sub_sentence($temp, ' ', MAX_DESC_LENGTH, true)."\")"; |
|
185 | 185 | |
186 | 186 | } |
187 | 187 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | function check_whether_to_show_profile($user, $logged_in_user) { |
193 | 193 | $min_credit = parse_config(get_config(), "<profile_min_credit>"); |
194 | - if (!$logged_in_user && $min_credit && $user->expavg_credit < $min_credit ) { |
|
194 | + if (!$logged_in_user && $min_credit && $user->expavg_credit < $min_credit) { |
|
195 | 195 | error_page( |
196 | 196 | tra("To prevent spam, profiles of users with an average credit of less than %1 are displayed only to logged-in users. We apologize for this inconvenience.", $min_credit) |
197 | 197 | ); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | // |
230 | 230 | $show_picture = $profile->has_picture; |
231 | 231 | if (profile_screening()) { |
232 | - if (!$screen_mode && !$can_edit && $profile->verification!=1) { |
|
232 | + if (!$screen_mode && !$can_edit && $profile->verification != 1) { |
|
233 | 233 | $show_picture = false; |
234 | 234 | } |
235 | 235 | } |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | // yet verified. This will tell them if other users can't view it yet, or |
246 | 246 | // if there is a problem with it and they need to replace it. |
247 | 247 | // |
248 | - if (profile_screening() && $profile->has_picture && $can_edit && $profile->verification!=1) { |
|
248 | + if (profile_screening() && $profile->has_picture && $can_edit && $profile->verification != 1) { |
|
249 | 249 | row1(offensive_profile_warning($profile->verification)); |
250 | 250 | } |
251 | 251 |
@@ -193,7 +193,7 @@ |
||
193 | 193 | $min_credit = parse_config(get_config(), "<profile_min_credit>"); |
194 | 194 | if (!$logged_in_user && $min_credit && $user->expavg_credit < $min_credit ) { |
195 | 195 | error_page( |
196 | - tra("To prevent spam, profiles of users with an average credit of less than %1 are displayed only to logged-in users. We apologize for this inconvenience.", $min_credit) |
|
196 | + tra("To prevent spam, profiles of users with an average credit of less than %1 are displayed only to logged-in users. We apologize for this inconvenience.", $min_credit) |
|
197 | 197 | ); |
198 | 198 | } |
199 | 199 | } |
@@ -27,25 +27,25 @@ |
||
27 | 27 | row_array(array("Name", "Engine", "Version", "Row Format", "Rows", "Avg Row Length (KB)", "Data Length (MB)", "Max Data Length (MB)", "Index Length (MB)", "Data free (MB)", "Create Time", "Update Time", "Check Time", "Create Options", "Comment")); |
28 | 28 | db_init(); |
29 | 29 | $result = _mysql_query("show table status"); |
30 | - while($row = _mysql_fetch_array($result)) { |
|
30 | + while ($row = _mysql_fetch_array($result)) { |
|
31 | 31 | $size += ($row["Data_length"] + $row["Index_length"]); |
32 | 32 | $engine = $row["Engine"]; |
33 | 33 | //if (!$engine) $engine = $row["Type"]; |
34 | 34 | row_array(array( |
35 | 35 | $row["Name"], |
36 | 36 | $engine, |
37 | - $row["Version"] , |
|
38 | - $row["Row_format"] , |
|
39 | - $row["Rows"] , |
|
40 | - round($row["Avg_row_length"]/1024,2) , |
|
41 | - round($row["Data_length"]/(1024*1024),2) , |
|
42 | - round($row["Max_data_length"]/(1024*1024),2) , |
|
43 | - round($row["Index_length"]/(1024*1024),2) , |
|
44 | - round($row["Data_free"]/(1024*1024),2) , |
|
45 | - $row["Create_time"] , |
|
46 | - $row["Update_time"] , |
|
47 | - $row["Check_time"] , |
|
48 | - $row["Create_options"] , |
|
37 | + $row["Version"], |
|
38 | + $row["Row_format"], |
|
39 | + $row["Rows"], |
|
40 | + round($row["Avg_row_length"]/1024, 2), |
|
41 | + round($row["Data_length"]/(1024*1024), 2), |
|
42 | + round($row["Max_data_length"]/(1024*1024), 2), |
|
43 | + round($row["Index_length"]/(1024*1024), 2), |
|
44 | + round($row["Data_free"]/(1024*1024), 2), |
|
45 | + $row["Create_time"], |
|
46 | + $row["Update_time"], |
|
47 | + $row["Check_time"], |
|
48 | + $row["Create_options"], |
|
49 | 49 | $row["Comment"] |
50 | 50 | )); |
51 | 51 | } |
@@ -218,13 +218,13 @@ |
||
218 | 218 | function get_file($user) { |
219 | 219 | $dir = sandbox_dir($user); |
220 | 220 | $url = post_str('url'); |
221 | - if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) { |
|
221 | + if (filter_var($url, FILTER_VALIDATE_URL) === false) { |
|
222 | 222 | error_page('Not a valid URL'); |
223 | 223 | } |
224 | 224 | $fname = basename($url); |
225 | 225 | $path = "$dir/$fname"; |
226 | 226 | if (file_exists($path)) { |
227 | - error_page("File $fname exists; delete it first."); |
|
227 | + error_page("file $fname exists; delete it first."); |
|
228 | 228 | } |
229 | 229 | copy($url, $path); |
230 | 230 | $notice = "Fetched file from <strong>$url</strong><br/>"; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | page_tail(); |
85 | 85 | } |
86 | 86 | |
87 | -function list_files($user, $notice=null) { |
|
87 | +function list_files($user, $notice = null) { |
|
88 | 88 | $dir = sandbox_dir($user); |
89 | 89 | if (!is_dir($dir)) error_page("Can't open sandbox directory"); |
90 | 90 | page_head("File sandbox"); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $notice = ""; |
169 | 169 | $dir = sandbox_dir($user); |
170 | 170 | $count = count($_FILES['new_file']['tmp_name']); |
171 | - for ($i=0; $i<$count; $i++) { |
|
171 | + for ($i = 0; $i < $count; $i++) { |
|
172 | 172 | $tmp_name = $_FILES['new_file']['tmp_name'][$i]; |
173 | 173 | if (!is_uploaded_file($tmp_name)) { |
174 | 174 | error_page("$tmp_name is not uploaded file"); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | require_once("../inc/boinc_db.inc"); |
22 | 22 | require_once("../inc/util.inc"); |
23 | 23 | |
24 | -define('CONSENT_TYPE_ENROLL','ENROLL'); |
|
24 | +define('CONSENT_TYPE_ENROLL', 'ENROLL'); |
|
25 | 25 | |
26 | 26 | function check_termsofuse() { |
27 | 27 | return defined('TERMSOFUSE_FILE') and file_exists(TERMSOFUSE_FILE); |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | $source, $ctime = 0 |
33 | 33 | ) { |
34 | 34 | $mys = BoincDb::escape_string($source); |
35 | - if ($ctime==0) { |
|
35 | + if ($ctime == 0) { |
|
36 | 36 | $mytime = $user->create_time; |
37 | 37 | } else { |
38 | 38 | $mytime = $ctime; |
39 | 39 | } |
40 | 40 | return BoincConsent::insert( |
41 | - "(userid, consent_type_id, consent_time, consent_flag, consent_not_required, source) " . |
|
41 | + "(userid, consent_type_id, consent_time, consent_flag, consent_not_required, source) ". |
|
42 | 42 | "values($user->id, $consent_type_id, $mytime, $consent_flag, $consent_not_required, '$mys')" |
43 | 43 | ); |
44 | 44 | |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | // The integer is the consent_type_id- the id from consent_type table. |
66 | 66 | // If the boolean is FALSE, the integer returned is -1. |
67 | 67 | // |
68 | -function check_consent_type($name, $checkenabled=TRUE) { |
|
68 | +function check_consent_type($name, $checkenabled = TRUE) { |
|
69 | 69 | $name = BoincDb::escape_string($name); |
70 | 70 | $ct = BoincConsentType::lookup("shortname = '$name'"); |
71 | - if ($ct and ( !$checkenabled or ($ct->enabled)) ) { |
|
71 | + if ($ct and (!$checkenabled or ($ct->enabled))) { |
|
72 | 72 | return array(TRUE, $ct->id); |
73 | 73 | } |
74 | 74 | return array(FALSE, -1); |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | "userid=$user->id AND consent_type_id=$ctid AND consent_flag=1" |
53 | 53 | ); |
54 | 54 | if ($consent_result) { |
55 | - return TRUE; |
|
55 | + return true; |
|
56 | 56 | } |
57 | 57 | } |
58 | - return FALSE; |
|
58 | + return false; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | // Check if a particular consent_type name is available. |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | // The integer is the consent_type_id- the id from consent_type table. |
66 | 66 | // If the boolean is FALSE, the integer returned is -1. |
67 | 67 | // |
68 | -function check_consent_type($name, $checkenabled=TRUE) { |
|
68 | +function check_consent_type($name, $checkenabled=true) { |
|
69 | 69 | $name = BoincDb::escape_string($name); |
70 | 70 | $ct = BoincConsentType::lookup("shortname = '$name'"); |
71 | 71 | if ($ct and ( !$checkenabled or ($ct->enabled)) ) { |
72 | - return array(TRUE, $ct->id); |
|
72 | + return array(true, $ct->id); |
|
73 | 73 | } |
74 | - return array(FALSE, -1); |
|
74 | + return array(false, -1); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | // When a user uses the Web site to login, this function checks the |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | // You should have received a copy of the GNU Lesser General Public License |
17 | 17 | // along with BOINC. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | |
19 | -NOT FINISHED. DON'T USE |
|
19 | +NOT FINISHED.DON'T USE |
|
20 | 20 | |
21 | 21 | require 'openid.php'; |
22 | 22 | include_once("../inc/boinc_db.inc"); |
@@ -26,14 +26,14 @@ discard block |
||
26 | 26 | |
27 | 27 | function show_error($str) { |
28 | 28 | page_head("Can't create account"); |
29 | - echo "$str<br>\n"; |
|
29 | + echo "$str < br > \n"; |
|
30 | 30 | page_tail(); |
31 | 31 | exit(); |
32 | 32 | } |
33 | 33 | |
34 | 34 | try { |
35 | 35 | $openid = new LightOpenID; |
36 | - echo "<pre>"; |
|
36 | + echo " < pre > "; |
|
37 | 37 | if(!$openid->mode) { |
38 | 38 | if(isset($_POST['openid_identifier'])) { |
39 | 39 | $openid->identity = $_POST['openid_identifier']; |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $subset = sanitize_tags(get_str("subset")); |
28 | 28 | $venue = sanitize_tags(get_str("venue", true)); |
29 | 29 | $columns = get_int("cols", true); |
30 | -$c = $columns?"&cols=$columns":""; |
|
30 | +$c = $columns ? "&cols=$columns" : ""; |
|
31 | 31 | check_subset($subset); |
32 | 32 | if ($action) { |
33 | 33 | check_tokens($user->authenticator); |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | return file_exists("$d/stop_sched"); |
57 | 57 | } |
58 | 58 | |
59 | -function xml_error($num=-1, $msg=null, $file=null, $line=null) { |
|
59 | +function xml_error($num = -1, $msg = null, $file = null, $line = null) { |
|
60 | 60 | global $xml_outer_tag; |
61 | 61 | if (!$msg) { |
62 | - switch($num) { |
|
62 | + switch ($num) { |
|
63 | 63 | case -112: $msg = "Invalid XML"; break; |
64 | 64 | case -136: $msg = "Not found"; break; |
65 | 65 | case -137: $msg = "Name or email address is not unique"; break; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | // If it's a single-tag element, and it's present, just return the tag |
106 | 106 | // |
107 | 107 | function parse_element($xml, $tag) { |
108 | - $closetag = "</" . substr($tag,1); |
|
108 | + $closetag = "</".substr($tag, 1); |
|
109 | 109 | $x = strstr($xml, $tag); |
110 | 110 | if ($x) { |
111 | 111 | if (strstr($tag, "/>")) return $tag; |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | |
122 | 122 | function parse_next_element($xml, $tag, &$cursor) { |
123 | 123 | $element = null; |
124 | - $closetag = "</" . substr($tag,1); |
|
125 | - $pos = substr($xml,$cursor); |
|
124 | + $closetag = "</".substr($tag, 1); |
|
125 | + $pos = substr($xml, $cursor); |
|
126 | 126 | $x = strstr($pos, $tag); |
127 | 127 | if ($x) { |
128 | 128 | if (strstr($tag, "/>")) return $tag; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | // whose OSs may have such restrictions. |
223 | 223 | // |
224 | 224 | function is_valid_filename($x) { |
225 | - if (strlen($x)>255) return false; |
|
225 | + if (strlen($x) > 255) return false; |
|
226 | 226 | // \w means A-Za-z0-9_ |
227 | 227 | return preg_match('/^[\w\-.]+$/', $x); |
228 | 228 | } |
@@ -30,6 +30,6 @@ |
||
30 | 30 | if (!$thread) error_page('No such thread'); |
31 | 31 | $logged_in_user = get_logged_in_user(); |
32 | 32 | |
33 | -$posts = get_thread_posts($threadid, 0,true); |
|
33 | +$posts = get_thread_posts($threadid, 0, true); |
|
34 | 34 | header("Location: forum_rate.php?choice=p&post=".$posts[0]->id); |
35 | 35 | ?> |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | start_table(); |
51 | 51 | |
52 | 52 | $get_reason = true; |
53 | -if (get_str('action')=="hide") { |
|
53 | +if (get_str('action') == "hide") { |
|
54 | 54 | //display input that selects reason |
55 | 55 | echo "<input type=hidden name=action value=hide>"; |
56 | 56 | row1(tra("Hide post")); |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | ) |
68 | 68 | ) |
69 | 69 | ); |
70 | -} elseif (get_str('action')=="move") { |
|
70 | +} elseif (get_str('action') == "move") { |
|
71 | 71 | row1(tra("Move post")); |
72 | 72 | echo "<input type=hidden name=action value=move>"; |
73 | 73 | row2(tra("Destination thread ID:"), "<input name=\"threadid\">"); |
74 | 74 | // TODO: display where to move the post as a dropdown instead of having to get ID |
75 | -} elseif (get_str('action')=="banish_user") { |
|
75 | +} elseif (get_str('action') == "banish_user") { |
|
76 | 76 | $userid = get_int('userid'); |
77 | 77 | $user = BoincUser::lookup_id($userid); |
78 | 78 | if (!$user) { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | BoincForumPrefs::lookup($user); |
82 | 82 | $x = $user->prefs->banished_until; |
83 | - if ($x>time()) { |
|
83 | + if ($x > time()) { |
|
84 | 84 | error_page(tra("User is already banished")); |
85 | 85 | } |
86 | 86 | row1(tra("Banish user")); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | echo "<input type=\"hidden\" name=\"id\" value=\"".$postid."\">\n"; |
99 | 99 | echo "<input type=\"hidden\" name=\"userid\" value=\"".$userid."\">\n"; |
100 | 100 | echo "<input type=\"hidden\" name=\"confirmed\" value=\"yes\">\n"; |
101 | -} elseif (get_str('action')=="delete") { |
|
101 | +} elseif (get_str('action') == "delete") { |
|
102 | 102 | echo "<input type=hidden name=action value=delete>"; |
103 | 103 | row2( |
104 | 104 | "Are you sure want to delete this post? This cannot be undone.", |