@@ -11,7 +11,7 @@ |
||
11 | 11 | $view = new MySociety\TheyWorkForYou\SectionView\WransView(); |
12 | 12 | $data = $view->display(); |
13 | 13 | if ($data) { |
14 | - if ( $data['template'] ) { |
|
14 | + if ($data['template']) { |
|
15 | 15 | $template = $data['template']; |
16 | 16 | } else { |
17 | 17 | $template = 'section/section'; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | if (!$dept) { |
13 | 13 | } else { |
14 | - $dept = strtolower(str_replace('_',' ',$dept)); |
|
14 | + $dept = strtolower(str_replace('_', ' ', $dept)); |
|
15 | 15 | $q = $db->query('select epobject.epobject_id from hansard,epobject |
16 | 16 | where hansard.epobject_id=epobject.epobject_id and major=3 and section_id=0 |
17 | 17 | and hdate>(select max(hdate) from hansard where major=3) - interval 7 day |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | ':dept' => $dept |
20 | 20 | )); |
21 | 21 | $ids = array(); |
22 | - for ($i=0; $i<$q->rows(); $i++) { |
|
22 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
23 | 23 | $ids[] = $q->field($i, 'epobject_id'); |
24 | 24 | } |
25 | 25 | |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | and section_id in (' . join(',', $ids) . ') |
31 | 31 | order by body'); |
32 | 32 | print '<ul>'; |
33 | - for ($i=0; $i<$q->rows(); $i++) { |
|
34 | - print '<li><a href="/wrans/?id=' . fix_gid_from_db($q->field($i, 'gid')). '">' . $q->field($i, 'body'). '</a>'; |
|
33 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
34 | + print '<li><a href="/wrans/?id=' . fix_gid_from_db($q->field($i, 'gid')) . '">' . $q->field($i, 'body') . '</a>'; |
|
35 | 35 | print '</li>'; |
36 | 36 | } |
37 | 37 | print '</ul>'; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | if (!$dept) { |
13 | 13 | } else { |
14 | - $dept = strtolower(str_replace('_',' ',$dept)); |
|
14 | + $dept = strtolower(str_replace('_', ' ', $dept)); |
|
15 | 15 | $q = $db->query('select epobject.epobject_id from hansard,epobject |
16 | 16 | where hansard.epobject_id=epobject.epobject_id and major=4 and section_id=0 |
17 | 17 | and hdate>(select max(hdate) from hansard where major=4) - interval 7 day |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | ':dept' => $dept |
20 | 20 | )); |
21 | 21 | $ids = array(); |
22 | - for ($i=0; $i<$q->rows(); $i++) { |
|
22 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
23 | 23 | $ids[] = $q->field($i, 'epobject_id'); |
24 | 24 | } |
25 | 25 | |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | and section_id in (' . join(',', $ids) . ') |
31 | 31 | order by body'); |
32 | 32 | print '<ul>'; |
33 | - for ($i=0; $i<$q->rows(); $i++) { |
|
34 | - print '<li><a href="/wms/?id=' . fix_gid_from_db($q->field($i, 'gid')). '">' . $q->field($i, 'body'). '</a>'; |
|
33 | + for ($i = 0; $i < $q->rows(); $i++) { |
|
34 | + print '<li><a href="/wms/?id=' . fix_gid_from_db($q->field($i, 'gid')) . '">' . $q->field($i, 'body') . '</a>'; |
|
35 | 35 | print '</li>'; |
36 | 36 | } |
37 | 37 | print '</ul>'; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $sysretval = 0; |
108 | 108 | $personid = get_http_var('editperson'); |
109 | 109 | |
110 | - $q = $db->query("DELETE FROM personinfo WHERE data_key = 'mp_website' AND personinfo.person_id = :person_id", array( |
|
110 | + $q = $db->query("DELETE FROM personinfo WHERE data_key = 'mp_website' AND personinfo.person_id = :person_id", array( |
|
111 | 111 | ':person_id' => $personid |
112 | 112 | )); |
113 | 113 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | if ($q->success()) { |
122 | 122 | exec($scriptpath . "/db2xml.pl --update_person --personid=" . escapeshellarg($personid) . " --debug", $exec_output); |
123 | 123 | $out = '<p id="warning">'; |
124 | - foreach ($exec_output as $message) {$out .= $message . "<br>";} |
|
124 | + foreach ($exec_output as $message) {$out .= $message . "<br>"; } |
|
125 | 125 | $out .= '</p>'; |
126 | 126 | # ../../../scripts/db2xml.pl --update_person --personid=10001 |
127 | 127 | } |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | |
141 | 141 | $rettext .= '<div id="subnav_websites">'; |
142 | 142 | foreach ($subnav as $label => $path) { |
143 | - $rettext .= '<a href="'. $path . '">'. $label .'</a>'; |
|
143 | + $rettext .= '<a href="' . $path . '">' . $label . '</a>'; |
|
144 | 144 | } |
145 | - $rettext .= '</div>'; |
|
145 | + $rettext .= '</div>'; |
|
146 | 146 | |
147 | 147 | return $rettext; |
148 | 148 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include_once '../../includes/easyparliament/init.php'; |
4 | -include_once (INCLUDESPATH."easyparliament/searchlog.php"); |
|
4 | +include_once (INCLUDESPATH . "easyparliament/searchlog.php"); |
|
5 | 5 | |
6 | 6 | $this_page = "admin_popularsearches"; |
7 | 7 | |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | |
15 | 15 | $rows = array(); |
16 | 16 | foreach ($search_popular as $row) { |
17 | - $rows[] = array ( |
|
18 | - '<a href="'.$row['url'].'">' . _htmlentities($row['query']) . '</a>', |
|
17 | + $rows[] = array( |
|
18 | + '<a href="' . $row['url'] . '">' . _htmlentities($row['query']) . '</a>', |
|
19 | 19 | $row['c'], |
20 | 20 | ); |
21 | 21 | } |
22 | 22 | |
23 | -$tabledata = array ( |
|
24 | - 'header' => array ( |
|
23 | +$tabledata = array( |
|
24 | + 'header' => array( |
|
25 | 25 | 'Query', |
26 | 26 | 'Count' |
27 | 27 | ), |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include_once '../../includes/easyparliament/init.php'; |
4 | -include_once (INCLUDESPATH."easyparliament/searchlog.php"); |
|
4 | +include_once (INCLUDESPATH . "easyparliament/searchlog.php"); |
|
5 | 5 | |
6 | 6 | $this_page = "admin_searchlogs"; |
7 | 7 | |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | $host = trim_characters($host, strlen($host) - 25, 100); |
19 | 19 | $time = relative_time($row['query_time']); |
20 | 20 | $time = str_replace(" ago", "", $time); |
21 | - $rows[] = array ( |
|
22 | - '<a href="'.$row['url'].'">' . _htmlentities($row['query']) . '</a>', |
|
21 | + $rows[] = array( |
|
22 | + '<a href="' . $row['url'] . '">' . _htmlentities($row['query']) . '</a>', |
|
23 | 23 | $row['page_number'], |
24 | 24 | $row['count_hits'], |
25 | 25 | $host, |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | ); |
28 | 28 | } |
29 | 29 | |
30 | -$tabledata = array ( |
|
31 | - 'header' => array ( |
|
30 | +$tabledata = array( |
|
31 | + 'header' => array( |
|
32 | 32 | 'Query', |
33 | 33 | 'Page', |
34 | 34 | 'Hits', |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include_once '../../includes/easyparliament/init.php'; |
4 | -include_once (INCLUDESPATH."easyparliament/searchlog.php"); |
|
4 | +include_once (INCLUDESPATH . "easyparliament/searchlog.php"); |
|
5 | 5 | |
6 | 6 | $this_page = "admin_failedsearches"; |
7 | 7 | |
@@ -20,17 +20,17 @@ discard block |
||
20 | 20 | $max_time = relative_time($row['max_time']); |
21 | 21 | $min_time = str_replace(" ago", "", $min_time); |
22 | 22 | $max_time = str_replace(" ago", "", $max_time); |
23 | - $rows[] = array ( |
|
23 | + $rows[] = array( |
|
24 | 24 | $row['count_ips'], |
25 | 25 | $row['group_count'], |
26 | - '<a href="'.$row['url'].'">'._htmlentities($row['query']).'</a>', |
|
26 | + '<a href="' . $row['url'] . '">' . _htmlentities($row['query']) . '</a>', |
|
27 | 27 | $max_time, |
28 | 28 | $min_time, |
29 | 29 | ); |
30 | 30 | } |
31 | 31 | |
32 | -$tabledata = array ( |
|
33 | - 'header' => array ( |
|
32 | +$tabledata = array( |
|
33 | + 'header' => array( |
|
34 | 34 | 'Distinct IPs', |
35 | 35 | 'Number of times', |
36 | 36 | 'Query', |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include_once '../../includes/easyparliament/init.php'; |
4 | -include_once (INCLUDESPATH."easyparliament/commentreportlist.php"); |
|
4 | +include_once (INCLUDESPATH . "easyparliament/commentreportlist.php"); |
|
5 | 5 | |
6 | 6 | $this_page = "admin_home"; |
7 | 7 | |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | $q = $db->query("SELECT COUNT(*) AS count FROM users WHERE confirmed = '0'"); |
23 | 23 | $unconfirmedusers = $q->field(0, 'count'); |
24 | 24 | |
25 | -$olddate = gmdate("Y-m-d H:i:s", time()-86400); |
|
25 | +$olddate = gmdate("Y-m-d H:i:s", time() - 86400); |
|
26 | 26 | $q = $db->query("SELECT COUNT(*) AS count FROM users WHERE lastvisit > '$olddate'"); |
27 | 27 | $dayusers = $q->field(0, 'count'); |
28 | 28 | |
29 | -$olddate = gmdate("Y-m-d H:i:s", time()-86400*7); |
|
29 | +$olddate = gmdate("Y-m-d H:i:s", time() - 86400 * 7); |
|
30 | 30 | $q = $db->query("SELECT COUNT(*) AS count FROM users WHERE lastvisit > '$olddate'"); |
31 | 31 | $weekusers = $q->field(0, 'count'); |
32 | 32 | ?> |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $rows = array(); |
62 | 62 | $USERURL = new URL('userview'); |
63 | 63 | |
64 | -for ($row=0; $row<$q->rows(); $row++) { |
|
64 | +for ($row = 0; $row < $q->rows(); $row++) { |
|
65 | 65 | |
66 | 66 | $user_id = $q->field($row, 'user_id'); |
67 | 67 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $name = _htmlspecialchars($q->field($row, 'firstname') . ' ' . $q->field($row, 'lastname')); |
77 | 77 | } |
78 | 78 | |
79 | - $rows[] = array ( |
|
79 | + $rows[] = array( |
|
80 | 80 | $name, |
81 | 81 | '<a href="mailto:' . $q->field($row, 'email') . '">' . $q->field($row, 'email') . '</a>', |
82 | 82 | $confirmed, |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | ); |
85 | 85 | } |
86 | 86 | |
87 | -$tabledata = array ( |
|
88 | - 'header' => array ( |
|
87 | +$tabledata = array( |
|
88 | + 'header' => array( |
|
89 | 89 | 'Name', |
90 | 90 | 'Email', |
91 | 91 | 'Confirmed?', |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include_once '../../includes/easyparliament/init.php'; |
4 | -include_once (INCLUDESPATH."easyparliament/commentreportlist.php"); |
|
4 | +include_once (INCLUDESPATH . "easyparliament/commentreportlist.php"); |
|
5 | 5 | |
6 | 6 | $this_page = "admin_badusers"; |
7 | 7 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $rows = array(); |
33 | 33 | $USERURL = new URL('userview'); |
34 | 34 | |
35 | -for ($row=0; $row<$q->rows(); $row++) { |
|
35 | +for ($row = 0; $row < $q->rows(); $row++) { |
|
36 | 36 | |
37 | 37 | $user_id = $q->field($row, 'user_id'); |
38 | 38 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $totalcomments = $r->field(0, 'totalcount'); |
45 | 45 | |
46 | - $percentagedeleted = ( $q->field($row, 'deletedcount') / $totalcomments ) * 100; |
|
46 | + $percentagedeleted = ($q->field($row, 'deletedcount') / $totalcomments) * 100; |
|
47 | 47 | |
48 | 48 | |
49 | 49 | // Get complaints made about this user's comments, but not upheld. |
@@ -59,17 +59,17 @@ discard block |
||
59 | 59 | |
60 | 60 | $USERURL->insert(array('u'=>$user_id)); |
61 | 61 | |
62 | - $rows[] = array ( |
|
62 | + $rows[] = array( |
|
63 | 63 | '<a href="' . $USERURL->generate() . '">' . $q->field($row, 'firstname') . ' ' . $q->field($row, 'lastname') . '</a>', |
64 | 64 | $totalcomments, |
65 | 65 | $q->field($row, 'deletedcount'), |
66 | - $percentagedeleted.'%', |
|
66 | + $percentagedeleted . '%', |
|
67 | 67 | $notupheldcount |
68 | 68 | ); |
69 | 69 | } |
70 | 70 | |
71 | -$tabledata = array ( |
|
72 | - 'header' => array ( |
|
71 | +$tabledata = array( |
|
72 | + 'header' => array( |
|
73 | 73 | 'Name', |
74 | 74 | 'Total comments', |
75 | 75 | 'Number deleted', |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $rows = array(); |
106 | 106 | $USERURL = new URL('userview'); |
107 | 107 | |
108 | -for ($row=0; $row<$q->rows(); $row++) { |
|
108 | +for ($row = 0; $row < $q->rows(); $row++) { |
|
109 | 109 | |
110 | 110 | $user_id = $q->field($row, 'user_id'); |
111 | 111 | |
@@ -117,15 +117,15 @@ discard block |
||
117 | 117 | WHERE user_id = '$user_id' |
118 | 118 | AND upheld = '1'"); |
119 | 119 | |
120 | - $rows[] = array ( |
|
120 | + $rows[] = array( |
|
121 | 121 | '<a href="' . $USERURL->generate() . '">' . $q->field($row, 'firstname') . ' ' . $q->field($row, 'lastname') . '</a>', |
122 | 122 | $q->field($row, 'rejectedcount'), |
123 | 123 | $r->field(0, 'upheldcount') |
124 | 124 | ); |
125 | 125 | |
126 | 126 | } |
127 | -$tabledata = array ( |
|
128 | - 'header' => array ( |
|
127 | +$tabledata = array( |
|
128 | + 'header' => array( |
|
129 | 129 | 'Name', |
130 | 130 | 'Reports not upheld', |
131 | 131 | 'Reports upheld' |