asked 8 years ago

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 ) {
                if (data.success) {
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
answered 8 years ago


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.

replied 8 years ago

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

replied 8 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