@@ -369,7 +369,7 @@ |
||
| 369 | 369 | $text = "---"; |
| 370 | 370 | if ($batch->state == BATCH_STATE_COMPLETE) { |
| 371 | 371 | $y = '<font color="red">failed</font>'; |
| 372 | - } else { |
|
| 372 | + } else { |
|
| 373 | 373 | $y = "in progress"; |
| 374 | 374 | } |
| 375 | 375 | } |
@@ -365,11 +365,11 @@ discard block |
||
| 365 | 365 | function progress_bar($batch, $wus, $width) { |
| 366 | 366 | $w_success = $width*$batch->fraction_done; |
| 367 | 367 | $w_fail = $width*$batch->nerror_jobs/$batch->njobs; |
| 368 | - $nsuccess = $batch->njobs * $batch->fraction_done; |
|
| 368 | + $nsuccess = $batch->njobs*$batch->fraction_done; |
|
| 369 | 369 | $nsent = wus_nsent($wus); |
| 370 | 370 | $nprog = $nsent - $nsuccess - $batch->nerror_jobs; |
| 371 | 371 | $w_prog = $width*$nprog/$batch->njobs; |
| 372 | - $nunsent = $batch->njobs-$nsent; |
|
| 372 | + $nunsent = $batch->njobs - $nsent; |
|
| 373 | 373 | $w_unsent = $width*$nunsent/$batch->njobs; |
| 374 | 374 | $x = '<table height=20><tr>'; |
| 375 | 375 | if ($w_fail) { |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | page_head("Batch $batch_id"); |
| 408 | 408 | start_table(); |
| 409 | 409 | row2("name", $batch->name); |
| 410 | - row2("application", $app?$app->name:'---'); |
|
| 410 | + row2("application", $app ? $app->name : '---'); |
|
| 411 | 411 | row2("state", batch_state_string($batch->state)); |
| 412 | 412 | //row2("# jobs", $batch->njobs); |
| 413 | 413 | //row2("# error jobs", $batch->nerror_jobs); |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | "Canonical instance<br><small>click to see result page on BOINC server</smallp>", |
| 455 | 455 | "Download Results" |
| 456 | 456 | ); |
| 457 | - foreach($wus as $wu) { |
|
| 457 | + foreach ($wus as $wu) { |
|
| 458 | 458 | $resultid = $wu->canonical_resultid; |
| 459 | 459 | if ($resultid) { |
| 460 | 460 | $x = "<a href=result.php?resultid=$resultid>$resultid</a>"; |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | $text = "---"; |
| 466 | 466 | if ($batch->state == BATCH_STATE_COMPLETE) { |
| 467 | 467 | $y = '<font color="red">failed</font>'; |
| 468 | - } else { |
|
| 468 | + } else { |
|
| 469 | 469 | $y = "in progress"; |
| 470 | 470 | } |
| 471 | 471 | } |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | $results = BoincResult::enum("workunitid=$wuid"); |
| 531 | 531 | $upload_dir = parse_config(get_config(), "<upload_dir>"); |
| 532 | 532 | $fanout = parse_config(get_config(), "<uldl_dir_fanout>"); |
| 533 | - foreach($results as $result) { |
|
| 533 | + foreach ($results as $result) { |
|
| 534 | 534 | echo "<tr> |
| 535 | 535 | <td><a href=result.php?resultid=$result->id>$result->id · $result->name </a></td> |
| 536 | 536 | <td>".state_string($result)."</td> |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | if ($result->server_state == 5) { |
| 541 | 541 | $phys_names = get_outfile_names($result); |
| 542 | 542 | $log_names = get_outfile_log_names($result); |
| 543 | - for ($i=0; $i<count($phys_names); $i++) { |
|
| 543 | + for ($i = 0; $i < count($phys_names); $i++) { |
|
| 544 | 544 | $url = sprintf( |
| 545 | 545 | 'get_output2.php?cmd=result&result_id=%d&file_num=%d', |
| 546 | 546 | $result->id, $i |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | $wus = BoincWorkunit::enum("batch = $batch->id"); |
| 405 | 405 | $batch = get_batch_params($batch, $wus); |
| 406 | 406 | |
| 407 | - page_head("Batch $batch_id"); |
|
| 407 | + page_head("batch $batch_id"); |
|
| 408 | 408 | start_table(); |
| 409 | 409 | row2("name", $batch->name); |
| 410 | 410 | row2("application", $app?$app->name:'---'); |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | $wu = BoincWorkunit::lookup_id($wuid); |
| 490 | 490 | if (!$wu) error_page("no such job"); |
| 491 | 491 | |
| 492 | - page_head("Job $wuid"); |
|
| 492 | + page_head("job $wuid"); |
|
| 493 | 493 | |
| 494 | 494 | echo " |
| 495 | 495 | <a href=workunit.php?wuid=$wuid>Workunit details</a> · |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $parent_post_id = 0; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | -if ($filter != "false"){ |
|
| 53 | +if ($filter != "false") { |
|
| 54 | 54 | $filter = true; |
| 55 | 55 | } else { |
| 56 | 56 | $filter = false; |
@@ -65,10 +65,10 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | $warning = null; |
| 68 | -if ($content && (!$preview)){ |
|
| 69 | - if (post_str('add_signature',true)=="add_it"){ |
|
| 68 | +if ($content && (!$preview)) { |
|
| 69 | + if (post_str('add_signature',true)=="add_it") { |
|
| 70 | 70 | $add_signature=true; // set a flag and concatenate later |
| 71 | - } else { |
|
| 71 | + } else { |
|
| 72 | 72 | $add_signature=false; |
| 73 | 73 | } |
| 74 | 74 | check_tokens($logged_in_user->authenticator); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $parent_post_id = 0; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | -if ($filter != "false"){ |
|
| 53 | +if ($filter != "false") { |
|
| 54 | 54 | $filter = true; |
| 55 | 55 | } else { |
| 56 | 56 | $filter = false; |
@@ -65,11 +65,11 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | $warning = null; |
| 68 | -if ($content && (!$preview)){ |
|
| 69 | - if (post_str('add_signature',true)=="add_it"){ |
|
| 70 | - $add_signature=true; // set a flag and concatenate later |
|
| 71 | - } else { |
|
| 72 | - $add_signature=false; |
|
| 68 | +if ($content && (!$preview)) { |
|
| 69 | + if (post_str('add_signature', true) == "add_it") { |
|
| 70 | + $add_signature = true; // set a flag and concatenate later |
|
| 71 | + } else { |
|
| 72 | + $add_signature = false; |
|
| 73 | 73 | } |
| 74 | 74 | check_tokens($logged_in_user->authenticator); |
| 75 | 75 | if (!akismet_check($logged_in_user, $content)) { |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | -page_head(tra("Post to thread"),'','','', $bbcode_js); |
|
| 91 | +page_head(tra("Post to thread"), '', '', '', $bbcode_js); |
|
| 92 | 92 | |
| 93 | 93 | show_forum_header($logged_in_user); |
| 94 | 94 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $x1 = tra("Message:").bbcode_info().post_warning(); |
| 143 | 143 | $x2 = ""; |
| 144 | 144 | if ($parent_post) { |
| 145 | - $x2 .=" ".tra("reply to %1 Message ID %2:", "<a href=#".$parent_post->id.">", " ".$parent_post->id."</a>"); |
|
| 145 | + $x2 .= " ".tra("reply to %1 Message ID %2:", "<a href=#".$parent_post->id.">", " ".$parent_post->id."</a>"); |
|
| 146 | 146 | } |
| 147 | 147 | $x2 .= "<form action=forum_reply.php?thread=".$thread->id; |
| 148 | 148 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | $x2 .= " method=\"post\" name=\"post\" onsubmit=\"return checkForm(this)\">\n"; |
| 154 | 154 | $x2 .= form_tokens($logged_in_user->authenticator); |
| 155 | 155 | $x2 .= start_table_str().$bbcode_html.end_table_str()."<textarea class=\"form-control\" name=\"content\" rows=\"18\">"; |
| 156 | - $no_quote = get_int("no_quote", true)==1; |
|
| 156 | + $no_quote = get_int("no_quote", true) == 1; |
|
| 157 | 157 | if ($preview) { |
| 158 | 158 | $x2 .= htmlspecialchars($content); |
| 159 | 159 | } else if (!$no_quote) { |
@@ -162,9 +162,9 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | if (!$logged_in_user->prefs->no_signature_by_default) { |
| 165 | - $enable_signature="checked=\"true\""; |
|
| 165 | + $enable_signature = "checked=\"true\""; |
|
| 166 | 166 | } else { |
| 167 | - $enable_signature=""; |
|
| 167 | + $enable_signature = ""; |
|
| 168 | 168 | } |
| 169 | 169 | $x2 .= "</textarea><p> </p> |
| 170 | 170 | <input class=\"btn btn-primary btn-sm \" type=\"submit\" name=\"preview\" value=\"".tra("Preview")."\"> |
@@ -179,9 +179,9 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | function quote_text($text) { |
| 182 | - $text = "[quote]" . $text . "[/quote]"; |
|
| 182 | + $text = "[quote]".$text."[/quote]"; |
|
| 183 | 183 | return $text; |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | -$cvs_version_tracker[]="\$Id$"; |
|
| 186 | +$cvs_version_tracker[] = "\$Id$"; |
|
| 187 | 187 | ?> |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | if (!$batch || $batch->user_id != $user->id) { |
| 33 | 33 | error_page("no batch"); |
| 34 | 34 | } |
| 35 | - page_head("Batch $batch->id"); |
|
| 35 | + page_head("batch $batch->id"); |
|
| 36 | 36 | $results = BoincResult::enum("batch=$batch->id order by workunitid"); |
| 37 | 37 | result_table_start(true, true, null); |
| 38 | 38 | foreach ($results as $result) { |
@@ -53,8 +53,9 @@ discard block |
||
| 53 | 53 | // ------------ Forum identity ----------- |
| 54 | 54 | |
| 55 | 55 | $select_0 = $select_1 = $select_2 = ""; |
| 56 | -if (strlen($user->prefs->avatar)){ |
|
| 57 | - if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { // Gravatar |
|
| 56 | +if (strlen($user->prefs->avatar)) { |
|
| 57 | + if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { |
|
| 58 | +// Gravatar |
|
| 58 | 59 | $select_1 = "checked=\"true\""; |
| 59 | 60 | } else { |
| 60 | 61 | $select_2 = "checked=\"true\""; |
@@ -73,7 +74,7 @@ discard block |
||
| 73 | 74 | <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" ".$select_2."> |
| 74 | 75 | <label for=\"avatar_select_2\">".tra("Use this uploaded avatar:")."</label> <input type=\"file\" name=\"picture\">" |
| 75 | 76 | ); |
| 76 | -if (strlen($user->prefs->avatar)){ |
|
| 77 | +if (strlen($user->prefs->avatar)) { |
|
| 77 | 78 | row2(tra("Avatar preview")."<br><p class=\"text-muted\">".tra("This is how your avatar will look")."</p>", |
| 78 | 79 | "<img src=\"".$user->prefs->avatar."\" width=\"100\" height=\"100\">"); |
| 79 | 80 | } |
@@ -92,7 +93,7 @@ discard block |
||
| 92 | 93 | textarea_with_counter("signature", 250, $signature) |
| 93 | 94 | ."<br><input type=\"checkbox\" name=\"signature_by_default\" ".$signature_by_default."> ".tra("Attach signature by default") |
| 94 | 95 | ); |
| 95 | -if ($user->prefs->signature!=""){ |
|
| 96 | +if ($user->prefs->signature!="") { |
|
| 96 | 97 | row2(tra("Signature preview"). |
| 97 | 98 | "<br><p class=\"text-muted\">".tra("This is how your signature will look in the forums")."</p>", |
| 98 | 99 | output_transform($user->prefs->signature) |
@@ -138,7 +139,7 @@ discard block |
||
| 138 | 139 | |
| 139 | 140 | $filtered_userlist = get_ignored_list($user); |
| 140 | 141 | $forum_filtered_userlist = ""; |
| 141 | -for ($i=0; $i<sizeof($filtered_userlist); $i++){ |
|
| 142 | +for ($i=0; $i<sizeof($filtered_userlist); $i++) { |
|
| 142 | 143 | $id = (int)$filtered_userlist[$i]; |
| 143 | 144 | if ($id) { |
| 144 | 145 | $filtered_user = BoincUser::lookup_id($id); |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | // ------------ Notification ----------- |
| 39 | 39 | |
| 40 | 40 | row1(tra("Notifications")); |
| 41 | -$ch0 = $user->prefs->pm_notification==0?"checked":""; |
|
| 42 | -$ch1 = $user->prefs->pm_notification==1?"checked":""; |
|
| 43 | -$ch2 = $user->prefs->pm_notification==2?"checked":""; |
|
| 41 | +$ch0 = $user->prefs->pm_notification == 0 ? "checked" : ""; |
|
| 42 | +$ch1 = $user->prefs->pm_notification == 1 ? "checked" : ""; |
|
| 43 | +$ch2 = $user->prefs->pm_notification == 2 ? "checked" : ""; |
|
| 44 | 44 | row2( |
| 45 | 45 | tra("How should we notify you of new private messages, friend requests, posts in subscribed threads, and other events?"), |
| 46 | 46 | "<input type=radio name=pm_notification value=0 $ch0> ".tra("On my Account page (no email)")." |
@@ -53,8 +53,8 @@ discard block |
||
| 53 | 53 | // ------------ Forum identity ----------- |
| 54 | 54 | |
| 55 | 55 | $select_0 = $select_1 = $select_2 = ""; |
| 56 | -if (strlen($user->prefs->avatar)){ |
|
| 57 | - if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18)=="//www.gravatar.com") { // Gravatar |
|
| 56 | +if (strlen($user->prefs->avatar)) { |
|
| 57 | + if (substr($user->prefs->avatar, 0, 23) == 'http://www.gravatar.com' || substr($user->prefs->avatar, 0, 18) == "//www.gravatar.com") { // Gravatar |
|
| 58 | 58 | $select_1 = "checked=\"true\""; |
| 59 | 59 | } else { |
| 60 | 60 | $select_2 = "checked=\"true\""; |
@@ -73,15 +73,15 @@ discard block |
||
| 73 | 73 | <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" ".$select_2."> |
| 74 | 74 | <label for=\"avatar_select_2\">".tra("Use this uploaded avatar:")."</label> <input type=\"file\" name=\"picture\">" |
| 75 | 75 | ); |
| 76 | -if (strlen($user->prefs->avatar)){ |
|
| 76 | +if (strlen($user->prefs->avatar)) { |
|
| 77 | 77 | row2(tra("Avatar preview")."<br><p class=\"text-muted\">".tra("This is how your avatar will look")."</p>", |
| 78 | 78 | "<img src=\"".$user->prefs->avatar."\" width=\"100\" height=\"100\">"); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | -$signature_by_default = $user->prefs->no_signature_by_default==false?"checked=\"checked\"":""; |
|
| 81 | +$signature_by_default = $user->prefs->no_signature_by_default == false ? "checked=\"checked\"" : ""; |
|
| 82 | 82 | |
| 83 | -$signature=$user->prefs->signature; |
|
| 84 | -$maxlen=250; |
|
| 83 | +$signature = $user->prefs->signature; |
|
| 84 | +$maxlen = 250; |
|
| 85 | 85 | row2( |
| 86 | 86 | tra("Signature for message board posts") |
| 87 | 87 | .bbcode_info() |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | textarea_with_counter("signature", 250, $signature) |
| 93 | 93 | ."<br><input type=\"checkbox\" name=\"signature_by_default\" ".$signature_by_default."> ".tra("Attach signature by default") |
| 94 | 94 | ); |
| 95 | -if ($user->prefs->signature!=""){ |
|
| 95 | +if ($user->prefs->signature != "") { |
|
| 96 | 96 | row2(tra("Signature preview"). |
| 97 | 97 | "<br><p class=\"text-muted\">".tra("This is how your signature will look in the forums")."</p>", |
| 98 | 98 | output_transform($user->prefs->signature) |
@@ -101,13 +101,13 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | // ------------ Message display ----------- |
| 103 | 103 | |
| 104 | -$forum_hide_avatars = $user->prefs->hide_avatars?"checked=\"checked\"":""; |
|
| 105 | -$forum_hide_signatures = $user->prefs->hide_signatures?"checked=\"checked\"":""; |
|
| 106 | -$forum_link_popup = $user->prefs->link_popup?"checked=\"checked\"":""; |
|
| 107 | -$forum_image_as_link = $user->prefs->images_as_links?"checked=\"checked\"":""; |
|
| 108 | -$forum_jump_to_unread = $user->prefs->jump_to_unread?"checked=\"checked\"":""; |
|
| 109 | -$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts?"checked=\"checked\"":""; |
|
| 110 | -$forum_highlight_special = $user->prefs->highlight_special?"checked=\"checked\"":""; |
|
| 104 | +$forum_hide_avatars = $user->prefs->hide_avatars ? "checked=\"checked\"" : ""; |
|
| 105 | +$forum_hide_signatures = $user->prefs->hide_signatures ? "checked=\"checked\"" : ""; |
|
| 106 | +$forum_link_popup = $user->prefs->link_popup ? "checked=\"checked\"" : ""; |
|
| 107 | +$forum_image_as_link = $user->prefs->images_as_links ? "checked=\"checked\"" : ""; |
|
| 108 | +$forum_jump_to_unread = $user->prefs->jump_to_unread ? "checked=\"checked\"" : ""; |
|
| 109 | +$forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts ? "checked=\"checked\"" : ""; |
|
| 110 | +$forum_highlight_special = $user->prefs->highlight_special ? "checked=\"checked\"" : ""; |
|
| 111 | 111 | |
| 112 | 112 | $forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount); |
| 113 | 113 | $forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | $filtered_userlist = get_ignored_list($user); |
| 140 | 140 | $forum_filtered_userlist = ""; |
| 141 | -for ($i=0; $i<sizeof($filtered_userlist); $i++){ |
|
| 141 | +for ($i = 0; $i < sizeof($filtered_userlist); $i++) { |
|
| 142 | 142 | $id = (int)$filtered_userlist[$i]; |
| 143 | 143 | if ($id) { |
| 144 | 144 | $filtered_user = BoincUser::lookup_id($id); |
@@ -168,5 +168,5 @@ discard block |
||
| 168 | 168 | end_table(); |
| 169 | 169 | page_tail(); |
| 170 | 170 | |
| 171 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
| 171 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
| 172 | 172 | ?> |
@@ -691,7 +691,8 @@ |
||
| 691 | 691 | <id>$result->id</id> |
| 692 | 692 | <state>".state_string($result)."</state> |
| 693 | 693 | "; |
| 694 | - if ($result->server_state == 5) { // over? |
|
| 694 | + if ($result->server_state == 5) { |
|
| 695 | +// over? |
|
| 695 | 696 | $paths = get_outfile_paths($result); |
| 696 | 697 | foreach($paths as $path) { |
| 697 | 698 | if (is_file($path)) { |
@@ -595,7 +595,7 @@ |
||
| 595 | 595 | // return a batch specified by the command, using either ID or name |
| 596 | 596 | // |
| 597 | 597 | function get_batch($r) { |
| 598 | - $batch = NULL; |
|
| 598 | + $batch = null; |
|
| 599 | 599 | if (!empty($r->batch_id)) { |
| 600 | 600 | $batch_id = (int)($r->batch_id); |
| 601 | 601 | $batch = BoincBatch::lookup_id($batch_id); |
@@ -1049,24 +1049,24 @@ |
||
| 1049 | 1049 | log_write("----- Handling RPC; command ".$r->getName()); |
| 1050 | 1050 | |
| 1051 | 1051 | switch ($r->getName()) { |
| 1052 | - case 'abort_batch': handle_abort_batch($r); break; |
|
| 1053 | - case 'abort_jobs': handle_abort_jobs($r); break; |
|
| 1054 | - case 'create_batch': create_batch($r); break; |
|
| 1055 | - case 'estimate_batch': estimate_batch($r); break; |
|
| 1056 | - case 'get_templates': get_templates($r); break; |
|
| 1057 | - case 'ping': ping($r); break; |
|
| 1058 | - case 'query_batch': query_batch($r); break; |
|
| 1059 | - case 'query_batch2': query_batch2($r); break; |
|
| 1060 | - case 'query_batches': query_batches($r); break; |
|
| 1061 | - case 'query_job': query_job($r); break; |
|
| 1062 | - case 'query_completed_job': query_completed_job($r); break; |
|
| 1063 | - case 'retire_batch': handle_retire_batch($r); break; |
|
| 1064 | - case 'set_expire_time': handle_set_expire_time($r); break; |
|
| 1065 | - case 'submit_batch': submit_batch($r); break; |
|
| 1066 | - default: |
|
| 1067 | - log_write("bad command"); |
|
| 1068 | - xml_error(-1, "bad command: ".$r->getName()); |
|
| 1069 | - break; |
|
| 1052 | +case 'abort_batch': handle_abort_batch($r); break; |
|
| 1053 | +case 'abort_jobs': handle_abort_jobs($r); break; |
|
| 1054 | +case 'create_batch': create_batch($r); break; |
|
| 1055 | +case 'estimate_batch': estimate_batch($r); break; |
|
| 1056 | +case 'get_templates': get_templates($r); break; |
|
| 1057 | +case 'ping': ping($r); break; |
|
| 1058 | +case 'query_batch': query_batch($r); break; |
|
| 1059 | +case 'query_batch2': query_batch2($r); break; |
|
| 1060 | +case 'query_batches': query_batches($r); break; |
|
| 1061 | +case 'query_job': query_job($r); break; |
|
| 1062 | +case 'query_completed_job': query_completed_job($r); break; |
|
| 1063 | +case 'retire_batch': handle_retire_batch($r); break; |
|
| 1064 | +case 'set_expire_time': handle_set_expire_time($r); break; |
|
| 1065 | +case 'submit_batch': submit_batch($r); break; |
|
| 1066 | +default: |
|
| 1067 | + log_write("bad command"); |
|
| 1068 | + xml_error(-1, "bad command: ".$r->getName()); |
|
| 1069 | + break; |
|
| 1070 | 1070 | } |
| 1071 | 1071 | |
| 1072 | 1072 | log_write("RPC done"); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | if ($template) { |
| 62 | 62 | $t = (double)$template->workunit->rsc_fpops_est; |
| 63 | 63 | } |
| 64 | - foreach($r->batch->job as $job) { |
|
| 64 | + foreach ($r->batch->job as $job) { |
|
| 65 | 65 | $y = (double)$job->rsc_fpops_est; |
| 66 | 66 | if ($y) { |
| 67 | 67 | $x += $y; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | function est_elapsed_time($r, $template) { |
| 88 | 88 | // crude estimate: batch FLOPs / project FLOPS |
| 89 | 89 | // |
| 90 | - return batch_flop_count($r, $template) / project_flops(); |
|
| 90 | + return batch_flop_count($r, $template)/project_flops(); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | // if batch-level input template filename was given, read it; |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | // |
| 98 | 98 | function read_input_template($app, $r) { |
| 99 | 99 | if ((isset($r->batch)) && (isset($r->batch->workunit_template_file)) && ($r->batch->workunit_template_file)) { |
| 100 | - $path = project_dir() . "/templates/".$r->batch->workunit_template_file; |
|
| 100 | + $path = project_dir()."/templates/".$r->batch->workunit_template_file; |
|
| 101 | 101 | } else { |
| 102 | - $path = project_dir() . "/templates/$app->name"."_in"; |
|
| 102 | + $path = project_dir()."/templates/$app->name"."_in"; |
|
| 103 | 103 | } |
| 104 | 104 | if (file_exists($path)) { |
| 105 | 105 | $x = simplexml_load_file($path); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | function validate_batch($jobs, $template) { |
| 145 | 145 | $i = 0; |
| 146 | 146 | $n = count($template->file_info); |
| 147 | - foreach($jobs as $job) { |
|
| 147 | + foreach ($jobs as $job) { |
|
| 148 | 148 | $m = count($job->input_files); |
| 149 | 149 | if ($n != $m) { |
| 150 | 150 | log_write("wrong # of input files for job $i: need $n, got $m"); |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | // stage all the files |
| 206 | 206 | // |
| 207 | 207 | function stage_files(&$jobs) { |
| 208 | - foreach($jobs as $job) { |
|
| 208 | + foreach ($jobs as $job) { |
|
| 209 | 209 | foreach ($job->input_files as $file) { |
| 210 | 210 | if ($file->mode != "remote") { |
| 211 | 211 | $file->name = stage_file($file); |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | // |
| 219 | 219 | function submit_jobs( |
| 220 | 220 | $jobs, $job_params, $app, $batch_id, $priority, $app_version_num, |
| 221 | - $input_template_filename, // batch-level; can also specify per job |
|
| 221 | + $input_template_filename, // batch-level; can also specify per job |
|
| 222 | 222 | $output_template_filename |
| 223 | 223 | ) { |
| 224 | 224 | global $input_templates, $output_templates; |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | // one line per job |
| 228 | 228 | // |
| 229 | 229 | $x = ""; |
| 230 | - foreach($jobs as $job) { |
|
| 230 | + foreach ($jobs as $job) { |
|
| 231 | 231 | if ($job->name) { |
| 232 | 232 | $x .= " --wu_name $job->name"; |
| 233 | 233 | } |
@@ -262,8 +262,8 @@ discard block |
||
| 262 | 262 | $x .= "\n"; |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | - $errfile = "/tmp/create_work_" . getmypid() . ".err"; |
|
| 266 | - $cmd = "cd " . project_dir() . "; ./bin/create_work --appname $app->name --batch $batch_id"; |
|
| 265 | + $errfile = "/tmp/create_work_".getmypid().".err"; |
|
| 266 | + $cmd = "cd ".project_dir()."; ./bin/create_work --appname $app->name --batch $batch_id"; |
|
| 267 | 267 | if ($priority !== null) { |
| 268 | 268 | $cmd .= " --priority $priority"; |
| 269 | 269 | } |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | // |
| 364 | 364 | function xml_get_jobs($r) { |
| 365 | 365 | $jobs = array(); |
| 366 | - foreach($r->batch->job as $j) { |
|
| 366 | + foreach ($r->batch->job as $j) { |
|
| 367 | 367 | $job = new StdClass; |
| 368 | 368 | $job->input_files = array(); |
| 369 | 369 | $job->command_line = (string)$j->command_line; |
@@ -414,16 +414,16 @@ discard block |
||
| 414 | 414 | // |
| 415 | 415 | function logical_end_time($r, $jobs, $user, $app) { |
| 416 | 416 | $total_flops = 0; |
| 417 | - foreach($jobs as $job) { |
|
| 417 | + foreach ($jobs as $job) { |
|
| 418 | 418 | //print_r($job); |
| 419 | 419 | if ($job->rsc_fpops_est) { |
| 420 | 420 | $total_flops += $job->rsc_fpops_est; |
| 421 | 421 | } else if ($job->input_template && $job->input_template->workunit->rsc_fpops_est) { |
| 422 | - $total_flops += (double) $job->input_template->workunit->rsc_fpops_est; |
|
| 422 | + $total_flops += (double)$job->input_template->workunit->rsc_fpops_est; |
|
| 423 | 423 | } else if ($r->batch->job_params->rsc_fpops_est) { |
| 424 | - $total_flops += (double) $r->batch->job_params->rsc_fpops_est; |
|
| 424 | + $total_flops += (double)$r->batch->job_params->rsc_fpops_est; |
|
| 425 | 425 | } else { |
| 426 | - $x = (double) $template->workunit->rsc_fpops_est; |
|
| 426 | + $x = (double)$template->workunit->rsc_fpops_est; |
|
| 427 | 427 | if ($x) { |
| 428 | 428 | $total_flops += $x; |
| 429 | 429 | } else { |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | } |
| 432 | 432 | } |
| 433 | 433 | } |
| 434 | - $cmd = "cd " . project_dir() . "/bin; ./adjust_user_priority --user $user->id --flops $total_flops --app $app->name"; |
|
| 434 | + $cmd = "cd ".project_dir()."/bin; ./adjust_user_priority --user $user->id --flops $total_flops --app $app->name"; |
|
| 435 | 435 | $x = exec($cmd); |
| 436 | 436 | if (!is_numeric($x) || (double)$x == 0) { |
| 437 | 437 | xml_error(-1, "$cmd returned $x"); |
@@ -509,15 +509,15 @@ discard block |
||
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | $job_params = new StdClass; |
| 512 | - $job_params->rsc_disk_bound = (double) $r->batch->job_params->rsc_disk_bound; |
|
| 513 | - $job_params->rsc_fpops_est = (double) $r->batch->job_params->rsc_fpops_est; |
|
| 514 | - $job_params->rsc_fpops_bound = (double) $r->batch->job_params->rsc_fpops_bound; |
|
| 515 | - $job_params->rsc_memory_bound = (double) $r->batch->job_params->rsc_memory_bound; |
|
| 516 | - $job_params->delay_bound = (double) $r->batch->job_params->delay_bound; |
|
| 512 | + $job_params->rsc_disk_bound = (double)$r->batch->job_params->rsc_disk_bound; |
|
| 513 | + $job_params->rsc_fpops_est = (double)$r->batch->job_params->rsc_fpops_est; |
|
| 514 | + $job_params->rsc_fpops_bound = (double)$r->batch->job_params->rsc_fpops_bound; |
|
| 515 | + $job_params->rsc_memory_bound = (double)$r->batch->job_params->rsc_memory_bound; |
|
| 516 | + $job_params->delay_bound = (double)$r->batch->job_params->delay_bound; |
|
| 517 | 517 | // could add quorum-related stuff |
| 518 | 518 | |
| 519 | - $input_template_filename = (string) $r->batch->input_template_filename; |
|
| 520 | - $output_template_filename = (string) $r->batch->output_template_filename; |
|
| 519 | + $input_template_filename = (string)$r->batch->input_template_filename; |
|
| 520 | + $output_template_filename = (string)$r->batch->output_template_filename; |
|
| 521 | 521 | // possibly empty |
| 522 | 522 | |
| 523 | 523 | submit_jobs( |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | function n_outfiles($wu) { |
| 609 | - $path = project_dir() . "/$wu->output_template_filename"; |
|
| 609 | + $path = project_dir()."/$wu->output_template_filename"; |
|
| 610 | 610 | $r = simplexml_load_file($path); |
| 611 | 611 | return count($r->file_info); |
| 612 | 612 | } |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | "; |
| 814 | 814 | if ($result->server_state == 5) { // over? |
| 815 | 815 | $paths = get_outfile_paths($result); |
| 816 | - foreach($paths as $path) { |
|
| 816 | + foreach ($paths as $path) { |
|
| 817 | 817 | if (is_file($path)) { |
| 818 | 818 | $size = filesize($path); |
| 819 | 819 | echo " <outfile> |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | } else { |
| 858 | 858 | $results = BoincResult::enum("workunitid=$job_id"); |
| 859 | 859 | foreach ($results as $r) { |
| 860 | - switch($r->outcome) { |
|
| 860 | + switch ($r->outcome) { |
|
| 861 | 861 | case 1: |
| 862 | 862 | case 3: |
| 863 | 863 | case 6: |
@@ -972,8 +972,8 @@ discard block |
||
| 972 | 972 | } |
| 973 | 973 | |
| 974 | 974 | list($user, $user_submit) = check_remote_submit_permissions($r, $app); |
| 975 | - $in = file_get_contents(project_dir() . "/templates/".$app->name."_in"); |
|
| 976 | - $out = file_get_contents(project_dir() . "/templates/".$app->name."_out"); |
|
| 975 | + $in = file_get_contents(project_dir()."/templates/".$app->name."_in"); |
|
| 976 | + $out = file_get_contents(project_dir()."/templates/".$app->name."_out"); |
|
| 977 | 977 | if ($in === false || $out === false) { |
| 978 | 978 | log_write("template file missing"); |
| 979 | 979 | xml_error(-1, "template file missing"); |
@@ -985,7 +985,7 @@ discard block |
||
| 985 | 985 | |
| 986 | 986 | function ping($r) { |
| 987 | 987 | xml_start_tag("ping"); |
| 988 | - BoincDb::get(); // errors out if DB down or web disabled |
|
| 988 | + BoincDb::get(); // errors out if DB down or web disabled |
|
| 989 | 989 | echo "<success>1</success> |
| 990 | 990 | </ping> |
| 991 | 991 | "; |
@@ -1052,9 +1052,9 @@ discard block |
||
| 1052 | 1052 | $request_log = parse_config(get_config(), "<remote_submit_request_log>"); |
| 1053 | 1053 | if ($request_log) { |
| 1054 | 1054 | $log_dir = parse_config(get_config(), "<log_dir>"); |
| 1055 | - $request_log = $log_dir . "/" . $request_log; |
|
| 1055 | + $request_log = $log_dir."/".$request_log; |
|
| 1056 | 1056 | if ($file = fopen($request_log, "a")) { |
| 1057 | - fwrite($file, "\n<submit_rpc_handler date=\"" . date(DATE_ATOM) . "\">\n" . $_POST['request'] . "\n</submit_rpc_handler>\n"); |
|
| 1057 | + fwrite($file, "\n<submit_rpc_handler date=\"".date(DATE_ATOM)."\">\n".$_POST['request']."\n</submit_rpc_handler>\n"); |
|
| 1058 | 1058 | fclose($file); |
| 1059 | 1059 | } |
| 1060 | 1060 | } |
@@ -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> |
@@ -86,11 +86,11 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | if ($disable_account_creation || defined('INVITE_CODES')) { |
| 89 | - echo " <account_creation_disabled/>\n"; |
|
| 89 | + echo " <account_creation_disabled/>\n"; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | if (defined('INVITE_CODES')) { |
| 93 | - echo " <invite_code_required/>\n"; |
|
| 93 | + echo " <invite_code_required/>\n"; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | echo " <min_passwd_length>$min_passwd_length</min_passwd_length>\n"; |
@@ -113,9 +113,9 @@ discard block |
||
| 113 | 113 | // the terms_of_use.txt file in the project base directory. |
| 114 | 114 | // |
| 115 | 115 | if (defined('TERMSOFUSE_FILE')) { |
| 116 | - $tou_file = TERMSOFUSE_FILE; |
|
| 116 | + $tou_file = TERMSOFUSE_FILE; |
|
| 117 | 117 | } else { |
| 118 | - $tou_file = "../../terms_of_use.txt"; |
|
| 118 | + $tou_file = "../../terms_of_use.txt"; |
|
| 119 | 119 | } |
| 120 | 120 | if (file_exists($tou_file)) { |
| 121 | 121 | $terms_of_use = trim(file_get_contents($tou_file)); |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | // |
| 31 | 31 | function show_platforms() { |
| 32 | 32 | $xmlFragment = unserialize(get_cached_data(3600, "project_config_platform_xml")); |
| 33 | - if ($xmlFragment==false){ |
|
| 33 | + if ($xmlFragment == false) { |
|
| 34 | 34 | $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", ""); |
| 35 | 35 | $xmlFragment = " <platforms>"; |
| 36 | - foreach ($platforms as $platform){ |
|
| 36 | + foreach ($platforms as $platform) { |
|
| 37 | 37 | $xmlFragment .= " |
| 38 | 38 | <platform> |
| 39 | 39 | <platform_name>$platform->name</platform_name> |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | if (defined('TERMSOFUSE_FILE')) { |
| 116 | 116 | $tou_file = TERMSOFUSE_FILE; |
| 117 | 117 | } else { |
| 118 | - $tou_file = "../../terms_of_use.txt"; |
|
| 118 | + $tou_file = "../../terms_of_use.txt"; |
|
| 119 | 119 | } |
| 120 | 120 | if (file_exists($tou_file)) { |
| 121 | 121 | $terms_of_use = trim(file_get_contents($tou_file)); |
@@ -56,7 +56,7 @@ 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 | 62 | $forumlist="<option value=\"-1\">".tra("All")."</option>"; |
@@ -64,7 +64,7 @@ discard block |
||
| 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){ |
|
| 67 | + if ($forum->id==$forumid) { |
|
| 68 | 68 | $forumlist.="<option selected value=\"".$forum->id."\">".$forum->title."</option>"; |
| 69 | 69 | } else { |
| 70 | 70 | $forumlist.="<option value=\"".$forum->id."\">".$forum->title."</option>"; |
@@ -76,8 +76,8 @@ 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){ |
|
| 79 | +foreach ($thread_sort_styles as $id => $style) { |
|
| 80 | + if ($id == CREATE_TIME_NEW) { |
|
| 81 | 81 | $sortlist.="<option selected value=\"".$id."\">".$style."</option>"; |
| 82 | 82 | } else { |
| 83 | 83 | $sortlist.="<option value=\"".$id."\">".$style."</option>"; |
@@ -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,22 +76,22 @@ 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"), |
| 87 | 87 | '<select class="form-control" name="search_sort">'.$sortlist.'</select'); |
| 88 | 88 | |
| 89 | 89 | row1(" "); |
| 90 | -row2("","<input class=\"btn btn-success\" type=\"submit\" value=\"".tra("Start the search")."\">"); |
|
| 90 | +row2("", "<input class=\"btn btn-success\" type=\"submit\" value=\"".tra("Start the search")."\">"); |
|
| 91 | 91 | echo "</form>"; |
| 92 | 92 | end_table(); |
| 93 | 93 | |
| 94 | 94 | page_tail(); |
| 95 | 95 | |
| 96 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
| 96 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
| 97 | 97 | ?> |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | $team = BoincTeam::lookup_id($teamid); |
| 58 | 58 | $user = BoincUser::lookup_id($team->userid); |
| 59 | 59 | if (!$user) { |
| 60 | - error_page("Team $team->name has no founder"); |
|
| 60 | + error_page("team $team->name has no founder"); |
|
| 61 | 61 | $teamid = 0; |
| 62 | 62 | } else { |
| 63 | 63 | echo "<b>".tra("This account will belong to the team %1 and will have the project preferences of its founder.", "<a href=\"team_display.php?teamid=$team->id\">$team->name</a>")."</b><p>"; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | -form_start("create_account_action.php","post"); |
|
| 69 | +form_start("create_account_action.php", "post"); |
|
| 70 | 70 | create_account_form($teamid, $next_url); |
| 71 | 71 | global $recaptcha_public_key; |
| 72 | 72 | if ($recaptcha_public_key) { |
@@ -77,5 +77,5 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | page_tail(); |
| 79 | 79 | |
| 80 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
| 80 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
| 81 | 81 | ?> |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | $now = time(); |
| 71 | 71 | $post->update("signature=$add_signature, content='$content', modified=$now"); |
| 72 | 72 | |
| 73 | - if ($can_edit_title){ |
|
| 73 | + if ($can_edit_title) { |
|
| 74 | 74 | $title = trim($title); |
| 75 | 75 | $title = sanitize_tags($title); |
| 76 | 76 | $title = BoincDb::escape_string($title); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $post_owner = BoincUser::lookup_id($post->user); |
| 46 | 46 | if (($logged_in_user->id != $post_owner->id) || (can_reply($thread, $forum, $logged_in_user) == false)) { |
| 47 | - error_page (tra("You are not authorized to edit this post.")); |
|
| 47 | + error_page(tra("You are not authorized to edit this post.")); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | $thread_owner = BoincUser::lookup_id($thread->owner); |
@@ -53,13 +53,13 @@ discard block |
||
| 53 | 53 | // (ie. not a response to another post) |
| 54 | 54 | // allow the user to modify the thread title |
| 55 | 55 | // |
| 56 | -$can_edit_title = ($post->parent_post==0 && $thread_owner->id==$logged_in_user->id && !is_banished($logged_in_user)); |
|
| 56 | +$can_edit_title = ($post->parent_post == 0 && $thread_owner->id == $logged_in_user->id && !is_banished($logged_in_user)); |
|
| 57 | 57 | |
| 58 | 58 | $content = post_str("content", true); |
| 59 | 59 | $title = post_str("title", true); |
| 60 | 60 | $preview = post_str("preview", true); |
| 61 | 61 | |
| 62 | -if (post_str('submit',true) && (!$preview)) { |
|
| 62 | +if (post_str('submit', true) && (!$preview)) { |
|
| 63 | 63 | if (POST_MAX_LINKS |
| 64 | 64 | && link_count($content) > POST_MAX_LINKS |
| 65 | 65 | && !is_moderator($logged_in_user, $forum) |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | check_tokens($logged_in_user->authenticator); |
| 70 | 70 | |
| 71 | - $add_signature = (post_str('add_signature', true) == "1")?1:0; |
|
| 71 | + $add_signature = (post_str('add_signature', true) == "1") ? 1 : 0; |
|
| 72 | 72 | $content = substr($content, 0, 64000); |
| 73 | 73 | $content = trim($content); |
| 74 | 74 | if (strlen($content)) { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $now = time(); |
| 77 | 77 | $post->update("signature=$add_signature, content='$content', modified=$now"); |
| 78 | 78 | |
| 79 | - if ($can_edit_title){ |
|
| 79 | + if ($can_edit_title) { |
|
| 80 | 80 | $title = trim($title); |
| 81 | 81 | $title = sanitize_tags($title); |
| 82 | 82 | $title = BoincDb::escape_string($title); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | -page_head(tra("Edit post"),'','','', $bbcode_js); |
|
| 92 | +page_head(tra("Edit post"), '', '', '', $bbcode_js); |
|
| 93 | 93 | |
| 94 | 94 | show_forum_header($logged_in_user); |
| 95 | 95 | switch ($forum->parent_type) { |
@@ -144,9 +144,9 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | if ($post->signature) { |
| 147 | - $enable_signature="checked=\"true\""; |
|
| 147 | + $enable_signature = "checked=\"true\""; |
|
| 148 | 148 | } else { |
| 149 | - $enable_signature=""; |
|
| 149 | + $enable_signature = ""; |
|
| 150 | 150 | } |
| 151 | 151 | row2("", "<input id=\"add_signature\" name=\"add_signature\" value=\"1\" ".$enable_signature." type=\"checkbox\"> |
| 152 | 152 | <label for=\"add_signature\">".tra("Add my signature to this post")."</label>"); |
@@ -159,5 +159,5 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | page_tail(); |
| 161 | 161 | |
| 162 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
| 162 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
| 163 | 163 | ?> |