@@ -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; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | BoincForumPrefs::lookup($user); |
75 | 75 | $user = @get_other_projects($user); |
76 | - $community_links = get_community_links_object($user); |
|
76 | + $community_links = get_community_links_object($user); |
|
77 | 77 | |
78 | 78 | $data = new StdClass; |
79 | 79 | $data->user = $user; |
@@ -29,6 +29,6 @@ |
||
29 | 29 | $thread = BoincThread::lookup_id($threadid); |
30 | 30 | $logged_in_user = get_logged_in_user(); |
31 | 31 | |
32 | -$posts = get_thread_posts($threadid, 0,true); |
|
32 | +$posts = get_thread_posts($threadid, 0, true); |
|
33 | 33 | header("Location: forum_rate.php?choice=p&post=".$posts[0]->id); |
34 | 34 | ?> |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $subset = sanitize_tags(get_str("subset")); |
28 | 28 | $venue = sanitize_tags(get_str("venue", true)); |
29 | 29 | $columns = get_str("cols", true); |
30 | -$c = $columns?"&cols=$columns":""; |
|
30 | +$c = $columns ? "&cols=$columns" : ""; |
|
31 | 31 | check_subset($subset); |
32 | 32 | |
33 | 33 | if ($action) { |
@@ -112,5 +112,5 @@ discard block |
||
112 | 112 | echo "<a href=prefs.php?subset=$subset$c>".tra("Back to preferences")."</a>\n"; |
113 | 113 | page_tail(); |
114 | 114 | |
115 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
115 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
116 | 116 | ?> |
@@ -28,10 +28,10 @@ |
||
28 | 28 | // |
29 | 29 | function show_platforms() { |
30 | 30 | $xmlFragment = unserialize(get_cached_data(3600, "project_config_platform_xml")); |
31 | - if ($xmlFragment==false){ |
|
31 | + if ($xmlFragment == false) { |
|
32 | 32 | $platforms = BoincDB::get()->enum_fields("platform, DBNAME.app_version, DBNAME.app", "BoincPlatform", "platform.name, platform.user_friendly_name, plan_class", "app_version.platformid = platform.id and app_version.appid = app.id and app_version.deprecated=0 and app.deprecated=0 group by platform.name, plan_class", ""); |
33 | 33 | $xmlFragment = " <platforms>"; |
34 | - foreach ($platforms as $platform){ |
|
34 | + foreach ($platforms as $platform) { |
|
35 | 35 | $xmlFragment .= " |
36 | 36 | <platform> |
37 | 37 | <platform_name>$platform->name</platform_name> |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $ndays = get_int('ndays', true); |
59 | 59 | $threads_only = get_str('threads_only', true); |
60 | 60 | |
61 | -if(!$ndays || $ndays < 1) { |
|
61 | +if (!$ndays || $ndays < 1) { |
|
62 | 62 | $ndays = 30; |
63 | 63 | } |
64 | 64 |
@@ -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; |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | if ($temp_sort_style) { |
80 | 80 | $sort_style = $temp_sort_style; |
81 | 81 | } else if ($sort_style) { |
82 | - $forum_style = 0; // this is deprecated |
|
83 | - if ($logged_in_user){ |
|
82 | + $forum_style = 0; // this is deprecated |
|
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(); |
@@ -118,10 +118,10 @@ discard block |
||
118 | 118 | |
119 | 119 | if (false) { |
120 | 120 | if ($forum->parent_type == 0) { |
121 | - if ($category->is_helpdesk && !$thread->status){ |
|
122 | - if ($logged_in_user){ |
|
123 | - if ($thread->owner == $logged_in_user->id){ |
|
124 | - if ($thread->replies !=0) { |
|
121 | + if ($category->is_helpdesk && !$thread->status) { |
|
122 | + if ($logged_in_user) { |
|
123 | + if ($thread->owner == $logged_in_user->id) { |
|
124 | + if ($thread->replies != 0) { |
|
125 | 125 | // Show a "this question has been answered" to the author |
126 | 126 | echo "<p>"; |
127 | 127 | show_button( |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | // If logged in user is moderator, enable some extra features |
188 | 188 | // |
189 | 189 | if (is_moderator($logged_in_user, $forum)) { |
190 | - if ($thread->hidden){ |
|
190 | + if ($thread->hidden) { |
|
191 | 191 | show_button( |
192 | 192 | "forum_moderate_thread_action.php?action=unhide&thread=".$thread->id."$tokens", |
193 | 193 | tra("Unhide"), |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | tra("Hide this thread") |
201 | 201 | ); |
202 | 202 | } |
203 | - if ($thread->sticky){ |
|
203 | + if ($thread->sticky) { |
|
204 | 204 | show_button( |
205 | 205 | "forum_moderate_thread_action.php?action=desticky&thread=".$thread->id."$tokens", |
206 | 206 | tra("Make unsticky"), |
@@ -306,5 +306,5 @@ discard block |
||
306 | 306 | $thread->update("views=views+1"); |
307 | 307 | |
308 | 308 | page_tail(); |
309 | -$cvs_version_tracker[]="\$Id$"; |
|
309 | +$cvs_version_tracker[] = "\$Id$"; |
|
310 | 310 | ?> |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | if (!$users_per_page) { |
29 | 29 | $users_per_page = 20; |
30 | 30 | } |
31 | -define ('ITEM_LIMIT', 10000); |
|
31 | +define('ITEM_LIMIT', 10000); |
|
32 | 32 | |
33 | 33 | function get_top_participants($offset, $sort_by) { |
34 | 34 | global $users_per_page; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | <td align=right>", format_credit_large($user->expavg_credit), "</td> |
68 | 68 | <td align=right>", format_credit_large($user->total_credit), "</td> |
69 | 69 | <td>", $user->country, "</td> |
70 | - <td>", time_str($user->create_time),"</td> |
|
70 | + <td>", time_str($user->create_time), "</td> |
|
71 | 71 | </tr> |
72 | 72 | "; |
73 | 73 | } |
@@ -82,16 +82,16 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | $offset = get_int("offset", true); |
85 | -if (!$offset) $offset=0; |
|
86 | -if ($offset % $users_per_page) $offset = 0; |
|
85 | +if (!$offset) $offset = 0; |
|
86 | +if ($offset%$users_per_page) $offset = 0; |
|
87 | 87 | |
88 | 88 | if ($offset < ITEM_LIMIT) { |
89 | 89 | $cache_args = "sort_by=$sort_by&offset=$offset"; |
90 | - $cacheddata = get_cached_data(TOP_PAGES_TTL,$cache_args); |
|
90 | + $cacheddata = get_cached_data(TOP_PAGES_TTL, $cache_args); |
|
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 |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | //save data in cache |
101 | 101 | // |
102 | - set_cached_data(TOP_PAGES_TTL, serialize($data),$cache_args); |
|
102 | + set_cached_data(TOP_PAGES_TTL, serialize($data), $cache_args); |
|
103 | 103 | } |
104 | 104 | } else { |
105 | 105 | error_page(tra("Limit exceeded - Sorry, first %1 items only", ITEM_LIMIT)); |
@@ -122,7 +122,7 @@ 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) { //If we aren't on the last page |
|
126 | 126 | $new_offset = $offset + $users_per_page; |
127 | 127 | echo "<a href=top_users.php?sort_by=$sort_by&offset=$new_offset>".tra("Next %1", $users_per_page)."</a>"; |
128 | 128 | } |
@@ -26,13 +26,13 @@ |
||
26 | 26 | |
27 | 27 | if (isset($_GET["sort_by"])) { |
28 | 28 | $sort_by = $_GET["sort_by"]; |
29 | - $sort_by = strip_tags($sort_by); // remove XSS nonsense |
|
29 | + $sort_by = strip_tags($sort_by); // remove XSS nonsense |
|
30 | 30 | } else { |
31 | 31 | $sort_by = "expavg_credit"; |
32 | 32 | } |
33 | 33 | |
34 | 34 | $offset = get_int("offset", true); |
35 | -if (!$offset) $offset=0; |
|
35 | +if (!$offset) $offset = 0; |
|
36 | 36 | |
37 | 37 | if ($offset > 1000) { |
38 | 38 | error_page(tra("Limit exceeded: Can only display the first 1000 members.")); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | table_header("platform", "plan class", "version#", "deprecated"); |
50 | 50 | foreach ($avs as $av) { |
51 | 51 | $platform = BoincPlatform::lookup_id($av->platformid); |
52 | - $c = $av->deprecated?"checked":""; |
|
52 | + $c = $av->deprecated ? "checked" : ""; |
|
53 | 53 | echo " |
54 | 54 | <tr> |
55 | 55 | <td>$platform->name</td> |