Failed Conditions
Pull Request — master (#1328)
by Nick
33:04 queued 18:05
created
www/includes/easyparliament/templates/html/section/pbc_bill.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
             <ul class="business-list">
25 25
             <?php
26 26
                 $first = 0;
27
-                foreach ( $content['rows'] as $row ) {
28
-                    if ( $row['htype'] == 10 ) {
29
-                        if ( !$first ) {
27
+                foreach ($content['rows'] as $row) {
28
+                    if ($row['htype'] == 10) {
29
+                        if (!$first) {
30 30
                             print '</li>';
31 31
                             $first = 1;
32 32
                         } ?>
@@ -37,16 +37,16 @@  discard block
 block discarded – undo
37 37
                                 </h3>
38 38
                             </a>
39 39
                             <p class="business-list__meta">
40
-                                <?php if ( isset($row['sitting']) ) { ?>
40
+                                <?php if (isset($row['sitting'])) { ?>
41 41
                                     <?= make_ranking($row['sitting']) ?> sitting &middot;
42 42
                                 <?php } ?>
43
-                                <?= format_date($row['hdate'], LONGERDATEFORMAT ) ?>
44
-                                <?php if ( $row['contentcount'] > 0 ) { ?>
43
+                                <?= format_date($row['hdate'], LONGERDATEFORMAT) ?>
44
+                                <?php if ($row['contentcount'] > 0) { ?>
45 45
                                 &middot; <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'] . ' speeches' ?>
46 46
                                 <?php } ?>
47 47
                             </p>
48 48
                             <p class="business-list__excerpt">
49
-                                <?= trim_characters($row['excerpt'], 0, 200 ) ?>
49
+                                <?= trim_characters($row['excerpt'], 0, 200) ?>
50 50
                             </p>
51 51
                     <?php } else { ?>
52 52
                     <ul>
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                                     <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'] . ' speeches' ?>
62 62
                                 </p>
63 63
                             <?php } ?>
64
-                            <?php if ( isset($row['excerpt']) ) { ?>
64
+                            <?php if (isset($row['excerpt'])) { ?>
65 65
                                 <p class="business-list__excerpt">
66 66
                                     <?= trim_characters($row['excerpt'], 0, 200) ?>
67 67
                                 </p>
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             </ul>
74 74
         </div>
75 75
 
76
-        <?php if ( isset($content['info']['committee']) ) {
76
+        <?php if (isset($content['info']['committee'])) {
77 77
             $committee = $content['info']['committee'];
78 78
         ?>
79 79
         <div class="business-section__secondary">
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
 
86 86
             <p><strong>Chairpersons</strong></p>
87 87
             <ul>
88
-            <?php foreach( $committee['chairmen'] as $chair ) { ?>
88
+            <?php foreach ($committee['chairmen'] as $chair) { ?>
89 89
                 <li><?= $chair['name'] ?> (<?= $chair['attending'] ?>)</li>
90 90
             <?php } ?>
91 91
             </ul>
92 92
             <p><strong>Members</strong></p>
93 93
             <ul>
94
-            <?php foreach( $committee['members'] as $chair ) { ?>
94
+            <?php foreach ($committee['members'] as $chair) { ?>
95 95
                 <li><?= $chair['name'] ?> (<?= $chair['attending'] ?>)</li>
96 96
             <?php } ?>
97 97
             </ul>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/_business_list_item.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <a href="<?= $item['list_url'] ?>" class="business-list__title">
2 2
     <h3>
3
-      <?php if ( isset( $item['parent'] ) ) { ?>
3
+      <?php if (isset($item['parent'])) { ?>
4 4
         <?= $item['parent']['body'] ?>
5 5
         <br><?= $item['body'] ?>
6 6
       <?php } else { ?>
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
     </h3>
10 10
     <span class="business-list__meta">
11 11
       <?= format_date($item['hdate'], LONGERDATEFORMAT) ?>
12
-      <?=  isset($item['contentcount']) ? '&middot; ' . $item['contentcount'] . ( $item['contentcount'] == 1 ? ' speech' : ' speeches' ) : '' ?>
12
+      <?=  isset($item['contentcount']) ? '&middot; ' . $item['contentcount'] . ($item['contentcount'] == 1 ? ' speech' : ' speeches') : '' ?>
13 13
     </span>
14 14
 </a>
15
-<?php if ( isset( $item['child'] ) ) { ?>
15
+<?php if (isset($item['child'])) { ?>
16 16
 <p class="business-list__excerpt">
17
-  <?php if ( isset($item['child']['speaker']) && count($item['child']['speaker']) > 0 ) { ?>
17
+  <?php if (isset($item['child']['speaker']) && count($item['child']['speaker']) > 0) { ?>
18 18
     <a href="<?= $item['child']['speaker']['url'] ?>"><?= $item['child']['speaker']['name'] ?></a>
19 19
   <?php } ?>
20
-  <?= strip_tags(trim_characters( $item['child']['body'], 0, 200 )) ?>
20
+  <?= strip_tags(trim_characters($item['child']['body'], 0, 200)) ?>
21 21
 </p>
22 22
 <?php } ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/hansard_search_video.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,17 +33,17 @@
 block discarded – undo
33 33
 
34 34
         echo '&#8220;' . $row['extract'] . "&#8221;</dd>\n";
35 35
         echo '<dd><em><small>This speech is ';
36
-        if ($row['hpos']-$want['hpos']>0) {
37
-            echo ($row['hpos']-$want['hpos']) . ' later than';
36
+        if ($row['hpos'] - $want['hpos'] > 0) {
37
+            echo ($row['hpos'] - $want['hpos']) . ' later than';
38 38
         } else {
39
-            echo ($want['hpos']-$row['hpos']) . ' earlier than';
39
+            echo ($want['hpos'] - $row['hpos']) . ' earlier than';
40 40
         }
41 41
         echo ' the one you want &ndash; ';
42
-        if ($row['video_status']&8 || !($row['video_status']&1)) {
42
+        if ($row['video_status'] & 8 || !($row['video_status'] & 1)) {
43 43
             echo ' it doesn\'t have any video';
44
-        } elseif ($row['video_status']&4) {
44
+        } elseif ($row['video_status'] & 4) {
45 45
             echo ' it has already been matched';
46
-        } elseif ($row['video_status']&1) {
46
+        } elseif ($row['video_status'] & 1) {
47 47
             # Only for Commons currently
48 48
             echo ' if you prefer, <a target="_top" onclick="t = parent.document[\'video\'].currentTime(); this.href += t;" href="/video/?gid=debate/' . $row['gid'] . '&amp;file=' . $want['file'] . '&amp;start=">switch to matching this speech instead</a>';
49 49
         }
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/glossary.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $USERURL->insert(array('u'=>$comment['user_id']));
78 78
         ?>
79 79
         <div class="comment">
80
-            <p><a href="<?php echo $USERURL->generate(); ?>" title="See information about this user"><strong><?php echo _htmlentities($comment['firstname']) .' '. _htmlentities($comment['lastname']); ?></strong></a><br>
80
+            <p><a href="<?php echo $USERURL->generate(); ?>" title="See information about this user"><strong><?php echo _htmlentities($comment['firstname']) . ' ' . _htmlentities($comment['lastname']); ?></strong></a><br>
81 81
 <?php
82 82
         // Make URLs into links and do <br>s.
83 83
         $body = prepare_comment_for_display($comment['body']); // In utility.php
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         }
106 106
 
107 107
         if (($this_page != 'commentreport' &&
108
-            $this_page != 'addcomment'  &&
108
+            $this_page != 'addcomment' &&
109 109
             $this_page != 'admin_commentreport')
110 110
             && $THEUSER->is_able_to('reportcomment')
111 111
             && !$comment['modflagged']
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/api/comments.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         // COMMENT REPORTING LINK.
83 83
 
84 84
         if (($this_page != 'commentreport' &&
85
-            $this_page != 'addcomment'  &&
85
+            $this_page != 'addcomment' &&
86 86
             $this_page != 'admin_commentreport')
87 87
             && $THEUSER->is_able_to('reportcomment')
88 88
             && $THEUSER->user_id() != $comment['user_id']
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         $date = format_date($date, SHORTDATEFORMAT);
118 118
         $time = format_time($time, TIMEFORMAT);
119 119
         ?>
120
-                    <p class="credit"><a href="<?php echo $USERURL->generate(); ?>" title="See information about this user"><strong><?php echo _htmlentities($comment['firstname']) .' '. _htmlentities($comment['lastname']); ?></strong></a><br>
120
+                    <p class="credit"><a href="<?php echo $USERURL->generate(); ?>" title="See information about this user"><strong><?php echo _htmlentities($comment['firstname']) . ' ' . _htmlentities($comment['lastname']); ?></strong></a><br>
121 121
                     <small>Posted on <?php echo $date;
122 122
 
123 123
         if (isset($comment['url'])) {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
         } else {
127 127
             // There won't be a URL when we're just previewing a comment.
128
-            print ' '.$time;
128
+            print ' ' . $time;
129 129
         }
130 130
         ?> <?php echo $reporthtml; ?></small></p>
131 131
 
Please login to merge, or discard this patch.
www/includes/easyparliament/sidebars/mps.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     'body'=>''));
10 10
 ?>
11 11
 <p>
12
-    Vacher Dods charge <a href="http://www.dodonline.co.uk/engine.asp?showPage=article&id=2564"> 95 pounds </a> for this list of MPs names. We think democracy should be free. Click <?php echo '<a href="'.$csvurl.'">here</a>'; ?> to download a CSV (Comma Separated Values) file that you can load into Excel.
12
+    Vacher Dods charge <a href="http://www.dodonline.co.uk/engine.asp?showPage=article&id=2564"> 95 pounds </a> for this list of MPs names. We think democracy should be free. Click <?php echo '<a href="' . $csvurl . '">here</a>'; ?> to download a CSV (Comma Separated Values) file that you can load into Excel.
13 13
 </p>
14 14
 <?php
15 15
 $this->block_end();
Please login to merge, or discard this patch.
www/includes/easyparliament/sidebars/calendar_future.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 list($firstyear, $firstmonth, $day) = explode('-', $min_future_date);
34 34
 list($finalyear, $finalmonth, $day) = explode('-', $max_future_date);
35 35
 
36
-$q =  $db->query("SELECT DISTINCT(event_date) AS event_date FROM future
36
+$q = $db->query("SELECT DISTINCT(event_date) AS event_date FROM future
37 37
     WHERE event_date >= :firstdate
38 38
     AND event_date <= :finaldate
39 39
     AND deleted = 0
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 if ($q->rows() > 0) {
47 47
     $years = array();
48
-    for ($row=0; $row<$q->rows(); $row++) {
48
+    for ($row = 0; $row < $q->rows(); $row++) {
49 49
         list($year, $month, $day) = explode('-', $q->field($row, 'event_date'));
50 50
         $month = intval($month);
51 51
         $years[$year][$month][] = intval($day);
Please login to merge, or discard this patch.
www/includes/easyparliament/commentreportlist.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         // available for editing, it's accurate.
25 25
         $this->_update_locked();
26 26
 
27
-        $data = $this->_get_data_by_recent ();
27
+        $data = $this->_get_data_by_recent();
28 28
 
29 29
         $this->render($data);
30 30
 
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
 
100 100
         if ($q->rows() > 0) {
101 101
 
102
-            for ($n=0; $n<$q->rows(); $n++) {
102
+            for ($n = 0; $n < $q->rows(); $n++) {
103 103
 
104
-                $data[] = array (
105
-                    'report_id'		=> $q->field($n,'report_id'),
106
-                    'comment_id' 	=> $q->field($n,'comment_id'),
104
+                $data[] = array(
105
+                    'report_id'		=> $q->field($n, 'report_id'),
106
+                    'comment_id' 	=> $q->field($n, 'comment_id'),
107 107
                     'firstname'		=> $q->field($n, 'firstname'),
108 108
                     'lastname'		=> $q->field($n, 'lastname'),
109 109
                     'body'			=> $q->field($n, 'body'),
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
 
115 115
         }
116 116
         if ($r->rows() > 0) {
117
-            for ($n=0; $n<$r->rows(); $n++) {
118
-                $data[] = array (
119
-                    'report_id'		=> $r->field($n,'report_id'),
120
-                    'comment_id' 	=> $r->field($n,'comment_id'),
117
+            for ($n = 0; $n < $r->rows(); $n++) {
118
+                $data[] = array(
119
+                    'report_id'		=> $r->field($n, 'report_id'),
120
+                    'comment_id' 	=> $r->field($n, 'comment_id'),
121 121
                     'firstname'		=> $r->field($n, 'firstname'),
122 122
                     'lastname'		=> $r->field($n, 'lastname'),
123 123
                     'body'			=> $r->field($n, 'body'),
Please login to merge, or discard this patch.
www/includes/easyparliament/searchlog.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
     // Select popular queries
70 70
     public function popular_recent($count, $max_chars = null) {
71 71
 
72
-        $q =  $this->db->query("SELECT *, count(*) AS c FROM search_query_log
72
+        $q = $this->db->query("SELECT *, count(*) AS c FROM search_query_log
73 73
                 WHERE count_hits != 0 AND query_string != 'twat'
74 74
            AND query_string != 'suffragettes' AND page_number=1
75 75
                 AND query_time > date_sub(NOW(), INTERVAL 1 DAY)
76 76
                 GROUP BY query_string ORDER BY c desc LIMIT $count;");
77 77
 
78 78
         $popular_searches = array();
79
-        for ($row=0; $row<$q->rows(); $row++) {
79
+        for ($row = 0; $row < $q->rows(); $row++) {
80 80
             array_push($popular_searches, $this->_db_row_to_array($q, $row));
81 81
         }
82 82
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         $rowarray['query'] = $query;
123 123
         $rowarray['visible_name'] = $visible_name;
124 124
         $rowarray['url'] = $url;
125
-        $rowarray['display'] = '<a href="' . $url . '">' . ($htmlescape ? _htmlentities($visible_name) : $visible_name). '</a>';
125
+        $rowarray['display'] = '<a href="' . $url . '">' . ($htmlescape ? _htmlentities($visible_name) : $visible_name) . '</a>';
126 126
 
127 127
         return $rowarray;
128 128
     }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         $q = $this->db->query("SELECT query_string, page_number, count_hits, ip_address, query_time
133 133
                 FROM search_query_log ORDER BY query_time desc LIMIT $count");
134 134
         $searches_array = array();
135
-        for ($row=0; $row<$q->rows(); $row++) {
135
+        for ($row = 0; $row < $q->rows(); $row++) {
136 136
             array_push($searches_array, $this->_db_row_to_array($q, $row));
137 137
         }
138 138
 
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
 
142 142
     public function admin_popular_searches($count) {
143 143
 
144
-        $q =  $this->db->query("SELECT *, count(*) AS c FROM search_query_log
144
+        $q = $this->db->query("SELECT *, count(*) AS c FROM search_query_log
145 145
                 WHERE count_hits != 0 AND query_string NOT LIKE '%speaker:%'
146 146
                 AND query_time > date_sub(NOW(), INTERVAL 30 DAY)
147 147
                 GROUP BY query_string ORDER BY c desc LIMIT $count;");
148 148
 
149 149
         $popular_searches = array();
150
-        for ($row=0; $row<$q->rows(); $row++) {
150
+        for ($row = 0; $row < $q->rows(); $row++) {
151 151
             array_push($popular_searches, $this->_db_row_to_array($q, $row));
152 152
         }
153 153
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                 FROM search_query_log GROUP BY query_string HAVING count_hits = 0
164 164
                 ORDER BY count_ips DESC, max_time DESC");
165 165
         $searches_array = array();
166
-        for ($row=0; $row<$q->rows(); $row++) {
166
+        for ($row = 0; $row < $q->rows(); $row++) {
167 167
             array_push($searches_array, $this->_db_row_to_array($q, $row));
168 168
         }
169 169
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@
 block discarded – undo
36 36
     public function add($searchlogdata) {
37 37
 
38 38
         $ip = getenv('REMOTE_ADDR');
39
-        if (preg_match('#66\.249\.(6[4-9]|[78]\d|9[0-5])\.#', $ip)) { # Googlebot
39
+        if (preg_match('#66\.249\.(6[4-9]|[78]\d|9[0-5])\.#', $ip)) {
40
+# Googlebot
40 41
             return;
41 42
         }
42 43
         if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('#simplepie|bot#i', $_SERVER['HTTP_USER_AGENT'])) {
Please login to merge, or discard this patch.