Register with categories
Posted: 06 May 2008 05:01 PM   [ Ignore ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  118
Joined  2005-09-13

Two things.

First and most important: it would seem that I’m unable to add categories support to the user:register form. I have a hidden input name="category[]" but it doesn’t get added to the user until I edit it.

Second: user:edit doesn’t support {category_id} or using anything else but a {selected} to get the user’s current category (I think!).

Essentially I don’t want users to be able to select their own categories because they’re tied to their member group. Suggestions? PHP query?

Third thing while I’m here: adding a hidden mailinglist_subscribe input doesn’t seem to actually subscribe new members to a mailing list. I see it’s in mod.user.php, but clearly it’s not made for dummies yet.

Thanks guys! This category support is pretty awesome, just really complex.

Profile
 
 
Posted: 07 May 2008 07:22 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2259
Joined  2006-10-18
Wonder Monkey - 06 May 2008 05:01 PM

First and most important: it would seem that I’m unable to add categories support to the user:register form. I have a hidden input name="category[]" but it doesn’t get added to the user until I edit it.

The User Categories function is incredibly complex, and is not quite fully robust yet, which is why it does not exist for the registration form yet.
I can promise you though, that it’s a major part of the User Module’s vision to have a fully robust Category system in place smile

Wonder Monkey - 06 May 2008 05:01 PM

Second: user:edit doesn’t support {category_id} or using anything else but a {selected} to get the user’s current category (I think!).

This is something that still fools me from time to time… you’ll need to build such like this:

<select name="category[]">
{categories}
{category_selected}selected
="selected"{/category_selected}
{category_body}
<option value="{category_id}" {selected}>{category_name}</option>{/category_body}
{
/categories}
</select>

You’re also only allowed to use the Categories variable pair once on a template, currently… though Mitchell is working on getting it to work more than once. smile
So if you are using it somewhere else on the page, that could be the issue as well. Though you can manipulate this with Embeds to get it to work more than once.

Wonder Monkey - 06 May 2008 05:01 PM

Third thing while I’m here: adding a hidden mailinglist_subscribe input doesn’t seem to actually subscribe new members to a mailing list. I see it’s in mod.user.php, but clearly it’s not made for dummies yet.

Knowing Mitchell, it might not yet “exist”, though he might have done some dabbling…
I’m assuming you’ve tried:

<input type="hidden" name="mailinglist_subscribe" value="3">

Wonder Monkey - 06 May 2008 05:01 PM

Thanks guys! This category support is pretty awesome, just really complex.

Haha, I definately agree!! LOL I still think Mitchell is clinically insane… and you haven’t seen the Events Module he’s developing! rasberry *drool*

 Signature 
Profile
 
 
Posted: 07 May 2008 08:32 AM   [ Ignore ]   [ # 2 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  118
Joined  2005-09-13

I gotta be quick, but thanks for the response Pieman.

1. It’s definitely in the code for the User module’s _reg function, I just can’t figure out why it’s not actually functioning. In the mean time I now have a lame-ass 2nd registration page where users hit “confirm”. smile

2. I don’t think your categories select box would work for me. As I said, the user’s category needs to be hidden from them, ie. input type="hidden" value="{current_value}"

3. The mailinglist_subscribe definitely exists in the code, but again, no results. And yep, that’s exactly what I tried.

Thanks Pieman. I hope Mitchell can chime in definitively on this, but either way I think the work-arounds I built last night will get me by.

Profile
 
 
Posted: 07 May 2008 08:38 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2259
Joined  2006-10-18
Wonder Monkey - 07 May 2008 08:32 AM

2. I don’t think your categories select box would work for me. As I said, the user’s category needs to be hidden from them, ie. input type="hidden" value="{current_value}”

What about this: smile

{categories}
{category_body}
<input type="hidden" name="category[]" value="{category_id}" />{/category_body}
{
/categories}

 Signature 
Profile
 
 
Posted: 07 May 2008 01:19 PM   [ Ignore ]   [ # 4 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  118
Joined  2005-09-13

That bit of code spits out all the categories like so:

<input type="hidden" value="17" name="category[]"/>
<
input type="hidden" value="14" name="category[]"/>
<
input type="hidden" value="13" name="category[]"/>
<
input type="hidden" value="16" name="category[]"/>
<
input type="hidden" value="15" name="category[]"/>

Profile
 
 
Posted: 07 May 2008 02:19 PM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2259
Joined  2006-10-18

Yeah, your right, I guess it should rasberry

Why do you want it as a hidden field on the Edit page anyway? cheese

 Signature 
Profile
 
 
Posted: 07 May 2008 03:08 PM   [ Ignore ]   [ # 6 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  118
Joined  2005-09-13

Because I need members assigned to categories, but there’s no way to add the categories to the register page. So now I have automatically assigned them categories based on their member group, forcing them to go to a “confirm page” (which is actually just an edit page with all the variables hidden and a Confirm button) which update their account with the appropriate category.

It sounds complicated and, I guess, it is. I have a client with fine grain permissions needs, for which the categories are very well suited.

Profile
 
 
Posted: 08 May 2008 07:23 AM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  702
Joined  2004-03-30

Tyler,

Those categories should be getting assigned at reg time. The code is in User 1.3.2 around 3870. Make sure that the category to which you are assigning is set as one of the category groups the User module recognizes.

Otherwise, email so I can login and FTP into your site and troubleshoot.

I still have your t-shirt. And if you ever want to see it, the price has gone up from one beer to two.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 14 May 2008 07:19 AM   [ Ignore ]   [ # 8 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2259
Joined  2006-10-18

Wonder Monkey,

I’ve documented this as a Bug, and I’ve queued it up for the next release of User smile

 Signature 
Profile