![]() |
Letters in codes?
How can I add letters into the codes? Instead of all numbers I'd like to add in letters too.
|
You could try something like this:
http://911-need-code-help.blogspot.c...using-php.html I haven't read it all the way through. Need to get to bed, and stop playing with my MtG cards... |
Where do I try to do this at?
|
That I'm not sure of. Probably somewhere in siggy.php.
|
I don't think so. I have no idea where though.
|
Somehow I think you need to get the code into the doadopt page... I've been trying but no luck.
|
HoF... any help on this?
|
umm you mean owned adoptables id code? Just go to phpmyadmin and change the data type of field 'code' from int(11) to varchar(20) and you are good to go.
|
|
Oh yeah you also need to modify the script that generates a random code, since the original one only gives you a 5 digit number without letters or symbols. Its doable, I will post a solution to this once I resolve SDT's breeding script glitch.
|
Can't wait for this!!
|
I created a function that allows you to generate an alphanumeric code of any length. You can also enable/disable generation of symbols. This function will be included in the functions.php file for Mys v1.3.0 release, but you can have it now if you cant wait for this. The symbols list does not include all available symbols, since some mess up the script. But anyway, Id say at least 80% of symbols can be generated successfully with this function.
|
*makes grabby hands*
|
Sent to your PM box already, the function will be available in Mys v1.3.0 anyway.
|
I must be missing some steps. It isn't working for me. Where do I put the example and do I need to change or add anything else?
|
umm first of all, if you have a field called code in database, make sure its type is varchar instead of int, since the latter only accepts numbers. You will need to copy/paste the function passgenerator() into your functions.php file, and then call it whenever you want to generate an alphanumeric code.
|
Ok I see. But you never see that code. I guess I want the $aid to be letters.
|
I see, the id to be letters? This can be done too, but a bit more complicated. First of all, you must disable the primary key auto_increment setting for this field. Next, edit the aid data type from phpmyadmin to make it varchar(15). The last thing to do is to use the following script, which you should not have problem with:
PHP Code:
|
I got it working but I had to remove the is_numeric part through out a lot of the scripts. Hope that wasn't very important :ooo:
|
I dont suppose its important, since is_numeric() checks if a variable contains only numbers.
|
All times are GMT -5. The time now is 07:53 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.