Failed Conditions
Pull Request — master (#1327)
by Nick
69:15 queued 59:17
created
www/docs/admin/websites.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     $sysretval = 0;
108 108
     $personid = get_http_var('editperson');
109 109
 
110
-    $q  = $db->query("DELETE FROM personinfo WHERE data_key = 'mp_website' AND personinfo.person_id = :person_id", array(
110
+    $q = $db->query("DELETE FROM personinfo WHERE data_key = 'mp_website' AND personinfo.person_id = :person_id", array(
111 111
         ':person_id' => $personid
112 112
         ));
113 113
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     if ($q->success()) {
122 122
         exec($scriptpath . "/db2xml.pl --update_person --personid=" . escapeshellarg($personid) . " --debug", $exec_output);
123 123
         $out = '<p id="warning">';
124
-        foreach ($exec_output as $message) {$out .= $message . "<br>";}
124
+        foreach ($exec_output as $message) {$out .= $message . "<br>"; }
125 125
         $out .= '</p>';
126 126
         # ../../../scripts/db2xml.pl  --update_person --personid=10001
127 127
     }
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
 
141 141
     $rettext .= '<div id="subnav_websites">';
142 142
     foreach ($subnav as $label => $path) {
143
-        $rettext .=  '<a href="'. $path . '">'. $label .'</a>';
143
+        $rettext .= '<a href="' . $path . '">' . $label . '</a>';
144 144
     }
145
-    $rettext .=  '</div>';
145
+    $rettext .= '</div>';
146 146
 
147 147
     return $rettext;
148 148
 }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
22 22
 
23 23
 if (get_http_var('editperson')) {
24 24
     $out .= edit_member_form();
25
-} else {
25
+}
26
+else {
26 27
     $out .= list_members();
27 28
 }
28 29
 
@@ -86,7 +87,8 @@  discard block
 block discarded – undo
86 87
         $out .= ' <small>[<a href="websites.php?editperson=' . $q->field($row, 'person_id') . '"';
87 88
         if ($mp_website) {
88 89
             $out .= ' title="Change URL ' . $mp_website . '">Edit URL</a>]</small>';
89
-        } else {
90
+        }
91
+        else {
90 92
             $out .= '>Add URL</a>]</small>';
91 93
         }
92 94
         $out .= ' ' . $name;
Please login to merge, or discard this patch.
www/docs/admin/popularsearches.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include_once '../../includes/easyparliament/init.php';
4
-include_once (INCLUDESPATH."easyparliament/searchlog.php");
4
+include_once (INCLUDESPATH . "easyparliament/searchlog.php");
5 5
 
6 6
 $this_page = "admin_popularsearches";
7 7
 
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
 
15 15
 $rows = array();
16 16
 foreach ($search_popular as $row) {
17
-    $rows[] = array (
18
-        '<a href="'.$row['url'].'">' . _htmlentities($row['query']) . '</a>',
17
+    $rows[] = array(
18
+        '<a href="' . $row['url'] . '">' . _htmlentities($row['query']) . '</a>',
19 19
         $row['c'],
20 20
     );
21 21
 }
22 22
 
23
-$tabledata = array (
24
-    'header' => array (
23
+$tabledata = array(
24
+    'header' => array(
25 25
         'Query',
26 26
         'Count'
27 27
     ),
Please login to merge, or discard this patch.
www/docs/admin/searchlogs.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include_once '../../includes/easyparliament/init.php';
4
-include_once (INCLUDESPATH."easyparliament/searchlog.php");
4
+include_once (INCLUDESPATH . "easyparliament/searchlog.php");
5 5
 
6 6
 $this_page = "admin_searchlogs";
7 7
 
@@ -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/failedsearches.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include_once '../../includes/easyparliament/init.php';
4
-include_once (INCLUDESPATH."easyparliament/searchlog.php");
4
+include_once (INCLUDESPATH . "easyparliament/searchlog.php");
5 5
 
6 6
 $this_page = "admin_failedsearches";
7 7
 
@@ -20,17 +20,17 @@  discard block
 block discarded – undo
20 20
     $max_time = relative_time($row['max_time']);
21 21
     $min_time = str_replace(" ago", "", $min_time);
22 22
     $max_time = str_replace(" ago", "", $max_time);
23
-    $rows[] = array (
23
+    $rows[] = array(
24 24
         $row['count_ips'],
25 25
         $row['group_count'],
26
-        '<a href="'.$row['url'].'">'._htmlentities($row['query']).'</a>',
26
+        '<a href="' . $row['url'] . '">' . _htmlentities($row['query']) . '</a>',
27 27
         $max_time,
28 28
         $min_time,
29 29
     );
30 30
 }
31 31
 
32
-$tabledata = array (
33
-    'header' => array (
32
+$tabledata = array(
33
+    'header' => array(
34 34
         'Distinct IPs',
35 35
         'Number of times',
36 36
         'Query',
Please login to merge, or discard this patch.
www/docs/admin/index.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,8 @@
 block discarded – undo
71 71
         $confirmed = 'Yes';
72 72
         $name = '<a href="' . $USERURL->generate() . '">' . _htmlspecialchars($q->field($row, 'firstname'))
73 73
             . ' ' . _htmlspecialchars($q->field($row, 'lastname')) . '</a>';
74
-    } else {
74
+    }
75
+    else {
75 76
         $confirmed = 'No';
76 77
         $name = _htmlspecialchars($q->field($row, 'firstname') . ' ' . $q->field($row, 'lastname'));
77 78
     }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  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");
4
+include_once (INCLUDESPATH . "easyparliament/commentreportlist.php");
5 5
 
6 6
 $this_page = "admin_home";
7 7
 
@@ -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 \MySociety\TheyWorkForYou\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
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 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 81
         '<a href="mailto:' . $q->field($row, 'email') . '">' . $q->field($row, 'email') . '</a>',
82 82
         $confirmed,
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
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/admin/glossary_pending.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2,14 +2,14 @@  discard block
 block discarded – undo
2 2
 // Some sketchy crap for displaying pending glossary additions
3 3
 
4 4
 include_once '../../includes/easyparliament/init.php';
5
-include_once (INCLUDESPATH."easyparliament/editqueue.php");
6
-include_once (INCLUDESPATH."easyparliament/glossary.php");
5
+include_once (INCLUDESPATH . "easyparliament/editqueue.php");
6
+include_once (INCLUDESPATH . "easyparliament/glossary.php");
7 7
 
8 8
 $this_page = "admin_glossary_pending";
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'];
@@ -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')
Please login to merge, or discard this patch.
www/docs/admin/reports.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include_once '../../includes/easyparliament/init.php';
4
-include_once (INCLUDESPATH."easyparliament/commentreportlist.php");
4
+include_once (INCLUDESPATH . "easyparliament/commentreportlist.php");
5 5
 
6 6
 $this_page = "admin_commentreports";
7 7
 
Please login to merge, or discard this patch.
www/docs/admin/trackbacks.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include_once '../../includes/easyparliament/init.php';
4
-include_once (INCLUDESPATH."easyparliament/commentreportlist.php");
4
+include_once (INCLUDESPATH . "easyparliament/commentreportlist.php");
5 5
 
6 6
 $this_page = "admin_trackbacks";
7 7
 
Please login to merge, or discard this patch.
www/docs/admin/comments.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include_once '../../includes/easyparliament/init.php';
4
-include_once (INCLUDESPATH."easyparliament/commentreportlist.php");
4
+include_once (INCLUDESPATH . "easyparliament/commentreportlist.php");
5 5
 
6 6
 $this_page = "admin_comments";
7 7
 
Please login to merge, or discard this patch.