vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Randomly sort users on signup (https://vborg.vbsupport.ru/showthread.php?t=66948)

isla142 07-07-2004 05:12 PM

Randomly sort users on signup
 
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

Quote:

Originally Posted by isla142
: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
PHP Code:

// ### 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)

PHP Code:

// ### 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>


All times are GMT. The time now is 08:00 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01324 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete