Comments Form - email newsletter opt-in
In blog/libraries/Fuel_log.php I have added the below for rendering to the page.
$fields['subscribed'] = array('label' => 'Would you like to receive our newsletters?', 'type' => 'checkbox', 'class' => 'form-control', 'checked' => true, 'value' => 1);
And in models/Blog_comments_model.php added 'subscribed' to the array of hidden fields so that cms administrators cannot manually over-ride the opt in and out.
The checkbox always saves to the database as 1 (the checked state).
How do I write to the database as 0 or 1 depending on whether the checkbox is checked or unchecked?