@@ -41,10 +41,10 @@ |
||
41 | 41 | return $db->insert_id(); |
42 | 42 | } |
43 | 43 | |
44 | -function create_forum($category, $orderID, $title, $description, $is_dev_blog=0) { |
|
44 | +function create_forum($category, $orderID, $title, $description, $is_dev_blog = 0) { |
|
45 | 45 | $q = "(category, orderID, title, description, is_dev_blog) values ($category, $orderID, '$title', '$description', $is_dev_blog)"; |
46 | 46 | $db = BoincDB::get(); |
47 | - $result = $db->insert("forum",$q); |
|
47 | + $result = $db->insert("forum", $q); |
|
48 | 48 | if (!$result) { |
49 | 49 | $forum = BoincForum::lookup("category=$category and title='$title'"); |
50 | 50 | if ($forum) return $forum->id; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | \***********************************************************************/ |
28 | 28 | |
29 | 29 | $limit = get_int('limit', true); |
30 | -if (! $limit > 0 ) $limit = 30; |
|
30 | +if (!$limit > 0) $limit = 30; |
|
31 | 31 | |
32 | 32 | |
33 | 33 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | echo "<input class=\"btn btn-default\" type=\"submit\" value=\"Display\">\n"; |
49 | 49 | echo "</form>\n"; |
50 | 50 | |
51 | -$query="SELECT * FROM user ORDER BY create_time DESC LIMIT $limit"; |
|
51 | +$query = "SELECT * FROM user ORDER BY create_time DESC LIMIT $limit"; |
|
52 | 52 | $result = _mysql_query($query); |
53 | 53 | if (_mysql_num_rows($result) < 1) { |
54 | 54 | echo "There are no new users."; |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | $joined = time_str($row->create_time); |
67 | 67 | $email_validated = $row->email_validated; |
68 | 68 | |
69 | - $team_name=""; |
|
70 | - if($row->teamid > 0){ |
|
69 | + $team_name = ""; |
|
70 | + if ($row->teamid > 0) { |
|
71 | 71 | $team = BoincTeam::lookup_id($row->teamid); |
72 | 72 | $team_name = $team->name; |
73 | 73 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | if ($special_bits != "0") { |
81 | 81 | for ($i = 0; $i < 7; $i++) { |
82 | 82 | $bit = substr($special_bits, $i, 1); |
83 | - if ($bit == '1'){ |
|
83 | + if ($bit == '1') { |
|
84 | 84 | if (!empty($roles)) { |
85 | 85 | $roles .= ", "; |
86 | 86 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | // Banished? |
96 | 96 | if (!empty($user->banished_until)) { |
97 | 97 | $dt = $user->banished_until - time(); |
98 | - if( $dt > 0 ) { |
|
98 | + if ($dt > 0) { |
|
99 | 99 | $x = "<span style=\"color: #ff0000\">Currently banished</span>"; |
100 | 100 | } |
101 | 101 | else { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | echo "<users>\n"; |
52 | 52 | $users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, expavg_time, has_profile, donated, country, cross_project_id, create_time, url", "teamid=$team->id"); |
53 | - foreach($users as $user) { |
|
53 | + foreach ($users as $user) { |
|
54 | 54 | show_team_member($user, $creditonly); |
55 | 55 | } |
56 | 56 | echo "</users>\n"; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | $users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, has_profile, donated, country, cross_project_id, create_time, url", "teamid=$team->id"); |
84 | -foreach($users as $user) { |
|
84 | +foreach ($users as $user) { |
|
85 | 85 | if ($plain) { |
86 | 86 | echo "$user->name $user->id\n"; |
87 | 87 | } else { |
@@ -29,7 +29,7 @@ |
||
29 | 29 | $venue = get_str("venue"); |
30 | 30 | $confirmed = get_str("confirmed", true); |
31 | 31 | $columns = get_int("cols", true); |
32 | -$c = $columns?"&cols=$columns":""; |
|
32 | +$c = $columns ? "&cols=$columns" : ""; |
|
33 | 33 | |
34 | 34 | if ($confirmed) { |
35 | 35 | if ($subset == "global") { |
@@ -56,18 +56,18 @@ discard block |
||
56 | 56 | </select>"); |
57 | 57 | |
58 | 58 | $forumid = null; |
59 | -if (get_str("forumid",true)){ |
|
59 | +if (get_str("forumid", true)) { |
|
60 | 60 | $forumid = get_str("forumid"); |
61 | 61 | } |
62 | -$forumlist="<option value=\"-1\">".tra("All")."</option>"; |
|
62 | +$forumlist = "<option value=\"-1\">".tra("All")."</option>"; |
|
63 | 63 | $categories = BoincCategory::enum(); |
64 | 64 | foreach ($categories as $category) { |
65 | 65 | $forums = BoincForum::enum("parent_type=0 and category=$category->id"); |
66 | 66 | foreach ($forums as $forum) { |
67 | - if ($forum->id==$forumid){ |
|
68 | - $forumlist.="<option selected value=\"".$forum->id."\">".$forum->title."</option>"; |
|
67 | + if ($forum->id == $forumid) { |
|
68 | + $forumlist .= "<option selected value=\"".$forum->id."\">".$forum->title."</option>"; |
|
69 | 69 | } else { |
70 | - $forumlist.="<option value=\"".$forum->id."\">".$forum->title."</option>"; |
|
70 | + $forumlist .= "<option value=\"".$forum->id."\">".$forum->title."</option>"; |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | } |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | '<select class="form-control" name="search_forum">'.$forumlist.'</select'); |
77 | 77 | |
78 | 78 | $sortlist = null; |
79 | -foreach ($thread_sort_styles as $id => $style){ |
|
80 | - if ($id == CREATE_TIME_NEW){ |
|
81 | - $sortlist.="<option selected value=\"".$id."\">".$style."</option>"; |
|
79 | +foreach ($thread_sort_styles as $id => $style) { |
|
80 | + if ($id == CREATE_TIME_NEW) { |
|
81 | + $sortlist .= "<option selected value=\"".$id."\">".$style."</option>"; |
|
82 | 82 | } else { |
83 | - $sortlist.="<option value=\"".$id."\">".$style."</option>"; |
|
83 | + $sortlist .= "<option value=\"".$id."\">".$style."</option>"; |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | row2(tra("Sort by"), |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $rating = post_int('rating', true); |
35 | 35 | if (!$choice) $choice = get_str('choice', true); |
36 | 36 | |
37 | - if ($choice == SOLUTION or $choice=="p") { |
|
37 | + if ($choice == SOLUTION or $choice == "p") { |
|
38 | 38 | $rating = 1; |
39 | 39 | } else { |
40 | 40 | $rating = -1; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | // Make sure the user has the forum's minimum amount of RAC and total credit |
54 | 54 | // before allowing them to rate a post. |
55 | 55 | // |
56 | - if ($user->total_credit<$forum->rate_min_total_credit || $user->expavg_credit<$forum->rate_min_expavg_credit) { |
|
56 | + if ($user->total_credit < $forum->rate_min_total_credit || $user->expavg_credit < $forum->rate_min_expavg_credit) { |
|
57 | 57 | error_page(tra("You need more average or total credit to rate a post.")); |
58 | 58 | } |
59 | 59 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $sum = 0; |
48 | 48 | echo "<pending_credit>\n"; |
49 | 49 | $results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0"); |
50 | - foreach($results as $result) { |
|
50 | + foreach ($results as $result) { |
|
51 | 51 | echo "<result>\n"; |
52 | 52 | echo " <resultid>".$result->id."</resultid>\n"; |
53 | 53 | echo " <workunitid>".$result->workunitid."</workunitid>\n"; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | start_table(); |
68 | 68 | echo "<tr><th>".tra("Result ID")."</th><th>".tra("Workunit ID")."</th><th>".tra("Host ID")."</th><th>".tra("Claimed credit")."</th></tr>\n"; |
69 | 69 | $results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0"); |
70 | - foreach($results as $result) { |
|
70 | + foreach ($results as $result) { |
|
71 | 71 | echo "<tr>\n"; |
72 | 72 | echo "<td><a href=\"result.php?resultid=$result->id\">$result->id</a></td>\n"; |
73 | 73 | echo "<td><a href=\"workunit.php?wuid=$result->workunitid\">$result->workunitid</a></td>\n"; |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | } |
39 | 39 | $format = get_str("format", true); |
40 | 40 | |
41 | -if ($format=="xml"){ |
|
41 | +if ($format == "xml") { |
|
42 | 42 | // don't do caching for XML |
43 | 43 | xml_header(); |
44 | 44 | $retval = db_init_xml(); |
45 | 45 | if ($retval) xml_error($retval); |
46 | - if ($auth){ |
|
46 | + if ($auth) { |
|
47 | 47 | $user = BoincUser::lookup_auth($auth); |
48 | 48 | $show_hosts = true; |
49 | 49 | } else { |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | // The page may be presented in many different languages, |
58 | 58 | // so here we cache the data instead |
59 | 59 | // |
60 | - $cache_args="userid=".$id; |
|
60 | + $cache_args = "userid=".$id; |
|
61 | 61 | $cached_data = get_cached_data(USER_PAGE_TTL, $cache_args); |
62 | - if ($cached_data){ |
|
62 | + if ($cached_data) { |
|
63 | 63 | // We found some old but non-stale data, let's use it |
64 | 64 | $data = unserialize($cached_data); |
65 | 65 | $user = $data->user; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | BoincForumPrefs::lookup($user); |
77 | 77 | $user = @get_other_projects($user); |
78 | - $community_links = get_community_links_object($user); |
|
78 | + $community_links = get_community_links_object($user); |
|
79 | 79 | |
80 | 80 | $data = new StdClass; |
81 | 81 | $data->user = $user; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | start_table(); |
42 | 42 | |
43 | 43 | $today = getdate(time()); |
44 | -$UOTD_heading = tra("User of the Day")." -- " . $today['month'] . " " . $today['mday'] . ", " . $today['year']; |
|
44 | +$UOTD_heading = tra("User of the Day")." -- ".$today['month']." ".$today['mday'].", ".$today['year']; |
|
45 | 45 | row1($UOTD_heading); |
46 | 46 | echo "<tr><td>"; |
47 | 47 | $profile = get_current_uotd(); |
@@ -59,15 +59,15 @@ discard block |
||
59 | 59 | row1(tra("User Profile Explorer")); |
60 | 60 | echo "<tr><td> |
61 | 61 | <ul> |
62 | - <li>".tra("View the %1 User Picture Gallery %2.", "<a href=\"" . url_base() . "user_profile/user_gallery_1.html\">", "</a>")."</li> |
|
63 | - <li>".tra("Browse profiles %1 by country %2.", "<a href=\"" . url_base() . "user_profile/profile_country.html\">", "</a>")."</li> |
|
62 | + <li>".tra("View the %1 User Picture Gallery %2.", "<a href=\"".url_base()."user_profile/user_gallery_1.html\">", "</a>")."</li> |
|
63 | + <li>".tra("Browse profiles %1 by country %2.", "<a href=\"".url_base()."user_profile/profile_country.html\">", "</a>")."</li> |
|
64 | 64 | <li>".tra("Browse profiles %1 at random %2, %3 at random with pictures %2, or %4 at random without pictures %2.", "<a href=\"?cmd=rand&pic=-1\">", "</a>", |
65 | 65 | "<a href=\"?cmd=rand&pic=1\">", "<a href=\"?cmd=rand&pic=0\">")."</li> |
66 | 66 | "; |
67 | -if (file_exists(PROFILE_PATH . "profile_alpha.html")) { |
|
67 | +if (file_exists(PROFILE_PATH."profile_alpha.html")) { |
|
68 | 68 | echo "<li>".tra("Alphabetical profile listings:")."<br>"; |
69 | 69 | |
70 | - include( PROFILE_PATH . "profile_alpha.html" ); |
|
70 | + include(PROFILE_PATH."profile_alpha.html"); |
|
71 | 71 | } |
72 | 72 | echo "</ul></td></tr>"; |
73 | 73 |