The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Question [Solved] Display user likes on one page
✦ Summarize Topic
✦
✦
✦
AI is analyzing the discussion...
Topic starter
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
Jan 27, 2023 1:34 pm
(@leo69)
Eminent Member
Joined: 3 years ago
Hello
Good time
With change in this piece of function code Dear Asti , is it possible for the user to be able to see all the comments he liked or disliked on the page?
add_shortcode('wpdiscuz_likes', 'wpdiscuz_current_user_likes');
function wpdiscuz_current_user_likes(){
global $wpdb,$user_ID;
if(!$user_ID){
return;
} $like_count = (int)$wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM `{$wpdb->prefix}wc_users_voted` WHERE `vote_type` = 1 AND `user_id` = %d", $user_ID));
$dislike_count = (int)$wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM `{$wpdb->prefix}wc_users_voted` WHERE `vote_type` = -1 AND `user_id` = %d", $user_ID)); echo 'Like Count - ' . $like_count .' Dislike Count - ' . $dislike_count;}
Support
Translate
▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Show original
Translating...
Jan 27, 2023 3:49 pm
(@asti)
Illustrious Member
Joined: 8 years ago
@mandegar266,
I'd suggest you check out the following two addons:
- wpDiscuz – Comment Author Info. The addon allows seeing comment author extended profiles, activity, votes and subscriptions
- wpDiscuz – Advanced Likers. The addon opens a pop-up window with all voters/likes of the current comment.