wpDiscuz - WordPress Comment Plugin
Nombre de Rating Ar...
 
Share:
Notifications
Clear all

Nombre de Rating Article

8 Posts
2 Users
1 Likes
38 Views
Posts: 4
Topic starter
(@marvern)
Active Member
Joined: 1 week ago

Bonjour, 

Suite à l'installation de votre plugin, est il possible d'obtenir le nombre total de personne ayant cliqué et noté avec le "Article Rating" 
 
Cas d'usage : Site de tutoriel Automobile. Nous pourrions savoir le nombre de voiture réparé en fonction du nombre de personnes ayant noté les articles. 
 
Merci d'avance, 
 
Bien cordialement 
Topic Tags
7 Replies
Asti
Posts: 5779
 Asti
Support
(@asti)
Illustrious Member
Joined: 5 years ago

Hi @marvern,

You just need to hover over the "Rating" section, you'll see the number of votes. Please watch this video: https://www.screencast.com/t/lhR2yNXRw

 

Reply
Posts: 4
Topic starter
(@marvern)
Active Member
Joined: 1 week ago

Hi @Asti, Thanks. I know but I need to know the total number of people that added a note in all the post website. 

Reply
1 Reply
Asti
 Asti
Support
(@asti)
Joined: 5 years ago

Illustrious Member
Posts: 5779

ok @marvern,

So please confirm that you need to display the number of ratings for all articles. 

If so, show on some screenshots where exactly you need to display the number of ratings. 

Reply
Posts: 4
Topic starter
(@marvern)
Active Member
Joined: 1 week ago

@Asti This is an exemple of application. I need to know how many people are voting on all the post. 

Exemple : 

1) Tuto How to change oil on toyota ( 15peoples voting)

2) Tuto How to change rear bulb on Peugeot 206 ( 3 peoples voting)

So 18 car fixed. 

test
Reply
3 Replies
Asti
 Asti
Support
(@asti)
Joined: 5 years ago

Illustrious Member
Posts: 5779

ok @marvern,

Thank you for he clarification. I'll ask the developers and get back to you ASAP. 

Reply
Asti
 Asti
Support
(@asti)
Joined: 5 years ago

Illustrious Member
Posts: 5779

@marvern,

Please follow the steps below: 

1. Add this code in the functions.php file of the active theme:

add_shortcode('wpdiscuz_all_ratings', 'wpdiscuz_get_all_ratings');
function wpdiscuz_get_all_ratings(){
    global $wpdb;
    $ratings_count = (int)$wpdb->get_var("SELECT COUNT(*) FROM `{$wpdb->prefix}wc_users_rated`");
    echo 'Ratings Count - ' . $ratings_count;
}

2. Then use the following shortcode to display the total number of ratings for all articles: 

[wpdiscuz_all_ratings]
Reply
(@marvern)
Joined: 1 week ago

Active Member
Posts: 4

@asti Thanks you asti. I will try to implement it 🙂

Reply
Share: