diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-14 09:50:41 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-14 09:50:41 +0000 |
commit | 723c4900895983b267bb41d8155f8f88ef9de889 (patch) | |
tree | b28e79076bccfa4fdb11df964d841ef6407989d3 /modules/poll | |
parent | ef5fd34577700d514c82ec9b5a579fad0b99efad (diff) | |
download | brdo-723c4900895983b267bb41d8155f8f88ef9de889.tar.gz brdo-723c4900895983b267bb41d8155f8f88ef9de889.tar.bz2 |
Although #64388 is not applicable here, a db_rewrite_sql() was missing from the counter query on the poll page, so fixed that
Diffstat (limited to 'modules/poll')
-rw-r--r-- | modules/poll/poll.pages.inc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/poll/poll.pages.inc b/modules/poll/poll.pages.inc index 45c76e95f..597073578 100644 --- a/modules/poll/poll.pages.inc +++ b/modules/poll/poll.pages.inc @@ -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)) { |