Hi Dan,
I have tried that option. Problem with changing it to 'true' or '1' is that the checkbox functionality gets messed up.
If an user unchecks autosubscribe in his user settings and 'saves'..the next time he clicks on edit profile it shows as checked . this is bound to confuse users.
The functionality Im looking for is , when a new user account is created ..auto subscribe is checked by default. But ofcourse, since we are giving him an option to uncheck it..it should remain unchecked once he unchecks it.
This is why I wanted to know which database table column stores this information.
I am also confused what $user->subscriptions_auto offers since there is no subscriptions_auto column anywhere .
Regards,
V
On 4/4/06, Dan Ziemecki dan@ziemecki.com wrote:
I never made that a configurable option, but you can fix it in the code, if you want to. Find this line in subscriptions.module:
return array(array('title' => t('Subscription settings'), 'data' => form_checkbox(t('Automatically subscribe to threads in which you post.'), 'subscriptions_auto', 1, isset($edit->subscriptions_auto) ? $edit->subscriptions_auto : $user->subscriptions_auto, t('Checking this box allows you to be automatically subscribe to any thread you create or post a comment to.'))));
Look at this section: isset($edit->subscriptions_auto) ? $edit->subscriptions_auto : $user->subscriptions_auto
I think you can change ...
: $user->subscriptions_auto
to
: true
That's someone else's edit, so I'm not sure what "$user->subscriptions_auto" is supposed to offer, thut that whole block is the "checked: value of the checkbox.
I should probably add this as an option - I've had people ask about it before.
-- Dan Ziemecki
On 4/4/06, VJ Rao cmsconsultant@gmail.com wrote:
Hi,
Im using subscriptions module for 4.6
How do I make 'auto subscribe' feature default? I couldnt find a way through settings.
If I have to do this in code, which table/column stores this information?
Thanks,
V
"VJ Rao" wrote:
The functionality Im looking for is , when a new user account is created ..auto subscribe is checked by default. But ofcourse, since we are giving him an option to uncheck it..it should remain unchecked once he unchecks it.
This is why I wanted to know which database table column stores this information.
VJ, it sounds like you just want the _form item_ to be checked upon presentation of the form, and then the user will either "opt-out" or not.
In that case, you can simply change the HTML that displays the form under consideration. This would _visually_ make the box checked upon display, and if it remained checked, then it would be submitted as a subscription.
The HTML <input> element for type 'checkbox' can take 'checked' value.
Here is a comparison:
Checkbox input type that is not checked:
<input name="someWidget" type="checkbox" value="Subscribe">
Checkbox input type that is checked:
<input name="someWidget" type="checkbox" value="Subscribe" checked>
-- Gary
On Wed, April 5, 2006 8:33 am, Lists said:
VJ, it sounds like you just want the _form item_ to be checked upon presentation of the form, and then the user will either "opt-out" or not.
In that case, you can simply change the HTML that displays the form under consideration. This would _visually_ make the box checked upon display, and if it remained checked, then it would be submitted as a subscription.
The HTML <input> element for type 'checkbox' can take 'checked' value.
Here is a comparison:
Checkbox input type that is not checked:
<input name="someWidget" type="checkbox" value="Subscribe">Checkbox input type that is checked:
<input name="someWidget" type="checkbox" value="Subscribe" checked>
Untrue. The correct syntax is as follows:
<input name="someWidget" type="checkbox" value="Subscribe" checked="checked" />
The ending / is only necessary if you are trying for XHTML compliance. The checked="checked" business is to make the tag both HTML and XHTML compliant, as value-less attributes don't exist in XML. By default Drupal outputs XHTML-compliant code. You should follow suit.
Of course, in the vast majority of cases you won't be writing a checkbox element yourself but calling the Drupal API for it, which will take care of making it properly formed for you. Drupal is nice like that. :-)
--Larry Garfield
On Wed, April 5, 2006 8:33 am, I said:
The HTML <input> element for type 'checkbox' can take 'checked' value.
Here is a comparison:
Checkbox input type that is not checked:
<input name="someWidget" type="checkbox" value="Subscribe">Checkbox input type that is checked:
<input name="someWidget" type="checkbox" value="Subscribe" checked>
"Larry Garfield" wrote:
Untrue. The correct syntax is as follows:
<input name="someWidget" type="checkbox" value="Subscribe" checked="checked" />
Oops. Yes, I relied on BBEdit's insertion, but without a full DOCTYPE, BBE inserted in HTML, not XHTML. :(
Thanks for correcting that, and sorry to confuse.
Of course, in the vast majority of cases you won't be writing a checkbox element yourself but calling the Drupal API for it, which will take care of making it properly formed for you. Drupal is nice like that. :-)
Yep. And this case seems to belong to the non-vast minority, where the OP wants to actually change a form's displayed state.
Good stuff. -- Gary