Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
in Q2A Core by

I have been testing the email confirmation tool and it works very well. However, it misses the Q2A redirect. Before that if I try to "ask a question" and I am not registered I was given the option to register and after registering I was returned to the page to "ask" a question. The same happened with several different  pages. Basically, the q2a saved as a parameter "to" the page I had been before being directed to registration [see the kind answer of @pupi1985 about this http://www.question2answer.org/qa/43787/how-does-the-redirect-work-after-registration]. After turned on the email confirmation tool for my site, this redirect disappears.

1) Are people worried about this?

2) Is there a way to fix this?

Q2A version: 1.7.0

2 Answers

+3 votes
selected by
Best answer

I thought by "Email confirmation tool" that it was a plugin but you meant the core feature.

The thing here is you need a way to let the user know they have successfully confirmed their email address. That is the reason why you're not redirected and displayed a "Thank you - your email address has been confirmed" message.

Now, what some sites do is to redirect you to another page after a few seconds has passed. You'll need to hack the core to do so but it is not a complex procedure.

1. In this line add this code:

$topath = qa_get('to');
if (isset($topath))
    $qa_content['head_lines'][] = '<meta http-equiv="refresh" content="5;url=' . qa_path_to_root() . $topath . '" />';

2. Replace number 5 in step #1 with the amount of seconds you want the user to wait before being redirected

3. Replace this line with this code:

return qa_path_absolute('confirm', array('c' => $emailcode, 'u' => $handle, 'to' => qa_get('to')));

That's it. Now the user is redirected to where they came from after 5 seconds.

well I get email confirmation but when I copy the code from the email and paste to url its say "Code not correct'

can  you comment on that

I have also added noreplay email
You seem to be having that issue for the last 5 days. I posted the answer 3 days ago. I hardly believe a change you've added AFTER getting the error could be the cause of the error. Totally unrelated issues
this is Solved

Thanks once again
0 votes