Commit 49f41239 authored by Dries's avatar Dries

- Fixed two SQL bugs in the queue.module. Fixes #14115.

parent 05ede217
......@@ -123,8 +123,7 @@ function queue_overview() {
$header = array(array('data' => t('Subject')), array('data' => t('Author')), array('data' => t('Type')), array('data' => t('Score')));
$sresult = pager_query('SELECT DISTINCT(n.nid), n.title, n.type, u.name, u.uid, SUM(IF(q.uid=%d,1,0)) AS voted, SUM(q.vote) AS score FROM {node} n '. node_access_join_sql() .' INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {queue} q ON n.nid = q.nid WHERE n.moderate = 1 AND '. node_access_where_sql(), 10, 0,
'SELECT DISTINCT(n.nid) FROM {node} n '. node_access_join_sql() .' WHERE n.moderate = 1 AND '. node_access_where_sql(), $user->uid);
$sresult = pager_query('SELECT DISTINCT(n.nid), n.title, n.type, u.name, u.uid, SUM(IF(q.uid = %d, 1, 0)) AS voted, SUM(q.vote) AS score FROM {node} n '. node_access_join_sql() .' INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {queue} q ON n.nid = q.nid WHERE n.moderate = 1 AND '. node_access_where_sql() .' GROUP BY n.nid, n.title, n.type, u.name, u.uid, q.uid, q.vote', 10, 0, 'SELECT DISTINCT(n.nid) FROM {node} n '. node_access_join_sql() .' INNER JOIN {queue} q ON n.nid = q.nid WHERE n.moderate = 1 AND '. node_access_where_sql(), $user->uid);
while ($node = db_fetch_object($sresult)) {
if ($user->uid == $node->uid || $node->voted) {
......
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