@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | BoincForumPrefs::lookup($user); |
31 | 31 | |
32 | -if (post_str("action", true)=="reset_confirm"){ |
|
32 | +if (post_str("action", true)=="reset_confirm") { |
|
33 | 33 | page_head(tra("Confirm reset")); |
34 | 34 | echo tra("This action will erase any changes you have made in your community preferences. To cancel, click your browser's Back button.")." |
35 | 35 | <p> |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | // If the user has requested a reset of preferences; |
46 | 46 | // preserve a few fields. |
47 | 47 | // |
48 | -if (post_str("action", true)=="reset"){ |
|
48 | +if (post_str("action", true)=="reset") { |
|
49 | 49 | $posts = $user->prefs->posts; |
50 | 50 | $last_post = $user->prefs->last_post; |
51 | 51 | $rated_posts = $user->prefs->rated_posts; |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | |
72 | 72 | // Update the user avatar |
73 | 73 | if ($avatar_type<0 or $avatar_type>3) $avatar_type=0; |
74 | -if ($avatar_type==0){ |
|
75 | - if (file_exists($newfile)){ |
|
74 | +if ($avatar_type==0) { |
|
75 | + if (file_exists($newfile)) { |
|
76 | 76 | // Delete the file on the server if the user |
77 | 77 | // decides not to use an avatar |
78 | 78 | // |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $avatar_url=""; |
82 | 82 | } elseif ($avatar_type == 1) { |
83 | 83 | $avatar_url = "//www.gravatar.com/avatar/".md5($user->email_addr)."?s=100&d=identicon"; |
84 | -} elseif ($avatar_type==2){ |
|
84 | +} elseif ($avatar_type==2) { |
|
85 | 85 | if (($rpc && (post_str("avatar_url", true) != null)) || ($_FILES['picture']['tmp_name']!="")) { |
86 | 86 | if ($_FILES['picture']['tmp_name']!="") { |
87 | 87 | $file = $_FILES['picture']['tmp_name']; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $file = post_str("avatar_url"); |
91 | 91 | } |
92 | 92 | $size = getImageSize($file); |
93 | - if ($size[2]!=2 and $size[2]!=3){ |
|
93 | + if ($size[2]!=2 and $size[2]!=3) { |
|
94 | 94 | //Not the right kind of file |
95 | 95 | error_page(tra("Error: Not the right kind of file, only PNG and JPEG are supported.")); |
96 | 96 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $image2 = intelligently_scale_image($file, 100, 100); |
100 | 100 | ImageJPEG($image2, $newfile); |
101 | 101 | } |
102 | - if (file_exists($newfile)){ |
|
102 | + if (file_exists($newfile)) { |
|
103 | 103 | $avatar_url=IMAGE_URL.$user->id."_avatar.jpg"; //$newfile; |
104 | 104 | } else { |
105 | 105 | //User didn't upload a compatible file or it went lost on the server |
@@ -131,9 +131,9 @@ discard block |
||
131 | 131 | } // DISABLE_FORUMS |
132 | 132 | |
133 | 133 | $add_user_to_filter = (isset($_POST["add_user_to_filter"]) && $_POST["add_user_to_filter"]!=""); |
134 | -if ($add_user_to_filter){ |
|
134 | +if ($add_user_to_filter) { |
|
135 | 135 | $user_to_add = trim($_POST["forum_filter_user"]); |
136 | - if ($user_to_add!="" and $user_to_add==strval(intval($user_to_add))){ |
|
136 | + if ($user_to_add!="" and $user_to_add==strval(intval($user_to_add))) { |
|
137 | 137 | $other_user = BoincUser::lookup_id($user_to_add); |
138 | 138 | if (!$other_user) { |
139 | 139 | echo tra("No such user:")." ".$user_to_add; |
@@ -146,9 +146,9 @@ discard block |
||
146 | 146 | // Or remove some from the ignore list |
147 | 147 | // |
148 | 148 | $ignored_users = get_ignored_list($user); |
149 | -for ($i=0;$i<sizeof($ignored_users);$i++){ |
|
149 | +for ($i=0;$i<sizeof($ignored_users);$i++) { |
|
150 | 150 | $remove = "remove".trim($ignored_users[$i]); |
151 | - if (isset($_POST[$remove]) && $_POST[$remove]!=""){ |
|
151 | + if (isset($_POST[$remove]) && $_POST[$remove]!="") { |
|
152 | 152 | $other_user = BoincUser::lookup_id($ignored_users[$i]); |
153 | 153 | if (!$other_user) { |
154 | 154 | echo tra("No such user:")." ".$ignored_users[$j]; |
@@ -369,7 +369,7 @@ |
||
369 | 369 | $text = "---"; |
370 | 370 | if ($batch->state == BATCH_STATE_COMPLETE) { |
371 | 371 | $y = '<font color="red">failed</font>'; |
372 | - } else { |
|
372 | + } else { |
|
373 | 373 | $y = "in progress"; |
374 | 374 | } |
375 | 375 | } |
@@ -48,14 +48,14 @@ |
||
48 | 48 | |
49 | 49 | if (!$sort_style) { |
50 | 50 | // get the sort style either from the logged in user or a cookie |
51 | - if ($user){ |
|
51 | + if ($user) { |
|
52 | 52 | $sort_style = $user->prefs->forum_sorting; |
53 | 53 | } else { |
54 | 54 | list($sort_style, $thread_style) = parse_forum_cookie(); |
55 | 55 | } |
56 | 56 | } else { |
57 | 57 | // set the sort style |
58 | - if ($user){ |
|
58 | + if ($user) { |
|
59 | 59 | $user->prefs->forum_sorting = $sort_style; |
60 | 60 | $user->prefs->update("forum_sorting=$sort_style"); |
61 | 61 | } else { |
@@ -92,7 +92,8 @@ |
||
92 | 92 | |
93 | 93 | $navailable_users = 0; |
94 | 94 | foreach ($users as $user) { |
95 | - if ($user->id != $team->userid) { //don't show current founder |
|
95 | + if ($user->id != $team->userid) { |
|
96 | +//don't show current founder |
|
96 | 97 | $user_total_credit = format_credit($user->total_credit); |
97 | 98 | $user_expavg_credit = format_credit($user->expavg_credit); |
98 | 99 | $selected = ($user->id == $team->ping_user)?"selected":""; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | // Do we have the data in cache? |
93 | 93 | // |
94 | - if ($cacheddata){ |
|
94 | + if ($cacheddata) { |
|
95 | 95 | $data = unserialize($cacheddata); // use the cached data |
96 | 96 | } else { |
97 | 97 | //if not do queries etc to generate new data |
@@ -122,7 +122,8 @@ discard block |
||
122 | 122 | echo "<a href=top_users.php?sort_by=$sort_by&offset=$new_offset>".tra("Previous %1", $users_per_page)."</a> · "; |
123 | 123 | |
124 | 124 | } |
125 | -if ($n==$users_per_page){ //If we aren't on the last page |
|
125 | +if ($n==$users_per_page) { |
|
126 | +//If we aren't on the last page |
|
126 | 127 | $new_offset = $offset + $users_per_page; |
127 | 128 | echo "<a href=top_users.php?sort_by=$sort_by&offset=$new_offset>".tra("Next %1", $users_per_page)."</a>"; |
128 | 129 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $parent_post_id = 0; |
51 | 51 | } |
52 | 52 | |
53 | -if ($filter != "false"){ |
|
53 | +if ($filter != "false") { |
|
54 | 54 | $filter = true; |
55 | 55 | } else { |
56 | 56 | $filter = false; |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | $warning = null; |
68 | -if ($content && (!$preview)){ |
|
69 | - if (post_str('add_signature',true)=="add_it"){ |
|
68 | +if ($content && (!$preview)) { |
|
69 | + if (post_str('add_signature',true)=="add_it") { |
|
70 | 70 | $add_signature=true; // set a flag and concatenate later |
71 | - } else { |
|
71 | + } else { |
|
72 | 72 | $add_signature=false; |
73 | 73 | } |
74 | 74 | check_tokens($logged_in_user->authenticator); |
@@ -44,7 +44,7 @@ |
||
44 | 44 | |
45 | 45 | $cache_args = "userid=$userid"; |
46 | 46 | $cacheddata = get_cached_data(USER_PROFILE_TTL, $cache_args); |
47 | -if ($cacheddata){ |
|
47 | +if ($cacheddata) { |
|
48 | 48 | // Already got a cached version of the information |
49 | 49 | $community_links_object = unserialize($cacheddata); |
50 | 50 | } else { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | // See if "action" is provided - either through post or get |
39 | 39 | if (!post_str('action', true)) { |
40 | - if (!get_str('action', true)){ |
|
40 | + if (!get_str('action', true)) { |
|
41 | 41 | error_page(tra("You must specify an action...")); |
42 | 42 | } else { |
43 | 43 | $action = get_str('action'); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $userid = post_int('userid'); |
50 | 50 | $user=BoincUser::lookup_id($userid); |
51 | 51 | |
52 | -if ($action!="start"){ |
|
52 | +if ($action!="start") { |
|
53 | 53 | error_page("Unknown action"); |
54 | 54 | } |
55 | 55 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $mod_category = tra("Other"); |
66 | 66 | } |
67 | 67 | |
68 | -if (post_str('reason', true)){ |
|
68 | +if (post_str('reason', true)) { |
|
69 | 69 | start_vote($config,$logged_in_user,$user, $mod_category,post_str("reason")); |
70 | 70 | } else { |
71 | 71 | start_vote($config,$logged_in_user,$user, $mod_category,"None given"); |
@@ -53,8 +53,9 @@ discard block |
||
53 | 53 | // ------------ Forum identity ----------- |
54 | 54 | |
55 | 55 | $select_0 = $select_1 = $select_2 = ""; |
56 | -if (strlen($user->prefs->avatar)){ |
|
57 | - if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { // Gravatar |
|
56 | +if (strlen($user->prefs->avatar)) { |
|
57 | + if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { |
|
58 | +// Gravatar |
|
58 | 59 | $select_1 = "checked=\"true\""; |
59 | 60 | } else { |
60 | 61 | $select_2 = "checked=\"true\""; |
@@ -73,7 +74,7 @@ discard block |
||
73 | 74 | <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" ".$select_2."> |
74 | 75 | <label for=\"avatar_select_2\">".tra("Use this uploaded avatar:")."</label> <input type=\"file\" name=\"picture\">" |
75 | 76 | ); |
76 | -if (strlen($user->prefs->avatar)){ |
|
77 | +if (strlen($user->prefs->avatar)) { |
|
77 | 78 | row2(tra("Avatar preview")."<br><p class=\"text-muted\">".tra("This is how your avatar will look")."</p>", |
78 | 79 | "<img src=\"".$user->prefs->avatar."\" width=\"100\" height=\"100\">"); |
79 | 80 | } |
@@ -92,7 +93,7 @@ discard block |
||
92 | 93 | textarea_with_counter("signature", 250, $signature) |
93 | 94 | ."<br><input type=\"checkbox\" name=\"signature_by_default\" ".$signature_by_default."> ".tra("Attach signature by default") |
94 | 95 | ); |
95 | -if ($user->prefs->signature!=""){ |
|
96 | +if ($user->prefs->signature!="") { |
|
96 | 97 | row2(tra("Signature preview"). |
97 | 98 | "<br><p class=\"text-muted\">".tra("This is how your signature will look in the forums")."</p>", |
98 | 99 | output_transform($user->prefs->signature) |
@@ -138,7 +139,7 @@ discard block |
||
138 | 139 | |
139 | 140 | $filtered_userlist = get_ignored_list($user); |
140 | 141 | $forum_filtered_userlist = ""; |
141 | -for ($i=0; $i<sizeof($filtered_userlist); $i++){ |
|
142 | +for ($i=0; $i<sizeof($filtered_userlist); $i++) { |
|
142 | 143 | $id = (int)$filtered_userlist[$i]; |
143 | 144 | if ($id) { |
144 | 145 | $filtered_user = BoincUser::lookup_id($id); |