need to set length of reg code

hello i would like to find out where in the cde do i need to edit to make it where codes by default are 16 chars long please help me find it.


Requires a hack to the reg codes index.php file


The reg codes module makes a random series of 4 letters, and then adds an incrementing number onto the end. So there isn't really strong control to keep them to 16 characters, ie: they will keep getting bigger as the number gets higher as you make more codes (though obviously once the number is three digits, it will stay that way for a long time).

The code that makes the random 4 letters is in the index.php file for the module, in a function called make_code. There's a for loop in there that runs four times. Just change this line:


To this:


If you want to have 16 letters instead of 4.

I hope that is helpful, let us know.


all codes expired

hello the codes are being generated but all are coming up as expired and no way to change but 2 new features need to be added the ability to generate a custom amount of codes at 1 time and make it where codes don't expire

but i am using xoops 2.4.2 so any ideas and when i try to code it says you do not have permission. any ideas?

Codes should have no expiry date if the date is blank


If you specify no expiry date for the codes (leave it blank), then they should have no expiry. Perhaps your XOOPS installation is causing a default date of today's date to show up in the expiry box, and if you accept that date without changing it, then that would cause the codes to be expired. Try blanking the box (and/or using the datebox patch that comes with Formulize).

I'm not sure what the permission issue is that you are having. If you set permission for a user to access the module, and you set permission in Reg Codes for them to be able to create codes that allow membership in other groups, then that should be all that's required.

Making a lot of codes at once is a neat idea. We have no plans for that ourselves, but I can imagine adding an option to the codes creation screen, where you could say how many "copies" you wanted, and it would make that many. All the code related to this would be in the main index.php file for the module, and it's not that complicated. We are always open to working for hire to deal with specific requests like this, if that's something you're interested in.

You can also just make up codes in the database, they're all contained in one table, and you might find it really easy to work with them that way.

I hope this helps,