Hot answers tagged plugin-gd-star-rating
3
It seems GD Star Rating uses get_query_var() to read query variables, which only reads this global $wp_query variable. query_posts() overwrites the global $wp_query variable, so it works there, but creating a new WP_Query (which is a good practice) will not work. You should contact the plugin author and ask for a fix.
3
The posts_where filters the 'WHERE' part of the SQL statement, and not the query string. So
$where .= "&post_date > '".date('Y-m-d H:i:s', strtotime('-24 hours'))."'";
should be
$where .= " AND post_date > '".date('Y-m-d H:i:s', strtotime('-24 hours'))."'";
Also as this hook is fired for every query (admin and public side), you should use ...
2
The plugin supports this feature by default. Searching for "gd star ratings custom images" finds lots of information including this guide on the official site. Apparently the GD Stars User Guide contains full instructions on creating new image sets as well as some pre-built ones you can use.
1
You need to add the global $wpdb reference and also add the second parameter required for prepare():
global $wpdb;
$post_id = $post->ID;
$reviewScore = $wpdb->query(
$wpdb->prepare(
"SELECT review FROM {$wpdb->prefix}gdsr_data_article WHERE post_id = %d",
$post_id
)
);
1
Untested as I don't have the plugin installed. But I'd say this would be a better way to do it rather than using query_posts()
global $wp_query;
// Get the existing query and add in extra query args
$query = array_merge( $wp_query->query, array( 'gdsr_sort' => 'thumbs', 'posts_per_page' => 10 ) );
// Apply our filter
add_filter( 'posts_where', ...
1
i wrote this plugin a while back for a client and never got around to polishing it off for general release.
https://github.com/dwenaus/bp-rate-vote-like-anything
Myself and another developer plan to launch it soon. But even as it is now, it's totally solid and very cleanly coded. I wrote it because GD Star Rating plugin was so bloated. Basically it ...
1
there are varaiables in gd rating to sort query.
you can use in URL like :
http://www.gdstarrating.com/?gdsr_sort=rating&gdsr_order=desc
http://www.gdstarrating.com/?gdsr_sort=review&gdsr_order=desc
http://www.gdstarrating.com/category/tutorials/?gdsr_sort=votes&gdsr_order=asc
or pass to a query
query_posts("gdsr_sort=rating");
...
1
After some googling and trial and error, here is the solution:
add_action("gdsr_vote_thumb_article", "cubepoints_vote_up_down", 10, 4);
function cubepoints_vote_up_down() {
global $bp;
cp_points('star_rating', cp_currentUser(), 1, $data);
}
add_action('cp_logs_description','cp_admin_logs_desc_star_rating', 10, 4);
function ...
1
First 2 results on googling for "gd star rating sort posts by rating' are:
How to Sort Post by Gd Star Rating Mirror
How to reorder posts Mirror
Few examples:
query_posts("gdsr_sort=rating");
query_posts("gdsr_sort=review&sort_order=asc");
query_posts("gdsr_sort=rating&gdsr_multi=3");
...
Only top voted, non community-wiki answers of a minimum length are eligible