Completed
Pull Request — master (#2135)
by Christian
10:38
created
html/ops/dbinfo.php 1 patch
Braces   +6 added lines, -9 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
 
43 43
 // returns formatted data size
44
-function size_format($size){
44
+function size_format($size) {
45 45
 	$retval = 0;
46 46
 
47 47
 	$KB = 1024;
@@ -65,8 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
 
67 67
 // returns the DB data structure as DB_REC
68
-function get_db_info($db_name) 
69
-{
68
+function get_db_info($db_name) {
70 69
 	// Carl grabbed this from the mysql.com boards http://dev.mysql.com/doc/refman/5.0/en/show-table-status.html  
71 70
     $result = _mysql_query("SHOW TABLE STATUS FROM $db_name");
72 71
 
@@ -105,8 +104,7 @@  discard block
 block discarded – undo
105 104
 
106 105
 
107 106
 // shows the plain db structure
108
-function show_db_info($db_name, $db_rec) 
109
-{ 
107
+function show_db_info($db_name, $db_rec) {
110 108
 
111 109
 	echo "<table cols=6>";
112 110
 	echo "<tr>";
@@ -122,7 +120,7 @@  discard block
 block discarded – undo
122 120
 	echo "<th>Avg. Size per Row</th>";
123 121
 	echo "</tr>";
124 122
 
125
-	for ($i = 0; $i < sizeof($db_rec)-1; $i++){ 
123
+	for ($i = 0; $i < sizeof($db_rec)-1; $i++) {
126 124
 		echo "<tr>";
127 125
 		echo "<td align=left valign=top class=fieldname>" . $db_rec[$i]->name . "</td>";
128 126
 		echo "<td align=left valign=top class=fieldname>" . size_format($db_rec[$i]->data_size)  . "</td>";
@@ -150,8 +148,7 @@  discard block
 block discarded – undo
150 148
 
151 149
 
152 150
 // NB: same as show_db_info but with sortable cloumns
153
-function sort_db_info($db_name, $db_rec) 
154
-{ 
151
+function sort_db_info($db_name, $db_rec) {
155 152
 	// sort 
156 153
 	$file_list = array();
157 154
     $file_sort = array();
@@ -171,7 +168,7 @@  discard block
 block discarded – undo
171 168
 		$sort = "name";
172 169
 	if(empty($r)) $r=0;
173 170
 
174
-	for ($i = 0; $i < sizeof($db_rec)-1; $i++){
171
+	for ($i = 0; $i < sizeof($db_rec)-1; $i++) {
175 172
 		$file_details["name"]         = $db_rec[$i]->name;
176 173
 		$file_details["data_size"]    = $db_rec[$i]->data_size;
177 174
 		$file_details["index_size"]   = $db_rec[$i]->index_size;
Please login to merge, or discard this patch.
html/ops/bbcode_convert_signature.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,14 +43,15 @@
 block discarded – undo
43 43
     $forum_preferencess = _mysql_query("select * from forum_preferences where userid>$start_id order by userid");
44 44
     echo _mysql_error();
45 45
     $i=0;
46
-    while ($forum_preferences = _mysql_fetch_object($forum_preferencess)){
46
+    while ($forum_preferences = _mysql_fetch_object($forum_preferencess)) {
47 47
         $i++; 
48
-        if ($i%100 == 0) {                      //For every 100 forum_preferencess
48
+        if ($i%100 == 0) {
49
+//For every 100 forum_preferencess
49 50
             echo $forum_preferences->userid.". "; flush();   // print out where we are
50 51
             //usleep(200000);
51 52
         }
52 53
         
53
-        if ($forum_preferences->userid > $start_id){
54
+        if ($forum_preferences->userid > $start_id) {
54 55
             fix_forum_preferences($forum_preferences);
55 56
         }
56 57
     }
Please login to merge, or discard this patch.
html/ops/db_form.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
 start_table();
36 36
 
37
-switch($table){
37
+switch($table) {
38 38
 	case "platform": 
39 39
 		break;
40 40
 	case "app": 
Please login to merge, or discard this patch.
html/ops/cancel_workunits.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,8 @@
 block discarded – undo
100 100
     echo "</p>\n";
101 101
     echo "</form>\n";
102 102
 
103
-} else { // if ($qclause)
103
+} else {
104
+// if ($qclause)
104 105
 
105 106
     $query = "SELECT id, name FROM workunit WHERE canonical_resultid = 0 AND error_mask = 0 AND $qclause;";
106 107
     $db = BoincDb::get(true);
Please login to merge, or discard this patch.
html/ops/bbcode_convert.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,14 +45,15 @@
 block discarded – undo
45 45
     $posts = _mysql_query("select * from post where id>$start_id order by id");
46 46
     echo _mysql_error();
47 47
     $i=0;
48
-    while ($post = _mysql_fetch_object($posts)){
48
+    while ($post = _mysql_fetch_object($posts)) {
49 49
         $i++; 
50
-        if ($i%100 == 0) {                      //For every 100 posts
50
+        if ($i%100 == 0) {
51
+//For every 100 posts
51 52
             echo $post->id.". "; flush();   // print out where we are
52 53
             //usleep(200000);
53 54
         }
54 55
         
55
-        if ($post->id > $start_id){
56
+        if ($post->id > $start_id) {
56 57
             fix_post($post);
57 58
         }
58 59
     }
Please login to merge, or discard this patch.
html/ops/grant_credit.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
 function testquery($argstring) {
42 42
     if (0) {
43 43
         echo "WOULD DO: $argstring\n";
44
-    }
45
-    else {
44
+    } else {
46 45
         _mysql_query($argstring);
47 46
     }
48 47
     return;
Please login to merge, or discard this patch.
html/ops/list_new_users.php 1 patch
Braces   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 start_table();
59 59
 table_header("ID", "Name", "Email", "Team", "Country", "Joined");
60 60
 
61
-while ($row = _mysql_fetch_object($result)) { 
61
+while ($row = _mysql_fetch_object($result)) {
62 62
     $id = $row->id;
63 63
     $name = $row->name;
64 64
     $email = $row->email_addr;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     $email_validated = $row->email_validated;
68 68
     
69 69
     $team_name="";
70
-    if($row->teamid > 0){
70
+    if($row->teamid > 0) {
71 71
         $team = BoincTeam::lookup_id($row->teamid);
72 72
         $team_name = $team->name;
73 73
     }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     if ($special_bits != "0") {
81 81
         for ($i = 0; $i < 7; $i++) {
82 82
             $bit = substr($special_bits, $i, 1);
83
-            if ($bit == '1'){
83
+            if ($bit == '1') {
84 84
                 if (!empty($roles)) {
85 85
                     $roles .= ", ";
86 86
                 }
@@ -97,8 +97,7 @@  discard block
 block discarded – undo
97 97
         $dt = $user->banished_until - time();
98 98
         if( $dt > 0 ) {
99 99
             $x = "<span style=\"color: #ff0000\">Currently banished</span>";
100
-        }
101
-        else {
100
+        } else {
102 101
             $x = "<span style=\"color: #ff9900\">Previously banished</span>";
103 102
         }
104 103
         $roles .= $x;
Please login to merge, or discard this patch.
html/ops/job_times.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,8 @@
 block discarded – undo
63 63
     printf("mean: %e<br>stdev: %e<br>samples: %d", $mean, $stdev, $count);
64 64
 }
65 65
 
66
-function show_stats_hist() {    //deprecated
66
+function show_stats_hist() {
67
+//deprecated
67 68
     global $hist;
68 69
     global $quantum;
69 70
 
Please login to merge, or discard this patch.
html/ops/clean_cache.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
 set_time_limit(0);
25 25
 
26
-function cache_check_diskspace2(){
26
+function cache_check_diskspace2() {
27 27
    $too_old = 86400;
28 28
    while (1) {
29 29
        $f = disk_free_space("../cache");
Please login to merge, or discard this patch.