I'm using the GD Star Rating plugin and the bbPress plugin. The first plugin do have a argument to sort posts by number of votes. But unfortunately, It doesn't work with
WP_Query (and apparently the bbPress loop uses it).
That's why I wanted to create my own way of sorting custom post types in a custom loop.
Let's say I have a function or a variable that outputs the number of votes of each post:
<?php votes_number(); ?> or $votes_number
How can I use them in something like this:
query_posts( "orderby=votes_number" );
query_posts( "my_custom_orderby=votes_number" );