@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $subset = sanitize_tags(get_str("subset")); |
28 | 28 | $venue = sanitize_tags(get_str("venue")); |
29 | 29 | $columns = get_int("cols", true); |
30 | -$c = $columns?"&cols=$columns":""; |
|
30 | +$c = $columns ? "&cols=$columns" : ""; |
|
31 | 31 | check_venue($venue); |
32 | 32 | check_subset($subset); |
33 | 33 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $title = tra("Edit %1 preferences", subset_name($subset)); |
41 | 41 | if ($venue) $title = "$title for $venue"; |
42 | 42 | page_head($title); |
43 | - $x = $venue?"&venue=$venue":""; |
|
43 | + $x = $venue ? "&venue=$venue" : ""; |
|
44 | 44 | |
45 | 45 | echo PREFS_FORM_DESC1; |
46 | 46 | echo PREFS_FORM_ERROR_DESC; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $title = tra("Edit %1 preferences", subset_name($subset)); |
65 | 65 | if ($venue) $title = "$title for $venue"; |
66 | 66 | page_head($title); |
67 | - $x = $venue?"&venue=$venue":""; |
|
67 | + $x = $venue ? "&venue=$venue" : ""; |
|
68 | 68 | |
69 | 69 | echo PREFS_FORM_ERROR_DESC; |
70 | 70 | |
@@ -90,5 +90,5 @@ discard block |
||
90 | 90 | print_prefs_form("add", $subset, $venue, $user, $prefs, $columns); |
91 | 91 | } |
92 | 92 | page_tail(); |
93 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
93 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
94 | 94 | ?> |
@@ -31,18 +31,18 @@ discard block |
||
31 | 31 | global $app_name,$log; |
32 | 32 | |
33 | 33 | $timestamp = date("Y-m-d H:i",time()); |
34 | - // read the list of template filenames |
|
35 | - // |
|
36 | - $files = file("../../tree_threader_template_files"); |
|
37 | - if ($files === false) { |
|
34 | + // read the list of template filenames |
|
35 | + // |
|
36 | + $files = file("../../tree_threader_template_files"); |
|
37 | + if ($files === false) { |
|
38 | 38 | fwrite($log,"$timestamp\ttemplate file tree_threader_template_files\n"); |
39 | 39 | error("no templates file"); |
40 | 40 | |
41 | 41 | } |
42 | - $njobs = sizeof($files); |
|
43 | - $now = time(); |
|
42 | + $njobs = sizeof($files); |
|
43 | + $now = time(); |
|
44 | 44 | $batch_id = BoincBatch::insert( |
45 | - "(user_id, create_time, njobs, name, app_id, state) values ($user->id, $now, $njobs, 'tree_threader batch', $app->id, ".BATCH_STATE_IN_PROGRESS.")" |
|
45 | + "(user_id, create_time, njobs, name, app_id, state) values ($user->id, $now, $njobs, 'tree_threader batch', $app->id, ".BATCH_STATE_IN_PROGRESS.")" |
|
46 | 46 | ); |
47 | 47 | if (!$batch_id) { |
48 | 48 | $log_msg = "$timestamp\tfailed to create batch for user $user->id\n"; |
@@ -68,20 +68,20 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | $i = 1; |
71 | - foreach ($files as $file) { |
|
71 | + foreach ($files as $file) { |
|
72 | 72 | $file = trim($file); |
73 | 73 | $wu_name = "ICT_".$batch_id."_$i"; |
74 | 74 | |
75 | - $cmd = "cd ../..; ./bin/create_work --appname $app_name --batch $batch_id --wu_name $wu_name --wu_template templates/ICT_in --result_template templates/ICT_out $seq_fname $file"; |
|
75 | + $cmd = "cd ../..; ./bin/create_work --appname $app_name --batch $batch_id --wu_name $wu_name --wu_template templates/ICT_in --result_template templates/ICT_out $seq_fname $file"; |
|
76 | 76 | fwrite($log, "$timestamp\t$cmd\n"); |
77 | 77 | system($cmd, $ret); |
78 | - if ($ret != 0) { |
|
78 | + if ($ret != 0) { |
|
79 | 79 | fwrite($log, "can not creat job $wu_name\n"); |
80 | - error("can't create job"); |
|
80 | + error("can't create job"); |
|
81 | 81 | } |
82 | 82 | $i++; |
83 | - } |
|
84 | - echo "<tt_reply>\n<batch_id>$batch_id</batch_id>\n</tt_reply>\n"; |
|
83 | + } |
|
84 | + echo "<tt_reply>\n<batch_id>$batch_id</batch_id>\n</tt_reply>\n"; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | // Enumerate all the successfully completed WUs for this batch. |
@@ -93,51 +93,51 @@ discard block |
||
93 | 93 | function handle_get_output($r, $batch) { |
94 | 94 | global $log; |
95 | 95 | $timestamp = date("Y-m-d H:i",time()); |
96 | - $wus = BoincWorkUnit::enum("batch=$batch->id"); |
|
97 | - $outdir = "/tmp/treeThreader_result_".$batch->id; |
|
96 | + $wus = BoincWorkUnit::enum("batch=$batch->id"); |
|
97 | + $outdir = "/tmp/treeThreader_result_".$batch->id; |
|
98 | 98 | @mkdir($outdir); |
99 | - foreach ($wus as $wu) { |
|
100 | - if (!$wu->canonical_resultid) continue; |
|
101 | - $result = BoincResult::lookup_id($wu->canonical_resultid); |
|
102 | - if (!$result) continue; |
|
103 | - $paths = get_outfile_paths($result); |
|
104 | - if (sizeof($paths) < 1) continue; |
|
105 | - |
|
106 | - // there's only one output file |
|
107 | - // |
|
108 | - $path = $paths[0]; |
|
109 | - |
|
110 | - // unzip it into a directory in /tmp |
|
111 | - // |
|
112 | - $dir = "/tmp/$wu->name"; |
|
99 | + foreach ($wus as $wu) { |
|
100 | + if (!$wu->canonical_resultid) continue; |
|
101 | + $result = BoincResult::lookup_id($wu->canonical_resultid); |
|
102 | + if (!$result) continue; |
|
103 | + $paths = get_outfile_paths($result); |
|
104 | + if (sizeof($paths) < 1) continue; |
|
105 | + |
|
106 | + // there's only one output file |
|
107 | + // |
|
108 | + $path = $paths[0]; |
|
109 | + |
|
110 | + // unzip it into a directory in /tmp |
|
111 | + // |
|
112 | + $dir = "/tmp/$wu->name"; |
|
113 | 113 | @mkdir($dir); |
114 | - $cmd = "cd $dir; unzip -q $path"; |
|
115 | - system($cmd, $ret); |
|
116 | - if ($ret != 0) { |
|
117 | - error("can't unzip output file"); |
|
118 | - } |
|
119 | - $cmd = "cp $dir/Aln/* $outdir"; |
|
120 | - system($cmd, $ret); |
|
121 | - if ($ret != 0) { |
|
122 | - error("can't copy output files"); |
|
123 | - } |
|
114 | + $cmd = "cd $dir; unzip -q $path"; |
|
115 | + system($cmd, $ret); |
|
116 | + if ($ret != 0) { |
|
117 | + error("can't unzip output file"); |
|
118 | + } |
|
119 | + $cmd = "cp $dir/Aln/* $outdir"; |
|
120 | + system($cmd, $ret); |
|
121 | + if ($ret != 0) { |
|
122 | + error("can't copy output files"); |
|
123 | + } |
|
124 | 124 | |
125 | 125 | system("rm -rf $dir"); |
126 | - } |
|
127 | - |
|
128 | - $cmd = "zip -r -q $outdir $outdir"; |
|
129 | - system($cmd, $ret); |
|
130 | - if ($ret != $ret) { |
|
131 | - error("can't zip output files"); |
|
132 | - } |
|
133 | - $fname = "treeThreader_result_".$batch->id.".zip"; |
|
126 | + } |
|
127 | + |
|
128 | + $cmd = "zip -r -q $outdir $outdir"; |
|
129 | + system($cmd, $ret); |
|
130 | + if ($ret != $ret) { |
|
131 | + error("can't zip output files"); |
|
132 | + } |
|
133 | + $fname = "treeThreader_result_".$batch->id.".zip"; |
|
134 | 134 | $treeThreader_dir="treeThreaderResult"; |
135 | 135 | if(!is_dir("../../download/$treeThreader_dir"))mkdir("../../download/$treeThreader_dir"); |
136 | - @symlink("/tmp/$fname", "../../download/$treeThreader_dir/$fname"); |
|
136 | + @symlink("/tmp/$fname", "../../download/$treeThreader_dir/$fname"); |
|
137 | 137 | system("rm -fr $outdir"); |
138 | 138 | $config = simplexml_load_string(file_get_contents("../../config.xml")); |
139 | 139 | $download_url = trim((string)$config->config->download_url); |
140 | - echo "<tt_reply>\n<url>$download_url/$treeThreader_dir/$fname</url>\n</tt_reply>\n"; |
|
140 | + echo "<tt_reply>\n<url>$download_url/$treeThreader_dir/$fname</url>\n</tt_reply>\n"; |
|
141 | 141 | $log_msg="$timestamp\tuser $batch->user_id downloads results for batch $batch->id : $download_url/$treeThreader_dir/$fname\n"; |
142 | 142 | fwrite($log, $log_msg); |
143 | 143 | } |
@@ -177,12 +177,12 @@ discard block |
||
177 | 177 | handle_submit($r, $user, $app); |
178 | 178 | break; |
179 | 179 | case 'get_output': |
180 | - $batch_id = (int)$r->batch_id; |
|
181 | - $batch = BoincBatch::lookup_id($batch_id); |
|
182 | - if (!$batch) error("no such batch"); |
|
183 | - if ($batch->user_id != $user->id) error("not owner of batch"); |
|
184 | - handle_get_output($r, $batch); |
|
185 | - break; |
|
180 | + $batch_id = (int)$r->batch_id; |
|
181 | + $batch = BoincBatch::lookup_id($batch_id); |
|
182 | + if (!$batch) error("no such batch"); |
|
183 | + if ($batch->user_id != $user->id) error("not owner of batch"); |
|
184 | + handle_get_output($r, $batch); |
|
185 | + break; |
|
186 | 186 | default: error("bad command"); |
187 | 187 | } |
188 | 188 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | ini_set('display_startup_errors', true); |
21 | 21 | |
22 | 22 | $app_name = "treeThreader"; |
23 | -$log = fopen("/tmp/tt_job.log","a+"); |
|
23 | +$log = fopen("/tmp/tt_job.log", "a+"); |
|
24 | 24 | |
25 | 25 | function error($s) { |
26 | 26 | echo "<error>\n<message>$s</message>\n</error>\n"; |
@@ -28,14 +28,14 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | function handle_submit($r, $user, $app) { |
31 | - global $app_name,$log; |
|
31 | + global $app_name, $log; |
|
32 | 32 | |
33 | - $timestamp = date("Y-m-d H:i",time()); |
|
33 | + $timestamp = date("Y-m-d H:i", time()); |
|
34 | 34 | // read the list of template filenames |
35 | 35 | // |
36 | 36 | $files = file("../../tree_threader_template_files"); |
37 | 37 | if ($files === false) { |
38 | - fwrite($log,"$timestamp\ttemplate file tree_threader_template_files\n"); |
|
38 | + fwrite($log, "$timestamp\ttemplate file tree_threader_template_files\n"); |
|
39 | 39 | error("no templates file"); |
40 | 40 | |
41 | 41 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | // |
93 | 93 | function handle_get_output($r, $batch) { |
94 | 94 | global $log; |
95 | - $timestamp = date("Y-m-d H:i",time()); |
|
95 | + $timestamp = date("Y-m-d H:i", time()); |
|
96 | 96 | $wus = BoincWorkUnit::enum("batch=$batch->id"); |
97 | 97 | $outdir = "/tmp/treeThreader_result_".$batch->id; |
98 | 98 | @mkdir($outdir); |
@@ -131,14 +131,14 @@ discard block |
||
131 | 131 | error("can't zip output files"); |
132 | 132 | } |
133 | 133 | $fname = "treeThreader_result_".$batch->id.".zip"; |
134 | - $treeThreader_dir="treeThreaderResult"; |
|
135 | - if(!is_dir("../../download/$treeThreader_dir"))mkdir("../../download/$treeThreader_dir"); |
|
134 | + $treeThreader_dir = "treeThreaderResult"; |
|
135 | + if (!is_dir("../../download/$treeThreader_dir"))mkdir("../../download/$treeThreader_dir"); |
|
136 | 136 | @symlink("/tmp/$fname", "../../download/$treeThreader_dir/$fname"); |
137 | 137 | system("rm -fr $outdir"); |
138 | 138 | $config = simplexml_load_string(file_get_contents("../../config.xml")); |
139 | 139 | $download_url = trim((string)$config->config->download_url); |
140 | 140 | echo "<tt_reply>\n<url>$download_url/$treeThreader_dir/$fname</url>\n</tt_reply>\n"; |
141 | - $log_msg="$timestamp\tuser $batch->user_id downloads results for batch $batch->id : $download_url/$treeThreader_dir/$fname\n"; |
|
141 | + $log_msg = "$timestamp\tuser $batch->user_id downloads results for batch $batch->id : $download_url/$treeThreader_dir/$fname\n"; |
|
142 | 142 | fwrite($log, $log_msg); |
143 | 143 | } |
144 | 144 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | // read the list of template filenames |
35 | 35 | // |
36 | 36 | $files = file("../../tree_threader_template_files"); |
37 | - if ($files === false) { |
|
37 | + if ($files === false) { |
|
38 | 38 | fwrite($log,"$timestamp\ttemplate file tree_threader_template_files\n"); |
39 | 39 | error("no templates file"); |
40 | 40 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | </form> |
53 | 53 | <hr> |
54 | 54 | "; |
55 | - if (strcmp($err_msg,"")!=0){ |
|
55 | + if (strcmp($err_msg, "") != 0) { |
|
56 | 56 | echo "<p>$err_msg<hr>"; |
57 | 57 | } |
58 | 58 | $files = array(); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } else { |
67 | 67 | sort($files); |
68 | 68 | start_table(); |
69 | - table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete","Download"); |
|
69 | + table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete", "Download"); |
|
70 | 70 | foreach ($files as $f) { |
71 | 71 | $path = "$dir/$f"; |
72 | 72 | list($error, $size, $md5) = sandbox_parse_link_file($path); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $s = stat($tmp_name); |
117 | 117 | $size = $s['size']; |
118 | 118 | list($exist, $elf) = sandbox_lf_exist($user, $md5); |
119 | - if ($exist){ |
|
119 | + if ($exist) { |
|
120 | 120 | $notice .= "<strong>Notice:</strong> Invalid Upload<br/>"; |
121 | 121 | $notice .= "You are trying to upload file <strong>$name</strong><br/>"; |
122 | 122 | $notice .= "Another file <strong>$elf</strong> with the same content (md5: $md5) already exists!<br/>"; |
@@ -149,15 +149,15 @@ discard block |
||
149 | 149 | error_page("no such physical file"); |
150 | 150 | } |
151 | 151 | $bused = sandbox_file_in_use($user, $name); |
152 | - if ($bused){ |
|
152 | + if ($bused) { |
|
153 | 153 | $notice = "<strong>$name</strong> is being used by batch(es), you can not delete it now!<br/>"; |
154 | - } else{ |
|
154 | + } else { |
|
155 | 155 | $notice = "<strong>$name</strong> is not being used by any batch(es) and successfully deleted from your sandbox<br/>"; |
156 | 156 | unlink("$dir/$name"); |
157 | 157 | unlink($p); |
158 | 158 | |
159 | 159 | } |
160 | - list_files($user,$notice); |
|
160 | + list_files($user, $notice); |
|
161 | 161 | //Header("Location: sandbox.php"); |
162 | 162 | } |
163 | 163 | function download_file($user) { |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | if (!$action) $action = post_str('action', true); |
195 | 195 | |
196 | 196 | switch ($action) { |
197 | -case '': list_files($user,""); break; |
|
197 | +case '': list_files($user, ""); break; |
|
198 | 198 | case 'upload_file': upload_file($user); break; |
199 | 199 | case 'delete_file': delete_file($user); break; |
200 | 200 | case 'download_file': download_file($user); break; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | </form> |
53 | 53 | <hr> |
54 | 54 | "; |
55 | - if (strcmp($err_msg,"")!=0){ |
|
55 | + if (strcmp($err_msg,"")!=0) { |
|
56 | 56 | echo "<p>$err_msg<hr>"; |
57 | 57 | } |
58 | 58 | $files = array(); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $s = stat($tmp_name); |
117 | 117 | $size = $s['size']; |
118 | 118 | list($exist, $elf) = sandbox_lf_exist($user, $md5); |
119 | - if ($exist){ |
|
119 | + if ($exist) { |
|
120 | 120 | $notice .= "<strong>Notice:</strong> Invalid Upload<br/>"; |
121 | 121 | $notice .= "You are trying to upload file <strong>$name</strong><br/>"; |
122 | 122 | $notice .= "Another file <strong>$elf</strong> with the same content (md5: $md5) already exists!<br/>"; |
@@ -149,9 +149,9 @@ discard block |
||
149 | 149 | error_page("no such physical file"); |
150 | 150 | } |
151 | 151 | $bused = sandbox_file_in_use($user, $name); |
152 | - if ($bused){ |
|
152 | + if ($bused) { |
|
153 | 153 | $notice = "<strong>$name</strong> is being used by batch(es), you can not delete it now!<br/>"; |
154 | - } else{ |
|
154 | + } else { |
|
155 | 155 | $notice = "<strong>$name</strong> is not being used by any batch(es) and successfully deleted from your sandbox<br/>"; |
156 | 156 | unlink("$dir/$name"); |
157 | 157 | unlink($p); |
@@ -82,7 +82,7 @@ |
||
82 | 82 | echo "<rpc_response>\n"; |
83 | 83 | echo "<count>$count</count>\n"; |
84 | 84 | echo "<threads>\n"; |
85 | - foreach($threads as $thread) { |
|
85 | + foreach ($threads as $thread) { |
|
86 | 86 | echo "<thread>\n"; |
87 | 87 | echo " <id>$thread->id</id>\n"; |
88 | 88 | echo " <forumid>$thread->forum</forumid>\n"; |
@@ -29,7 +29,7 @@ discard block |
||
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,5 +56,5 @@ discard block |
||
56 | 56 | page_tail(); |
57 | 57 | } |
58 | 58 | |
59 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
59 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
60 | 60 | ?> |
@@ -38,7 +38,7 @@ |
||
38 | 38 | // See if "action" is provided - either through post or get |
39 | 39 | if (!post_str('action', true)) { |
40 | 40 | if (!get_str('action', true)){ |
41 | - error_page(tra("You must specify an action...")); |
|
41 | + error_page(tra("You must specify an action...")); |
|
42 | 42 | } else { |
43 | 43 | $action = get_str('action'); |
44 | 44 | } |
@@ -55,14 +55,14 @@ |
||
55 | 55 | |
56 | 56 | // TODO: create a function for this in forum_banishment_vote.inc to make it more flexible |
57 | 57 | switch (post_int("category", true)) { |
58 | - case 1: |
|
59 | - $mod_category = tra("Obscene"); |
|
60 | - case 2: |
|
61 | - $mod_category = tra("Flame/Hate mail"); |
|
62 | - case 3: |
|
63 | - $mod_category = tra("User Request"); |
|
64 | - default: |
|
65 | - $mod_category = tra("Other"); |
|
58 | +case 1: |
|
59 | + $mod_category = tra("Obscene"); |
|
60 | +case 2: |
|
61 | + $mod_category = tra("Flame/Hate mail"); |
|
62 | +case 3: |
|
63 | + $mod_category = tra("User Request"); |
|
64 | +default: |
|
65 | + $mod_category = tra("Other"); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | if (post_str('reason', true)){ |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | // See if "action" is provided - either through post or get |
39 | 39 | if (!post_str('action', true)) { |
40 | - if (!get_str('action', true)){ |
|
40 | + if (!get_str('action', true)) { |
|
41 | 41 | error_page(tra("You must specify an action...")); |
42 | 42 | } else { |
43 | 43 | $action = get_str('action'); |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | $userid = post_int('userid'); |
50 | -$user=BoincUser::lookup_id($userid); |
|
50 | +$user = BoincUser::lookup_id($userid); |
|
51 | 51 | |
52 | -if ($action!="start"){ |
|
52 | +if ($action != "start") { |
|
53 | 53 | error_page("Unknown action"); |
54 | 54 | } |
55 | 55 | |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | $mod_category = tra("Other"); |
66 | 66 | } |
67 | 67 | |
68 | -if (post_str('reason', true)){ |
|
69 | - start_vote($config,$logged_in_user,$user, $mod_category,post_str("reason")); |
|
68 | +if (post_str('reason', true)) { |
|
69 | + start_vote($config, $logged_in_user, $user, $mod_category, post_str("reason")); |
|
70 | 70 | } else { |
71 | - start_vote($config,$logged_in_user,$user, $mod_category,"None given"); |
|
71 | + start_vote($config, $logged_in_user, $user, $mod_category, "None given"); |
|
72 | 72 | } |
73 | 73 | |
74 | -$cvs_version_tracker[]="\$Id: forum_moderate_post_action.php 13718 2007-09-30 11:17:11Z Rytis $"; //Generated automatically - do not edit |
|
74 | +$cvs_version_tracker[] = "\$Id: forum_moderate_post_action.php 13718 2007-09-30 11:17:11Z Rytis $"; //Generated automatically - do not edit |
|
75 | 75 | ?> |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | // See if "action" is provided - either through post or get |
39 | 39 | if (!post_str('action', true)) { |
40 | - if (!get_str('action', true)){ |
|
40 | + if (!get_str('action', true)) { |
|
41 | 41 | error_page(tra("You must specify an action...")); |
42 | 42 | } else { |
43 | 43 | $action = get_str('action'); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $userid = post_int('userid'); |
50 | 50 | $user=BoincUser::lookup_id($userid); |
51 | 51 | |
52 | -if ($action!="start"){ |
|
52 | +if ($action!="start") { |
|
53 | 53 | error_page("Unknown action"); |
54 | 54 | } |
55 | 55 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $mod_category = tra("Other"); |
66 | 66 | } |
67 | 67 | |
68 | -if (post_str('reason', true)){ |
|
68 | +if (post_str('reason', true)) { |
|
69 | 69 | start_vote($config,$logged_in_user,$user, $mod_category,post_str("reason")); |
70 | 70 | } else { |
71 | 71 | start_vote($config,$logged_in_user,$user, $mod_category,"None given"); |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | if ($forum->parent_type == 1) { |
90 | 90 | // post to team msg board |
91 | 91 | if ($forum->category == $teamid) { |
92 | - if ($thread->hidden && !$show_team_hidden) { |
|
93 | - continue; |
|
94 | - } |
|
92 | + if ($thread->hidden && !$show_team_hidden) { |
|
93 | + continue; |
|
94 | + } |
|
95 | 95 | if ($post->hidden && !$show_team_hidden) { |
96 | 96 | continue; |
97 | 97 | } |
@@ -99,18 +99,18 @@ discard block |
||
99 | 99 | continue; |
100 | 100 | } |
101 | 101 | } else { |
102 | - if ($thread->hidden && !$show_hidden) { |
|
103 | - continue; |
|
104 | - } |
|
102 | + if ($thread->hidden && !$show_hidden) { |
|
103 | + continue; |
|
104 | + } |
|
105 | 105 | if ($post->hidden && !$show_hidden) { |
106 | 106 | continue; |
107 | 107 | } |
108 | 108 | } |
109 | 109 | } |
110 | - if ($n == $offset + $items_per_page) { |
|
111 | - $show_next = true; |
|
112 | - break; |
|
113 | - } |
|
110 | + if ($n == $offset + $items_per_page) { |
|
111 | + $show_next = true; |
|
112 | + break; |
|
113 | + } |
|
114 | 114 | if ($n >= $offset) { |
115 | 115 | show_post_and_context($post, $thread, $forum, $options, $n+1); |
116 | 116 | } |
@@ -119,12 +119,12 @@ discard block |
||
119 | 119 | echo "</table><br><br>\n"; |
120 | 120 | |
121 | 121 | if ($offset) { |
122 | - $x = $offset - $items_per_page; |
|
122 | + $x = $offset - $items_per_page; |
|
123 | 123 | echo "<a href=forum_user_posts.php?userid=$userid&offset=$x> |
124 | 124 | <b>".tra("Previous %1", $items_per_page)."</b> |
125 | 125 | </a> |
126 | 126 | "; |
127 | - if ($show_next) echo " · "; |
|
127 | + if ($show_next) echo " · "; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | if ($show_next) { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | $userid = get_int("userid"); |
29 | 29 | $offset = get_int("offset", true); |
30 | -if (!$offset) $offset=0; |
|
30 | +if (!$offset) $offset = 0; |
|
31 | 31 | $items_per_page = 20; |
32 | 32 | |
33 | 33 | $user = BoincUser::lookup_id($userid); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | break; |
113 | 113 | } |
114 | 114 | if ($n >= $offset) { |
115 | - show_post_and_context($post, $thread, $forum, $options, $n+1); |
|
115 | + show_post_and_context($post, $thread, $forum, $options, $n + 1); |
|
116 | 116 | } |
117 | 117 | $n++; |
118 | 118 | } |
@@ -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); |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | $users = BoincUser::enum("teamid=$team->id"); |
50 | 50 | $ninactive_users = 0; |
51 | -foreach($users as $user) { |
|
51 | +foreach ($users as $user) { |
|
52 | 52 | if ($user->id == $logged_in_user->id) continue; |
53 | 53 | if ($user->id == $team->userid) continue; |
54 | 54 | $user_total_credit = format_credit($user->total_credit); |