@@ -114,7 +114,10 @@ discard block |
||
114 | 114 | // 'foot' - For the bottom stripe on hansard debates/wrans listings. |
115 | 115 | // $id is the value of an id for this div (if blank, not used). |
116 | 116 | ?> |
117 | - <div class="stripe-<?php echo $type; ?><?php if ($extra_class != '') echo ' ' . $extra_class; ?>"<?php |
|
117 | + <div class="stripe-<?php echo $type; ?><?php if ($extra_class != '') { |
|
118 | + echo ' ' . $extra_class; |
|
119 | +} |
|
120 | +?>"<?php |
|
118 | 121 | if ($id != '') { |
119 | 122 | print ' id="' . $id . '"'; |
120 | 123 | } |
@@ -479,7 +482,9 @@ discard block |
||
479 | 482 | |
480 | 483 | global $DATA, $this_page; |
481 | 484 | |
482 | - if ($this->page_started()) return; |
|
485 | + if ($this->page_started()) { |
|
486 | + return; |
|
487 | + } |
|
483 | 488 | // The page's HTML hasn't been started yet, so we'd better do it. |
484 | 489 | |
485 | 490 | // Set the page title (in the <title></title>). |
@@ -629,7 +634,9 @@ discard block |
||
629 | 634 | $URL->insert(array('adv' => 1)); |
630 | 635 | echo ' <a href="' . $URL->generate() . '">More options</a>'; |
631 | 636 | echo '<br>'; |
632 | - if ($wtt) print '<input type="hidden" name="wtt" value="1">'; |
|
637 | + if ($wtt) { |
|
638 | + print '<input type="hidden" name="wtt" value="1">'; |
|
639 | + } |
|
633 | 640 | } else { ?> |
634 | 641 | <form action="http://www.writetothem.com/lords" method="get"> |
635 | 642 | <input type="hidden" name="pid" value="<?=_htmlentities(get_http_var('pid')) ?>"> |
@@ -753,8 +760,7 @@ discard block |
||
753 | 760 | // The return url for after the user has logged in. |
754 | 761 | if (get_http_var("ret") != "") { |
755 | 762 | $returl = get_http_var("ret"); |
756 | - } |
|
757 | - else { |
|
763 | + } else { |
|
758 | 764 | $returl = $glossary_returl; |
759 | 765 | } |
760 | 766 | ?> |
@@ -803,15 +809,13 @@ discard block |
||
803 | 809 | else { |
804 | 810 | $letters[] = "<li class=\"on\">" . $letter . "</li>"; |
805 | 811 | } |
806 | - } |
|
807 | - elseif (!empty($GLOSSARY->alphabet[$letter])) { |
|
812 | + } elseif (!empty($GLOSSARY->alphabet[$letter])) { |
|
808 | 813 | $URL = new URL('glossary'); |
809 | 814 | $URL->insert(array('az' => $letter)); |
810 | 815 | $letter_link = $URL->generate('url'); |
811 | 816 | |
812 | 817 | $letters[] = "<li><a href=\"" . $letter_link . "\">" . $letter . "</a></li>"; |
813 | - } |
|
814 | - else { |
|
818 | + } else { |
|
815 | 819 | $letters[] = '<li>' . $letter . '</li>'; |
816 | 820 | } |
817 | 821 | } |
@@ -851,8 +855,7 @@ discard block |
||
851 | 855 | $URL->insert(array("delete_confirm" => $term['glossary_id'])); |
852 | 856 | $delete_url = $URL->generate(); |
853 | 857 | $admin_links = "<br><small><a href=\"".$delete_url."\">delete</a></small>"; |
854 | - } |
|
855 | - else { |
|
858 | + } else { |
|
856 | 859 | $admin_links = ""; |
857 | 860 | } |
858 | 861 | |
@@ -862,8 +865,7 @@ discard block |
||
862 | 865 | $user_link = $URL->generate('url'); |
863 | 866 | |
864 | 867 | $user_details = "\t\t\t\t<p><small>contributed by user <a href=\"" . $user_link . "\">" . $term['firstname'] . " " . $term['lastname'] . "</a></small>" . $admin_links . "</p>\n"; |
865 | - } |
|
866 | - else { |
|
868 | + } else { |
|
867 | 869 | $user_details = ""; |
868 | 870 | } |
869 | 871 |
@@ -19,7 +19,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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'] . ' »</a>'; |
|
571 | + $nextlink = '<a href="' . $next['url'] . '" title="' . $next['title'] . '" class="linkbutton">' . $next['body'] . ' »</a>'; |
|
572 | 572 | } else { |
573 | 573 | $nextlink = $next['body'] . ' »'; |
574 | 574 | } |
@@ -585,7 +585,7 @@ discard block |
||
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 |
||
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 |
||
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 ' <a href="' . $URL->generate() . '">More options</a>'; |
@@ -646,16 +646,16 @@ discard block |
||
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 " | "; |
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 |
||
663 | 663 | } |
664 | 664 | |
665 | 665 | print " | "; |
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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' |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | ); |
125 | 125 | $hansardmajors[104] = $hansardmajors[4]; |
126 | 126 | |
127 | -$parties = array ( |
|
127 | +$parties = array( |
|
128 | 128 | 'Bp' => 'Bishop', |
129 | 129 | 'Con' => 'Conservative', |
130 | 130 | 'CWM' => 'Deputy Speaker', |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | */ |
167 | 167 | |
168 | 168 | // Constants for various house types |
169 | -define ('HOUSE_TYPE_ROYAL', 0); |
|
170 | -define ('HOUSE_TYPE_COMMONS', 1); |
|
171 | -define ('HOUSE_TYPE_LORDS', 2); |
|
172 | -define ('HOUSE_TYPE_NI', 3); |
|
173 | -define ('HOUSE_TYPE_SCOTLAND', 4); |
|
174 | -define ('HOUSE_TYPE_WALES', 5); |
|
169 | +define('HOUSE_TYPE_ROYAL', 0); |
|
170 | +define('HOUSE_TYPE_COMMONS', 1); |
|
171 | +define('HOUSE_TYPE_LORDS', 2); |
|
172 | +define('HOUSE_TYPE_NI', 3); |
|
173 | +define('HOUSE_TYPE_SCOTLAND', 4); |
|
174 | +define('HOUSE_TYPE_WALES', 5); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | <p></p> |
17 | 17 | <?php |
18 | 18 | |
19 | -$PAGE->block_start(array ('title'=>'Share this with your friends')); |
|
19 | +$PAGE->block_start(array('title'=>'Share this with your friends')); |
|
20 | 20 | |
21 | 21 | #foi2009_sharethis_link(); |
22 | 22 | #foi2009_share_page(); |
@@ -25,4 +25,4 @@ discard block |
||
25 | 25 | |
26 | 26 | $PAGE->block_end(); |
27 | 27 | $PAGE->stripe_end(); |
28 | -$PAGE->page_end (); |
|
28 | +$PAGE->page_end(); |
@@ -7,7 +7,7 @@ |
||
7 | 7 | |
8 | 8 | $PAGE->page_start(); |
9 | 9 | $PAGE->stripe_start(); |
10 | -$PAGE->block_start(array ('id'=>'intro', 'title'=>'We need your help:')); |
|
10 | +$PAGE->block_start(array('id'=>'intro', 'title'=>'We need your help:')); |
|
11 | 11 | |
12 | 12 | echo '<div id="foi2009">'; |
13 | 13 | echo $foi2009_message; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | } elseif ($constituency == "") { |
15 | 15 | $errors['pc'] = "Sorry, " . _htmlentities($pc) . " isn't a known postcode"; |
16 | 16 | twfy_debug ('MP', "Can't display an MP, as submitted postcode didn't match a constituency"); |
17 | - } else { |
|
17 | + } else { |
|
18 | 18 | $MEMBER = new MEMBER(array('constituency' => $constituency)); |
19 | 19 | if ($MEMBER->person_id()) { |
20 | 20 | // This will cookie the postcode. |
@@ -5,7 +5,9 @@ |
||
5 | 5 | |
6 | 6 | $pc = get_http_var('pc'); |
7 | 7 | $pc = preg_replace('#[^a-z0-9 ]#i', '', $pc); |
8 | -if (!$pc) exit; |
|
8 | +if (!$pc) { |
|
9 | + exit; |
|
10 | +} |
|
9 | 11 | |
10 | 12 | if (validate_postcode($pc)) { |
11 | 13 | $constituency = strtolower(MySociety\TheyWorkForYou\Utility\Postcode::postcodeToConstituency($pc)); |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include_once '../../includes/easyparliament/init.php'; |
4 | -include_once INCLUDESPATH."easyparliament/member.php"; |
|
4 | +include_once INCLUDESPATH . "easyparliament/member.php"; |
|
5 | 5 | |
6 | 6 | $pc = get_http_var('pc'); |
7 | 7 | $pc = preg_replace('#[^a-z0-9 ]#i', '', $pc); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $errors['pc'] = "Sorry, we couldn't check your postcode right now. Please use the 'All Mps' link above to browse MPs"; |
14 | 14 | } elseif ($constituency == "") { |
15 | 15 | $errors['pc'] = "Sorry, " . _htmlentities($pc) . " isn't a known postcode"; |
16 | - twfy_debug ('MP', "Can't display an MP, as submitted postcode didn't match a constituency"); |
|
16 | + twfy_debug('MP', "Can't display an MP, as submitted postcode didn't match a constituency"); |
|
17 | 17 | } else { |
18 | 18 | $MEMBER = new MEMBER(array('constituency' => $constituency)); |
19 | 19 | if ($MEMBER->person_id()) { |
@@ -27,5 +27,5 @@ discard block |
||
27 | 27 | } |
28 | 28 | } else { |
29 | 29 | $errors['pc'] = "Sorry, " . _htmlentities($pc) . " isn't a valid postcode"; |
30 | - twfy_debug ('MP', "Can't display an MP because the submitted postcode wasn't of a valid form."); |
|
30 | + twfy_debug('MP', "Can't display an MP because the submitted postcode wasn't of a valid form."); |
|
31 | 31 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | <?php |
17 | 17 | } |
18 | 18 | |
19 | -$PAGE->block_start(array ('title'=>'Share the \'Free our Bills!\' campaign')); |
|
19 | +$PAGE->block_start(array('title'=>'Share the \'Free our Bills!\' campaign')); |
|
20 | 20 | freeourbills_styles(); |
21 | 21 | |
22 | 22 | freeourbills_share_page(); |
@@ -25,4 +25,4 @@ discard block |
||
25 | 25 | |
26 | 26 | $PAGE->block_end(); |
27 | 27 | $PAGE->stripe_end(); |
28 | -$PAGE->page_end (); |
|
28 | +$PAGE->page_end(); |
@@ -144,4 +144,4 @@ |
||
144 | 144 | <?php |
145 | 145 | #$PAGE->block_end(); |
146 | 146 | $PAGE->stripe_end(); |
147 | -$PAGE->page_end (); |
|
147 | +$PAGE->page_end(); |
@@ -138,4 +138,4 @@ |
||
138 | 138 | 'type' => 'html', |
139 | 139 | 'content' => '<p align="center"><img title="Duck-billed platypus" src="bill3.jpg" alt="" hspace="10"></p>' |
140 | 140 | ))); |
141 | -$PAGE->page_end (); |
|
141 | +$PAGE->page_end(); |
@@ -16,8 +16,9 @@ discard block |
||
16 | 16 | $email = get_http_var('email'); |
17 | 17 | $sign = get_http_var('sign'); |
18 | 18 | $pid = get_http_var('pid'); |
19 | -if (!$pid || !ctype_digit($pid)) print 'not valid'; |
|
20 | -else { |
|
19 | +if (!$pid || !ctype_digit($pid)) { |
|
20 | + print 'not valid'; |
|
21 | +} else { |
|
21 | 22 | $authed = auth_verify_with_shared_secret($email, OPTION_AUTH_SHARED_SECRET, $sign); |
22 | 23 | if ($authed) { |
23 | 24 | $db = new ParlDB; |
@@ -26,10 +27,11 @@ discard block |
||
26 | 27 | ':criteria' => 'speaker:' . $pid |
27 | 28 | )); |
28 | 29 | $already_signed = $q->rows(); |
29 | - if ($already_signed) |
|
30 | - print "already signed"; |
|
31 | - else |
|
32 | - print "not signed"; |
|
30 | + if ($already_signed) { |
|
31 | + print "already signed"; |
|
32 | + } else { |
|
33 | + print "not signed"; |
|
34 | + } |
|
33 | 35 | } else { |
34 | 36 | print "not authed"; |
35 | 37 | } |