Completed
Branch master (84c25f)
by Nick
32:17
created
www/includes/easyparliament/templates/html/glossary.php 2 patches
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.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,13 +39,16 @@  discard block
 block discarded – undo
39 39
     // If we're just previewing a comment, we passed in 'preview' => true.
40 40
     $subheading = 'Your annotation would look like this:';
41 41
 
42
-} elseif ($this_page == 'addcomment') {
42
+}
43
+elseif ($this_page == 'addcomment') {
43 44
     $subheading = 'Previous annotations';
44 45
 
45
-} elseif ($this_page == 'commentreport' || $this_page == 'admin_commentreport') {
46
+}
47
+elseif ($this_page == 'commentreport' || $this_page == 'admin_commentreport') {
46 48
     $subheading = "";
47 49
 
48
-} else {
50
+}
51
+else {
49 52
     $subheading = 'Annotations';
50 53
 }
51 54
 
@@ -69,7 +72,8 @@  discard block
 block discarded – undo
69 72
         if (isset($comment['comment_id'])) {
70 73
             ?> id="c<?php echo $comment['comment_id']; ?>"><a name="c<?php echo $comment['comment_id']; ?>"></a>
71 74
 <?php
72
-        } else {
75
+        }
76
+        else {
73 77
             echo ">\n";
74 78
         }
75 79
 
@@ -99,7 +103,8 @@  discard block
 block discarded – undo
99 103
             ?>
100 104
         <a href="<?php echo $comment['url']; ?>" title="Link to this annotation"><?php echo $time; ?></a>
101 105
 <?php
102
-        } else {
106
+        }
107
+        else {
103 108
             // There won't be a URL when we're just previewing a comment.
104 109
             echo "\t\t$time";
105 110
         }
@@ -124,7 +129,8 @@  discard block
 block discarded – undo
124 129
         <a href="<?php echo $URL->generate(); ?>" title="Notify moderators that this annotation needs editing or deleting">Report this annotation</a>
125 130
 <?php
126 131
 
127
-        } elseif ($comment['modflagged']) {
132
+        }
133
+        elseif ($comment['modflagged']) {
128 134
             ?><br>
129 135
         This annotation has been reported
130 136
 <?php
@@ -139,7 +145,8 @@  discard block
 block discarded – undo
139 145
 
140 146
     }
141 147
 
142
-} else {
148
+}
149
+else {
143 150
 
144 151
     ?>
145 152
     <p>No annotations</p>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/api/hansard_calendar.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,6 +13,7 @@
 block discarded – undo
13 13
         }
14 14
     }
15 15
     api_output($out);
16
-} else {
16
+}
17
+else {
17 18
     api_error('Please supply a year');
18 19
 }
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/api/comments.php 2 patches
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.
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,13 +39,16 @@  discard block
 block discarded – undo
39 39
     // If we're just previewing a comment, we passed in 'preview' => true.
40 40
     $subheading = 'Your comment would look like this:';
41 41
 
42
-} elseif ($this_page == 'addcomment') {
42
+}
43
+elseif ($this_page == 'addcomment') {
43 44
     $subheading = 'Previous annotations';
44 45
 
45
-} elseif ($this_page == 'commentreport' || $this_page == 'admin_commentreport') {
46
+}
47
+elseif ($this_page == 'commentreport' || $this_page == 'admin_commentreport') {
46 48
     $subheading = "";
47 49
 
48
-} else {
50
+}
51
+else {
49 52
     $subheading = 'Annotations';
50 53
 }
51 54
 
@@ -70,7 +73,8 @@  discard block
 block discarded – undo
70 73
 
71 74
         if (isset($comment['comment_id'])) {
72 75
             $id = 'c' . $comment['comment_id'];
73
-        } else {
76
+        }
77
+        else {
74 78
             $id = '';
75 79
         }
76 80
 
@@ -100,9 +104,11 @@  discard block
 block discarded – undo
100 104
 
101 105
             $reporthtml = '(<a href="' . $URL->generate() . '" title="Notify moderators that this comment should be deleted">Report this comment</a>)';
102 106
 
103
-        } elseif ($comment['modflagged']) {
107
+        }
108
+        elseif ($comment['modflagged']) {
104 109
             $reporthtml = '(This comment has been reported to moderators)';
105
-        } else {
110
+        }
111
+        else {
106 112
             // When previewing a comment...
107 113
             $reporthtml = '';
108 114
         }
@@ -123,7 +129,8 @@  discard block
 block discarded – undo
123 129
         if (isset($comment['url'])) {
124 130
             print ' <a href="' . $comment['url'] . '" title="Link to this comment">' . $time . '</a>';
125 131
 
126
-        } else {
132
+        }
133
+        else {
127 134
             // There won't be a URL when we're just previewing a comment.
128 135
             print ' '.$time;
129 136
         }
@@ -144,7 +151,8 @@  discard block
 block discarded – undo
144 151
 <?php
145 152
     }
146 153
 
147
-} else {
154
+}
155
+else {
148 156
 
149 157
     ?>
150 158
                 <div class="comment">
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/api/comments_user.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@  discard block
 block discarded – undo
40 40
         // Get the name of the member whose epobject was commented upon (if any).
41 41
         if (isset($comment['speaker']) && $comment['speaker']['name'] != '') {
42 42
             $member_name = $comment['speaker']['name'] . ': ';
43
-        } else {
43
+        }
44
+        else {
44 45
             $member_name = '';
45 46
         }
46 47
 
@@ -61,7 +62,8 @@  discard block
 block discarded – undo
61 62
     $PAGE->page_links($data);
62 63
     $PAGE->stripe_end();
63 64
 
64
-} else {
65
+}
66
+else {
65 67
 
66 68
     $PAGE->stripe_start();
67 69
     ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/editqueue.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
 
85 85
         if ($q->success()) {
86 86
             // Set the object variables up.
87
-            $this->editqueue_id 	= $q->insert_id();
87
+            $this->editqueue_id = $q->insert_id();
88 88
             $this->title			= $data['title'];
89 89
             $this->body				= $data['body'];
90
-            $this->posted			= $data['posted'];
90
+            $this->posted = $data['posted'];
91 91
 
92 92
             return $this->editqueue_id;
93 93
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             // the new epobject id and approval details.
168 168
             $q = $this->db->query("UPDATE editqueue
169 169
                             SET
170
-                            epobject_id_l='" .  $this->current_epobject_id. "',
170
+                            epobject_id_l='" .  $this->current_epobject_id . "',
171 171
                             editor_id='" . addslashes($THEUSER->user_id()) . "',
172 172
                             approved='1',
173 173
                             decided='" . $timestamp . "'
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
         $q = $this->db->query("SELECT eq.edit_id, eq.user_id, u.firstname, u.lastname, eq.glossary_id, eq.title, eq.body, eq.submitted FROM editqueue AS eq, users AS u WHERE eq.user_id = u.user_id AND eq.approved IS NULL ORDER BY eq.submitted DESC;");
250 250
         if ($q->success() && $q->rows()) {
251 251
             for ($i = 0; $i < ($q->rows()); $i++) {
252
-                $this->pending[	$q->field($i,"edit_id") ] = $q->row($i);
252
+                $this->pending[$q->field($i, "edit_id")] = $q->row($i);
253 253
             }
254 254
 
255 255
             $this->update_pending_count();
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
             // the new epobject id and approval details.
362 362
             $q = $this->db->query("UPDATE editqueue
363 363
                             SET
364
-                            glossary_id='" .  $this->current_epobject_id. "',
364
+                            glossary_id='" .  $this->current_epobject_id . "',
365 365
                             editor_id='" . addslashes($THEUSER->user_id()) . "',
366 366
                             approved='1',
367 367
                             decided='" . $timestamp . "'
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,8 @@
 block discarded – undo
91 91
 
92 92
             return $this->editqueue_id;
93 93
 
94
-        } else {
94
+        }
95
+        else {
95 96
             return false;
96 97
         }
97 98
     }
Please login to merge, or discard this patch.
www/includes/easyparliament/page.php 2 patches
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     public $within_stripe_sidebar = false;
20 20
 
21 21
     public function page_start() {
22
-        if ( !$this->page_started() ) {
22
+        if (!$this->page_started()) {
23 23
             $this->checkForAdmin();
24 24
             $this->displayHeader();
25 25
         }
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
         $data = $h->data;
34 34
         $data = array_merge($u->data, $data);
35
-        if ( isset($page_errors) ) {
35
+        if (isset($page_errors)) {
36 36
             $data['page_errors'] = $page_errors;
37 37
         }
38 38
         $data['banner_text'] = '';
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                 $THISPAGE = new URL($this_page);
53 53
 
54 54
                 $LOGINURL = new URL('userlogin');
55
-                $LOGINURL->insert(array('ret' => $THISPAGE->generate('none') ));
55
+                $LOGINURL->insert(array('ret' => $THISPAGE->generate('none')));
56 56
 
57 57
                 $text = "<a href=\"" . $LOGINURL->generate() . "\">You'd better sign in!</a>";
58 58
             } else {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     }
68 68
 
69 69
     public function page_end() {
70
-        if ( !$this->page_started() ) {
70
+        if (!$this->page_started()) {
71 71
             $this->page_start();
72 72
         }
73 73
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         }
102 102
     }
103 103
 
104
-    public function stripe_start($type='side', $id='', $extra_class = '') {
104
+    public function stripe_start($type = 'side', $id = '', $extra_class = '') {
105 105
         // $type is one of:
106 106
         //  'full' - a full width div
107 107
         //  'side' - a white stripe with a coloured sidebar.
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     }
132 132
 
133 133
 
134
-    public function stripe_end ($contents = array(), $extra = '') {
134
+    public function stripe_end($contents = array(), $extra = '') {
135 135
         // $contents is an array containing 0 or more hashes.
136 136
         // Each hash has two values, 'type' and 'content'.
137 137
         // 'Type' could be one of these:
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
     public function include_sidebar_template($sidebarname) {
235 235
         global $this_page, $DATA;
236 236
 
237
-            $sidebarpath = INCLUDESPATH.'easyparliament/sidebars/'.$sidebarname.'.php';
237
+            $sidebarpath = INCLUDESPATH . 'easyparliament/sidebars/' . $sidebarname . '.php';
238 238
 
239 239
             if (file_exists($sidebarpath)) {
240 240
                 include $sidebarpath;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     }
243 243
 
244 244
 
245
-    public function block_start($data=array()) {
245
+    public function block_start($data = array()) {
246 246
         // Starts a 'block' div, used mostly on the home page,
247 247
         // on the MP page, and in the sidebars.
248 248
         // $data is a hash like this:
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
         if (is_string($message)) {
390 390
             // Sometimes we're just sending a single line to this function
391 391
             // rather like the bigger array...
392
-            $message = array (
392
+            $message = array(
393 393
                 'text' => $message
394 394
             );
395 395
         }
@@ -397,13 +397,13 @@  discard block
 block discarded – undo
397 397
         // if the page has started then we're most likely in an old school page
398 398
         // so we should just print out the error, otherwise stick it in the error
399 399
         // global which will then be displayed by the header template
400
-        if ( $this->page_started() ) {
400
+        if ($this->page_started()) {
401 401
             $this->message($message, 'error');
402 402
         } else {
403
-            if ( !isset($page_errors) ) {
403
+            if (!isset($page_errors)) {
404 404
                 $page_errors = array();
405 405
             }
406
-            $page_errors[]  = $message;
406
+            $page_errors[] = $message;
407 407
         }
408 408
 
409 409
         if ($fatal) {
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
     }
421 421
 
422 422
 
423
-    public function message($message, $class='') {
423
+    public function message($message, $class = '') {
424 424
         // Generates a very simple but common page content.
425 425
         // Used for when a user logs out, or votes, or any simple thing
426 426
         // where there's a little message and probably a link elsewhere.
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
             if ($page_title != '') {
499 499
                 $page_title .= ': ';
500 500
             }
501
-            $page_title .= format_date ($info['date'], SHORTDATEFORMAT);
501
+            $page_title .= format_date($info['date'], SHORTDATEFORMAT);
502 502
         }
503 503
 
504 504
         if ($page_title != '') {
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 
554 554
         if (isset($nextprev['up'])) {
555 555
 
556
-            $uplink = '<span class="up"><a href="' .  $nextprev['up']['url'] . '" title="' . $nextprev['up']['title'] . '">' . $nextprev['up']['body'] . '</a>';
556
+            $uplink = '<span class="up"><a href="' . $nextprev['up']['url'] . '" title="' . $nextprev['up']['title'] . '">' . $nextprev['up']['body'] . '</a>';
557 557
             if (get_http_var('s')) {
558 558
                 $URL = new URL($this_page);
559 559
                 $uplink .= '<br><a href="' . $URL->generate() . '">Remove highlighting</a>';
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
             $next = $nextprev['next'];
569 569
 
570 570
             if (isset($next['url'])) {
571
-                $nextlink = '<a href="' .  $next['url'] . '" title="' . $next['title'] . '" class="linkbutton">' . $next['body'] . ' &raquo;</a>';
571
+                $nextlink = '<a href="' . $next['url'] . '" title="' . $next['title'] . '" class="linkbutton">' . $next['body'] . ' &raquo;</a>';
572 572
             } else {
573 573
                 $nextlink = $next['body'] . ' &raquo;';
574 574
             }
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
     }
586 586
 
587 587
 
588
-    public function search_form($value='') {
588
+    public function search_form($value = '') {
589 589
         global $SEARCHENGINE;
590 590
         // Search box on the search page.
591 591
         // If $value is set then it will be displayed in the form.
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
             }
616 616
 
617 617
         echo '<div class="mainsearchbox">';
618
-        if ($wtt<2) {
618
+        if ($wtt < 2) {
619 619
                 echo '<form action="', $URL->generate(), '" method="get">';
620 620
                 if (get_http_var('o')) {
621 621
                     echo '<input type="hidden" name="o" value="', _htmlentities(get_http_var('o')), '">';
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
                     echo '<input type="hidden" name="house" value="', _htmlentities(get_http_var('house')), '">';
625 625
                 }
626 626
                 echo '<input type="text" name="q" value="', _htmlentities($value), '" size="50"> ';
627
-                echo '<input type="submit" value=" ', ($wtt?'Modify search':'Search'), ' ">';
627
+                echo '<input type="submit" value=" ', ($wtt ? 'Modify search' : 'Search'), ' ">';
628 628
                 $URL = new URL('search');
629 629
             $URL->insert(array('adv' => 1));
630 630
                 echo '&nbsp;&nbsp; <a href="' . $URL->generate() . '">More&nbsp;options</a>';
@@ -646,16 +646,16 @@  discard block
 block discarded – undo
646 646
                     $ordering = 'd';
647 647
                 }
648 648
 
649
-                if ($ordering=='r') {
649
+                if ($ordering == 'r') {
650 650
                 print '<strong>Sorted by relevance</strong>';
651 651
                 } else {
652 652
                 printf("<a href='%s'>Sort by relevance</a>", $orderUrl->generate('html', array('o'=>'r')));
653 653
                 }
654 654
 
655 655
                 print "&nbsp;|&nbsp;";
656
-                if ($ordering=='d') {
656
+                if ($ordering == 'd') {
657 657
                 print '<strong>Sorted by date: newest</strong> / <a href="' . $orderUrl->generate('html', array('o'=>'o')) . '">oldest</a>';
658
-                } elseif ($ordering=='o') {
658
+                } elseif ($ordering == 'o') {
659 659
                 print '<strong>Sorted by date:</strong> <a href="' . $orderUrl->generate('html', array('o'=>'d')) . '">newest</a> / <strong>oldest</strong>';
660 660
                 } else {
661 661
                 printf("Sort by date: <a href='%s'>newest</a> / <a href='%s'>oldest</a>",
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
                 }
664 664
 
665 665
             print "&nbsp;|&nbsp;";
666
-            if ($ordering=='p') {
666
+            if ($ordering == 'p') {
667 667
                 print '<strong>Use by person</strong>';
668 668
             } else {
669 669
                 printf('<a href="%s">Show use by person</a>', $orderUrl->generate('html', array('o'=>'p')));
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
         include_once INCLUDESPATH . 'easyparliament/templates/html/search_advanced.php';
688 688
     }
689 689
 
690
-    public function login_form ($errors = array()) {
690
+    public function login_form($errors = array()) {
691 691
         // Used for /user/login/ and /user/prompt/
692 692
         // $errors is a hash of potential errors from a previous log in attempt.
693 693
         ?>
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
     public function glossary_atoz(&$GLOSSARY) {
792 792
     // Print out a nice list of lettered links to glossary pages
793 793
 
794
-        $letters = array ();
794
+        $letters = array();
795 795
 
796 796
         foreach ($GLOSSARY->alphabet as $letter => $eps) {
797 797
             // if we're writing out the current letter (list or item)
@@ -824,14 +824,14 @@  discard block
 block discarded – undo
824 824
                     <div class="letters">
825 825
                         <ul>
826 826
     <?php
827
-        for ($n=0; $n<13; $n++) {
827
+        for ($n = 0; $n < 13; $n++) {
828 828
             print $letters[$n];
829 829
         }
830 830
         ?>
831 831
                         </ul>
832 832
                         <ul>
833 833
     <?php
834
-        for ($n=13; $n<26; $n++) {
834
+        for ($n = 13; $n < 26; $n++) {
835 835
             print $letters[$n];
836 836
         }
837 837
         ?>
@@ -850,12 +850,12 @@  discard block
 block discarded – undo
850 850
 
851 851
         // add some extra controls for the administrators
852 852
         if ($this_page == "admin_glossary") {
853
-            print "<a id=\"gl".$term['glossary_id']."\"></a>";
853
+            print "<a id=\"gl" . $term['glossary_id'] . "\"></a>";
854 854
             print "<h3>" . $term['title'] . "</h3>";
855 855
             $URL = new URL('admin_glossary');
856 856
             $URL->insert(array("delete_confirm" => $term['glossary_id']));
857 857
             $delete_url = $URL->generate();
858
-            $admin_links = "<br><small><a href=\"".$delete_url."\">delete</a></small>";
858
+            $admin_links = "<br><small><a href=\"" . $delete_url . "\">delete</a></small>";
859 859
         }
860 860
         else {
861 861
             $admin_links = "";
@@ -878,9 +878,9 @@  discard block
 block discarded – undo
878 878
             // Add a direct search link for current glossary item
879 879
             $URL = new URL('search');
880 880
             // remember to quote the term for phrase matching in search
881
-            $URL->insert(array('s' => '"'.$term['title'].'"'));
881
+            $URL->insert(array('s' => '"' . $term['title'] . '"'));
882 882
             $search_url = $URL->generate();
883
-            printf ("\t\t\t\t<p>Search hansard for \"<a href=\"%s\" title=\"View search results for this glossary item\">%s</a>\"</p>", $search_url, $term['title']);
883
+            printf("\t\t\t\t<p>Search hansard for \"<a href=\"%s\" title=\"View search results for this glossary item\">%s</a>\"</p>", $search_url, $term['title']);
884 884
         }
885 885
     }
886 886
 
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
 
956 956
             // Generate all the page links.
957 957
             $URL = new URL($this_page);
958
-            $URL->insert( array('wtt' => get_http_var('wtt')) );
958
+            $URL->insert(array('wtt' => get_http_var('wtt')));
959 959
             if (isset($pagedata['s'])) {
960 960
                 # XXX: Should be taken out in *one* place, not here + search_form etc.
961 961
                 $value = $pagedata['s'];
@@ -1093,7 +1093,7 @@  discard block
 block discarded – undo
1093 1093
 
1094 1094
                 $body = trim_characters($report['body'], 0, 40);
1095 1095
 
1096
-                $tabledata['rows'][] = array (
1096
+                $tabledata['rows'][] = array(
1097 1097
                     _htmlentities($report['firstname'] . ' ' . $report['lastname']),
1098 1098
                     _htmlentities($body),
1099 1099
                     $report['reported'],
@@ -1124,13 +1124,13 @@  discard block
 block discarded – undo
1124 1124
         // $page is the name of the page the dates should link to.
1125 1125
 
1126 1126
         // Create array containing abbreviations of days of week.
1127
-        $daysOfWeek = array('Mon','Tue','Wed','Thu','Fri','Sat','Sun');
1127
+        $daysOfWeek = array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun');
1128 1128
 
1129 1129
         // What is the first day of the month in question?
1130
-        $firstDayOfMonth = mktime(0,0,0,$month,1,$year);
1130
+        $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year);
1131 1131
 
1132 1132
         // How many days does this month contain?
1133
-        $numberDays = date('t',$firstDayOfMonth);
1133
+        $numberDays = date('t', $firstDayOfMonth);
1134 1134
 
1135 1135
         // Retrieve some information about the first day of the
1136 1136
         // month in question.
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
 
1212 1212
             // Is the $currentDay a member of $dateArray? If so,
1213 1213
             // the day should be linked.
1214
-            if (in_array($currentDay,$dateArray)) {
1214
+            if (in_array($currentDay, $dateArray)) {
1215 1215
 
1216 1216
                 $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay);
1217 1217
 
@@ -1312,8 +1312,8 @@  discard block
 block discarded – undo
1312 1312
         // Returns HTML suitable for putting in the sidebar on Admin pages.
1313 1313
         global $this_page, $DATA;
1314 1314
 
1315
-        $pages = array ('admin_home',
1316
-                'admin_comments','admin_trackbacks', 'admin_searchlogs', 'admin_popularsearches', 'admin_failedsearches',
1315
+        $pages = array('admin_home',
1316
+                'admin_comments', 'admin_trackbacks', 'admin_searchlogs', 'admin_popularsearches', 'admin_failedsearches',
1317 1317
                 'alert_stats', 'admin_statistics', 'admin_reportstats',
1318 1318
                 'admin_commentreports', 'admin_glossary', 'admin_glossary_pending', 'admin_badusers',
1319 1319
                 'admin_photos', 'admin_mpurls', 'admin_policies', 'admin_banner', 'admin_featured', 'admin_topics'
Please login to merge, or discard this patch.
Braces   +78 added lines, -37 removed lines patch added patch discarded remove patch
@@ -55,7 +55,8 @@  discard block
 block discarded – undo
55 55
                 $LOGINURL->insert(array('ret' => $THISPAGE->generate('none') ));
56 56
 
57 57
                 $text = "<a href=\"" . $LOGINURL->generate() . "\">You'd better sign in!</a>";
58
-            } else {
58
+            }
59
+            else {
59 60
                 $text = "That's all folks!";
60 61
             }
61 62
             $this_page = 'home';
@@ -88,7 +89,8 @@  discard block
 block discarded – undo
88 89
     public function within_stripe() {
89 90
         if ($this->within_stripe_main == true || $this->within_stripe_sidebar == true) {
90 91
             return true;
91
-        } else {
92
+        }
93
+        else {
92 94
             return false;
93 95
         }
94 96
     }
@@ -96,7 +98,8 @@  discard block
 block discarded – undo
96 98
     public function within_stripe_sidebar() {
97 99
         if ($this->within_stripe_sidebar == true) {
98 100
             return true;
99
-        } else {
101
+        }
102
+        else {
100 103
             return false;
101 104
         }
102 105
     }
@@ -114,7 +117,10 @@  discard block
 block discarded – undo
114 117
         //  'foot' - For the bottom stripe on hansard debates/wrans listings.
115 118
         // $id is the value of an id for this div (if blank, not used).
116 119
         ?>
117
-        <div class="stripe-<?php echo $type; ?><?php if ($extra_class != '') echo ' ' . $extra_class; ?>"<?php
120
+        <div class="stripe-<?php echo $type; ?><?php if ($extra_class != '') {
121
+    echo ' ' . $extra_class;
122
+}
123
+?>"<?php
118 124
         if ($id != '') {
119 125
             print ' id="' . $id . '"';
120 126
         }
@@ -192,20 +198,24 @@  discard block
 block discarded – undo
192 198
 
193 199
         if (count($contents) == 0) {
194 200
             print "\t\t\t&nbsp;\n";
195
-        } else {
201
+        }
202
+        else {
196 203
             #print '<div class="sidebar">';
197 204
             foreach ($contents as $hash) {
198 205
                 if (isset($hash['type'])) {
199 206
                     if ($hash['type'] == 'include') {
200 207
                         $this->include_sidebar_template($hash['content']);
201 208
 
202
-                    } elseif ($hash['type'] == 'nextprev') {
209
+                    }
210
+                    elseif ($hash['type'] == 'nextprev') {
203 211
                         $this->nextprevlinks();
204 212
 
205
-                    } elseif ($hash['type'] == 'html') {
213
+                    }
214
+                    elseif ($hash['type'] == 'html') {
206 215
                         print $hash['content'];
207 216
 
208
-                    } elseif ($hash['type'] == 'extrahtml') {
217
+                    }
218
+                    elseif ($hash['type'] == 'extrahtml') {
209 219
                         $extrahtml .= $hash['content'];
210 220
                     }
211 221
                 }
@@ -256,7 +266,8 @@  discard block
 block discarded – undo
256 266
 
257 267
         if (isset($data['id']) && $data['id'] != '') {
258 268
             $id = ' id="' . $data['id'] . '"';
259
-        } else {
269
+        }
270
+        else {
260 271
             $id = '';
261 272
         }
262 273
 
@@ -304,7 +315,8 @@  discard block
 block discarded – undo
304 315
             // This is the page title of the parent.
305 316
             $section_text = $DATA->page_metadata($parent_page, 'title');
306 317
 
307
-        } else {
318
+        }
319
+        else {
308 320
             // Top level page - no parent, hence no parental title.
309 321
             $section_text = '';
310 322
         }
@@ -318,7 +330,8 @@  discard block
 block discarded – undo
318 330
 
319 331
         if ($page_text == '' && !is_bool($page_text)) {
320 332
             // If the metadata 'heading' is set, but empty, we display nothing.
321
-        } elseif ($page_text == false) {
333
+        }
334
+        elseif ($page_text == false) {
322 335
             // But if it just hasn't been set, we use the 'title'.
323 336
             $page_text = $DATA->page_metadata($this_page, "title");
324 337
         }
@@ -326,7 +339,8 @@  discard block
 block discarded – undo
326 339
         if ($page_text == $section_text) {
327 340
             // We don't want to print both.
328 341
             $section_text = '';
329
-        } elseif (!$page_text && $section_text) {
342
+        }
343
+        elseif (!$page_text && $section_text) {
330 344
             // Bodge for if we have a section_text but no page_text.
331 345
             $page_text = $section_text;
332 346
             $section_text = '';
@@ -340,7 +354,8 @@  discard block
 block discarded – undo
340 354
                     print "\n\t\t\t\t<br><span>$page_text</span>\n";
341 355
                 }
342 356
                 print "</h1>\n";
343
-            } elseif ($page_text) {
357
+            }
358
+            elseif ($page_text) {
344 359
                 print "\t\t\t\t<h1>$page_text</h1>\n";
345 360
             }
346 361
         }
@@ -399,7 +414,8 @@  discard block
 block discarded – undo
399 414
         // global which will then be displayed by the header template
400 415
         if ( $this->page_started() ) {
401 416
             $this->message($message, 'error');
402
-        } else {
417
+        }
418
+        else {
403 419
             if ( !isset($page_errors) ) {
404 420
                 $page_errors = array();
405 421
             }
@@ -479,7 +495,9 @@  discard block
 block discarded – undo
479 495
 
480 496
         global $DATA, $this_page;
481 497
 
482
-        if ($this->page_started()) return;
498
+        if ($this->page_started()) {
499
+            return;
500
+        }
483 501
         // The page's HTML hasn't been started yet, so we'd better do it.
484 502
 
485 503
         // Set the page title (in the <title></title>).
@@ -487,7 +505,8 @@  discard block
 block discarded – undo
487 505
 
488 506
         if (isset($info['text_heading'])) {
489 507
             $page_title = $info['text_heading'];
490
-        } elseif (isset($info['text'])) {
508
+        }
509
+        elseif (isset($info['text'])) {
491 510
             // Use a truncated version of the page's main item's body text.
492 511
             // trim_words() is in utility.php. Trim to 40 chars.
493 512
             $page_title = trim_characters($info['text'], 0, 40);
@@ -539,7 +558,8 @@  discard block
 block discarded – undo
539 558
             if (isset($prev['url'])) {
540 559
                 $prevlink = '<a href="' . $prev['url'] . '" title="' . $prev['title'] . '" class="linkbutton">&laquo; ' . $prev['body'] . '</a>';
541 560
 
542
-            } else {
561
+            }
562
+            else {
543 563
                 $prevlink = '&laquo; ' . $prev['body'];
544 564
             }
545 565
         }
@@ -569,7 +589,8 @@  discard block
 block discarded – undo
569 589
 
570 590
             if (isset($next['url'])) {
571 591
                 $nextlink = '<a href="' .  $next['url'] . '" title="' . $next['title'] . '" class="linkbutton">' . $next['body'] . ' &raquo;</a>';
572
-            } else {
592
+            }
593
+            else {
573 594
                 $nextlink = $next['body'] . ' &raquo;';
574 595
             }
575 596
         }
@@ -599,7 +620,8 @@  discard block
 block discarded – undo
599 620
         if ($value == '') {
600 621
             if (get_http_var('q') !== '') {
601 622
                 $value = get_http_var('q');
602
-            } else {
623
+            }
624
+            else {
603 625
                 $value = get_http_var('s');
604 626
             }
605 627
         }
@@ -629,8 +651,11 @@  discard block
 block discarded – undo
629 651
             $URL->insert(array('adv' => 1));
630 652
                 echo '&nbsp;&nbsp; <a href="' . $URL->generate() . '">More&nbsp;options</a>';
631 653
                 echo '<br>';
632
-                if ($wtt) print '<input type="hidden" name="wtt" value="1">';
633
-        } else { ?>
654
+                if ($wtt) {
655
+                    print '<input type="hidden" name="wtt" value="1">';
656
+                }
657
+        }
658
+        else { ?>
634 659
     <form action="http://www.writetothem.com/lords" method="get">
635 660
     <input type="hidden" name="pid" value="<?=_htmlentities(get_http_var('pid')) ?>">
636 661
     <input type="submit" style="font-size: 150%" value=" I want to write to this Lord "><br>
@@ -648,16 +673,19 @@  discard block
 block discarded – undo
648 673
 
649 674
                 if ($ordering=='r') {
650 675
                 print '<strong>Sorted by relevance</strong>';
651
-                } else {
676
+                }
677
+                else {
652 678
                 printf("<a href='%s'>Sort by relevance</a>", $orderUrl->generate('html', array('o'=>'r')));
653 679
                 }
654 680
 
655 681
                 print "&nbsp;|&nbsp;";
656 682
                 if ($ordering=='d') {
657 683
                 print '<strong>Sorted by date: newest</strong> / <a href="' . $orderUrl->generate('html', array('o'=>'o')) . '">oldest</a>';
658
-                } elseif ($ordering=='o') {
684
+                }
685
+                elseif ($ordering=='o') {
659 686
                 print '<strong>Sorted by date:</strong> <a href="' . $orderUrl->generate('html', array('o'=>'d')) . '">newest</a> / <strong>oldest</strong>';
660
-                } else {
687
+                }
688
+                else {
661 689
                 printf("Sort by date: <a href='%s'>newest</a> / <a href='%s'>oldest</a>",
662 690
                     $orderUrl->generate('html', array('o'=>'d')), $orderUrl->generate('html', array('o'=>'o')));
663 691
                 }
@@ -665,7 +693,8 @@  discard block
 block discarded – undo
665 693
             print "&nbsp;|&nbsp;";
666 694
             if ($ordering=='p') {
667 695
                 print '<strong>Use by person</strong>';
668
-            } else {
696
+            }
697
+            else {
669 698
                 printf('<a href="%s">Show use by person</a>', $orderUrl->generate('html', array('o'=>'p')));
670 699
             }
671 700
             echo '</div>';
@@ -888,7 +917,8 @@  discard block
 block discarded – undo
888 917
             if ($GLOSSARY->num_search_matches > 1) {
889 918
                 $plural = "them";
890 919
                 $definition = "some definitions";
891
-            } else {
920
+            }
921
+            else {
892 922
                 $plural = "it";
893 923
                 $definition = "a definition";
894 924
             }
@@ -941,7 +971,8 @@  discard block
 block discarded – undo
941 971
             if ($page < 10) {
942 972
                 $firstpage = 1;
943 973
                 $lastpage = 10;
944
-            } else {
974
+            }
975
+            else {
945 976
                 $firstpage = $page - 10;
946 977
                 $lastpage = $page + 9;
947 978
             }
@@ -971,7 +1002,8 @@  discard block
 block discarded – undo
971 1002
 
972 1003
                 if ($n > 1) {
973 1004
                     $URL->insert(array('p'=>$n));
974
-                } else {
1005
+                }
1006
+                else {
975 1007
                     // No page number for the first page.
976 1008
                     $URL->remove(array('p'));
977 1009
                 }
@@ -981,7 +1013,8 @@  discard block
 block discarded – undo
981 1013
 
982 1014
                 if ($n != $page) {
983 1015
                     $pagelinks[] = '<a href="' . $URL->generate() . '">' . $n . '</a>';
984
-                } else {
1016
+                }
1017
+                else {
985 1018
                     $pagelinks[] = "<strong>$n</strong>";
986 1019
                 }
987 1020
             }
@@ -1028,7 +1061,8 @@  discard block
 block discarded – undo
1028 1061
             $USERURL = new URL('userview');
1029 1062
             $USERURL->insert(array('id'=>$data['user_id']));
1030 1063
             $username = '<a href="' . $USERURL->generate() . '">' . _htmlentities($data['user_name']) . '</a>';
1031
-        } else {
1064
+        }
1065
+        else {
1032 1066
             $username = _htmlentities($data['user_name']);
1033 1067
         }
1034 1068
         ?>
@@ -1043,7 +1077,8 @@  discard block
 block discarded – undo
1043 1077
             ?>
1044 1078
                 <p>&nbsp;<br><em>This report has not been resolved.</em></p>
1045 1079
 <?php
1046
-        } else {
1080
+        }
1081
+        else {
1047 1082
             ?>
1048 1083
                 <p><em>This report was resolved on <?php echo $data['resolved']; ?></em></p>
1049 1084
 <?php
@@ -1087,7 +1122,8 @@  discard block
 block discarded – undo
1087 1122
                         'cid' => $report['comment_id'],
1088 1123
                     ));
1089 1124
                     $editlink = '<a href="' . $EDITURL->generate() . '">View</a>';
1090
-                } else {
1125
+                }
1126
+                else {
1091 1127
                     $editlink = 'Locked';
1092 1128
                 }
1093 1129
 
@@ -1104,7 +1140,8 @@  discard block
 block discarded – undo
1104 1140
 
1105 1141
             $this->display_table($tabledata);
1106 1142
 
1107
-        } else {
1143
+        }
1144
+        else {
1108 1145
 
1109 1146
             print "<p>There are no outstanding annotation reports.</p>\n";
1110 1147
         }
@@ -1144,7 +1181,8 @@  discard block
 block discarded – undo
1144 1181
         $nowDateComponents = getdate();
1145 1182
         if ($nowDateComponents['mon'] == $month && $nowDateComponents['year'] == $year) {
1146 1183
             $toDay = $nowDateComponents['mday'];
1147
-        } else {
1184
+        }
1185
+        else {
1148 1186
             $toDay = '';
1149 1187
         }
1150 1188
 
@@ -1205,7 +1243,8 @@  discard block
 block discarded – undo
1205 1243
             // If so, higlight it.
1206 1244
             if ($currentDay == $toDay) {
1207 1245
                 $calendar .= '<td class="on">';
1208
-            } else {
1246
+            }
1247
+            else {
1209 1248
                 $calendar .= '<td>';
1210 1249
             }
1211 1250
 
@@ -1221,7 +1260,8 @@  discard block
 block discarded – undo
1221 1260
 
1222 1261
                 // $currentDay is not a member of $dateArray.
1223 1262
 
1224
-            } else {
1263
+            }
1264
+            else {
1225 1265
 
1226 1266
                 $calendar .= "$currentDay</td>";
1227 1267
             }
@@ -1327,7 +1367,8 @@  discard block
 block discarded – undo
1327 1367
             if ($page != $this_page) {
1328 1368
                 $URL = new URL($page);
1329 1369
                 $title = '<a href="' . $URL->generate() . '">' . $title . '</a>';
1330
-            } else {
1370
+            }
1371
+            else {
1331 1372
                 $title = '<strong>' . $title . '</strong>';
1332 1373
             }
1333 1374
 
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 2 patches
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.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,8 @@
 block discarded – undo
61 61
 
62 62
         if (!isset($years[$y])) {
63 63
             $years[$y] = array(1=>array(), 2=>array(), 3=>array(), 4=>array(), 5=>array(), 6=>array(), 7=>array(), 8=>array(), 9=>array(), 10=>array(), 11=>array(), 12=>array());
64
-        } else {
64
+        }
65
+        else {
65 66
             // This year is set. Check it has all the months...
66 67
             $minmonth = $y == $firstyear ? $firstmonth : 1;
67 68
             $maxmonth = $y == $finalyear ? $finalmonth : 12;
Please login to merge, or discard this patch.
www/includes/easyparliament/sidebars/people.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,8 @@  discard block
 block discarded – undo
44 44
 </form>
45 45
 
46 46
 <?php
47
-} elseif ($this_page == 'msps') {
47
+}
48
+elseif ($this_page == 'msps') {
48 49
 ?>
49 50
 
50 51
 <li><a href="?date=2007-05-03">MSPs at 2007 election</a></li>
@@ -53,7 +54,8 @@  discard block
 block discarded – undo
53 54
 <li><a href="<?=$allurl?>">Historical list of all MSPs</a></li>
54 55
 
55 56
 <?php
56
-} else {
57
+}
58
+else {
57 59
     echo "<li><a href='$allurl'>Historical list of all $rep</a></li>";
58 60
 }
59 61
 echo '</ul>';
Please login to merge, or discard this patch.