Completed
Pull Request — master (#1322)
by Nick
07:54 queued 02:46
created
www/docs/news/index.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
         $PAGE->page_start();
20 20
         $PAGE->stripe_start();
21 21
         print news_format_body($content);
22
-        print "<p>Posted on " . format_date(substr($date, 0, 10), LONGDATEFORMAT) . " at " . substr($date, 11);
22
+        print "<p>Posted on ".format_date(substr($date, 0, 10), LONGDATEFORMAT)." at ".substr($date, 11);
23 23
         if (isset($news_row[3])) print " by $news_row[3]";
24
-        print " | <a href=\"" . news_individual_link($date, $title) . "\">Link to this</a>";
24
+        print " | <a href=\"".news_individual_link($date, $title)."\">Link to this</a>";
25 25
         break;
26 26
     }
27 27
     if (!$PAGE->page_started()) {
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
     foreach (array_reverse($all_news) as $id => $news_row) {
39 39
         list($title, $content, $date) = $news_row;
40 40
         if (substr($date, 0, 7) != "$year-$month") continue;
41
-        print "<h3>" . format_date(substr($date, 0, 10), LONGDATEFORMAT) . "</h3>";
42
-        print "<h4>" . $title . "</h4>";
41
+        print "<h3>".format_date(substr($date, 0, 10), LONGDATEFORMAT)."</h3>";
42
+        print "<h4>".$title."</h4>";
43 43
         print news_format_body($content);
44
-        print "<p>Posted at " . substr($date, 11);
44
+        print "<p>Posted at ".substr($date, 11);
45 45
         if (isset($news_row[3])) print " by $news_row[3]";
46
-        print " | <a href=\"" . news_individual_link($date, $title) . "\">Link to this</a>";
46
+        print " | <a href=\"".news_individual_link($date, $title)."\">Link to this</a>";
47 47
     }
48 48
 } else {
49 49
     // Front page /news
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
     foreach ($all_news as $id => $news_row) {
55 55
         if ($c++ == 10) break;
56 56
         list($title, $content, $date) = $news_row;
57
-        print "<h3>" . format_date(substr($date, 0, 10), LONGDATEFORMAT) . "</h3>";
58
-        print "<h4>" . $title . "</h4>";
57
+        print "<h3>".format_date(substr($date, 0, 10), LONGDATEFORMAT)."</h3>";
58
+        print "<h4>".$title."</h4>";
59 59
         print news_format_body($content);
60
-        print "<p>Posted at " . substr($date, 11);
60
+        print "<p>Posted at ".substr($date, 11);
61 61
         if (isset($news_row[3])) print " by $news_row[3]";
62
-        print " | <a href=\"" . news_individual_link($date, $title) . "\">Link to this</a>";
62
+        print " | <a href=\"".news_individual_link($date, $title)."\">Link to this</a>";
63 63
     }
64 64
 }
65 65
 
Please login to merge, or discard this patch.
Braces   +21 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,10 +9,14 @@  discard block
 block discarded – undo
9 9
 if (preg_match("#/(\d\d\d\d)/(\d\d)/(\d\d)/([a-z0-9_]+)(\.php)?$#", $uri, $matches)) {
10 10
     // Individual item
11 11
     list($all, $year, $month, $day, $ref) = $matches;
12
-    if ($ref == "please_build_on_") $ref = "new_full_source_";
12
+    if ($ref == "please_build_on_") {
13
+        $ref = "new_full_source_";
14
+    }
13 15
     foreach ($all_news as $id => $news_row) {
14 16
         list($title, $content, $date) = $news_row;
15
-        if (news_format_ref($title) != $ref) continue;
17
+        if (news_format_ref($title) != $ref) {
18
+            continue;
19
+        }
16 20
 
17 21
         $this_page = 'sitenews_individual';
18 22
         $DATA->set_page_metadata($this_page, 'title', $title);
@@ -20,7 +24,9 @@  discard block
 block discarded – undo
20 24
         $PAGE->stripe_start();
21 25
         print news_format_body($content);
22 26
         print "<p>Posted on " . format_date(substr($date, 0, 10), LONGDATEFORMAT) . " at " . substr($date, 11);
23
-        if (isset($news_row[3])) print " by $news_row[3]";
27
+        if (isset($news_row[3])) {
28
+            print " by $news_row[3]";
29
+        }
24 30
         print " | <a href=\"" . news_individual_link($date, $title) . "\">Link to this</a>";
25 31
         break;
26 32
     }
@@ -37,12 +43,16 @@  discard block
 block discarded – undo
37 43
     $PAGE->stripe_start();
38 44
     foreach (array_reverse($all_news) as $id => $news_row) {
39 45
         list($title, $content, $date) = $news_row;
40
-        if (substr($date, 0, 7) != "$year-$month") continue;
46
+        if (substr($date, 0, 7) != "$year-$month") {
47
+            continue;
48
+        }
41 49
         print "<h3>" . format_date(substr($date, 0, 10), LONGDATEFORMAT) . "</h3>";
42 50
         print "<h4>" . $title . "</h4>";
43 51
         print news_format_body($content);
44 52
         print "<p>Posted at " . substr($date, 11);
45
-        if (isset($news_row[3])) print " by $news_row[3]";
53
+        if (isset($news_row[3])) {
54
+            print " by $news_row[3]";
55
+        }
46 56
         print " | <a href=\"" . news_individual_link($date, $title) . "\">Link to this</a>";
47 57
     }
48 58
 } else {
@@ -52,13 +62,17 @@  discard block
 block discarded – undo
52 62
     $PAGE->stripe_start();
53 63
     $c = 0;
54 64
     foreach ($all_news as $id => $news_row) {
55
-        if ($c++ == 10) break;
65
+        if ($c++ == 10) {
66
+            break;
67
+        }
56 68
         list($title, $content, $date) = $news_row;
57 69
         print "<h3>" . format_date(substr($date, 0, 10), LONGDATEFORMAT) . "</h3>";
58 70
         print "<h4>" . $title . "</h4>";
59 71
         print news_format_body($content);
60 72
         print "<p>Posted at " . substr($date, 11);
61
-        if (isset($news_row[3])) print " by $news_row[3]";
73
+        if (isset($news_row[3])) {
74
+            print " by $news_row[3]";
75
+        }
62 76
         print " | <a href=\"" . news_individual_link($date, $title) . "\">Link to this</a>";
63 77
     }
64 78
 }
Please login to merge, or discard this patch.
www/docs/api/api_getWrans.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once dirname(__FILE__) . '/api_getHansard.php';
3
+include_once dirname(__FILE__).'/api_getHansard.php';
4 4
 
5 5
 function api_getWrans_front() {
6 6
 ?>
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
     _api_getHansard_year('WRANS', $y);
58 58
 }
59 59
 function api_getWrans_search($s) {
60
-    _api_getHansard_search( array(
60
+    _api_getHansard_search(array(
61 61
         's' => $s,
62 62
         'pid' => get_http_var('person'),
63 63
         'type' => 'wrans',
64
-    ) );
64
+    ));
65 65
 }
66 66
 function api_getWrans_person($pid) {
67 67
     _api_getHansard_search(array(
Please login to merge, or discard this patch.
www/docs/api/api_getAlerts.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 function api_getAlerts_start_date($start_date) {
4
-  $args = array ('start_date' => $start_date, 'end_date' => get_http_var('end_date'));
5
-  $alert = new ALERT();
6
-  $data = $alert->fetch_between($confirmed=1, $deleted=0, $args['start_date'], $args['end_date']);
7
-  api_output($data);
4
+    $args = array ('start_date' => $start_date, 'end_date' => get_http_var('end_date'));
5
+    $alert = new ALERT();
6
+    $data = $alert->fetch_between($confirmed=1, $deleted=0, $args['start_date'], $args['end_date']);
7
+    api_output($data);
8 8
 }
9 9
 
10 10
 ?>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 function api_getAlerts_start_date($start_date) {
4
-  $args = array ('start_date' => $start_date, 'end_date' => get_http_var('end_date'));
4
+  $args = array('start_date' => $start_date, 'end_date' => get_http_var('end_date'));
5 5
   $alert = new ALERT();
6
-  $data = $alert->fetch_between($confirmed=1, $deleted=0, $args['start_date'], $args['end_date']);
6
+  $data = $alert->fetch_between($confirmed = 1, $deleted = 0, $args['start_date'], $args['end_date']);
7 7
   api_output($data);
8 8
 }
9 9
 
Please login to merge, or discard this patch.
www/docs/api/api_getConstituency.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once INCLUDESPATH . '../../commonlib/phplib/mapit.php';
3
+include_once INCLUDESPATH.'../../commonlib/phplib/mapit.php';
4 4
 
5 5
 function api_getConstituency_front() {
6 6
 ?>
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     $q = $db->query("select constituency, data_key, data_value from consinfo
61 61
                      where constituency = :constituency", array(':constituency' => $constituency));
62 62
     if ($q->rows()) {
63
-        for ($i=0; $i<$q->rows(); $i++) {
63
+        for ($i = 0; $i < $q->rows(); $i++) {
64 64
             $data_key = $q->field($i, 'data_key');
65 65
             $output[$data_key] = $q->field($i, 'data_value');
66 66
         }
Please login to merge, or discard this patch.
www/docs/api/api_getMPInfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once dirname(__FILE__) . '/api_getMPsInfo.php';
3
+include_once dirname(__FILE__).'/api_getMPsInfo.php';
4 4
 
5 5
 function api_getMPInfo_front() {
6 6
 ?>
Please login to merge, or discard this patch.
www/docs/api/api_getMLAs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once dirname(__FILE__) . '/api_getMembers.php';
3
+include_once dirname(__FILE__).'/api_getMembers.php';
4 4
 
5 5
 function api_getMLAs_front() {
6 6
 ?>
Please login to merge, or discard this patch.
www/docs/api/api_getMembers.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@  discard block
 block discarded – undo
8 8
     $q = $db->query($sql, $params);
9 9
     $output = array();
10 10
     $last_mod = 0;
11
-    for ($i=0; $i<$q->rows(); $i++) {
11
+    for ($i = 0; $i < $q->rows(); $i++) {
12 12
         $pid = $q->field($i, 'person_id');
13 13
         $row = array(
14 14
             'member_id' => $q->field($i, 'member_id'),
15 15
             'person_id' => $pid,
16 16
             'name' => html_entity_decode(member_full_name($q->field($i, 'house'), $q->field($i, 'title'),
17 17
                 $q->field($i, 'given_name'), $q->field($i, 'family_name'),
18
-                $q->field($i, 'lordofname') )),
18
+                $q->field($i, 'lordofname'))),
19 19
             'party' => isset($parties[$q->field($i, 'party')]) ? $parties[$q->field($i, 'party')] : $q->field($i, 'party'),
20 20
         );
21 21
         if ($q->field($i, 'house') != 2) {
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
     $pids = array_keys($output);
32 32
     if (count($pids)) {
33 33
         $q = $db->query('SELECT person, dept, position, from_date, to_date FROM moffice
34
-            WHERE to_date="9999-12-31" AND person IN (' . join(',', $pids) . ')');
35
-        for ($i=0; $i<$q->rows(); $i++) {
34
+            WHERE to_date="9999-12-31" AND person IN (' . join(',', $pids).')');
35
+        for ($i = 0; $i < $q->rows(); $i++) {
36 36
             $row = $q->row($i);
37 37
             $pid = $row['person'];
38 38
             unset($row['person']);
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             AND p.start_date <= date(now()) and date(now()) <= p.end_date
56 56
         and party like :party and entered_house <= date(now()) and date(now()) <= left_house', array(
57 57
             ':house' => $house,
58
-            ':party' => '%' . $s . '%'
58
+            ':party' => '%'.$s.'%'
59 59
             ));
60 60
 }
61 61
 
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
 
75 75
     _api_getMembers_output($query, array(
76 76
         ':house' => $house,
77
-        ':name' => '%' . $s . '%'
77
+        ':name' => '%'.$s.'%'
78 78
         ));
79 79
 }
80 80
 
81 81
 function api_getMembers_date($house, $date) {
82 82
     if ($date = parse_date($date)) {
83
-        api_getMembers($house, '"' . $date['iso'] . '"');
83
+        api_getMembers($house, '"'.$date['iso'].'"');
84 84
     } else {
85 85
         api_error('Invalid date format');
86 86
     }
Please login to merge, or discard this patch.
www/docs/api/api_getDebates.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once dirname(__FILE__) . '/api_getHansard.php';
3
+include_once dirname(__FILE__).'/api_getHansard.php';
4 4
 
5 5
 function api_getDebates_front() {
6 6
 ?>
Please login to merge, or discard this patch.
www/docs/api/api_getMSP.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once INCLUDESPATH . 'easyparliament/member.php';
4
-include_once dirname(__FILE__) . '/api_getPerson.php';
3
+include_once INCLUDESPATH.'easyparliament/member.php';
4
+include_once dirname(__FILE__).'/api_getPerson.php';
5 5
 
6 6
 function api_getMSP_front() {
7 7
 ?>
Please login to merge, or discard this patch.