@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | start_table(); |
50 | 50 | |
51 | 51 | $get_reason = true; |
52 | -if (get_str('action')=="hide") { |
|
52 | +if (get_str('action') == "hide") { |
|
53 | 53 | //display input that selects reason |
54 | 54 | echo "<input type=hidden name=action value=hide>"; |
55 | 55 | row1(tra("Hide post")); |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | ) |
67 | 67 | ) |
68 | 68 | ); |
69 | -} elseif (get_str('action')=="move") { |
|
69 | +} elseif (get_str('action') == "move") { |
|
70 | 70 | row1(tra("Move post")); |
71 | 71 | echo "<input type=hidden name=action value=move>"; |
72 | 72 | row2(tra("Destination thread ID:"), "<input name=\"threadid\">"); |
73 | 73 | // TODO: display where to move the post as a dropdown instead of having to get ID |
74 | -} elseif (get_str('action')=="banish_user") { |
|
74 | +} elseif (get_str('action') == "banish_user") { |
|
75 | 75 | $userid = get_int('userid'); |
76 | 76 | $user = BoincUser::lookup_id($userid); |
77 | 77 | BoincForumPrefs::lookup($user); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | error_page("no user found"); |
80 | 80 | } |
81 | 81 | $x = $user->prefs->banished_until; |
82 | - if ($x>time()) { |
|
82 | + if ($x > time()) { |
|
83 | 83 | error_page(tra("User is already banished")); |
84 | 84 | } |
85 | 85 | row1(tra("Banish user")); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | echo "<input type=\"hidden\" name=\"id\" value=\"".$postid."\">\n"; |
98 | 98 | echo "<input type=\"hidden\" name=\"userid\" value=\"".$userid."\">\n"; |
99 | 99 | echo "<input type=\"hidden\" name=\"confirmed\" value=\"yes\">\n"; |
100 | -} elseif (get_str('action')=="delete") { |
|
100 | +} elseif (get_str('action') == "delete") { |
|
101 | 101 | echo "<input type=hidden name=action value=delete>"; |
102 | 102 | row2( |
103 | 103 | "Are you sure want to delete this post? This cannot be undone.", |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | // where team includes a field "refcnt". |
32 | 32 | // |
33 | 33 | function merge_lists($list1, &$list2, $weight) { |
34 | - foreach($list1 as $team) { |
|
34 | + foreach ($list1 as $team) { |
|
35 | 35 | $id = $team->id; |
36 | 36 | if (array_key_exists($id, $list2)) { |
37 | 37 | $list2[$id]->refcnt += $weight; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if (defined("SHOW_NONVALIDATED_TEAMS")) { |
98 | 98 | $user = BoincUser::lookup_id($team->userid); |
99 | 99 | echo "<td>"; |
100 | - echo $user->email_validated?"Yes":"No"; |
|
100 | + echo $user->email_validated ? "Yes" : "No"; |
|
101 | 101 | echo "</td>\n"; |
102 | 102 | } |
103 | 103 | echo " |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | xml_header(); |
138 | 138 | echo "<teams>\n"; |
139 | 139 | sort_list($list); |
140 | - foreach($list as $team) { |
|
140 | + foreach ($list as $team) { |
|
141 | 141 | show_team_xml($team); |
142 | 142 | } |
143 | 143 | echo "</teams>\n"; |
@@ -164,14 +164,14 @@ discard block |
||
164 | 164 | merge_lists($list2, $list, 3); |
165 | 165 | $tried = true; |
166 | 166 | } |
167 | - if (strlen($params->country) && $params->country!='None') { |
|
167 | + if (strlen($params->country) && $params->country != 'None') { |
|
168 | 168 | $country = BoincDb::escape_string($params->country); |
169 | 169 | $list2 = get_teams("country = '$country'", $params->active); |
170 | 170 | //echo "<br>country matches: ",sizeof($list2); |
171 | 171 | merge_lists($list2, $list, 1); |
172 | 172 | $tried = true; |
173 | 173 | } |
174 | - if ($params->type and $params->type>1) { |
|
174 | + if ($params->type and $params->type > 1) { |
|
175 | 175 | $list2 = get_teams("type=$params->type", $params->active); |
176 | 176 | //echo "<br>type matches: ",sizeof($list2); |
177 | 177 | merge_lists($list2, $list, 2); |
@@ -35,14 +35,14 @@ |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | $owner = BoincUser::lookup_id($thread->owner); |
38 | -if ($logged_in_user->id == $owner->id){ |
|
38 | +if ($logged_in_user->id == $owner->id) { |
|
39 | 39 | $action = get_str("action"); |
40 | 40 | if ($action == "set") { |
41 | 41 | $ret = $thread->update("status=1"); |
42 | 42 | } else { |
43 | 43 | $ret = $thread->update("status=0"); |
44 | 44 | } |
45 | - if (!$ret){ |
|
45 | + if (!$ret) { |
|
46 | 46 | error_page("Could not update the status of the thread: ".$thread->id); |
47 | 47 | } |
48 | 48 | } else { |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | // Object-caching and full-file caching is used to speed up queries |
24 | 24 | // for data from this page. |
25 | 25 | |
26 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
26 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
27 | 27 | |
28 | 28 | require_once("../inc/cache.inc"); |
29 | 29 | require_once("../inc/util.inc"); |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | } |
40 | 40 | $format = get_str("format", true); |
41 | 41 | |
42 | -if ($format=="xml"){ |
|
42 | +if ($format == "xml") { |
|
43 | 43 | // don't do caching for XML |
44 | 44 | xml_header(); |
45 | 45 | $retval = db_init_xml(); |
46 | 46 | if ($retval) xml_error($retval); |
47 | - if ($auth){ |
|
47 | + if ($auth) { |
|
48 | 48 | $user = BoincUser::lookup_auth($auth); |
49 | 49 | $show_hosts = true; |
50 | 50 | } else { |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | // The page may be presented in many different languages, |
59 | 59 | // so here we cache the data instead |
60 | 60 | // |
61 | - $cache_args="userid=".$id; |
|
61 | + $cache_args = "userid=".$id; |
|
62 | 62 | $cached_data = get_cached_data(USER_PAGE_TTL, $cache_args); |
63 | - if ($cached_data){ |
|
63 | + if ($cached_data) { |
|
64 | 64 | // We found some old but non-stale data, let's use it |
65 | 65 | $data = unserialize($cached_data); |
66 | 66 | $user = $data->user; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | BoincForumPrefs::lookup($user); |
78 | 78 | $user = @get_other_projects($user); |
79 | - $community_links = get_community_links_object($user); |
|
79 | + $community_links = get_community_links_object($user); |
|
80 | 80 | |
81 | 81 | $data = new StdClass; |
82 | 82 | $data->user = $user; |
@@ -39,7 +39,7 @@ |
||
39 | 39 | } else { |
40 | 40 | $last_mod_time = time(); |
41 | 41 | } |
42 | -$create_date = gmdate('D, d M Y H:i:s', $last_mod_time) . ' GMT'; |
|
42 | +$create_date = gmdate('D, d M Y H:i:s', $last_mod_time).' GMT'; |
|
43 | 43 | |
44 | 44 | header("Expires: ".gmdate('D, d M Y H:i:s', time())." GMT"); |
45 | 45 | header("Last-Modified: ".$create_date); |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | |
40 | 40 | // Delete a user if they have no credit, results, or posts |
41 | 41 | // |
42 | -function possibly_delete_user($user){ |
|
43 | - if ($user->total_credit > 0.0){ |
|
42 | +function possibly_delete_user($user) { |
|
43 | + if ($user->total_credit > 0.0) { |
|
44 | 44 | admin_error_page("Cannot delete user: User has credit."); |
45 | 45 | } |
46 | 46 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | admin_error_page("Cannot delete user: User has forum posts."); |
57 | 57 | } |
58 | 58 | |
59 | - if ($user->teamid){ |
|
59 | + if ($user->teamid) { |
|
60 | 60 | user_quit_team($user); |
61 | 61 | } |
62 | 62 | delete_user($user); |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | function handle_special_user($user) { |
68 | 68 | global $special_user_bitfield; |
69 | 69 | $Nbf = sizeof($special_user_bitfield); |
70 | - $bits=""; |
|
71 | - for ($i=0; $i<$Nbf; $i++) { |
|
70 | + $bits = ""; |
|
71 | + for ($i = 0; $i < $Nbf; $i++) { |
|
72 | 72 | $key = "special_user_$i"; |
73 | 73 | if (array_key_exists($key, $_POST) && $_POST[$key]) { |
74 | 74 | $bits .= "1"; |
@@ -94,35 +94,35 @@ discard block |
||
94 | 94 | ); |
95 | 95 | } else { |
96 | 96 | if (is_numeric($dt)) { |
97 | - $t = $dt>0 ? time()+$dt : 0; |
|
97 | + $t = $dt > 0 ? time() + $dt : 0; |
|
98 | 98 | $q = "UPDATE forum_preferences SET banished_until=$t WHERE userid=$user->id"; |
99 | 99 | _mysql_query($q); |
100 | 100 | |
101 | 101 | // put a timestamp in wiki to trigger re-validation of credentials |
102 | 102 | |
103 | - if (function_exists('touch_wiki_user')){ |
|
103 | + if (function_exists('touch_wiki_user')) { |
|
104 | 104 | touch_wiki_user($user); |
105 | 105 | } |
106 | 106 | |
107 | 107 | // Send suspension e-mail to user and administrators |
108 | 108 | |
109 | - if ($dt>0) { |
|
110 | - $subject = PROJECT." posting privileges suspended for ". $user->name; |
|
109 | + if ($dt > 0) { |
|
110 | + $subject = PROJECT." posting privileges suspended for ".$user->name; |
|
111 | 111 | $body = " |
112 | -Forum posting privileges for the " .PROJECT. " user \"".$user->name."\" |
|
113 | -have been suspended for " .time_diff($dt). " by ".$g_logged_in_user->name.". |
|
112 | +Forum posting privileges for the " .PROJECT." user \"".$user->name."\" |
|
113 | +have been suspended for " .time_diff($dt)." by ".$g_logged_in_user->name.". |
|
114 | 114 | The reason given was: |
115 | 115 | |
116 | 116 | $reason |
117 | 117 | |
118 | -The suspension will end at " .time_str($t)."\n"; |
|
118 | +The suspension will end at ".time_str($t)."\n"; |
|
119 | 119 | } else { |
120 | - $subject = PROJECT." user ". $user->name. " unsuspended"; |
|
120 | + $subject = PROJECT." user ".$user->name." unsuspended"; |
|
121 | 121 | $body = " |
122 | -Forum posting privileges for the " .PROJECT. " user \"".$user->name."\" |
|
122 | +Forum posting privileges for the " .PROJECT." user \"".$user->name."\" |
|
123 | 123 | have been restored by ".$g_logged_in_user->name."\n"; |
124 | 124 | if ($reason) { |
125 | - $body.="The reason given was:\n\n $reason\n"; |
|
125 | + $body .= "The reason given was:\n\n $reason\n"; |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
@@ -186,13 +186,13 @@ discard block |
||
186 | 186 | row1("Special User Status"); |
187 | 187 | |
188 | 188 | echo "<tr>\n"; |
189 | - for ($i=0; $i<$Nbf; $i++) { |
|
189 | + for ($i = 0; $i < $Nbf; $i++) { |
|
190 | 190 | $bit = substr($user->prefs->special_user, $i, 1); |
191 | 191 | echo "<tr><td><input type='checkbox'' name='special_user_".$i."' value='1'"; |
192 | 192 | if ($bit == 1) { |
193 | 193 | echo " checked='checked'"; |
194 | 194 | } |
195 | - echo ">". $special_user_bitfield[$i] ."</td></tr>\n"; |
|
195 | + echo ">".$special_user_bitfield[$i]."</td></tr>\n"; |
|
196 | 196 | } |
197 | 197 | echo "</tr>"; |
198 | 198 | |
@@ -217,10 +217,10 @@ discard block |
||
217 | 217 | if ($user->prefs->banished_until) { |
218 | 218 | $dt = $user->prefs->banished_until - time(); |
219 | 219 | if ($dt > 0) { |
220 | - $x = " Suspended until " . time_str($user->prefs->banished_until) |
|
221 | - ."<br/> (Expires in " . time_diff($dt) .")" ; |
|
220 | + $x = " Suspended until ".time_str($user->prefs->banished_until) |
|
221 | + ."<br/> (Expires in ".time_diff($dt).")"; |
|
222 | 222 | } else { |
223 | - $x = " last suspended " . time_str($user->prefs->banished_until); |
|
223 | + $x = " last suspended ".time_str($user->prefs->banished_until); |
|
224 | 224 | } |
225 | 225 | row1($x); |
226 | 226 | } else { |
@@ -238,11 +238,11 @@ discard block |
||
238 | 238 | "; |
239 | 239 | echo " |
240 | 240 | <input type='radio' name='suspend_for' value='172800'> 48 hours <br/> |
241 | - <input type='radio' name='suspend_for' value='",86400*7,"'> 1 week <br/> |
|
242 | - <input type='radio' name='suspend_for' value='",86400*14,"'> 2 weeks <br/> |
|
241 | + <input type='radio' name='suspend_for' value='",86400*7, "'> 1 week <br/> |
|
242 | + <input type='radio' name='suspend_for' value='",86400*14, "'> 2 weeks <br/> |
|
243 | 243 | "; |
244 | 244 | |
245 | - if ($dt>0) { |
|
245 | + if ($dt > 0) { |
|
246 | 246 | echo " |
247 | 247 | <input type='radio' name='suspend_for' value='-1'> <b>unsuspend</b> <br/>"; |
248 | 248 | } |
@@ -306,6 +306,6 @@ discard block |
||
306 | 306 | |
307 | 307 | show_manage_user_form($user); |
308 | 308 | |
309 | -$cvs_version_tracker[]= //Generated automatically - do not edit |
|
309 | +$cvs_version_tracker[] = //Generated automatically - do not edit |
|
310 | 310 | "\$Id$"; |
311 | 311 | ?> |
@@ -42,15 +42,15 @@ |
||
42 | 42 | $start_id = 0; //Set this to something else if you like |
43 | 43 | $forum_preferencess = _mysql_query("select * from forum_preferences where userid>$start_id order by userid"); |
44 | 44 | echo _mysql_error(); |
45 | - $i=0; |
|
46 | - while ($forum_preferences = _mysql_fetch_object($forum_preferencess)){ |
|
45 | + $i = 0; |
|
46 | + while ($forum_preferences = _mysql_fetch_object($forum_preferencess)) { |
|
47 | 47 | $i++; |
48 | 48 | if ($i%100 == 0) { //For every 100 forum_preferencess |
49 | - echo $forum_preferences->userid.". "; flush(); // print out where we are |
|
49 | + echo $forum_preferences->userid.". "; flush(); // print out where we are |
|
50 | 50 | //usleep(200000); |
51 | 51 | } |
52 | 52 | |
53 | - if ($forum_preferences->userid > $start_id){ |
|
53 | + if ($forum_preferences->userid > $start_id) { |
|
54 | 54 | fix_forum_preferences($forum_preferences); |
55 | 55 | } |
56 | 56 | } |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | |
27 | 27 | |
28 | 28 | // Create the graph. These two calls are always required |
29 | - $graph = new Graph(350,250,"auto"); |
|
29 | + $graph = new Graph(350, 250, "auto"); |
|
30 | 30 | //$graph->SetScale("lin"); |
31 | 31 | //$graph->SetScale("textlin"); |
32 | 32 | $graph->SetScale("loglin"); |
33 | 33 | |
34 | 34 | // Create the linear plot |
35 | - $lineplot=new BarPlot($arr, $xarr); |
|
35 | + $lineplot = new BarPlot($arr, $xarr); |
|
36 | 36 | $lineplot->SetColor("blue"); |
37 | 37 | |
38 | 38 | // Add the plot to the graph |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | function show_text($xarr, $yarr) { |
46 | 46 | $n = sizeof($xarr); |
47 | - for ($i=0; $i<$n; $i++) { |
|
47 | + for ($i = 0; $i < $n; $i++) { |
|
48 | 48 | echo "<br>$xarr[$i] $yarr[$i]\n"; |
49 | 49 | } |
50 | 50 | } |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | if ($ind > $maxind) $maxind = $ind; |
91 | 91 | } |
92 | 92 | $xarr = array(); |
93 | - for ($i=0; $i<=$maxind; $i++) { |
|
93 | + for ($i = 0; $i <= $maxind; $i++) { |
|
94 | 94 | $xarr[$i] = $i; |
95 | - if (is_null($yarr[$i])) $yarr[$i]=0; |
|
95 | + if (is_null($yarr[$i])) $yarr[$i] = 0; |
|
96 | 96 | } |
97 | 97 | if ($show_text) { |
98 | 98 | show_text($xarr, $yarr); |
@@ -44,15 +44,15 @@ |
||
44 | 44 | $start_id = 0; //Set this to something else if you like |
45 | 45 | $posts = _mysql_query("select * from post where id>$start_id order by id"); |
46 | 46 | echo _mysql_error(); |
47 | - $i=0; |
|
48 | - while ($post = _mysql_fetch_object($posts)){ |
|
47 | + $i = 0; |
|
48 | + while ($post = _mysql_fetch_object($posts)) { |
|
49 | 49 | $i++; |
50 | 50 | if ($i%100 == 0) { //For every 100 posts |
51 | - echo $post->id.". "; flush(); // print out where we are |
|
51 | + echo $post->id.". "; flush(); // print out where we are |
|
52 | 52 | //usleep(200000); |
53 | 53 | } |
54 | 54 | |
55 | - if ($post->id > $start_id){ |
|
55 | + if ($post->id > $start_id) { |
|
56 | 56 | fix_post($post); |
57 | 57 | } |
58 | 58 | } |