News:

Wondering if this will always be free?  See why free is better.

Main Menu

Membergroup On Registration

Started by codenaught, September 30, 2006, 09:44:18 PM

Previous topic - Next topic

Jim R

And installing I got:

1.     Execute Modification     ./Sources/ManageRegistration.php     Test successful
2.    Execute Modification    ./Sources/Subs-Members.php    Test successful
3.    Execute Modification    ./Sources/Register.php    Test successful
4.    Execute Modification    ./Themes/default/Register.template.php    Test failed
5.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful

codenaught

Quote from: Jim R on October 09, 2006, 02:57:29 PM
I got this error after install:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/####/public_html/smf/Sources/Register.php on line 318


I think I have this error fixed. On a fresh install this wouldn't necessarily cause problems but if you have other mods that edit Register.php, it could. Please try downloading the updated "Group on Registration-1.1.tar.gz" package again.

Quote from: Jim R on October 09, 2006, 03:02:25 PM
And installing I got:

1.     Execute Modification     ./Sources/ManageRegistration.php     Test successful
2.    Execute Modification    ./Sources/Subs-Members.php    Test successful
3.    Execute Modification    ./Sources/Register.php    Test successful
4.    Execute Modification    ./Themes/default/Register.template.php    Test failed
5.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
Hmmm, not sure why it is failing. Do you have any other mods installed that edit Register.template.php? If not, I would recommend uploading a fresh copy of Register.template to Themes/default/ and trying the install again.
Dev Consultant
Former SMF Doc Coordinator

Jim R

#22
I got rid of the parse error, but the install error is still there.    There doesn't appear to be a way to control if users can choose a primary or secondary group. 

Also, upon registering, the option to choose a group shows up twice.

As I uninstall it, it's not wiping out the Admin option to pick which group to make available upon registration.


codenaught

It sounds like when you uninstalled the mod there was a failure with the Register.template.php file (or you somehow installed the new version without uninstalling the original one). I would advise uninstalling the mod, reuploading a fresh Register.template.php file (as long as you have no other mods that edit it) and reinstall the mod.

The option to pick Primary / Secondary group can be found in Admin / Registration / Settings. Because it looks like your Register.template.php file failed to install, it isn't showing up.
Dev Consultant
Former SMF Doc Coordinator

Jim R

Yep...I had gotten that far.  It didn't uninstall properly, so I reinstalled 1.0, uninstalled again, and it went through.  Then I installed 1.1 again, and now I get all the options at my disposal as they should.  The problem I still have is when a User registers, it asks User to join a group twice.

What would I look for to make sure code isn't being duplicated?


codenaught

In Register.template.php:

You should see this code twice:

if(!isset($context['no_avail_groups']))
{
echo '
<tr>
<td width="40%">
<b>', $txt['pick_group'], '</b>
</td>
<td>
<select name="', $context['is_primary_group'] ? 'ID_GROUP' : 'ID_ADDITIONAL','" tabindex="', $context['tabindex']++, '">';
foreach($context['membergroups'] as $id => $name)
{
echo '
<option value="', $id, '">', $name,'</option>';
}

echo ' </select>
</td>
</tr>';
}


Remove one occurrence of it and leave the other one there.
Dev Consultant
Former SMF Doc Coordinator

Jim R

Very nice...thank you very much.

And now for you next trick...  8)

Earlier above you responded to one my questions saying you were working on that:  The question is will there be a way to make it so this option is placed JUST on the users profile?

What is there is great and gets what is needed.  I have the Paid Subscriptions mod in place, which is not active yet for regular users (November).

As it stands, anyone who registers can choose a secondary group.  That's OK, but I'd rather make it so only those who Subscribe can do it by making that change in their Profile / Account Settings.  These Subscribers will able to have access to their Profile, where those just registered can't.  Subscribers will also have access to additional fields, filling them out for College Coaches ONLY to see.

Follow?

In other words, I asked earlier if this would ever be an option where secondary groups are chosen within the profile.  You said you were getting to it.  Are you still working on that?

This is great so far.  I'm very pleased...getting close to nirvana.

Thanks for your time.

henmar

How can i make selection of member group during registration a mandatory, Otherwise during registration if user doesn't select membergroup ,he placed automatically to newbie.

MoreBloodWine

#28
Quote from: Jim R on October 01, 2006, 04:17:08 PM
Questions:

2)  Can this option be moved to allow User to make their choice on their Profile (Account Related Settings)?
Quote from: akabugeyes on October 01, 2006, 04:41:38 PM
Number 2 I am already planning to do in the future. :)
First I'd like to address the above by saying not a bad idea but I personally wouldnt like this because my membergroups are game faction based and I dont want em switchin in their profile... maybe if you do do this you could host the version as is now without and one with the mod... for those that want to choose... or maybe add a new permission that admins can set that will allow or disallow the switchin of groups in the users profile... that would least solve the problem of not wanting to host two versions hehe...

---------------------

Anyway to get to my point of why I came here... how can I set it so that when a user doesnt select a group they are unable to complete the  registration process... I tested this by registerin to my own forum and I didnt select a group and I was still able to register... hope this makes sense... but basically I dont want people to be able to register on my forum if they dont select a group... think you could also make that an option in your next update... so admins can set to either allow or disalow a person to complete the registration process without selectin a group...

---------------------

So maybe if your willing when you do your next update you could add options that allows an admin to set either of the following permissions...

1. User can change membergroups from profile Y / N
2. User can complete registration without selecting a membergroup Y / N
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


MoreBloodWine

Sorry for the bump but no ones replied for 5 days heh...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

MoreBloodWine, I plan to include an option in an updated version of the mod, but in the meantime if you don't want to allow members to register and picking "no special membergroup" you can find in Sources/Register.php:

$context['page_title'] = $txt[97];

And add after:

// Assuming this is running an old version of the mod.
if (!isset($modSettings['groups_allowed_change']) && isset($context['membergroups'][0]))
{
unset($context['membergroups'][0]);
}


I did the code like that so when it comes time to upgrade the mod, you will be able to uninstall it still even after those changes were made. ;)
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

#31
That works but it automatically defaults to the first group... how do you rather how would I set it so it defaults to nothing making u actually open the menu to see the available options... kinda like the country flag mod... on the reg page the field is blank till u click the dox for the drop down menu... hope this makes sense... also when it comes time to uninstall and install a new version i wont be able to use package manager anyway bec i already have made some changed to a few files to reword some things hehe...

Edit : If you click this http://www.choice-online-gaming.com/index.php?action=register you'll see what I mean about the country flag being defaulted to "nothing"...

Edit : Basically what I'm after is that the membergroup menu be defaulted to "nothing - black bar" so you actually have to click the drop down menu to see the avail groups... and if you dont choose a group and try to continue registration you get a message saying something like " Sorry but you cannot proceed with the registration process until you have selected a membergroup..." except in my case the word "membergroup..." would be replaced with "player faction..."
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

In that case change the code I posted before:

// Assuming this is running an old version of the mod.
if (!isset($modSettings['groups_allowed_change']) && isset($context['membergroups'][0]))
{
unset($context['membergroups'][0]);
}


To this:

$context['membergroups'][0] = '';

And then in the same file (Register.php), find:

// Are they under age, and under age users are banned?
if (!empty($modSettings['coppaAge']) && empty($modSettings['coppaType']) && !isset($_POST['skip_coppa']))
{
// !!! This should be put in Errors, imho.
loadLanguage('Login');
fatal_lang_error('under_age_registration_prohibited', false, array($modSettings['coppaAge']));
}


Add after:

if(empty($_POST['ID_GROUP']) && empty($_POST['ID_ADDITIONAL']))
fatal_error('Sorry but you cannot proceed with the registration process until you have selected a player faction');


Let me know if that does exactly what you want.
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

#33
Parse error: syntax error, unexpected ':' in /home/choiceo2/public_html/Sources/Register.php on line 272

Thats what I get after usng the "new changes" changing this...
// Assuming this is running an old version of the mod.
if (!isset($modSettings['groups_allowed_change']) && isset($context['membergroups'][0]))
{
unset($context['membergroups'][0]);
}


To this...
$context['membergroups'][0] = '';

Then adding those other two lines after the ones u posted...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


codenaught

Hmmm, not sure why that would cause a parse error, I don't see anything obviously wrong with it. Can you post line 272 of your Register.php file?
Dev Consultant
Former SMF Doc Coordinator

MoreBloodWine

#35
Quote from: akabugeyes on October 29, 2006, 01:27:13 PM
Hmmm, not sure why that would cause a parse error, I don't see anything obviously wrong with it. Can you post line 272 of your Register.php file?
I have to re-apply the changes to get the same error so ya hold on... ill edit this in a min with the line...

Edit : This is line 272...
$language_directories =: array_unique($language_directories);
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


MoreBloodWine

#36
Fixed it on my own I just deleted the : from that line and all works as expected... thx aka...

Edit : I was checking something and its nice to know that if I ever wana install a new version of this using the package manager all I need to do is unmod my register.template.php file... hehe. So I wont have to undo - redo any of the crap I just did lol... so long as I continue to use this mod and any future versions , lol... which I def will... but with new mods might bring new permissions which means i prolly would have to undo some of this which would be more headaches hehe... I might just stick with this ver since it does what I need it to do...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


J!ass

Hey aka,

is it possible to make the field compulsory during the registration?
Because if not filled the standart usergroup will be selected when registering and I want the special Newbie group to be selected.

J!ass

captain236

i know it doesnt pertyain as much to this mod.. but since we were on the topic of addin secondary membergroups..  is there a way to set it so that it will display both membergroup images? 

i have some ranks set up and each rank has a lead, and would like ppl to see which rank they are in, as well as if they are also in a lead position.?

thanks for any info.

Gobo

good mod :D im gona try it out once I get a few new member groups set up

thanks

Advertisement: