View Full Version : Randomly sort users on signup
isla142
07-07-2004, 05:12 PM
I am searching for a hack to randomly sort users into one of four usergroups upon signup to my website. This needs to be able to be over-ridden, and once sorted, the user cannot change group. I know this is possible, since I have seen it done on another forum. However, when I asked the admin of that forum, she had forgotten the code.
Please help.
Isla
Berethorn
07-07-2004, 06:08 PM
That's a great idea for a Harry Potter forum! I can see how without this hack, 98.5% of the members would choose Gryffendor or Slytherin.
It looks like no one has done this hack yet, but maybe someone could. :)
isla142
07-07-2004, 07:10 PM
:D How did you know it was for a Harry Potter forum? I've seen it on one already, so it must work. I really need more Hufflepuffs, because none on the old forum were active. I'd like the code before I activate the forum if possible. That may not be for a couple of days yet.
Berethorn
07-07-2004, 07:34 PM
First of all, I guessed, since it was the first thing I could think of that would "sorting". Then I went to your homepage, and it was obvious. ;)
isla142
07-09-2004, 06:13 AM
:D Well... I know this thread has gone down to the second page... PLEASE help! I really really need to get this hack. I don't want people just to be sorted by a quiz, that's old. Please help (still).
Isla
Boofo
07-09-2004, 06:21 AM
:D Well... I know this thread has gone down to the second page... PLEASE help! I really really need to get this hack. I don't want people just to be sorted by a quiz, that's old. Please help (still).
Isla
Someone has just done that code on my site. I will ask them if it is allright to release it or have them do it. Will that work?
Modin
07-09-2004, 02:15 PM
Boofo pointed me to this thread :)
I haven't tested this but it "should" work...
open up register.php and find
// ### DO THE UG/TITLE UPDATE ###
$DB_site->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid=$user[usergroupid] $dotitle WHERE userid=$u");
and replace it with (filling in the array with the groups you want to randomize)
// ### DO THE UG/TITLE UPDATE ###
$rnd_grps = array('7', '9');
$user['usergroupid'] = $rnd_grps[rand(0,count($rnd_grps) + 1) - 1];
$DB_site->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid=$user[usergroupid] $dotitle WHERE userid=$u");
This assumes your users have to activate their accounts before they can use them, if that's not the case I can modify it.
Hope it works for ya :)
isla142
07-15-2004, 06:46 AM
Oh. No. They don't have to activate their accounts before signup. Can you modify it for me? All my users are in Gryffindor :( at the moment, except the manually changed ones.
isla142
08-20-2004, 05:21 PM
Sorry for double posting, but I really need help with this! It's been well over a month, and I need this hack! Can someone help me with a hack to randomly sort users on signup with no need to have activation of account?
Love the help!
Isla
dstruct2k
08-20-2004, 05:53 PM
Yeah, I'll take a look at the code... Give me a couple minutes.
dstruct2k
08-20-2004, 06:15 PM
<a href="https://vborg.vbsupport.ru/showthread.php?t=68566" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=68566</a>
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.