Commit 723c4900 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

Although #64388 is not applicable here, a db_rewrite_sql() was missing from...

Although #64388 is not applicable here, a db_rewrite_sql() was missing from the counter query on the poll page, so fixed that
parent ef5fd345
......@@ -11,10 +11,9 @@
*/
function poll_page() {
// List all polls.
$sql = "SELECT n.nid, n.title, p.active, n.created, SUM(c.chvotes) AS votes FROM {node} n INNER JOIN {poll} p ON n.nid = p.nid INNER JOIN {poll_choices} c ON n.nid = c.nid WHERE n.status = 1 GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC";
$sql = db_rewrite_sql("SELECT n.nid, n.title, p.active, n.created, SUM(c.chvotes) AS votes FROM {node} n INNER JOIN {poll} p ON n.nid = p.nid INNER JOIN {poll_choices} c ON n.nid = c.nid WHERE n.status = 1 GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC");
// Count all polls for the pager.
$count_sql = 'SELECT COUNT(*) FROM {node} n INNER JOIN {poll} p ON n.nid = p.nid WHERE n.status = 1';
$sql = db_rewrite_sql($sql);
$count_sql = db_rewrite_sql('SELECT COUNT(*) FROM {node} n INNER JOIN {poll} p ON n.nid = p.nid WHERE n.status = 1');
$result = pager_query($sql, 15, 0, $count_sql);
$output = '<ul>';
while ($node = db_fetch_object($result)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment