theyuv
asked 7 years ago

Hello,
 
I override the dwqa-single-question.js file in my site so that I can display a dialog if the user tries to vote when he’s not logged in.
 
Currently, I check for this by checking if the data returned equals zero:

success: function( data ) {
                console.log(data);
                if (data.success) {
                    parent.find('.dwqa-vote-count').text(data.data.vote);
                }
elseif(data === 0) {
// show dialog
}
            }

Is there a better way to detect if the user is not logged in when he attempted to vote?

I looked at the dwqa_action_vote function in Base.php but I don’t see where anything is returned if the user is not logged in.

Thank you

1 Answers
Kevin
answered 7 years ago

Hi,

At present, the user who is not logged in can’t vote. If you want this feature on your site, I can do it for you as a custom work.

cali949
replied 7 years ago

How much would you charge to add the feature for non logged in users to vote?

theyuv
replied 7 years ago

Hey, thank you.

I think you misunderstood my question.
I actually just wanted a dialog to come up when someone who’s not a user tries to vote (telling him he should register).
But I figured out a way to do this without javascript.

Thank you.

Powered by DW Question & Answer Pro