Step by Step Reg Codes Install

eljkmw has requested some help getting the Registration Codes module setup. Here's the basic order of operations, taken from the readme file.

The readme file contains more details and all the necessary information to get you started.

If you are having problems, post here with precise details about what step you are stuck on and what exactly is not seeming to work.

1. Upload and install Registration Codes

2. Backup the core files register.php, edituser.php, userinfo.php and modules/system/templates/system_userinfo.php

3. Replace the existing copies of those files with the copies that come with the Registration Codes module (they're in the core_patch_files_2.0.13.2 folder).

4. Login as a webmaster and go the admin side of the Registration Codes module and give webmasters permission to create codes for all groups.

5. Upload and Install Formulize

6. Create a new form in Formulize. This will be your new user profile form. There is only one user profile form. If you want the form to appear different to different groups of users, then use the "Display" option for each element and customize which groups should see that element. You don't need to include all the "system" type options in this form, ie: username, password, timezone, etc. Those will all be included automatically.

7. In Formulize, modify the form access permissions and give Registered Users and Anonymous users view_form, add_own_entry and update_own_entry permissions on the form you just made.

8. Update the Formulize module (in System Admin->Modules).

9. In the perferences for Formulize, select the form you just made as the form to use as the User Profile Form.

10. In the front side of the Registration Codes module, create the Registration Codes that you want to use. Users will have to type in one of these codes in order to create an account. When they type in a code, they will then get the user profile form you made to fill in.

That's a basic setup. There are several other options available, and the readme outlines them all.

This is as much general help as we can provide getting people started with this. The only other advice is to read the readme file very carefully. If you are stuck on a particular step, post details here and we will try to give some pointers.

Good luck,

--Julian

Comments

RE: Step by Step Reg Codes Install

I skipped step 6 and 7 (and 9) but everything works. Now I wonder why...

My next question refers to upgrading reg-codes rather than installing it.
When does one update the reg-codes module in xoops admin panel? Or it is not needed?
I did it before running the upgrade patch and that interfered with the patch. Luckily I was able to manually alter the tables, and everything went ok.

RE: Step by Step Reg Codes Install

My hunch would be that without a form specified as the user profile form, then after typing in a registration code, you would get a blank page, or an error message.

You never need to update the reg codes module as part of the setup process. Just Formulize, so that the user profile form you just created will show up in the dropdown list in the preferences.

I'm not sure why doing an update would affect the upgrade patch in the database. The update does not alter the database at all (which is why a separate process is needed to patch the database).

NOTE: this upgrade-of-the-database step we're talking about is only necessary if you are upgrading from a previous install of the Registration Codes module, not if you are installing fresh with 2.2 RC1.

--Julian

RE: Step by Step Reg Codes Install

@ jegelstaff ...

The steps which you've provided are easy to follow. However, there's one which I'm uncertain. At Step6, you mentioned that "you don't need to include all the "system" type options in the Formulize form, ie. username, password, timezone, etc." I was hoping to see the standard user registration form after an anonymous user has entered the given Code.

How do I make this "user registration form" appear here?

Please help -- Many thanks in advance, Jason

RE: Step by Step Reg Codes Install

@ jegelstaff ...

Another thing I noticed is that when I click on Edit Account under User Menu, a blank-page appears with "Profile »» Edit Profile" displayed on the top-left hand corner of this blank-page. Why is this so? Any way to resolve this problem?

Please help -- Many thanks in advance, Jason

RE: Step by Step Reg Codes Install

Until you have completed all these steps, you will get a blank page when you try to edit your account, and also on the registration page as well I expect. That's because the form you need to create is part of the user profile, and without it the edit user page and registration page are missing a big piece of their content.

So, step 6....

The whole point of having a custom form is so you can ask questions that make sense for your site. So instead of asking everyone for their instant messanger IDs, you could ask their job titles, or how they heard about your site, or their phone numbers, or whatever you think makes sense in your site.

The Registration Codes module will include all the basic stuff (username, password, etc) in the profile already, but also includes custom stuff as specified in the form you need to make.

If there are truly no custom questions that you can think of having in your form, well, I just can't imagine there are none. The other key thing that Registration Codes does is it lets you pre-assign users to groups in your site, so since you have different groups that users can be members of, surly there are custom questions that could be specific to people in one group or other. ie: for a "volunteers" group, you would ask "How many hours a week do you plan on volunteering?".

Anyway, I think you're being a little hesitant here. The key way to make free, open source software work for you, is to dig in and experiment. If you're not sure about what questions to put in the form, just make one up. Save the form, complete the steps, see how it's working. Once you've seen how it works, then go back and delete that question and add three more that actually make sense in your situation. Don't let the fact you're not sure what to do prevent you from doing anything! :-)

99.999% of open source software comes with pretty much zero instructions, and most has no real technical support. So jumping in with both feet is usually the only way to go. We're happy to help, but our situation is not common, so I suggest trying to fly by the seat of your pants as a good way to get the most out of most of the software out there, including ours.

Let us know how it goes,

--Julian

RE: Step by Step Reg Codes Install

@ jegelstaff ...

Thanks for the explanation. However I would appreciate it if you could provide me a small 'tip off' to begin with. I'm indeed hesitant to begin with, so as to not screw up my website's contents. If I can 'see' how to create Xoops' default user profile form, then I'll take into consideration your wise suggestion.

Please let me know how to begin soon.

Many thanks in advance,
Jason

RE: Step by Step Reg Codes Install

@ jegelstaff ...

Sorry to bother you again. But after reading through Step 6 over and over again, I'm truly puzzled on what you're trying to say. I looked through the coding from the reg_codes core_patch_files_2.0.13.2, which replaces edituser.php, reigster.php, userinfo.php (in root-directory), and root/modules/system/templates/system_userinfo.html; I found all the "system" type options you mentioned.

Hoewver, I truly confused with Steps 6-10. I followed these steps, selected all the fields active, and previewing the form has somehow widen my fix-width theme :-( . Secondly, I updated Formulize, created a reg code, logged out, and tried to register a new user. Nothing appeared, no window asking me for code, nothing! Then I tried to Edit Account, that too was nothing!

This Formulize module is indeed very, very difficult for a newbie like me :-(

Please help again soon.

Many thanks in advance,
Jason

RE: Step by Step Reg Codes Install

@ jegelstaff ...

I've managed to 'fix' the form extending beyond the boundaries of my fix-width theme. I found this at:
http://dev.xoops.org/modules/xfmod/tracker/?func=detail&aid=2812&group_i...

However, I still can't get it to work. I kept getting blank pages after blank pages. Please help!

Just some basic steps to start with is all I'm asking.

Many thanks in advance,
Jason

RE: Step by Step Reg Codes Install

Hello,

You know, I hate to say it, but I'm starting to laugh at this whole thing.

Just some basic steps to start with is all I'm asking.

We have given you basic steps, and not so basic steps, and completely documented steps in the readme. And feedback, and on and on and on. Either you're trolling, or you're maybe not capable of installing the module.

My best advice would be make sure the permissions in Formulize are set right, and make sure you've got your form selected at the user profile form in the Formulize Preferences page. (Steps 7 to 9 above)

The fact you seem to get a blank page when you click Register Now on the login screen suggests there's something wrong with your site at a deeper level. If you replace the register.php file with the one that comes with Registration Codes, then even without doing anything else at all, you should get the screen asking for a registration code.

And don't try to read the code and think that's telling you anything. If you're a newbie, reading the code will just confuse you. If you're actually capable of reading the code, you don't need our help!

Good luck,

--Julian

RE: Step by Step Reg Codes Install

My installation fails in step 4

Parse error: parse error, unexpected $end in C:\wamp\www\cis\modules\reg_codes\admin\index.php on line 607

RE: Step by Step Reg Codes Install

My installation fails in step 4

Parse error: parse error, unexpected $end in C:\wamp\www\cis\modules\reg_codes\admin\index.php on line 607

RE: Step by Step Reg Codes Install

Hi Julian ...

Would it be possible to include the "registration code" field into the default user registration form? In that way, anonymous users can just access one page in filling out his/her details plus the given reg_code. I noticed this when I was experimenting with RegKeys, but this requires a "hard core" hacking to the Xoops core. In some way, I liked it but in the end I decided to go back to Plan-A that's RegCodes & Formulize ...

Any ideas on how to approach my 1st request? Please drop in soon.

Cheers,
Jason

RE: Step by Step Reg Codes Install

parse error, unexpected $end in C:\wamp\www\cis\modules\reg_codes\admin\index.php on line 607

This suggests that the file is not being read as expected by your server, probably because the linebreaks are being interpreted differently. Or the file has been modified, or damaged, and is missing an ending } or ?> tag.

What operating system is your server? There were some issue with line breaks in the iMenu module that seemed to be a problem mostly on Macs. I believe those were corrected in 2.2.

Without further information, the best advice I can give is to open the file and check to see if the line breaks are in the right place or not, and perhaps download the module again and check your copy against the freshly downloaded copy to make sure there was not some kind of damage during the file upload or something like that.

--Julian

RE: Step by Step Reg Codes Install

Would it be possible to include the "registration code" field into the default user registration form? In that way, anonymous users can just access one page in filling out his/her details plus the given reg_code.

I hear what you're saying, it would be simpler for the user to just have one page, and not start by filling in the code by itself. But we're not going to reorganize the module that way, since we need to know the code first, in order to determine what questions to display on the form. ie: based on the groups that the code allows membership in, that can affect which questions the user should see in the profile. So we have to ask for the code first.

The best way to "fix" this would be to change the whole underlying form display mechanism so it was nicely Ajax enabled and you could dynamically change the contents of the form based on the information typed into a textbox in realtime, without having to reload the whole page. That would be completely possible with current technology and techniques. But it's a whole lot of work that I don't see happening any time soon.

Sorry. In the meantime, it is only one simple page with one box for the code that they have to fill in. And here's a tip:

If users go to a URL like this:

http://www.yoursite.com/register.php?code=code1

Then they will bypass that first page and the registration form will appear without asking for a code first. So depending on the use case for your codes, you may be able to craft a few special links in the right place in your site, ie:

Click here if you are a volunteer:
http://www.yoursite.com/register.php?code=volcode

Click here if you are a parent:
http://www.yoursite.com/register.php?code=parentcode

Does this help?

--Julian

RE: Step by Step Reg Codes Install

I was testing it local on WAMP5, but after the error I try to upload xoops 2.0.13.2 and 2.0.15 and 2.0.16 on a free host. 3 sites, and follow this step by step guide.

Reg codes work fine on all 3 versions! and is is a very nice guide and module!
Then I tested on WAMP5 it was not a clean installation so I think its time to clean my local installations :-)

RE: Step by Step Reg Codes Install

Super! I'm glad to hear it's working well for you. Thank you for the kudos. :-)

--Julian

RE: Step by Step Reg Codes Install

Hi Julian ...

I'm curious why while I tried to edit my account, a blank page appears. Is it because of Step3 ...?
I'm currently using Xoops 2.0.15 on my hosting server, but Step3 mentions that the core patch files are for 2.0.13. Any suggestions here?

As for your last posting, I feel that it's weird to a selection form so that a new user can be linked to the right registration form. It's still appropriate to incorporate the registration form & the reg_code field on the same one-page.

I look forward to your reply soon.

Many thanks in advance,
Jason

RE: Step by Step Reg Codes Install

About the edit account page not showing up...

If you are using 2.0.15, there was a patched core file for that which used to be available on the Download XOOPS page of xoops.org, but now that 2.0.16 has been released, I can't see the patched core file for 2.0.15 anywhere. If you don't have the patch, there are known issues with Formulize (and several other modules).

So the recommendation would be to upgrade to 2.0.16, if you don't have the patch or are uncertain that you do (it was a new version of class\xoopsform\forms.php, or something like that).

If the userinfo.php page works fine, but the edituser.php page does not, then this is almost certainly because of you not having the patched file for 2.0.15.

Without more details (ie: PHP debug info for starters), it's really hard to say what the problem is.

As for the two step registration code...it is fundamental that we need to know the code before we draw the form, so we can't ask for the code as part of the profile form. That's just the way it works, architecturally speaking, until such time as the whole form architecture in Formulize (and/or XOOPS) is upgraded to some kind of web 2.0/Ajax kind of thing.

The ability to put the code in the URL should let you get around any problems you're having with a two step registration process; just change all the links you have that point to the register.php file, so that they have the right code in them as outlined above. That's the best we can suggest.

Good luck,

--Julian

RE: Step by Step Reg Codes Install

Hi Julian ...

I did what you told me to. I've upgraded my website to Xoops 2.0.16, and both Formulize & RegCodes work flawlessly. Many thanks for the help.

By the way, do you know to how to re-direct a user who doesn't have a registration code back to the 'home' page? Before re-directing him/her, a message will prompt out saying "A valid code is required for registration. Thank you!"

Many thanks in advance,
Jason :-D

RE: Step by Step Reg Codes Install

Hello,

I'm glad to hear that the upgrade to 2.0.16 worked for you. :-)

Registration Codes does give you a message when you type a code incorrectly or use an invalid one. But it then gives you another chance to fill in the code. I think this is better than redirecting to the home page, since maybe the user just made a typo, and they want to type in the right code. By going to the home page, you make them go through the extra step of figuring out what to click on to get back to the registration page.

But if you do want to redirect to the home page, the easiest way to implement the redirection would be a hack in the reg_codes\include\functions.php file in the function that detects whether the code is valid or not. Instead of returning "false", actually put in a PHP-based redirection there, or use the XOOPS redirection function.

--Julian

RE: Step by Step Reg Codes Install

Hi'

Follow the installationguide and now I can show userinfo, but not edit.
I get the blank page and this error

Fatal error: Call to a member function on a non-object in httpdocs/modules/formulize/include/formdisplay.php on line 1331

If I'm locked in ad admin on the page, the edituser function works fine.

RE: Step by Step Reg Codes Install

Hi'

Follow the installationguide and now I can show userinfo, but not edit.
I get the blank page and this error

Fatal error: Call to a member function on a non-object in httpdocs/modules/formulize/include/formdisplay.php on line 1331

If I'm locked in ad admin on the page, the edituser function works fine.

RE: Step by Step Reg Codes Install

Hi Julian ...

There's a bug with RegCodes. Apparently, I've setup the Administrator to issue codes to GroupA and GroupB with their respective registration codes. Unfortunately when I was testing one, the new user (with GroupA code) is successfully grouped in GroupA but also in Administrator Group. Why is this the case?

Please help here ...

Many thanks in advance,
Jason :-D

RE: Step by Step Reg Codes Install

Hi Julian ...
Nevermind the above, as I found the answer at:
http://dev.xoops.org/modules/xfmod/forum/forum.php?thread_id=2840&forum_...

Cheer, J.

RE: Step by Step Reg Codes Install