diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-01-19 01:46:25 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-01-19 01:46:25 +0000 |
commit | 09bd156ba212f56cc62de85c53f14127c719522b (patch) | |
tree | 226933be541577bc1d347cd1ae02c7a18b155673 /modules/poll | |
parent | 86af977ecaebbed31d2897bdf6f3b829b0be924c (diff) | |
download | brdo-09bd156ba212f56cc62de85c53f14127c719522b.tar.gz brdo-09bd156ba212f56cc62de85c53f14127c719522b.tar.bz2 |
- Fix tracker pager count query being wrong (it did not return a count but a set, and it counted nodes with more than 1 comment as multiple nodes).
- Clean up various SQL queries: removing literally inserted data (db_escape_string is evil!), fixing single "%" which should be "%%", fixing integers being compared as strings.
Diffstat (limited to 'modules/poll')
-rw-r--r-- | modules/poll/poll.module | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 38827db67..dc8e517e6 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -265,7 +265,7 @@ function poll_node_name($node) { 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 type = 'poll' AND status = 1 AND moderate = 0 GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC"; + $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 type = 'poll' AND status = 1 AND moderate = 0 GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC"; $sql = node_rewrite_sql($sql); $result = pager_query($sql, 15); $output = '<ul>'; |