@@ -31,7 +31,7 @@ |
||
| 31 | 31 | function reg_form() { |
| 32 | 32 | $config = get_config(); |
| 33 | 33 | $disable_acct = parse_bool($config, "disable_account_creation"); |
| 34 | - page_head("Register", null, null, null, boinc_recaptcha_get_head_extra()); |
|
| 34 | + page_head("Register", null, null, null, boinc_recaptcha_get_head_extra()); |
|
| 35 | 35 | echo "<h3>Create an account</h3>"; |
| 36 | 36 | form_start("create_account_action.php", "post"); |
| 37 | 37 | create_account_form(0, "download_software.php"); |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | -form_start("create_account_action.php","post"); |
|
| 67 | +form_start("create_account_action.php", "post"); |
|
| 68 | 68 | create_account_form($teamid, $next_url); |
| 69 | 69 | if (recaptcha_public_key()) { |
| 70 | 70 | form_general("", boinc_recaptcha_get_html(recaptcha_public_key())); |
@@ -58,10 +58,10 @@ |
||
| 58 | 58 | //panel(null, 'panel_contents'); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | -function left(){ |
|
| 61 | +function left() { |
|
| 62 | 62 | global $user, $no_web_account_creation, $project_id; |
| 63 | 63 | panel( |
| 64 | - $user?tra("Welcome, %1", $user->name):tra("What is %1?", PROJECT), |
|
| 64 | + $user ?tra("Welcome, %1", $user->name) : tra("What is %1?", PROJECT), |
|
| 65 | 65 | function() use($user) { |
| 66 | 66 | global $no_web_account_creation, $project_id; |
| 67 | 67 | if ($user) { |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | // If $selection is provided, and if it matches one of the entries in the file, |
| 33 | 33 | // it will be selected by default. |
| 34 | 34 | // |
| 35 | -function show_combo_box($name, $filename, $selection=null) { |
|
| 35 | +function show_combo_box($name, $filename, $selection = null) { |
|
| 36 | 36 | echo "<select name=\"$name\" class=\"form-control\">\n"; |
| 37 | 37 | |
| 38 | 38 | $file = fopen($filename, "r"); |
@@ -63,14 +63,14 @@ discard block |
||
| 63 | 63 | <tr><td colspan=2> |
| 64 | 64 | <table border=0 cellpadding=5 |
| 65 | 65 | <tr> |
| 66 | -<td valign=top><a href=\"" . IMAGE_URL . $profile->userid . '.jpg' . "\"><img src=\"" . IMAGE_URL . $profile->userid . '_sm.jpg' . "\"></a> |
|
| 66 | +<td valign=top><a href=\"" . IMAGE_URL.$profile->userid.'.jpg'."\"><img src=\"".IMAGE_URL.$profile->userid.'_sm.jpg'."\"></a> |
|
| 67 | 67 | </td> |
| 68 | -<td valign=top>" .tra("%1 Your profile picture is shown to the left.", $warning) ." |
|
| 68 | +<td valign=top>" .tra("%1 Your profile picture is shown to the left.", $warning)." |
|
| 69 | 69 | <p>". |
| 70 | -tra("To replace it, click the \"Browse\" button and select a JPEG or PNG file (%1 or less).", "50KB") ."<br /> |
|
| 70 | +tra("To replace it, click the \"Browse\" button and select a JPEG or PNG file (%1 or less).", "50KB")."<br /> |
|
| 71 | 71 | <input name=picture type=file><br> |
| 72 | 72 | <p>". |
| 73 | -tra("To remove it from your profile, check this box:") . " |
|
| 73 | +tra("To remove it from your profile, check this box:")." |
|
| 74 | 74 | <input type=checkbox name=delete_pic> |
| 75 | 75 | <p> |
| 76 | 76 | </td></tr>"; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | end_table(); |
| 79 | 79 | echo "</td></tr>"; |
| 80 | 80 | } else { |
| 81 | - rowify(tra("If you would like include a picture with your profile, click the \"Browse\" button and select a JPEG or PNG file. Please select images of %1 or less.", "50KB") . " |
|
| 81 | + rowify(tra("If you would like include a picture with your profile, click the \"Browse\" button and select a JPEG or PNG file. Please select images of %1 or less.", "50KB")." |
|
| 82 | 82 | <p> |
| 83 | 83 | <input name=picture type=file> |
| 84 | 84 | "); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | row1(tra("Language")); |
| 94 | 94 | echo "<tr><td> |
| 95 | 95 | <p>" . |
| 96 | - tra("Select the language in which your profile is written:") . " |
|
| 96 | + tra("Select the language in which your profile is written:")." |
|
| 97 | 97 | <p> |
| 98 | 98 | "; |
| 99 | 99 | if (isset($profile->language)) { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | if (recaptcha_public_key()) { |
| 110 | 110 | table_row(boinc_recaptcha_get_html(recaptcha_public_key())); |
| 111 | 111 | } |
| 112 | - table_row("<p><input class=\"btn btn-success\" type=\"submit\" value=\"".tra("Create/edit profile") ."\" name=\"submit\">"); |
|
| 112 | + table_row("<p><input class=\"btn btn-success\" type=\"submit\" value=\"".tra("Create/edit profile")."\" name=\"submit\">"); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | // Returns an array containing: |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | // Determine if the filetype uploaded is supported. |
| 125 | 125 | // TODO: Change these to constants. |
| 126 | - switch($size[2]) { |
|
| 126 | + switch ($size[2]) { |
|
| 127 | 127 | case '2': // JPEG |
| 128 | 128 | $image = imageCreateFromJPEG($fileName); |
| 129 | 129 | break; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | function show_description() { |
| 162 | 162 | echo " |
| 163 | - <p>" .tra("Your %1 profile %2 lets you share your opinions and background with the %3 community.", "<b>", "</b>", PROJECT) . " |
|
| 163 | + <p>" .tra("Your %1 profile %2 lets you share your opinions and background with the %3 community.", "<b>", "</b>", PROJECT)." |
|
| 164 | 164 | <p> |
| 165 | 165 | "; |
| 166 | 166 | } |
@@ -178,14 +178,14 @@ discard block |
||
| 178 | 178 | row1(show_profile_heading1()); |
| 179 | 179 | rowify(show_profile_question1().bbcode_info()); |
| 180 | 180 | show_textarea("response1", $response1); |
| 181 | - row1( show_profile_heading2()); |
|
| 182 | - rowify( show_profile_question2().bbcode_info()); |
|
| 181 | + row1(show_profile_heading2()); |
|
| 182 | + rowify(show_profile_question2().bbcode_info()); |
|
| 183 | 183 | show_textarea("response2", $response2); |
| 184 | 184 | show_language_selection($profile); |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | function show_textarea($name, $text) { |
| 188 | - rowify("<textarea name=\"$name\" class=\"form-control\" rows=\"10\">" . $text . "</textarea>"); |
|
| 188 | + rowify("<textarea name=\"$name\" class=\"form-control\" rows=\"10\">".$text."</textarea>"); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | // $profile is null if user doesn't already have a profile. |
@@ -229,8 +229,8 @@ discard block |
||
| 229 | 229 | $delete_pic = "off"; |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | - if (strlen($response1)==0 && |
|
| 233 | - strlen($response2)==0 && |
|
| 232 | + if (strlen($response1) == 0 && |
|
| 233 | + strlen($response2) == 0 && |
|
| 234 | 234 | $delete_pic != "on" && |
| 235 | 235 | !is_uploaded_file($_FILES['picture']['tmp_name']) |
| 236 | 236 | ) { |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | $profile->verification = 0; |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - $profile ? $has_picture = $profile->has_picture: $has_picture = false; |
|
| 247 | + $profile ? $has_picture = $profile->has_picture : $has_picture = false; |
|
| 248 | 248 | |
| 249 | 249 | if (is_uploaded_file($_FILES['picture']['tmp_name'])) { |
| 250 | 250 | $has_picture = true; |
@@ -259,13 +259,13 @@ discard block |
||
| 259 | 259 | |
| 260 | 260 | // Write the original image file to disk. |
| 261 | 261 | // TODO: define a constant for image quality. |
| 262 | - ImageJPEG($images[0], IMAGE_PATH . $user->id . '.jpg'); |
|
| 263 | - ImageJPEG($images[1], IMAGE_PATH . $user->id . '_sm.jpg'); |
|
| 262 | + ImageJPEG($images[0], IMAGE_PATH.$user->id.'.jpg'); |
|
| 263 | + ImageJPEG($images[1], IMAGE_PATH.$user->id.'_sm.jpg'); |
|
| 264 | 264 | } |
| 265 | 265 | $response1 = sanitize_html($response1); |
| 266 | 266 | $response2 = sanitize_html($response2); |
| 267 | 267 | |
| 268 | - $has_picture = $has_picture?1:0; |
|
| 268 | + $has_picture = $has_picture ? 1 : 0; |
|
| 269 | 269 | if ($profile) { |
| 270 | 270 | $query = " response1 = '".BoincDb::escape_string($response1)."'," |
| 271 | 271 | ." response2 = '".BoincDb::escape_string($response2)."'," |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | page_tail(); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | -function show_profile_form($profile, $warning=null) { |
|
| 310 | +function show_profile_form($profile, $warning = null) { |
|
| 311 | 311 | if ($profile) { |
| 312 | 312 | page_head(tra("Edit your profile"), null, null, null, boinc_recaptcha_get_head_extra()); |
| 313 | 313 | } else { |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | // - project forums: everyone in POST_REPORT_EMAILS |
| 25 | 25 | // - team message board: team founder and admins |
| 26 | 26 | // |
| 27 | -function mail_report_list($forum, $subject, $body, $must_send=false) { |
|
| 27 | +function mail_report_list($forum, $subject, $body, $must_send = false) { |
|
| 28 | 28 | $success = true; |
| 29 | 29 | switch ($forum->parent_type) { |
| 30 | 30 | case 0: |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | function send_moderation_email($forum, $post, $thread, $explanation, $action) { |
| 66 | 66 | $master_url = master_url(); |
| 67 | 67 | |
| 68 | - $moderator=get_logged_in_user(); |
|
| 68 | + $moderator = get_logged_in_user(); |
|
| 69 | 69 | $body = ""; |
| 70 | 70 | $user = BoincUser::lookup_id($post->user); |
| 71 | 71 | |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | // There's a new post in the thread, which the user is subscribed to. |
| 127 | 127 | // send them an email notifying them. |
| 128 | 128 | // |
| 129 | -function send_thread_notification_email($thread, $user){ |
|
| 130 | - $title = PROJECT . ": there is a new post in '". $thread->title ."'"; |
|
| 131 | - $link = secure_url_base() . "forum_thread.php?id=" . $thread->id; |
|
| 132 | - $body = "A " . PROJECT . " user has posted to the thread |
|
| 133 | -\"" . $thread->title . "\".\n" |
|
| 129 | +function send_thread_notification_email($thread, $user) { |
|
| 130 | + $title = PROJECT.": there is a new post in '".$thread->title."'"; |
|
| 131 | + $link = secure_url_base()."forum_thread.php?id=".$thread->id; |
|
| 132 | + $body = "A ".PROJECT." user has posted to the thread |
|
| 133 | +\"" . $thread->title."\".\n" |
|
| 134 | 134 | ."To view the updated thread, visit:\n$link |
| 135 | 135 | |
| 136 | 136 | -------------------------- |
@@ -144,11 +144,11 @@ discard block |
||
| 144 | 144 | // There's a new thread in the forum, which the user is subscribed to. |
| 145 | 145 | // send them an email notifying them. |
| 146 | 146 | // |
| 147 | -function send_forum_notification_email($forum, $user){ |
|
| 148 | - $title = PROJECT . ": there is a new thread in '". $forum->title ."'"; |
|
| 149 | - $link = secure_url_base() . "forum_forum.php?id=" . $forum->id; |
|
| 150 | - $body = "A " . PROJECT . " user has added a thread to the forum |
|
| 151 | -\"" . $thread->title . "\".\n" |
|
| 147 | +function send_forum_notification_email($forum, $user) { |
|
| 148 | + $title = PROJECT.": there is a new thread in '".$forum->title."'"; |
|
| 149 | + $link = secure_url_base()."forum_forum.php?id=".$forum->id; |
|
| 150 | + $body = "A ".PROJECT." user has added a thread to the forum |
|
| 151 | +\"" . $thread->title."\".\n" |
|
| 152 | 152 | ."To view the updated forum, visit:\n$link |
| 153 | 153 | |
| 154 | 154 | -------------------------- |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | //////////////////// a user clicks the red "x" to report a post /////////// |
| 163 | 163 | // |
| 164 | -function send_report_post_email($user, $forum, $thread, $post, $message) { |
|
| 164 | +function send_report_post_email($user, $forum, $thread, $post, $message) { |
|
| 165 | 165 | $master_url = master_url(); |
| 166 | 166 | |
| 167 | 167 | $body = ""; |
@@ -219,16 +219,16 @@ discard block |
||
| 219 | 219 | // |
| 220 | 220 | function send_banish_vote_email($user, $duration, $reason, $end_time) { |
| 221 | 221 | $master_url = master_url(); |
| 222 | - $now=time(); |
|
| 222 | + $now = time(); |
|
| 223 | 223 | $subject = PROJECT." banishment vote underway"; |
| 224 | 224 | $vote_url = $master_url."forum_banishment_vote.php"; |
| 225 | 225 | $body = " |
| 226 | 226 | A vote has been started to banish you |
| 227 | 227 | from the ".PROJECT." message boards until ".date('M j, |
| 228 | -Y G:i', $duration+$now).", |
|
| 228 | +Y G:i', $duration + $now).", |
|
| 229 | 229 | because your postings have not followed our guidelines. |
| 230 | 230 | |
| 231 | -This vote will last until ".date('M j, Y G:i',$end_time)." or until a majority |
|
| 231 | +This vote will last until ".date('M j, Y G:i', $end_time)." or until a majority |
|
| 232 | 232 | decision has been reached. If the vote does not result in banishment, you will be |
| 233 | 233 | able to resume posting at that time. |
| 234 | 234 | "; |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | mkdir("../cache", 0770); |
| 33 | 33 | chmod("../cache", 0770); |
| 34 | 34 | } |
| 35 | - for ($i=0;$i<256;$i++) { |
|
| 36 | - $j=sprintf("%02x",$i); |
|
| 35 | + for ($i = 0; $i < 256; $i++) { |
|
| 36 | + $j = sprintf("%02x", $i); |
|
| 37 | 37 | if (!@filemtime("../cache/$j")) { |
| 38 | 38 | mkdir("../cache/$j", 0770); |
| 39 | 39 | chmod("../cache/$j", 0770); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | -function get_path($params, $phpfile=null) { |
|
| 44 | +function get_path($params, $phpfile = null) { |
|
| 45 | 45 | if (!@filemtime("../cache/00")) make_cache_dirs(); |
| 46 | 46 | if ($phpfile) { |
| 47 | 47 | $z = $phpfile; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // add a layer of subdirectories for reducing file lookup time |
| 54 | - $sz = substr(md5($z."_".urlencode($params)),1,2); |
|
| 54 | + $sz = substr(md5($z."_".urlencode($params)), 1, 2); |
|
| 55 | 55 | $path = "../cache/".$sz."/".$z; |
| 56 | 56 | if ($params) { |
| 57 | 57 | $path = $path."_".urlencode($params); |
@@ -60,14 +60,14 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | function disk_usage($dir) { |
| 63 | - $usage=0; |
|
| 64 | - if ($handle=@opendir($dir)) { |
|
| 65 | - while ($file=readdir($handle)) { |
|
| 63 | + $usage = 0; |
|
| 64 | + if ($handle = @opendir($dir)) { |
|
| 65 | + while ($file = readdir($handle)) { |
|
| 66 | 66 | if (($file != ".") && ($file != "..")) { |
| 67 | 67 | if (@is_dir($dir."/".$file)) { |
| 68 | - $usage+=disk_usage($dir."/".$file); |
|
| 68 | + $usage += disk_usage($dir."/".$file); |
|
| 69 | 69 | } else { |
| 70 | - $usage+=@filesize($dir."/".$file); |
|
| 70 | + $usage += @filesize($dir."/".$file); |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | if (!chdir($dir)) { |
| 82 | 82 | return; |
| 83 | 83 | } |
| 84 | - if ($handle=@opendir(".")) { |
|
| 85 | - while ($file=readdir($handle)) { |
|
| 84 | + if ($handle = @opendir(".")) { |
|
| 85 | + while ($file = readdir($handle)) { |
|
| 86 | 86 | if ($file == ".") continue; |
| 87 | 87 | if ($file == "..") continue; |
| 88 | 88 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | if (@is_dir($file)) { |
| 94 | 94 | clean_cache($max_age, $file); |
| 95 | 95 | } else { |
| 96 | - if ((time()-@filemtime($file))>$max_age) { |
|
| 96 | + if ((time() - @filemtime($file)) > $max_age) { |
|
| 97 | 97 | //echo "unlinking ".getcwd()."/$file\n"; |
| 98 | 98 | @unlink($file); |
| 99 | 99 | } |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | // check cache size every once in a while, purge if too big |
| 109 | 109 | // |
| 110 | -function cache_check_diskspace(){ |
|
| 111 | - if ((rand() % CACHE_SIZE_CHECK_FREQ)) return; |
|
| 110 | +function cache_check_diskspace() { |
|
| 111 | + if ((rand()%CACHE_SIZE_CHECK_FREQ)) return; |
|
| 112 | 112 | if (disk_usage("../cache") < MAX_CACHE_USAGE) return; |
| 113 | 113 | $x = max(TEAM_PAGE_TTL, USER_PAGE_TTL, USER_HOST_TTL, |
| 114 | 114 | USER_PROFILE_TTL, TOP_PAGES_TTL, INDEX_PAGE_TTL |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | clean_cache($x, "../cache"); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | -function cache_need_to_regenerate($path, $max_age){ |
|
| 119 | +function cache_need_to_regenerate($path, $max_age) { |
|
| 120 | 120 | $regenerate = false; |
| 121 | 121 | $request = apache_request_headers(); |
| 122 | 122 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | // and touch the cached copy so other processes |
| 129 | 129 | // don't regenerate at the same time |
| 130 | 130 | // |
| 131 | - if ($lastmodified<time()-$max_age) { |
|
| 131 | + if ($lastmodified < time() - $max_age) { |
|
| 132 | 132 | $regenerate = true; |
| 133 | 133 | @touch($path); |
| 134 | 134 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | // Returns cached data or false if nothing was found |
| 142 | -function get_cached_data($max_age, $params=""){ |
|
| 142 | +function get_cached_data($max_age, $params = "") { |
|
| 143 | 143 | global $no_cache; |
| 144 | 144 | |
| 145 | 145 | if ($no_cache) return false; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | } else { |
| 157 | 157 | cache_check_diskspace(); |
| 158 | - $regenerate=cache_need_to_regenerate($path, $max_age); |
|
| 158 | + $regenerate = cache_need_to_regenerate($path, $max_age); |
|
| 159 | 159 | if (!$regenerate) { |
| 160 | 160 | return file_get_contents($path); |
| 161 | 161 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | // DEPRECATED |
| 168 | -function start_cache($max_age, $params=""){ |
|
| 168 | +function start_cache($max_age, $params = "") { |
|
| 169 | 169 | global $no_cache, $caching, $memcache; |
| 170 | 170 | |
| 171 | 171 | if ($no_cache) return; |
@@ -188,15 +188,15 @@ discard block |
||
| 188 | 188 | $regenerate = cache_need_to_regenerate($path, $max_age); |
| 189 | 189 | } |
| 190 | 190 | //Is the stored version too old, do we need to regenerate it? |
| 191 | - if ($regenerate){ |
|
| 191 | + if ($regenerate) { |
|
| 192 | 192 | // If cached version is too old (or non-existent) |
| 193 | 193 | // generate the page and write to cache |
| 194 | 194 | // |
| 195 | 195 | ob_start(); |
| 196 | 196 | ob_implicit_flush(0); |
| 197 | - Header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
| 198 | - Header("Expires: " . gmdate("D, d M Y H:i:s",time()+$max_age) . " GMT"); |
|
| 199 | - Header("Cache-Control: public, max-age=" . $max_age); |
|
| 197 | + Header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); |
|
| 198 | + Header("Expires: ".gmdate("D, d M Y H:i:s", time() + $max_age)." GMT"); |
|
| 199 | + Header("Cache-Control: public, max-age=".$max_age); |
|
| 200 | 200 | |
| 201 | 201 | // allow the calling page to see cache period |
| 202 | 202 | // |
@@ -208,9 +208,9 @@ discard block |
||
| 208 | 208 | if (strstr($params, "format=xml")) { |
| 209 | 209 | header('Content-type: text/xml'); |
| 210 | 210 | } |
| 211 | - Header("Last-Modified: " . gmdate("D, d M Y H:i:s",$lastmodified) . " GMT"); |
|
| 212 | - Header("Expires: " . gmdate("D, d M Y H:i:s",$lastmodified+$max_age) . " GMT"); |
|
| 213 | - Header("Cache-Control: public, max-age=" . $max_age ); |
|
| 211 | + Header("Last-Modified: ".gmdate("D, d M Y H:i:s", $lastmodified)." GMT"); |
|
| 212 | + Header("Expires: ".gmdate("D, d M Y H:i:s", $lastmodified + $max_age)." GMT"); |
|
| 213 | + Header("Cache-Control: public, max-age=".$max_age); |
|
| 214 | 214 | if ($cache && $cache->content) { |
| 215 | 215 | echo $cache->content; |
| 216 | 216 | exit; |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | // write output buffer both to client and to cache |
| 230 | 230 | // DEPRECATED |
| 231 | -function end_cache($max_age,$params=""){ |
|
| 231 | +function end_cache($max_age, $params = "") { |
|
| 232 | 232 | global $no_cache; |
| 233 | 233 | if ($no_cache) return; |
| 234 | 234 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | -function set_cached_data($max_age, $data, $params=""){ |
|
| 256 | +function set_cached_data($max_age, $data, $params = "") { |
|
| 257 | 257 | // for the benefit of hackers |
| 258 | 258 | if (strstr($params, "..")) { |
| 259 | 259 | return "bad params"; |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | } |
| 296 | 296 | $server_arr = array(); |
| 297 | 297 | $servers = explode('|', MEMCACHE_SERVERS); |
| 298 | - foreach($servers as &$server) { |
|
| 298 | + foreach ($servers as &$server) { |
|
| 299 | 299 | list($ip, $port, $weight) = explode(':', $server); |
| 300 | 300 | if (!$port) { $port = 11211; } |
| 301 | 301 | $server_arr[] = array($ip, $port, $weight); |
@@ -93,9 +93,9 @@ |
||
| 93 | 93 | global $job_keywords; |
| 94 | 94 | $kw = $job_keywords[$id]; |
| 95 | 95 | $u = $uprefs[$id]; |
| 96 | - $yes_checked = ($u == KW_YES)?"checked":""; |
|
| 97 | - $no_checked = ($u == KW_NO)?"checked":""; |
|
| 98 | - $maybe_checked = ($u == KW_MAYBE)?"checked":""; |
|
| 96 | + $yes_checked = ($u == KW_YES) ? "checked" : ""; |
|
| 97 | + $no_checked = ($u == KW_NO) ? "checked" : ""; |
|
| 98 | + $maybe_checked = ($u == KW_MAYBE) ? "checked" : ""; |
|
| 99 | 99 | |
| 100 | 100 | echo sprintf('<tr id="%s" hidden>%s', "row$id", "\n"); |
| 101 | 101 | echo sprintf(' <td width=50%% id="%s"></td>%s', "text$id", "\n"); |
@@ -31,14 +31,14 @@ |
||
| 31 | 31 | if (file_exists($path)) { |
| 32 | 32 | $x = file($path); |
| 33 | 33 | $yes = explode(' ', trim($x[0])); |
| 34 | - if ($yes[0]=='') $yes=[]; |
|
| 34 | + if ($yes[0] == '') $yes = []; |
|
| 35 | 35 | $yes = array_map('intval', $yes); |
| 36 | 36 | $no = explode(' ', trim($x[1])); |
| 37 | - if ($no[0]=='') $no=[]; |
|
| 37 | + if ($no[0] == '') $no = []; |
|
| 38 | 38 | $no = array_map('intval', $no); |
| 39 | 39 | return [$yes, $no]; |
| 40 | 40 | } else { |
| 41 | - return [[],[]]; |
|
| 41 | + return [[], []]; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | |
| 33 | 33 | function boinc_recaptcha_get_html($publickey) { |
| 34 | 34 | if ($publickey) { |
| 35 | - return '<div class="g-recaptcha" data-sitekey="' . $publickey . '"></div>'; |
|
| 35 | + return '<div class="g-recaptcha" data-sitekey="'.$publickey.'"></div>'; |
|
| 36 | 36 | } else { |
| 37 | 37 | return ''; |
| 38 | 38 | } |