@@ -208,11 +208,11 @@ discard block |
||
| 208 | 208 | $db = BoincDb::get(); |
| 209 | 209 | return $db->update($this, 'user', $clause); |
| 210 | 210 | } |
| 211 | - static function enum($where_clause, $order_clause=null) { |
|
| 211 | + static function enum($where_clause, $order_clause = null) { |
|
| 212 | 212 | $db = BoincDb::get(); |
| 213 | 213 | return $db->enum('user', 'BoincUser', $where_clause, $order_clause); |
| 214 | 214 | } |
| 215 | - static function enum_fields($fields, $where_clause, $order_clause=null) { |
|
| 215 | + static function enum_fields($fields, $where_clause, $order_clause = null) { |
|
| 216 | 216 | $db = BoincDb::get(); |
| 217 | 217 | return $db->enum_fields( |
| 218 | 218 | 'user', 'BoincUser', $fields, $where_clause, $order_clause |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | $db = BoincDb::get(); |
| 262 | 262 | return $db->update($this, 'team', $clause); |
| 263 | 263 | } |
| 264 | - static function enum($where_clause, $order_clause=null) { |
|
| 264 | + static function enum($where_clause, $order_clause = null) { |
|
| 265 | 265 | $db = BoincDb::get(); |
| 266 | 266 | return $db->enum('team', 'BoincTeam', $where_clause, $order_clause); |
| 267 | 267 | } |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | $db = BoincDb::get(); |
| 287 | 287 | return $db->max('team', $field); |
| 288 | 288 | } |
| 289 | - static function enum_fields($fields, $where_clause, $order_clause=null) { |
|
| 289 | + static function enum_fields($fields, $where_clause, $order_clause = null) { |
|
| 290 | 290 | $db = BoincDb::get(); |
| 291 | 291 | return $db->enum_fields( |
| 292 | 292 | 'team', 'BoincTeam', $fields, $where_clause, $order_clause |
@@ -322,11 +322,11 @@ discard block |
||
| 322 | 322 | $db = BoincDb::get(); |
| 323 | 323 | return $db->delete($this, 'host'); |
| 324 | 324 | } |
| 325 | - static function enum($where_clause, $order_clause=null) { |
|
| 325 | + static function enum($where_clause, $order_clause = null) { |
|
| 326 | 326 | $db = BoincDb::get(); |
| 327 | 327 | return $db->enum('host', 'BoincHost', $where_clause, $order_clause); |
| 328 | 328 | } |
| 329 | - static function enum_fields($fields, $where_clause, $order_clause=null) { |
|
| 329 | + static function enum_fields($fields, $where_clause, $order_clause = null) { |
|
| 330 | 330 | $db = BoincDb::get(); |
| 331 | 331 | return $db->enum_fields( |
| 332 | 332 | 'host', 'BoincHost', $fields, $where_clause, $order_clause |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | $db = BoincDb::get(); |
| 446 | 446 | return $db->update($this, 'app', $clause); |
| 447 | 447 | } |
| 448 | - static function sum($field, $clause=null) { |
|
| 448 | + static function sum($field, $clause = null) { |
|
| 449 | 449 | $db = BoincDb::get(); |
| 450 | 450 | return $db->sum('app', $field, $clause); |
| 451 | 451 | } |
@@ -501,11 +501,11 @@ discard block |
||
| 501 | 501 | $db = BoincDb::get(); |
| 502 | 502 | return $db->insert('profile', $clause); |
| 503 | 503 | } |
| 504 | - static function enum($where_clause=null, $order_clause=null) { |
|
| 504 | + static function enum($where_clause = null, $order_clause = null) { |
|
| 505 | 505 | $db = BoincDb::get(); |
| 506 | 506 | return $db->enum('profile', 'BoincProfile', $where_clause, $order_clause); |
| 507 | 507 | } |
| 508 | - static function enum_fields($fields, $where_clause=null, $order_clause=null) { |
|
| 508 | + static function enum_fields($fields, $where_clause = null, $order_clause = null) { |
|
| 509 | 509 | $db = BoincDb::get(); |
| 510 | 510 | return $db->enum_fields('profile', 'BoincProfile', $fields, $where_clause, $order_clause); |
| 511 | 511 | } |
@@ -889,12 +889,12 @@ discard block |
||
| 889 | 889 | return $db->enum('consent', 'BoincConsent', $where_clause); |
| 890 | 890 | } |
| 891 | 891 | |
| 892 | - static function insert ($clause) { |
|
| 892 | + static function insert($clause) { |
|
| 893 | 893 | $db = BoincDb::get(); |
| 894 | 894 | return $db->insert('consent', $clause); |
| 895 | 895 | } |
| 896 | 896 | |
| 897 | - static function update ($clause) { |
|
| 897 | + static function update($clause) { |
|
| 898 | 898 | $db = BoincDb::get(); |
| 899 | 899 | return $db->update_aux('consent', $clause); |
| 900 | 900 | } |
@@ -918,17 +918,17 @@ discard block |
||
| 918 | 918 | return $db->lookup('consent_type', 'BoincConsentType', $clause); |
| 919 | 919 | } |
| 920 | 920 | |
| 921 | - static function enum($where_clause, $order_clause=null) { |
|
| 921 | + static function enum($where_clause, $order_clause = null) { |
|
| 922 | 922 | $db = BoincDb::get(); |
| 923 | 923 | return $db->enum('consent_type', 'BoincConsentType', $where_clause, $order_clause); |
| 924 | 924 | } |
| 925 | 925 | |
| 926 | - static function insert ($clause) { |
|
| 926 | + static function insert($clause) { |
|
| 927 | 927 | $db = BoincDb::get(); |
| 928 | 928 | return $db->insert('consent_type', $clause); |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | - static function update ($clause) { |
|
| 931 | + static function update($clause) { |
|
| 932 | 932 | $db = BoincDb::get(); |
| 933 | 933 | return $db->update_aux('consent_type', $clause); |
| 934 | 934 | } |
@@ -953,7 +953,7 @@ discard block |
||
| 953 | 953 | return $db->lookup('latest_consent', 'BoincLatestConsent', $clause); |
| 954 | 954 | } |
| 955 | 955 | |
| 956 | - static function enum($where_clause, $order_clause=null) { |
|
| 956 | + static function enum($where_clause, $order_clause = null) { |
|
| 957 | 957 | $db = BoincDb::get(); |
| 958 | 958 | return $db->enum('latest_consent', 'BoincLatestConsent', $where_clause, $order_clause); |
| 959 | 959 | } |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | // apply this to any user-supplied strings used in queries |
| 965 | 965 | // |
| 966 | 966 | function boinc_real_escape_string($x) { |
| 967 | - if (version_compare(phpversion(),"4.3.0")>=0) { |
|
| 967 | + if (version_compare(phpversion(), "4.3.0") >= 0) { |
|
| 968 | 968 | return BoincDb::escape_string($x); |
| 969 | 969 | } else { |
| 970 | 970 | $x = str_replace("'", "\'", $x); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | db_init(); |
| 27 | 27 | |
| 28 | 28 | function current_tally($voteid) { |
| 29 | - $query="select sum(yes) as ayes,count(id)-sum(yes) as nays from banishment_votes where voteid=".$voteid; |
|
| 29 | + $query = "select sum(yes) as ayes,count(id)-sum(yes) as nays from banishment_votes where voteid=".$voteid; |
|
| 30 | 30 | $result = _mysql_query($query); |
| 31 | 31 | $foobar = _mysql_fetch_object($result); |
| 32 | 32 | echo "<b>Current Tally</b> Ayes: ".$foobar->ayes." Nays: ".$foobar->nays."<p>"; |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | function vote_is_in_progress($userid) { |
| 37 | 37 | // check whether a vote is already ongoing |
| 38 | - $now=time(); |
|
| 39 | - $query="select count(id) as count from banishment_vote where userid=".$userid." and end_time>".$now; |
|
| 38 | + $now = time(); |
|
| 39 | + $query = "select count(id) as count from banishment_vote where userid=".$userid." and end_time>".$now; |
|
| 40 | 40 | $result = _mysql_query($query); |
| 41 | 41 | if (!$result) { |
| 42 | 42 | echo "Database error attempting to read banishment_vote table 1.<p>"; |
@@ -51,56 +51,56 @@ discard block |
||
| 51 | 51 | return $foobar->count; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | -function start_vote($config,$logged_in_user,$user,$category,$reason) { |
|
| 55 | - $now=time(); |
|
| 56 | - $fin=$now+21600; |
|
| 54 | +function start_vote($config, $logged_in_user, $user, $category, $reason) { |
|
| 55 | + $now = time(); |
|
| 56 | + $fin = $now + 21600; |
|
| 57 | 57 | |
| 58 | 58 | |
| 59 | - if ( vote_is_in_progress($user->id) !=0 ) { |
|
| 59 | + if (vote_is_in_progress($user->id) != 0) { |
|
| 60 | 60 | echo "A banishment vote is already underway for this user.<p>"; |
| 61 | 61 | return 0; |
| 62 | 62 | } |
| 63 | - $query="insert into banishment_vote (userid,modid,start_time,end_time) values (".$user->id.",".$logged_in_user->id.",".$now.",".$fin.")"; |
|
| 63 | + $query = "insert into banishment_vote (userid,modid,start_time,end_time) values (".$user->id.",".$logged_in_user->id.",".$now.",".$fin.")"; |
|
| 64 | 64 | $result = _mysql_query($query); |
| 65 | 65 | if (!$result) { |
| 66 | 66 | echo "Database error attempting to insert to banishment_vote table.<p>"; |
| 67 | 67 | return 0; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - $voteid=_mysql_insert_id(); |
|
| 71 | - $query="insert into banishment_votes (voteid,modid,time,yes) values (". $voteid .",". $logged_in_user->id .",". $now .",1)"; |
|
| 70 | + $voteid = _mysql_insert_id(); |
|
| 71 | + $query = "insert into banishment_votes (voteid,modid,time,yes) values (".$voteid.",".$logged_in_user->id.",".$now.",1)"; |
|
| 72 | 72 | $result = _mysql_query($query); |
| 73 | 73 | if (!$result) { |
| 74 | 74 | echo "Database error attempting to insert to banishment_votes table.<p>"; |
| 75 | 75 | return 0; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - $query="update forum_preferences set banished_until=".$fin." where userid=".$user->id; |
|
| 78 | + $query = "update forum_preferences set banished_until=".$fin." where userid=".$user->id; |
|
| 79 | 79 | $result = _mysql_query($query); |
| 80 | 80 | |
| 81 | 81 | echo "Banishment vote started.<p><p>"; |
| 82 | 82 | current_tally($voteid); |
| 83 | - return send_banish_vote_email($user, 86400*14, $reason, $now+21600); |
|
| 83 | + return send_banish_vote_email($user, 86400*14, $reason, $now + 21600); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | -function vote_yes($config,$logged_in_user,$user) { |
|
| 87 | - $now=time(); |
|
| 86 | +function vote_yes($config, $logged_in_user, $user) { |
|
| 87 | + $now = time(); |
|
| 88 | 88 | // Check that a vote is underway. |
| 89 | - if (vote_is_in_progress($user->id)<1) { |
|
| 89 | + if (vote_is_in_progress($user->id) < 1) { |
|
| 90 | 90 | echo "No banishment vote is underway for this user.<p><p>"; |
| 91 | 91 | return 0; |
| 92 | 92 | } |
| 93 | 93 | // Find the voteid |
| 94 | - $query="select id as voteid from banishment_vote where userid=".$user->id." and end_time>".$now; |
|
| 94 | + $query = "select id as voteid from banishment_vote where userid=".$user->id." and end_time>".$now; |
|
| 95 | 95 | $result = _mysql_query($query); |
| 96 | 96 | $foobar = _mysql_fetch_object($result); |
| 97 | 97 | if (!$foobar) { |
| 98 | 98 | echo "Database error attempting to read banishment_vote table.<p>"; |
| 99 | 99 | return 0; |
| 100 | 100 | } |
| 101 | - $voteid=$foobar->voteid; |
|
| 101 | + $voteid = $foobar->voteid; |
|
| 102 | 102 | // Check whether mod has voted already. |
| 103 | - $query="select count(id) as count from banishment_votes where voteid=".$voteid." and modid=".$logged_in_user->id; |
|
| 103 | + $query = "select count(id) as count from banishment_votes where voteid=".$voteid." and modid=".$logged_in_user->id; |
|
| 104 | 104 | $result = _mysql_query($query); |
| 105 | 105 | $foobar = _mysql_fetch_object($result); |
| 106 | 106 | if (!$foobar) { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | return 0; |
| 114 | 114 | } |
| 115 | 115 | // insert the vote |
| 116 | - $query="insert into banishment_votes (voteid,modid,time,yes) values (" . $voteid .",". $logged_in_user->id .",". $now .",1)"; |
|
| 116 | + $query = "insert into banishment_votes (voteid,modid,time,yes) values (".$voteid.",".$logged_in_user->id.",".$now.",1)"; |
|
| 117 | 117 | $result = _mysql_query($query); |
| 118 | 118 | if (!$result) { |
| 119 | 119 | echo "Database error attempting to insert to banishment_votes table.<p>"; |
@@ -124,24 +124,24 @@ discard block |
||
| 124 | 124 | return 1; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | -function vote_no($config,$logged_in_user,$user) { |
|
| 127 | +function vote_no($config, $logged_in_user, $user) { |
|
| 128 | 128 | // Check that a vote is underway. |
| 129 | - $now=time(); |
|
| 130 | - if (vote_is_in_progress($user->id)<1) { |
|
| 129 | + $now = time(); |
|
| 130 | + if (vote_is_in_progress($user->id) < 1) { |
|
| 131 | 131 | echo "No banishment vote is underway for this user.<p>"; |
| 132 | 132 | return 0; |
| 133 | 133 | } |
| 134 | 134 | // Find the voteid |
| 135 | - $query="select id as voteid from banishment_vote where userid=".$user->id." and end_time>".$now; |
|
| 135 | + $query = "select id as voteid from banishment_vote where userid=".$user->id." and end_time>".$now; |
|
| 136 | 136 | $result = _mysql_query($query); |
| 137 | 137 | $foobar = _mysql_fetch_object($result); |
| 138 | 138 | if (!$foobar) { |
| 139 | 139 | echo "Database error attempting to read banishment_vote table.<p>"; |
| 140 | 140 | return 0; |
| 141 | 141 | } |
| 142 | - $voteid=$foobar->voteid; |
|
| 142 | + $voteid = $foobar->voteid; |
|
| 143 | 143 | // Check whether mod has voted already. |
| 144 | - $query="select count(id) as count from banishment_votes where voteid=".$voteid ." and modid=".$logged_in_user->id; |
|
| 144 | + $query = "select count(id) as count from banishment_votes where voteid=".$voteid." and modid=".$logged_in_user->id; |
|
| 145 | 145 | $result = _mysql_query($query); |
| 146 | 146 | $foobar = _mysql_fetch_object($result); |
| 147 | 147 | if (!$foobar) { |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | return 0; |
| 155 | 155 | } |
| 156 | 156 | // insert the vote |
| 157 | - $query="insert into banishment_votes (voteid,modid,time,yes) values (" . $voteid .",". $logged_in_user->id .",". $now .",0)"; |
|
| 157 | + $query = "insert into banishment_votes (voteid,modid,time,yes) values (".$voteid.",".$logged_in_user->id.",".$now.",0)"; |
|
| 158 | 158 | $result = _mysql_query($query); |
| 159 | 159 | if (!$result) { |
| 160 | 160 | echo "Database error attempting to insert to banishment_votes table.<p>"; |
@@ -31,10 +31,10 @@ discard block |
||
| 31 | 31 | // Optionally filters by forum, user, time, or hidden if specified. |
| 32 | 32 | // |
| 33 | 33 | function search_thread_titles( |
| 34 | - $keyword_list, $forum="", $user="", $time="", $limit=200, |
|
| 35 | - $sort_style=CREATE_TIME_NEW, $show_hidden = false |
|
| 36 | -){ |
|
| 37 | - $search_string="%"; |
|
| 34 | + $keyword_list, $forum = "", $user = "", $time = "", $limit = 200, |
|
| 35 | + $sort_style = CREATE_TIME_NEW, $show_hidden = false |
|
| 36 | +) { |
|
| 37 | + $search_string = "%"; |
|
| 38 | 38 | foreach ($keyword_list as $key => $word) { |
| 39 | 39 | $search_string .= BoincDb::escape_string($word)."%"; |
| 40 | 40 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | if (!$show_hidden) { |
| 52 | 52 | $query .= " and thread.hidden = 0"; |
| 53 | 53 | } |
| 54 | - switch($sort_style) { |
|
| 54 | + switch ($sort_style) { |
|
| 55 | 55 | case MODIFIED_NEW: |
| 56 | 56 | $query .= ' ORDER BY timestamp DESC'; |
| 57 | 57 | break; |
@@ -84,11 +84,11 @@ discard block |
||
| 84 | 84 | // |
| 85 | 85 | function search_post_content( |
| 86 | 86 | $keyword_list, $forum, $user, $time, $limit, $sort_style, $show_hidden |
| 87 | -){ |
|
| 87 | +) { |
|
| 88 | 88 | $db = BoincDb::get(); |
| 89 | 89 | |
| 90 | - $search_string="%"; |
|
| 91 | - foreach ($keyword_list as $key => $word){ |
|
| 90 | + $search_string = "%"; |
|
| 91 | + foreach ($keyword_list as $key => $word) { |
|
| 92 | 92 | $search_string .= BoincDb::escape_string($word)."%"; |
| 93 | 93 | } |
| 94 | 94 | $optional_join = ""; |
@@ -100,20 +100,20 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | $query = "select post.* from ".$db->db_name.".post".$optional_join." where content like '".$search_string."'"; |
| 102 | 102 | if ($forum) { |
| 103 | - $query.=" and forum = $forum->id"; |
|
| 103 | + $query .= " and forum = $forum->id"; |
|
| 104 | 104 | } |
| 105 | 105 | if ($user) { |
| 106 | - $query.=" and post.user = $user->id "; |
|
| 106 | + $query .= " and post.user = $user->id "; |
|
| 107 | 107 | } |
| 108 | 108 | if ($time) { |
| 109 | - $query.=" and post.timestamp > $time"; |
|
| 109 | + $query .= " and post.timestamp > $time"; |
|
| 110 | 110 | } |
| 111 | 111 | if (!$show_hidden) { |
| 112 | 112 | $query .= " AND post.hidden = 0"; |
| 113 | 113 | } |
| 114 | - switch($sort_style) { |
|
| 114 | + switch ($sort_style) { |
|
| 115 | 115 | case VIEWS_MOST: |
| 116 | - $query.= ' ORDER BY views DESC'; |
|
| 116 | + $query .= ' ORDER BY views DESC'; |
|
| 117 | 117 | break; |
| 118 | 118 | case CREATE_TIME_NEW: |
| 119 | 119 | $query .= ' ORDER by post.timestamp desc'; |
@@ -128,13 +128,13 @@ discard block |
||
| 128 | 128 | $query .= ' ORDER BY post.timestamp DESC'; |
| 129 | 129 | break; |
| 130 | 130 | } |
| 131 | - $query.= " limit $limit"; |
|
| 131 | + $query .= " limit $limit"; |
|
| 132 | 132 | return BoincPost::enum_general($query); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | $logged_in_user = get_logged_in_user(false); |
| 136 | 136 | BoincForumPrefs::lookup($logged_in_user); |
| 137 | -if ($logged_in_user && $logged_in_user->prefs->privilege(S_MODERATOR)){ |
|
| 137 | +if ($logged_in_user && $logged_in_user->prefs->privilege(S_MODERATOR)) { |
|
| 138 | 138 | $show_hidden_posts = true; |
| 139 | 139 | } else { |
| 140 | 140 | $show_hidden_posts = false; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $search_max_time = post_int("search_max_time"); |
| 148 | 148 | $search_forum = post_int("search_forum"); |
| 149 | 149 | $search_sort = post_int("search_sort"); |
| 150 | -$search_list = explode(" ",$search_keywords); |
|
| 150 | +$search_list = explode(" ", $search_keywords); |
|
| 151 | 151 | if ($search_max_time) { |
| 152 | 152 | $min_timestamp = time() - ($search_max_time*3600*24); |
| 153 | 153 | } else { |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | $limit = 100; |
| 158 | 158 | |
| 159 | -if ($search_forum==-1){ |
|
| 159 | +if ($search_forum == -1) { |
|
| 160 | 160 | $forum = null; |
| 161 | 161 | } else if ($search_forum) { |
| 162 | 162 | $forum = BoincForum::lookup_id($search_forum); |
@@ -173,10 +173,10 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | // Display the threads while we search for posts |
| 175 | 175 | // |
| 176 | -if (count($threads)){ |
|
| 177 | - echo "<h3>" . tra("Thread titles matching your query:") . "</h3>"; |
|
| 176 | +if (count($threads)) { |
|
| 177 | + echo "<h3>".tra("Thread titles matching your query:")."</h3>"; |
|
| 178 | 178 | show_thread_and_context_header(); |
| 179 | - foreach ($threads as $thread){ |
|
| 179 | + foreach ($threads as $thread) { |
|
| 180 | 180 | if ($thread->hidden) continue; |
| 181 | 181 | show_thread_and_context($thread, $logged_in_user); |
| 182 | 182 | } |
@@ -192,8 +192,8 @@ discard block |
||
| 192 | 192 | $show_hidden_posts |
| 193 | 193 | ); |
| 194 | 194 | |
| 195 | -if (count($posts)){ |
|
| 196 | - echo "<h3>" . tra("Messages matching your query:") . "</h3>"; |
|
| 195 | +if (count($posts)) { |
|
| 196 | + echo "<h3>".tra("Messages matching your query:")."</h3>"; |
|
| 197 | 197 | start_table(); |
| 198 | 198 | $n = 1; |
| 199 | 199 | $options = get_output_options($logged_in_user); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | end_table(); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | -if (!count($threads) && !count($posts)){ |
|
| 218 | +if (!count($threads) && !count($posts)) { |
|
| 219 | 219 | echo "<p>".tra("Sorry, couldn't find anything matching your search query. You can try to broaden your search by using less words (or less specific words).")."</p> |
| 220 | 220 | <p>" |
| 221 | 221 | .tra("You can also %1 try the same search on Google. %2", |
@@ -226,5 +226,5 @@ discard block |
||
| 226 | 226 | echo "<p><a href=\"forum_search.php\">".tra("Perform another search")."</a></p>"; |
| 227 | 227 | page_tail(); |
| 228 | 228 | |
| 229 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
| 229 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
| 230 | 230 | ?> |
@@ -25,17 +25,17 @@ |
||
| 25 | 25 | page_head(tra("Download BOINC add-on software")); |
| 26 | 26 | echo " |
| 27 | 27 | <p>" . |
| 28 | - tra("You can download applications in several categories.") ." |
|
| 28 | + tra("You can download applications in several categories.")." |
|
| 29 | 29 | <ul> |
| 30 | 30 | <li>". |
| 31 | - tra("These applications are not endorsed by %1 and you use them at your own risk.", PROJECT) ." |
|
| 31 | + tra("These applications are not endorsed by %1 and you use them at your own risk.", PROJECT)." |
|
| 32 | 32 | <li>" . |
| 33 | 33 | tra("We do not provide instructions for installing these applications. |
| 34 | 34 | However, the author may have provided some help on installing or uninstalling the application. |
| 35 | 35 | If this is not enough you should contact the author."). |
| 36 | 36 | tra("Instructions for installing and running BOINC are %1 here %2.", "<a href=https://boinc.berkeley.edu/download.php>", "</a>") |
| 37 | - . "<li>" . |
|
| 38 | - tra("This list is managed centrally at %1 the BOINC website %2.", "<a href=\"https://boinc.berkeley.edu/addons.php\">", "</a>") ." |
|
| 37 | + . "<li>". |
|
| 38 | + tra("This list is managed centrally at %1 the BOINC website %2.", "<a href=\"https://boinc.berkeley.edu/addons.php\">", "</a>")." |
|
| 39 | 39 | </ul> |
| 40 | 40 | "; |
| 41 | 41 | |
@@ -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); |