Completed
Pull Request — master (#1322)
by Nick
07:54 queued 02:46
created
www/docs/admin/policies.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 include_once '../../includes/easyparliament/init.php';
4 4
 #include_once INCLUDESPATH . 'easyparliament/commentreportlist.php';
5 5
 #include_once INCLUDESPATH . 'easyparliament/searchengine.php';
6
-include_once INCLUDESPATH . 'easyparliament/member.php';
6
+include_once INCLUDESPATH.'easyparliament/member.php';
7 7
 #include_once INCLUDESPATH . 'easyparliament/people.php';
8 8
 
9 9
 $this_page = 'admin_policies';
@@ -47,24 +47,24 @@  discard block
 block discarded – undo
47 47
 
48 48
     for ($row = 0; $row < $q->rows(); $row++) {
49 49
 
50
-        $out = "<h3>Edit policy: " . $q->field($row, 'title') . "</h3>\n";
50
+        $out = "<h3>Edit policy: ".$q->field($row, 'title')."</h3>\n";
51 51
 
52
-        $out .= '<form action="policies.php?editpolicy=' . $q->field($row, 'policy_id') . '" method="post">';
52
+        $out .= '<form action="policies.php?editpolicy='.$q->field($row, 'policy_id').'" method="post">';
53 53
         $out .= '<input name="action" type="hidden" value="Save">';
54 54
         $out .= '<p><label for="title">Title: </label>';
55
-        $out .= '<span class="formw"><input id="title-textbox" name="title" type="text"  size="60" value="' . htmlentities($q->field($row, 'title')) . '"></span>' . "</p>\n";
55
+        $out .= '<span class="formw"><input id="title-textbox" name="title" type="text"  size="60" value="'.htmlentities($q->field($row, 'title')).'"></span>'."</p>\n";
56 56
         $out .= '<p><label for="description">Description</label><br>';
57
-        $out .= '<span class="formw"><textarea id="description" name="description" rows="10" cols="100">' . htmlentities($q->field($row, 'description')) . '</textarea></span>' . "</p>\n";
57
+        $out .= '<span class="formw"><textarea id="description" name="description" rows="10" cols="100">'.htmlentities($q->field($row, 'description')).'</textarea></span>'."</p>\n";
58 58
         $out .= '<p><label for="image">Image URL: </label>';
59
-        $out .= '<span class="formw"><input id="image" name="image" type="text"  size="60" value="' . htmlentities($q->field($row, 'image')) . '"></span>' . "</p>\n";
59
+        $out .= '<span class="formw"><input id="image" name="image" type="text"  size="60" value="'.htmlentities($q->field($row, 'image')).'"></span>'."</p>\n";
60 60
         $out .= '<p><label for="image_attrib">Image attribution: </label>';
61
-        $out .= '<span class="formw"><input id="image_attrib" name="image_attrib" type="text"  size="60" value="' . htmlentities($q->field($row, 'image_attrib')) . '"></span>' . "</p>\n";
61
+        $out .= '<span class="formw"><input id="image_attrib" name="image_attrib" type="text"  size="60" value="'.htmlentities($q->field($row, 'image_attrib')).'"></span>'."</p>\n";
62 62
         $out .= '<p><label for="image_license">Image license: </label>';
63
-        $out .= '<span class="formw"><input id="image_license" name="image_license" type="text"  size="60" value="' . htmlentities($q->field($row, 'image_license')) . '"></span>' . "</p>\n";
63
+        $out .= '<span class="formw"><input id="image_license" name="image_license" type="text"  size="60" value="'.htmlentities($q->field($row, 'image_license')).'"></span>'."</p>\n";
64 64
         $out .= '<p><label for="image_license_url">Image license URL: </label>';
65
-        $out .= '<span class="formw"><input id="image_license_url" name="image_license_url" type="text"  size="60" value="' . htmlentities($q->field($row, 'image_license_url')) . '"></span>' . "</p>\n";
65
+        $out .= '<span class="formw"><input id="image_license_url" name="image_license_url" type="text"  size="60" value="'.htmlentities($q->field($row, 'image_license_url')).'"></span>'."</p>\n";
66 66
         $out .= '<p><label for="image_source">Image source: </label>';
67
-        $out .= '<span class="formw"><input id="image_source" name="image_source" type="text"  size="60" value="' . htmlentities($q->field($row, 'image_source')) . '"></span>' . "</p>\n";
67
+        $out .= '<span class="formw"><input id="image_source" name="image_source" type="text"  size="60" value="'.htmlentities($q->field($row, 'image_source')).'"></span>'."</p>\n";
68 68
         $out .= '<p><span class="formw"><input name="btnaction" type="submit" value="Save"></span>';
69 69
         $out .= '</form>';
70 70
     }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     for ($row = 0; $row < $q->rows(); $row++) {
82 82
         $out .= '<li style="margin-bottom: 1em;">';
83 83
         $out .= sprintf('<strong>%d</strong>: %s - %s', $q->field($row, 'policy_id'), htmlentities($q->field($row, 'title')), htmlentities($q->field($row, 'description')));
84
-        $out .= ' <small>[<a href="policies.php?editpolicy=' . $q->field($row, 'policy_id') . '">Edit Policy</a>]</small>';
84
+        $out .= ' <small>[<a href="policies.php?editpolicy='.$q->field($row, 'policy_id').'">Edit Policy</a>]</small>';
85 85
         $out .= "</li>\n";
86 86
     }
87 87
     $out .= '</ul>';
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         )
111 111
     );
112 112
 
113
-    if ( $q->success() ) {
113
+    if ($q->success()) {
114 114
         $out = "<h4>update successful</h4>";
115 115
     }
116 116
 
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 
126 126
     $rettext .= '<div id="subnav_websites">';
127 127
     foreach ($subnav as $label => $path) {
128
-        $rettext .=  '<a href="'. $path . '">'. $label .'</a>';
128
+        $rettext .= '<a href="'.$path.'">'.$label.'</a>';
129 129
     }
130
-    $rettext .=  '</div>';
130
+    $rettext .= '</div>';
131 131
 
132 132
     return $rettext;
133 133
 }
Please login to merge, or discard this patch.
www/docs/admin/photos.php 3 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include_once '../../includes/easyparliament/init.php';
4
-include_once INCLUDESPATH . 'easyparliament/commentreportlist.php';
5
-include_once INCLUDESPATH . 'easyparliament/searchengine.php';
6
-include_once INCLUDESPATH . 'easyparliament/member.php';
7
-include_once INCLUDESPATH . 'easyparliament/people.php';
4
+include_once INCLUDESPATH.'easyparliament/commentreportlist.php';
5
+include_once INCLUDESPATH.'easyparliament/searchengine.php';
6
+include_once INCLUDESPATH.'easyparliament/member.php';
7
+include_once INCLUDESPATH.'easyparliament/people.php';
8 8
 
9 9
 $this_page = 'admin_photos';
10 10
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
     if ($errors)
74 74
         return display_photo_form($errors);
75
-    return "<p><em>Photo uploaded and resized for pid $pid</em> &mdash; check how it looks <a href=\"/mp?p=$pid\">on their page</a></p>" . display_photo_form();
75
+    return "<p><em>Photo uploaded and resized for pid $pid</em> &mdash; check how it looks <a href=\"/mp?p=$pid\">on their page</a></p>".display_photo_form();
76 76
 }
77 77
 
78 78
 function person_drop_down() {
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
 
95 95
     $houses = array(1 => 'MP', 'Lord', 'MLA', 'MSP');
96 96
 
97
-    for ($i=0; $i<$q->rows(); $i++) {
97
+    for ($i = 0; $i < $q->rows(); $i++) {
98 98
         $p_id = $q->field($i, 'person_id');
99 99
         $house = $q->field($i, 'house');
100
-        $desc = member_full_name($house, $q->field($i, 'title'), $q->field($i, 'given_name'), $q->field($i, 'family_name'), $q->field($i, 'lordofname')) .
101
-                " " . $houses[$house];
102
-        if ($q->field($i, 'party')) $desc .= ' (' . $q->field($i, 'party') . ')';
100
+        $desc = member_full_name($house, $q->field($i, 'title'), $q->field($i, 'given_name'), $q->field($i, 'family_name'), $q->field($i, 'lordofname')).
101
+                " ".$houses[$house];
102
+        if ($q->field($i, 'party')) $desc .= ' ('.$q->field($i, 'party').')';
103 103
         if ($q->field($i, 'constituency')) {
104
-            $desc .= ', ' . $q->field($i, 'constituency');
104
+            $desc .= ', '.$q->field($i, 'constituency');
105 105
         }
106 106
 
107 107
         list($dummy, $sz) = MySociety\TheyWorkForYou\Utility\Member::findMemberImage($p_id);
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         } else {
113 113
             $desc .= ' [no photo]';
114 114
         }
115
-        $out .= '<option value="'.$p_id.'">'.$desc.'</option>' . "\n";
115
+        $out .= '<option value="'.$p_id.'">'.$desc.'</option>'."\n";
116 116
     }
117 117
 
118 118
     $out .= ' </select></span> </div> ';
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 function display_photo_form($errors = array()) {
124 124
     $out = '';
125 125
     if ($errors) {
126
-        $out .= '<ul class="error"><li>' . join('</li><li>', $errors) . '</li></ul>';
126
+        $out .= '<ul class="error"><li>'.join('</li><li>', $errors).'</li></ul>';
127 127
     }
128 128
     $out .= '<form method="post" action="photos.php" enctype="multipart/form-data">';
129 129
     $out .= person_drop_down();
@@ -169,13 +169,13 @@  discard block
 block discarded – undo
169 169
         ':attr_link' => $attr_link
170 170
         ));
171 171
 
172
-    return "<p><em>Attribution text/link set for pid $pid</em> &mdash; check how it looks <a href=\"/mp?p=$pid\">on their page</a></p>" . display_attribution_form();
172
+    return "<p><em>Attribution text/link set for pid $pid</em> &mdash; check how it looks <a href=\"/mp?p=$pid\">on their page</a></p>".display_attribution_form();
173 173
 }
174 174
 
175 175
 function display_attribution_form($errors = array()) {
176 176
     $out = '';
177 177
     if ($errors) {
178
-        $out .= '<ul class="error"><li>' . join('</li><li>', $errors) . '</li></ul>';
178
+        $out .= '<ul class="error"><li>'.join('</li><li>', $errors).'</li></ul>';
179 179
     }
180 180
     $out .= '<form method="post" action="photos.php">';
181 181
     $out .= person_drop_down();
Please login to merge, or discard this patch.
Braces   +36 added lines, -26 removed lines patch added patch discarded remove patch
@@ -36,28 +36,33 @@  discard block
 block discarded – undo
36 36
     $pid = intval(get_http_var('pid'));
37 37
     $errors = array();
38 38
 
39
-    if (!array_key_exists('photo', $_FILES))
40
-        array_push($errors, 'Not got the photo.');
41
-    elseif ($_FILES['photo']['error'] > 0)
42
-        array_push($errors, 'There was an error uploading the photo.');
43
-    elseif (!is_uploaded_file($_FILES['photo']['tmp_name']))
44
-        array_push($errors, 'Did not get an uploaded file.');
45
-    else {
39
+    if (!array_key_exists('photo', $_FILES)) {
40
+            array_push($errors, 'Not got the photo.');
41
+    } elseif ($_FILES['photo']['error'] > 0) {
42
+            array_push($errors, 'There was an error uploading the photo.');
43
+    } elseif (!is_uploaded_file($_FILES['photo']['tmp_name'])) {
44
+            array_push($errors, 'Did not get an uploaded file.');
45
+    } else {
46 46
         $tmp_name = $_FILES['photo']['tmp_name'];
47 47
 
48 48
         $image = new Imagick();
49 49
         $image->readImage($tmp_name);
50
-        if (!$image)
51
-            array_push($errors, 'Failed to read image from uploaded file');
50
+        if (!$image) {
51
+                    array_push($errors, 'Failed to read image from uploaded file');
52
+        }
52 53
             $imageS = clone $image;
53
-        if (!$image->scaleImage(0, 118))
54
-            array_push($errors, 'Scaling large failed');
55
-        if (!$imageS->scaleImage(0, 59))
56
-            array_push($errors, 'Scaling small failed');
57
-        if (!$image->writeImage("$dir/mpsL/$pid.jpeg"))
58
-            array_push($errors, "Saving to $dir/mpsL/$pid.jpeg failed");
59
-        if (!$imageS->writeImage("$dir/mps/$pid.jpeg"))
60
-            array_push($errors, "Saving to $dir/mps/$pid.jpeg failed");
54
+        if (!$image->scaleImage(0, 118)) {
55
+                    array_push($errors, 'Scaling large failed');
56
+        }
57
+        if (!$imageS->scaleImage(0, 59)) {
58
+                    array_push($errors, 'Scaling small failed');
59
+        }
60
+        if (!$image->writeImage("$dir/mpsL/$pid.jpeg")) {
61
+                    array_push($errors, "Saving to $dir/mpsL/$pid.jpeg failed");
62
+        }
63
+        if (!$imageS->writeImage("$dir/mps/$pid.jpeg")) {
64
+                    array_push($errors, "Saving to $dir/mps/$pid.jpeg failed");
65
+        }
61 66
         if (!$errors) {
62 67
             print "<pre>";
63 68
             chdir($dir);
@@ -70,8 +75,9 @@  discard block
 block discarded – undo
70 75
         }
71 76
     }
72 77
 
73
-    if ($errors)
74
-        return display_photo_form($errors);
78
+    if ($errors) {
79
+            return display_photo_form($errors);
80
+    }
75 81
     return "<p><em>Photo uploaded and resized for pid $pid</em> &mdash; check how it looks <a href=\"/mp?p=$pid\">on their page</a></p>" . display_photo_form();
76 82
 }
77 83
 
@@ -99,7 +105,9 @@  discard block
 block discarded – undo
99 105
         $house = $q->field($i, 'house');
100 106
         $desc = member_full_name($house, $q->field($i, 'title'), $q->field($i, 'given_name'), $q->field($i, 'family_name'), $q->field($i, 'lordofname')) .
101 107
                 " " . $houses[$house];
102
-        if ($q->field($i, 'party')) $desc .= ' (' . $q->field($i, 'party') . ')';
108
+        if ($q->field($i, 'party')) {
109
+            $desc .= ' (' . $q->field($i, 'party') . ')';
110
+        }
103 111
         if ($q->field($i, 'constituency')) {
104 112
             $desc .= ', ' . $q->field($i, 'constituency');
105 113
         }
@@ -150,13 +158,15 @@  discard block
 block discarded – undo
150 158
     $attr_link = get_http_var('attr_link');
151 159
     $errors = array();
152 160
 
153
-    if (!$pid || !$attr_text)
154
-        array_push($errors, 'Missing information');
155
-    elseif ($attr_link && substr($attr_link, 0, 4) != 'http')
156
-        array_push($errors, 'Bad link');
161
+    if (!$pid || !$attr_text) {
162
+            array_push($errors, 'Missing information');
163
+    } elseif ($attr_link && substr($attr_link, 0, 4) != 'http') {
164
+            array_push($errors, 'Bad link');
165
+    }
157 166
 
158
-    if ($errors)
159
-        return display_attribution_form($errors);
167
+    if ($errors) {
168
+            return display_attribution_form($errors);
169
+    }
160 170
 
161 171
     # UPDATE
162 172
     global $db;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 </form>
140 140
 
141 141
 <p style="clear:both; margin-top: 3em"><a href="/images/mps/photo-status.php">List MPs without photos</a></p>
142
-EOF;
142
+eof;
143 143
 
144 144
     return $out;
145 145
 }
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     <span class="formw"><input type="submit" name="submit" value="Update attribution"></span>
194 194
 </div>
195 195
 </form>
196
-EOF;
196
+eof;
197 197
 
198 198
     return $out;
199 199
 }
Please login to merge, or discard this patch.
www/docs/admin/searchlogs.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
     $host = trim_characters($host, strlen($host) - 25, 100);
19 19
     $time = relative_time($row['query_time']);
20 20
     $time = str_replace(" ago", "", $time);
21
-    $rows[] = array (
22
-        '<a href="'.$row['url'].'">' . _htmlentities($row['query']) . '</a>',
21
+    $rows[] = array(
22
+        '<a href="'.$row['url'].'">'._htmlentities($row['query']).'</a>',
23 23
         $row['page_number'],
24 24
         $row['count_hits'],
25 25
         $host,
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
     );
28 28
 }
29 29
 
30
-$tabledata = array (
31
-    'header' => array (
30
+$tabledata = array(
31
+    'header' => array(
32 32
         'Query',
33 33
         'Page',
34 34
         'Hits',
Please login to merge, or discard this patch.
www/docs/admin/glossary_pending.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 $EDITQUEUE = new GLOSSEDITQUEUE();
11 11
 
12
-$args = array (
12
+$args = array(
13 13
     'sort' => "regexp_replace"
14 14
 );
15 15
 $GLOSSARY = new GLOSSARY($args);
@@ -24,19 +24,19 @@  discard block
 block discarded – undo
24 24
 if (get_http_var('approve')) {
25 25
     $approve = get_http_var('approve');
26 26
     if (!is_array($approve)) {
27
-        $approve = array ( $approve );
27
+        $approve = array($approve);
28 28
     }
29 29
     // Add all approved items
30
-    $data = array (
30
+    $data = array(
31 31
         'approvals' => $approve,
32 32
         'epobject_type' => 2
33 33
     );
34 34
     $EDITQUEUE->approve($data);
35 35
 }
36 36
 elseif (get_http_var('decline')) {
37
-    $decline = array (get_http_var('decline'));
37
+    $decline = array(get_http_var('decline'));
38 38
     // Dump all declined items
39
-    $data = array (
39
+    $data = array(
40 40
         'declines' => $decline,
41 41
         'epobject_type' => 2
42 42
     );
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 
56 56
     // Mock up a "current term" to send to the display function
57 57
     if (get_http_var('previewterm')) {
58
-        $body	= get_http_var('definition');
59
-        $title	= get_http_var('g');
58
+        $body = get_http_var('definition');
59
+        $title = get_http_var('g');
60 60
     }
61 61
     else {
62 62
         $body = $EDITQUEUE->pending[$glossary_id]['body'];
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
     // Wiki woo!
96 96
     // We need to work out how best to work this...
97
-    $wiki_link = _htmlspecialchars("http://en.wikipedia.org/wiki/" . strtr($title, " ", "_"));
97
+    $wiki_link = _htmlspecialchars("http://en.wikipedia.org/wiki/".strtr($title, " ", "_"));
98 98
 ?>
99 99
         <p>Guessing the wikipedia link - give it a go:<br>
100 100
         <a href="<?php echo $wiki_link; ?>" target="_blank"><?php echo $wiki_link; ?></a></p>
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
     // add a modification to the database
118 118
     if (get_http_var('submitterm') && get_http_var('modify')) {
119
-        $data = array (
119
+        $data = array(
120 120
             'user_id'	=> get_http_var('userid'),
121 121
             'title'		=> get_http_var('g'),
122 122
             'body'		=> get_http_var('definition')
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     }
127 127
 
128 128
     if ($EDITQUEUE->pending_count) {
129
-        print "<h3>" . $EDITQUEUE->pending_count . " Pending Glossary terms</h3>";
129
+        print "<h3>".$EDITQUEUE->pending_count." Pending Glossary terms</h3>";
130 130
         $EDITQUEUE->display("pending");
131 131
     }
132 132
     else {
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@  discard block
 block discarded – undo
32 32
         'epobject_type' => 2
33 33
     );
34 34
     $EDITQUEUE->approve($data);
35
-}
36
-elseif (get_http_var('decline')) {
35
+} elseif (get_http_var('decline')) {
37 36
     $decline = array (get_http_var('decline'));
38 37
     // Dump all declined items
39 38
     $data = array (
@@ -57,15 +56,13 @@  discard block
 block discarded – undo
57 56
     if (get_http_var('previewterm')) {
58 57
         $body	= get_http_var('definition');
59 58
         $title	= get_http_var('g');
60
-    }
61
-    else {
59
+    } else {
62 60
         $body = $EDITQUEUE->pending[$glossary_id]['body'];
63 61
         $title = $EDITQUEUE->pending[$glossary_id]['title'];
64 62
     }
65 63
     if (get_http_var('wikiguess')) {
66 64
         $checked = " checked";
67
-    }
68
-    else {
65
+    } else {
69 66
         $checked = "";
70 67
     }
71 68
 
@@ -111,8 +108,7 @@  discard block
 block discarded – undo
111 108
 
112 109
     $PAGE->glossary_display_term($GLOSSARY);
113 110
 
114
-}
115
-else {
111
+} else {
116 112
 
117 113
     // add a modification to the database
118 114
     if (get_http_var('submitterm') && get_http_var('modify')) {
@@ -128,8 +124,7 @@  discard block
 block discarded – undo
128 124
     if ($EDITQUEUE->pending_count) {
129 125
         print "<h3>" . $EDITQUEUE->pending_count . " Pending Glossary terms</h3>";
130 126
         $EDITQUEUE->display("pending");
131
-    }
132
-    else {
127
+    } else {
133 128
         print "<h3>Nothing pending, tap your fingers awhile.</h3>";
134 129
     }
135 130
 }
Please login to merge, or discard this patch.
www/docs/admin/statistics.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,10 +38,10 @@
 block discarded – undo
38 38
 <p>There are <b><?=number_format($debate_speeches)?></b> debate speeches (<?=number_format($debate_items)?> items including headers).
39 39
 <br>There are <b><?=number_format($wrans_questions)?></b> written questions (<?=number_format($wrans_items)?> items including headers and answers).
40 40
 
41
-<!-- Debate items / in-session day: <?=round($debate_items/$uniquedates,0)?>
42
-Wrans items / in-session day: <?=round($wrans_items/$uniquedates,0)?> -->
41
+<!-- Debate items / in-session day: <?=round($debate_items / $uniquedates, 0)?>
42
+Wrans items / in-session day: <?=round($wrans_items / $uniquedates, 0)?> -->
43 43
 
44
-<p>Per sitting day, MPs are producing <b><?=round($debate_speeches/$uniquedates,0)?></b> speeches, and <b><?=round($wrans_questions/$uniquedates,0)?></b> written answers.
44
+<p>Per sitting day, MPs are producing <b><?=round($debate_speeches / $uniquedates, 0)?></b> speeches, and <b><?=round($wrans_questions / $uniquedates, 0)?></b> written answers.
45 45
 </p>
46 46
 
47 47
 <?php
Please login to merge, or discard this patch.
www/docs/admin/index.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 $q = $db->query("SELECT COUNT(*) AS count FROM users WHERE confirmed = '0'");
23 23
 $unconfirmedusers = $q->field(0, 'count');
24 24
 
25
-$olddate = gmdate("Y-m-d H:i:s", time()-86400);
25
+$olddate = gmdate("Y-m-d H:i:s", time() - 86400);
26 26
 $q = $db->query("SELECT COUNT(*) AS count FROM users WHERE lastvisit > '$olddate'");
27 27
 $dayusers = $q->field(0, 'count');
28 28
 
29
-$olddate = gmdate("Y-m-d H:i:s", time()-86400*7);
29
+$olddate = gmdate("Y-m-d H:i:s", time() - 86400 * 7);
30 30
 $q = $db->query("SELECT COUNT(*) AS count FROM users WHERE lastvisit > '$olddate'");
31 31
 $weekusers = $q->field(0, 'count');
32 32
 ?>
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 $rows = array();
62 62
 $USERURL = new URL('userview');
63 63
 
64
-for ($row=0; $row<$q->rows(); $row++) {
64
+for ($row = 0; $row < $q->rows(); $row++) {
65 65
 
66 66
     $user_id = $q->field($row, 'user_id');
67 67
 
@@ -69,23 +69,23 @@  discard block
 block discarded – undo
69 69
 
70 70
     if ($q->field($row, 'confirmed') == 1) {
71 71
         $confirmed = 'Yes';
72
-        $name = '<a href="' . $USERURL->generate() . '">' . _htmlspecialchars($q->field($row, 'firstname'))
73
-            . ' ' . _htmlspecialchars($q->field($row, 'lastname')) . '</a>';
72
+        $name = '<a href="'.$USERURL->generate().'">'._htmlspecialchars($q->field($row, 'firstname'))
73
+            . ' '._htmlspecialchars($q->field($row, 'lastname')).'</a>';
74 74
     } else {
75 75
         $confirmed = 'No';
76
-        $name = _htmlspecialchars($q->field($row, 'firstname') . ' ' . $q->field($row, 'lastname'));
76
+        $name = _htmlspecialchars($q->field($row, 'firstname').' '.$q->field($row, 'lastname'));
77 77
     }
78 78
 
79
-    $rows[] = array (
79
+    $rows[] = array(
80 80
         $name,
81
-        '<a href="mailto:' . $q->field($row, 'email') . '">' . $q->field($row, 'email') . '</a>',
81
+        '<a href="mailto:'.$q->field($row, 'email').'">'.$q->field($row, 'email').'</a>',
82 82
         $confirmed,
83 83
         $q->field($row, 'registrationtime')
84 84
     );
85 85
 }
86 86
 
87
-$tabledata = array (
88
-    'header' => array (
87
+$tabledata = array(
88
+    'header' => array(
89 89
         'Name',
90 90
         'Email',
91 91
         'Confirmed?',
Please login to merge, or discard this patch.
www/docs/search-hansard/index.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 $DATA->set_page_metadata($this_page, 'title', 'Hansard');
8 8
 $DATA->set_page_metadata($this_page, 'meta_description',
9
-             'Find the complete Hansard on TheyWorkForYou.com - transcripts from all UK parliamentary debates in easily-searchable form.');
9
+                'Find the complete Hansard on TheyWorkForYou.com - transcripts from all UK parliamentary debates in easily-searchable form.');
10 10
 $DATA->set_page_metadata($this_page, 'meta_keywords', "hansard, search hansard, hansard transcriptions, hansard record, parliamentary transcripts, parliament transcripts, parliament records, uk hansard, hansard uk, house of commons transcript, house of commons debates, house of commons records");
11 11
 
12 12
 $PAGE->supress_heading = true;
Please login to merge, or discard this patch.
www/docs/report/index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
     if ($COMMENT->exists() == false || !$COMMENT->visible()) {
22 22
         // This comment id didn't exist in the DB.
23
-        trigger_error("There is no annotation with an ID of '" . _htmlentities($comment_id) . "'.", E_USER_NOTICE);
23
+        trigger_error("There is no annotation with an ID of '"._htmlentities($comment_id)."'.", E_USER_NOTICE);
24 24
     }
25 25
 
26 26
     // OK, we've got a valid comment ID.
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
             $REPORT = new COMMENTREPORT;
58 58
 
59
-            $reportdata = array (
59
+            $reportdata = array(
60 60
                 'body'		=> get_http_var('body'),
61 61
                 'firstname'	=> get_http_var('firstname'),
62 62
                 'lastname'	=> get_http_var('lastname'),
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
 
86 86
             } else {
87
-                $PAGE->error_message ("Sorry, we were unable to add the report to the database.");
87
+                $PAGE->error_message("Sorry, we were unable to add the report to the database.");
88 88
             }
89 89
         }
90 90
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 
101 101
 
102
-function display_form($COMMENT, $errors=array()) {
102
+function display_form($COMMENT, $errors = array()) {
103 103
     global $this_page, $THEUSER, $PAGE;
104 104
 
105 105
     ?>
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 <?php
123 123
     if ($THEUSER->isloggedin()) {
124 124
         ?>
125
-                <p><br><strong>From:</strong> <?php echo _htmlentities($THEUSER->firstname() . ' ' . $THEUSER->lastname()); ?></p>
125
+                <p><br><strong>From:</strong> <?php echo _htmlentities($THEUSER->firstname().' '.$THEUSER->lastname()); ?></p>
126 126
 <?php
127 127
     } else {
128 128
         // Not-logged-in user, so we want their name and email address.
Please login to merge, or discard this patch.
www/docs/vote/index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         voteerror("Your browser must be able to accept cookies before you can register a vote.");
32 32
     } else {
33 33
         // Delete the test cookie.
34
-        setcookie ('testcookie', '');
34
+        setcookie('testcookie', '');
35 35
     }
36 36
     // On with the voting...!
37 37
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     // We need to check the user can accept cookies, so...
41 41
 
42 42
     // Set a cookie
43
-    setcookie ('testcookie', 'true');
43
+    setcookie('testcookie', 'true');
44 44
 
45 45
     $ret = get_http_var('ret');
46 46
     $id = get_http_var('id');
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     ));
57 57
 
58 58
     // Redirect to this same URL with 'testing=true' on the end.
59
-    header("Location: " . $URL->generate('none'));
59
+    header("Location: ".$URL->generate('none'));
60 60
     exit;
61 61
 }
62 62
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
     $PAGE->page_start();
69 69
 
70
-    $message = array (
70
+    $message = array(
71 71
         'title'	=> 'Sorry',
72 72
         'text'	=> $text
73 73
     );
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         $prev_epvotes[] = $epobject_id;
159 159
         $new_cookie = implode('+', $prev_epvotes);
160 160
 
161
-        setcookie ("epvotes", $new_cookie, time()+60*60*24*365, "/", COOKIEDOMAIN);
161
+        setcookie("epvotes", $new_cookie, time() + 60 * 60 * 24 * 365, "/", COOKIEDOMAIN);
162 162
 
163 163
 
164 164
     } else {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
 $PAGE->page_start();
191 191
 
192
-$message = array (
192
+$message = array(
193 193
     'title'	=> "Thanks for your vote",
194 194
     'text'	=> "<strong>Would you like to ask a question like this yourself?</strong> Use our <a href=\"http://www.whatdotheyknow.com\">Freedom of Information site</a>."
195 195
 );
Please login to merge, or discard this patch.