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

i want to hide this check box from q2a pages ( ask page,comments and answers)

: Email me (example@domain.com) if my question is answered or commented on

how can i do it?
Q2A version: 1.6.2

3 Answers

+1 vote
by
edited by

Firstly, you can untick the option "Check email notification box by default" in Admin > Posting. That still makes it appear, but users have to tick it to be emailed.

I spent a little time digging through the Q2A code, and I think it should be possible in a custom theme. Override the 'form' function like this:

function form($form)
{
    $form['fields']['notify'] = null;
    parent::form(
$form);
}

Let me know how it goes for you.

by
hi scott
i use this function code in qa-theme.php on localhost but there was an error :
 Warning: Missing argument 1 for qa_html_theme_base::form(), called in F:\wamp server\wamp\www\q2a\qa-theme\Snow\qa-theme.php on line 9 and defined in F:\wamp server\wamp\www\q2a\qa-include\qa-theme-base.php on line 822

and i delete this checkbox from ask page by deleting this code from qa-page-ask.php  :
    qa_set_up_notify_fields($qa_content, $qa_content['form']['fields'], 'Q', qa_get_logged_in_email(),
        isset($in['notify']) ? $in['notify'] : qa_opt('notify_users_default'), @$in['email'], @$errors['email']);
and check box removed from ask page!
how can i delete it from comments and answers too?
thank you
by
The call to form() should have the $form variable inside it. I've updated my answer.
by
Hi Scott, I follow your instruction, it work only for ask, but I still have the same probleme, how can i delete it from comments and answers too?

You said to change function form($form)  , but in which folder ?
Thanks for your answer.
by
@iancomega It would be in an advanced theme, in the file qa-themes/yourtheme/qa-theme.php

Alternatively, you could edit the function in qa-include/qa-theme-base.php but that would get overwritten when you upgrade.
0 votes
by

Anonymous user is not supported. However, this may serve as a reference.

http://www.question2answer.org/qa/30281/how-to-hide-email-me-chekbox-in-comment-and-answer?show=30291#a30291

+1 vote
by

Log into your site as an admin. Go to admin > layout.

Tick Custom HTML at bottom of every page:

Then paste this into the box that appears:
 
<script>
        // ...turn off emails...
        $('.qa-form-tall-checkbox[name="notify"], .qa-form-tall-checkbox[name="a_notify"]').removeProp("checked");
        // ...and hide them.
        $('.qa-form-tall-label label').has('.qa-form-tall-checkbox[name="notify"], .qa-form-tall-checkbox[name="a_notify"]').hide();
</script>
...