Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
715 views
in Q2A Core by
Can we have a way like Stackoverflow where a user just fill his name / email / website in the form or chose to register.
related to an answer for: Great Way to get more Signups!

1 Answer

0 votes
by
reshown

It's pretty easy to do this with a custom theme... for example:

            if(qa_opt('permit_post_q') == QA_PERMIT_USERS && !qa_get_logged_in_userid()) {
                $userlinks=qa_get_login_links($qa_root_url_relative, isset($topath) ? $topath : qa_path($qa_request, $_GET, ''));                
                $this->content['navigation']['main']['ask']['url'] = 'javascript:if (confirm(\'Asking questions requires you to login or register.  Would you like to register now?\')) document.location.href=\''.qa_html(@$userlinks['register']).'\';';
            }

You can replace 'register' with 'login' if you want it to redirect to the login form.  You could also create your own hybrid login/register page.

Edit: here's a way to do this with the ask-box widget as well, in qa-ask-box.php:

<FORM METHOD="POST" ACTION="<?php  
 
if(qa_opt('permit_post_q') == QA_PERMIT_USERS && !qa_get_logged_in_userid() && isset($qa_content['navigation']['main']['ask'])) {
    $userlinks=qa_get_login_links($qa_root_url_relative, isset($topath) ? $topath : qa_path($qa_request, $_GET, ''));                
    echo 'javascript:if (confirm(\'Asking questions requires you to login or register.  Would you like to register now?\')) document.location.href=\''.qa_html(@$userlinks['register']).'\';';
}
else echo qa_path_html('ask', $params);  
 
?>">

 

 

By Noahy

On http://www.question2answer.org/qa/8143/great-way-to-get-more-signups?show=9526#a9526

...