[development] subscriptions

VJ Rao cmsconsultant at gmail.com
Thu Apr 6 08:47:59 UTC 2006


isset($user->subscriptions_auto) ? $user->subscriptions_auto : true

Seems to work.

On 4/5/06, Dan Ziemecki <dan at ziemecki.com> wrote:
>
> I'm at work right now, so I can't give you the exact column, but the trick
> you're missing is that most site and user configurations are stored in a
> serialized array, not a separate field.  Since the system tables have no
> idea what modules you'll be running, they store all the module variables in
> a single field.
>
> The code on the particular field is the right place to make your
> modification, but I may have given you the wrong way to do it.
> Unfortunately, other people have worked on the module and I don't completely
> understand all of what other people have done.  And I was sleepy when I
> answered your email.  This, however, I do know:  the checkbox element has a
> 'checked' value you can set to any state you want.  If you set the checkbox
> to 'checked', but only if the user has not set a value, you should be
> golden.
>
> Check this out:
>
> http://drupaldocs.org/api/4.6/function/form_checkbox
>
> That 'checked' variable needs something that operates like this:
>
>
> if(isset(subscriptions_auto){$checked=subscriptions_auto;}else{$checked=strue;}
> ... or something like that.
>
> --
> Dan Ziemecki
> Philosopher. Curmudgeon. Nerd.
>
>
> On 4/5/06, VJ Rao <cmsconsultant at gmail.com> wrote:
> >
> > 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 at 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 at 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
> > > >
> > >
> > >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20060406/57a8f328/attachment-0001.htm


More information about the development mailing list