Index: vote_up_down.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/vote_up_down/vote_up_down.module,v
retrieving revision 1.19
diff -r1.19 vote_up_down.module
177a178,183
>     $items[] = array(
>       'path' => 'voteupdown/nodesvotes',
>       'title' => t('Content by votes'),
>       'callback' => 'vote_up_down_page',
>       'access' => user_access('access up-down vote statistic'),
>     );
333a340,342
>     case 'nodesvotes':
>       $output = vote_up_down_content_votes();
>       break;
335a345
>       $items[] = l(t('Content by votes'), 'voteupdown/nodesvotes');
370a381,409
>  * Nodes votes page for the vote_up_down data
>  */
> function vote_up_down_content_votes() {
>   $sql = "SELECT COUNT(v.value) AS number_votes, SUM(v.value) AS total_votes, n.title, n.nid, t.name AS type FROM ({votingapi_vote} v INNER JOIN {node} n ON v.content_id=n.nid) INNER JOIN {node_type} t ON n.type=t.type WHERE v.tag = '%s' GROUP BY t.name, n.title";
>   $sql_cnt = "SELECT COUNT(DISTINCT(content_id)) FROM {votingapi_vote}";
>   $header = array(
>     array('data' => t('Title'), 'field' => 'n.title'),
>     array('data' => t('Type'), 'field' => 't.name'),
>     array('data' => t('Votes'), 'field' => 'number_votes', 'sort' => 'desc'),
>     array('data' => t('Vote sum'), 'field' => 'total_votes'),
>   );
>   $sql .= tablesort_sql($header);
>   $result = pager_query($sql, 30, 0, $sql_cnt, variable_get('vote_up_down_tag', 'vote'));
>   while ($vote = db_fetch_object($result)) {
>     $rows[] = array(
>       l($vote->title, '/node/' . $vote->nid),
>       ucfirst($vote->type),
>       $vote->number_votes,
>       $vote->total_votes
>     );
>   }
>   drupal_set_title(t('Content by votes'));
>   $output = theme('table', $header, $rows);
>   $output .= theme('pager', NULL, 30, 0);
> 
>   return $output;
> }
> 
> /*
