I'm building a membership website and new members can sign up on the website. Each new member should be assigned an unique membership number.
Is it somehow possible to insert an unique serial number in a FEU field on creation in frontend via CGFEURegister/FrontEndUsers like "Unique Integer Field" in FormBuilder?
Or maybe i have to create an UDT to fetch last Membership Number in FEU and +1 in a hidden field?
I know the practical thing would be to just use the FEU ID as membership number. But the ID isn't visible in FEU in backend, and membership administrators need to know and see the membership number for each member.
CGFEURegister/FrontEndUsers insert serial number on creation Topic is solved
Re: CGFEURegister/FrontEndUsers insert serial number on creation
I'm assuming that you are using FEU 3.x, which I have never used, but the concept should be similar. I use a UDT on a hidden field in the registration form replacing the field where you want to insert the code, :
That should return a unique code mainly because the date and time of the registration are part of the code, and should add to the entropy
Code: Select all
$length = 10;
$string = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$ts = date("His");
$ds = date("Ymd");
$tk = '';
for ($i = 0; $i < $length; $i++)
{
$index = rand(0, strlen($string) - 1);
$tk .= $string[$index];
}
$code = 'FEU::' . $tk . '::' . $ds . '::' . $ts;
return $code;
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: CGFEURegister/FrontEndUsers insert serial number on creation
Cool! Thanks!
Yes, it is FEU 3.x but i guess it should be similar. I'll play around with it and see if i can get it to work.
Yes, it is FEU 3.x but i guess it should be similar. I'll play around with it and see if i can get it to work.
Re: CGFEURegister/FrontEndUsers insert serial number on creation
I do think the user's id is available in the admin template(s). So if they aren't displayed now, you could consider creating a custom admin template for the specific admin actions.I know the practical thing would be to just use the FEU ID as membership number. But the ID isn't visible in FEU in backend, and membership administrators need to know and see the membership number for each member.
(e.g. templates\admin_userlist.tpl)
https://docs.cmsmadesimple.org/customiz ... -templates
Re: CGFEURegister/FrontEndUsers insert serial number on creation
Yes, you're right, Velden.
{$entry->id} was available in the admin_userlist.tpl template.
{$entry->id} was available in the admin_userlist.tpl template.