@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | // post back to PayPal system to validate |
31 | 31 | $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; |
32 | 32 | $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; |
33 | -$header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; |
|
34 | -$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); |
|
33 | +$header .= "Content-Length: ".strlen($req)."\r\n\r\n"; |
|
34 | +$fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30); |
|
35 | 35 | |
36 | 36 | // assign posted variables to local variables |
37 | 37 | $item_name = $_POST['item_name']; |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | if (!$fp) { |
51 | 51 | // HTTP ERROR, might want to do additional handling here |
52 | 52 | } else { |
53 | - fputs ($fp, $header . $req); |
|
53 | + fputs($fp, $header.$req); |
|
54 | 54 | while (!feof($fp)) { |
55 | - $res = fgets ($fp, 1024); |
|
56 | - if (strcmp ($res, "VERIFIED") == 0) { |
|
57 | - $item_array = explode("_",$item_number); |
|
55 | + $res = fgets($fp, 1024); |
|
56 | + if (strcmp($res, "VERIFIED") == 0) { |
|
57 | + $item_array = explode("_", $item_number); |
|
58 | 58 | $payment_id = abs($item_array[0]); |
59 | 59 | $order_time = abs($item_array[1]); |
60 | 60 | $result = _mysql_query("SELECT * FROM donation_paypal WHERE order_time = '$order_time' AND id = '$payment_id' AND processed = '0'"); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | } |
72 | - fclose ($fp); |
|
72 | + fclose($fp); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | ?> |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $languages = get_supported_languages(); |
23 | 23 | $lang = sanitize_tags(get_str("lang", true)); |
24 | 24 | |
25 | -if (!in_array($lang, $languages) && $lang!="auto" && $lang!="en") { |
|
25 | +if (!in_array($lang, $languages) && $lang != "auto" && $lang != "en") { |
|
26 | 26 | echo "Language $lang is not supported"; |
27 | 27 | } else { |
28 | 28 | send_cookie('lang', $lang, true); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $lang = sanitize_tags(get_str("lang", true)); |
24 | 24 | |
25 | 25 | if (!in_array($lang, $languages) && $lang!="auto" && $lang!="en") { |
26 | - echo "Language $lang is not supported"; |
|
26 | + echo "language $lang is not supported"; |
|
27 | 27 | } else { |
28 | 28 | send_cookie('lang', $lang, true); |
29 | 29 | header('Location: index.php'); |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | $userid = get_int("userid", true); |
38 | 38 | $offset = get_int("offset", true); |
39 | 39 | $appid = get_int("appid", true); |
40 | -if (!$offset) $offset=0; |
|
40 | +if (!$offset) $offset = 0; |
|
41 | 41 | $state = get_int("state", true); |
42 | -if (!$state) $state=0; |
|
42 | +if (!$state) $state = 0; |
|
43 | 43 | $show_names = get_int("show_names", true); |
44 | -if (!$show_names) $show_names=0; |
|
44 | +if (!$show_names) $show_names = 0; |
|
45 | 45 | |
46 | 46 | $s = $state_name[$state]; |
47 | 47 | if ($appid) { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $clause = "hostid=$hostid"; |
58 | 58 | page_head(tra("$s tasks for computer %1", $host->id)); |
59 | 59 | $show_host_link = false; |
60 | -} else if ($userid){ |
|
60 | +} else if ($userid) { |
|
61 | 61 | $user = get_logged_in_user(); |
62 | 62 | if ($userid != $user->id) { |
63 | 63 | error_page(tra("No access")); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | error_page(tra("Missing user ID or host ID")); |
70 | 70 | } |
71 | 71 | |
72 | -$clause2 = $clause. $state_clause[$state]; |
|
72 | +$clause2 = $clause.$state_clause[$state]; |
|
73 | 73 | if ($appid) { |
74 | 74 | $clause2 .= ' AND appid='.$appid; |
75 | 75 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | } else { |
80 | 80 | $order_clause = "order by sent_time desc"; |
81 | 81 | } |
82 | -$query = "$clause2 $order_clause limit $offset,".($results_per_page+1); |
|
82 | +$query = "$clause2 $order_clause limit $offset,".($results_per_page + 1); |
|
83 | 83 | $results = BoincResult::enum($query); |
84 | 84 | |
85 | 85 | $info = new StdClass; |
@@ -57,7 +57,7 @@ |
||
57 | 57 | $clause = "hostid=$hostid"; |
58 | 58 | page_head(tra("$s tasks for computer %1", $host->id)); |
59 | 59 | $show_host_link = false; |
60 | -} else if ($userid){ |
|
60 | +} else if ($userid) { |
|
61 | 61 | $user = get_logged_in_user(); |
62 | 62 | if ($userid != $user->id) { |
63 | 63 | error_page(tra("No access")); |
@@ -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"; |
@@ -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,10 +47,10 @@ 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 | if (!$user) error_page('No such user'); |
52 | 52 | |
53 | -if ($action!="start"){ |
|
53 | +if ($action != "start") { |
|
54 | 54 | error_page("Unknown action"); |
55 | 55 | } |
56 | 56 | |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | $mod_category = tra("Other"); |
67 | 67 | } |
68 | 68 | |
69 | -if (post_str('reason', true)){ |
|
70 | - start_vote($config,$logged_in_user,$user, $mod_category,post_str("reason")); |
|
69 | +if (post_str('reason', true)) { |
|
70 | + start_vote($config, $logged_in_user, $user, $mod_category, post_str("reason")); |
|
71 | 71 | } else { |
72 | - start_vote($config,$logged_in_user,$user, $mod_category,"None given"); |
|
72 | + start_vote($config, $logged_in_user, $user, $mod_category, "None given"); |
|
73 | 73 | } |
74 | 74 | |
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'); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $user=BoincUser::lookup_id($userid); |
51 | 51 | if (!$user) error_page('No such user'); |
52 | 52 | |
53 | -if ($action!="start"){ |
|
53 | +if ($action!="start") { |
|
54 | 54 | error_page("Unknown action"); |
55 | 55 | } |
56 | 56 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $mod_category = tra("Other"); |
67 | 67 | } |
68 | 68 | |
69 | -if (post_str('reason', true)){ |
|
69 | +if (post_str('reason', true)) { |
|
70 | 70 | start_vote($config,$logged_in_user,$user, $mod_category,post_str("reason")); |
71 | 71 | } else { |
72 | 72 | start_vote($config,$logged_in_user,$user, $mod_category,"None given"); |
@@ -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); |
@@ -107,7 +107,7 @@ |
||
107 | 107 | row_array( |
108 | 108 | array( |
109 | 109 | "Total", |
110 | - number_format($total_nhosts, 0). " computers", |
|
110 | + number_format($total_nhosts, 0)." computers", |
|
111 | 111 | "", |
112 | 112 | "", |
113 | 113 | number_format($total_gflops/1e3, 2)." TeraFLOPS" |
@@ -45,7 +45,7 @@ |
||
45 | 45 | rowify(tra("Your vote to reject this profile has been recorded.")); |
46 | 46 | } |
47 | 47 | end_table(); |
48 | -echo "<br><a href=\"view_profile.php?userid=", $userid ,"\">" . tra("Return to profile.") . "</a>"; |
|
48 | +echo "<br><a href=\"view_profile.php?userid=", $userid, "\">".tra("Return to profile.")."</a>"; |
|
49 | 49 | |
50 | 50 | page_tail(); |
51 | 51 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $n1 = $x[1] + $x[3]; |
27 | 27 | $n2 = $y[1] + $y[3]; |
28 | 28 | if ($n1 == $n2) return 0; |
29 | - return ($n1 < $n2)?1:-1; |
|
29 | + return ($n1 < $n2) ? 1 : -1; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | function get_models() { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $m[$r->outcome]++; |
45 | 45 | $models[$name_uc] = $m; |
46 | 46 | } else { |
47 | - $m = array(0,0,0,0,0,0,0,0); |
|
47 | + $m = array(0, 0, 0, 0, 0, 0, 0, 0); |
|
48 | 48 | $m[$r->outcome]++; |
49 | 49 | $models[$name_uc] = $m; |
50 | 50 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $name = $name[0]; |
60 | 60 | if (array_key_exists($name, $vendors)) { |
61 | 61 | $v = $vendors[$name]; |
62 | - for ($i=0; $i<8; $i++) { |
|
62 | + for ($i = 0; $i < 8; $i++) { |
|
63 | 63 | $v[$i] += $m[$i]; |
64 | 64 | } |
65 | 65 | $vendors[$name] = $v; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | "Vendor<br><p class=\"text-muted\">click for models</p>", |
101 | 101 | "Success", "Failure", "Success rate" |
102 | 102 | ); |
103 | - $y = array(0,0,0,0,0,0,0,0); |
|
103 | + $y = array(0, 0, 0, 0, 0, 0, 0, 0); |
|
104 | 104 | foreach ($vendors as $name=>$x) { |
105 | 105 | if (!$name) { |
106 | 106 | $name = "not reported by client"; |