Running on a Fedora 5 box, MySQL=5.0.22, PHP=5.1.4

I started out by installing the action, VotingAPI, and all the other modules recommended by the author. I was able to get the voting buttons to display, and the votes are tallied each time. What isn't working, is trying to sort the nodes by the vote totals. I set the "frontpage" view as the default view, and then I added the vote total as a sort criteria. When I refresh the view, any story that has votes is duplicated on the page. If I remove the sorting criteria, and just sort by date, it works fine. If I turn back on the vote total sorting, then I get duplicates.

Anyone seen this? Any thoughts on where in the code I can look?

Thanks,
Kevin

Comments

nerdymark’s picture

That is exactly the problem I'm getting whenever I try. I get duplicates.

chrishaslam’s picture

I was having the same issue, to get rid of the duplicates and have a view ordered by total votes and within a timeframe I did the following:

Filters
Node: Created Time | Is Greater Than | now(value) | -604800 (Option)
This just shows nodes from within the last week (604800 seconds)

Node: Type | Is One Of | story (to just show stories and not static pages)

VotingAPI: Result function | Is | Number of votes

Sort Criteria
Voting result | Descending

--------------------------------------------------------
http://www.AnfieldRed.co.uk

---------------------------
Managed Drupal hosting from Ixis IT

budda’s picture

This solution doesn't work for Drupal 5.x - there's no longer a VotingAPI Result function option under Views filters now.

Anybody know what to use now? It's all a bit trial-and-error.

marcoBauli’s picture

hmm... seems sorting nodes by their average value does not work too well here:

nodes with an average vote of 1 are displayed before those with avrg vote of 2..then 1s again..

(you can check at http://webhost.aconfronto.com/top/delmese/web%20host )

tryed also adding an extra votingapi filter, but nothing, does everything work fine for you _chris?

Follows my view:

$view = new stdClass();
$view->name = 'cat_top_delmese';
$view->description = 'Cat: top del mese';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Top Del Mese';
$view->page_header = '';
$view->page_header_format = '2';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '2';
$view->page_type = 'teaser';
$view->url = 'view/top/delmese';
$view->use_pager = TRUE;
$view->nodes_per_page = '15';
$view->sort = array (
array (
'tablename' => 'votingapi_cache',
'field' => 'value',
'sortorder' => 'DESC',
'options' => '',
),
);
$view->argument = array (
array (
'type' => 'taxid',
'argdefault' => '1',
'title' => '%1',
'options' => '1',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'node',
'field' => 'created',
'operator' => '>=',
'options' => '-2592000',
'value' => 'now',
),
array (
'tablename' => 'node',
'field' => 'distinct',
'operator' => '=',
'options' => '',
'value' => array (
0 => 'distinct',
),
),
array (
'tablename' => 'votingapi_cache',
'field' => 'function',
'operator' => '=',
'options' => '',
'value' => 'count',
),
);
$view->exposed_filter = array (
);
$view->requires = array(votingapi_cache, node);
$views[$view->name] = $view;

Thanks for any help!