wpDiscuz - WordPress Comment Plugin
Share:
Notifications
Clear all

[Solved] Allow multi voting?


Egg
Posts: 5
 Egg
Topic starter
(@egg)
Active Member
Joined: 10 months ago

Dear all,

we have a special environment and we would like to use wpdiscuz.

Our environment: all guests uses one computer / terminal as "guest" (no login). So everyone should be able to comment, vote and so on.

Therefore we have to deactivate any code which prevents multi vote, locks same user to do something twice, or even set a cookie with the name.

Any hints where to find the functions?

Thank you,

Michael

4 Replies
Asti
Posts: 3556
 Asti
Support
(@asti)
Support member
Joined: 4 years ago

Hi @egg,

Please use this code:

add_filter('pre_comment_user_ip', function(){
    if(!is_user_logged_in()){
        return md5(uniqid());
    }
});

Put it in the active theme functions.php file. More information on how to add insert custom code.

Egg
Posts: 5
 Egg
Topic starter
(@egg)
Active Member
Joined: 10 months ago

@Asti: Perfect! So I can put this in a plugin 🙂

Thank you for the fast help.

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

Support member
Posts: 3556

@egg,

Not in a plugin just in the current active theme functions.php file.

Egg
Posts: 5
 Egg
Topic starter
(@egg)
Active Member
Joined: 10 months ago

I understand. But if I use it in a custom plugin, I can change / update my themes. Again: Thank you 🙂

Share: