Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Random Usergroup on registration Details »»
Random Usergroup on registration
Version: 1.00, by dstruct2k dstruct2k is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 08-19-2004 Last Update: Never Installs: 10
Re-useable Code Code Changes Translations  
No support by the author.

Ever wanted to randomly sort your new registrants into seperate usergroups?

Now you can!

Good for Harry Potter themed forums.


Instructions: Create the usergroups you want to randomly sort between and record the usergroupid's for use when installing the hack. Further instructions in TXT file.

File Modifications: 1 (register.php)

Template Mods: 0

Time to install: >2 minutes


Enjoy!

Update: Version 2.0 released
This version incorporates code by True.Rooster which fixes my half-assed attempts at getting the code right. (It's been a while... lol)

To upgrade, reapply the hack.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 08-22-2004, 07:27 PM
Merjawy's Avatar
Merjawy Merjawy is offline
 
Join Date: Sep 2002
Location: USA
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dstruct2k
Just only put one group, that'd do it.
thnx mate, will try that
Reply With Quote
  #13  
Old 08-30-2004, 07:38 AM
dstruct2k's Avatar
dstruct2k dstruct2k is offline
 
Join Date: Dec 2002
Location: Winnipeg
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by isla142
This doesn't appear to be working. I put it on my site and signed up as a new member, but for some reason they were placed in 'COPPA users awaiting moderation' (group 4)

I had put the four usergroups as 2 (Gryffindor), 9 (Hufflepuff), 10 (Ravenclaw) and 11 (Slytherin). Maybe you need to check your code. I did a straight copy with the numbers changed.
That would be because you're requiring email verification or COPPA registration. This hack doesn't support verification yet.

Quote:
Originally Posted by integra99
dstruct2k: what is the application of this hack on your site?
No application. Wrote it for someone else.
Reply With Quote
  #14  
Old 08-30-2004, 10:41 AM
isla142 isla142 is offline
 
Join Date: Jun 2004
Location: Warks, UK
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dstruct2k
That would be because you're requiring email verification or COPPA registration. This hack doesn't support verification yet.
That's the thing. I don't require e-mail verification or COPPA registration on my site, which is why I needed the original hack that I asked for modified. :disappointed:
Reply With Quote
  #15  
Old 10-31-2004, 07:50 PM
Wifey Wifey is offline
 
Join Date: Mar 2004
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't require e-mail, COPPA registration, image verification, nor birthday's ro register. I just changed the not requiring birthday and am hoping that this alleviates the problem I'm having, but for some reason or other a few people have been thrown into that COPPA group up on registration. Any ideas?

Here's my PHP code verbatim from my DB:

PHP Code:
// RANDOM USERGROUP HACK by dstruct2k
// Replace "999" with the usergroupid's of your randomized groups.
// Add extra groups if required.

    
$rndgroups = array(
        
'10',
        
'11',
        
'13');
    
$rndid $rndgroups[rand(0,count($rndgroups) + 1) - 1];

    
// assign user to group 3 if email needs verification
    
if ($vboptions['verifyemail'])
    {
        
$newusergroupid 3;
    }
else
    {
        if (
$vboptions['moderatenewmembers'] OR $_POST['coppauser'])
        {
            
$newusergroupid 4;
        }
        else
        {
            
$newusergroupid $rndid;
        }
    }

// END RANDOM USERGROUP HACK by dstruct2k 
Reply With Quote
  #16  
Old 10-31-2004, 11:43 PM
Wifey Wifey is offline
 
Join Date: Mar 2004
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, since I'm wickedly impatient I decided to see about figuring this out on my own. After disabling virtually everything and still having the problem, I realized that the hack was rotating improperly and therefore throwing people into COPPA - problem is, they weren't IN the COPPA usergroup. The query had somehow created a NEW usergroup with no name and no id number that can't be modified. All as a result of a simple -1

So, change:

PHP Code:
$rndid $rndgroups[rand(0,count($rndgroups) + 1) - 1]; 
to:

PHP Code:
$rndid $rndgroups[rand(0,count($rndgroups) + 1)]; 
and there should be no more problems.

I tested it no less than 5 times and was able to keep it working even with re-activating my image verification
Reply With Quote
  #17  
Old 11-14-2004, 09:48 PM
bexie bexie is offline
 
Join Date: Jun 2003
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

EXACTLY what I need--is this possible for 2.3.5?
Reply With Quote
  #18  
Old 12-10-2004, 02:14 AM
The Equivocate The Equivocate is offline
 
Join Date: Sep 2004
Location: Chicago
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ashkarita
Okay, since I'm wickedly impatient I decided to see about figuring this out on my own. After disabling virtually everything and still having the problem, I realized that the hack was rotating improperly and therefore throwing people into COPPA - problem is, they weren't IN the COPPA usergroup. The query had somehow created a NEW usergroup with no name and no id number that can't be modified. All as a result of a simple -1

So, change:

PHP Code:
$rndid $rndgroups[rand(0,count($rndgroups) + 1) - 1]; 
to:

PHP Code:
$rndid $rndgroups[rand(0,count($rndgroups) + 1)]; 
and there should be no more problems.

I tested it no less than 5 times and was able to keep it working even with re-activating my image verification
Doing that didn't solve the problem.
Reply With Quote
  #19  
Old 12-10-2004, 03:42 AM
Andrew's Avatar
Andrew Andrew is offline
 
Join Date: Nov 2004
Location: Pennsylvania
Posts: 441
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
// RANDOM USERGROUP HACK by dstruct2k
// Replace "999" with the usergroupid's of your randomized groups.
// Add extra groups if required.

    
$rndgroups = array(
        
'10',
        
'11',
        
'13');

    if (
count($rndgroups) == 1)
    {
    
$newusergroupid $rndgroups[0];
    }
    else
    {
        
$rndid $rndgroups[rand(0,count($rndgroups) - 1)];

        
// assign user to group 3 if email needs verification
        
if ($vboptions['verifyemail'])
        {
            
$newusergroupid 3;
        }
        else
        {
            if (
$vboptions['moderatenewmembers'] OR $_POST['coppauser'])
            {
                
$newusergroupid 4;
            }
            else
            {
                
$newusergroupid $rndid;
            }
        }
    }

// END RANDOM USERGROUP HACK by dstruct2k 
Try that there - I've been creating new users for the last 30 minutes and it is working perfectly. I've tested with everything from 1 usergroup to 10 random ones and no errors. All I did was add an if statement that if there is only one automattically sets that as the group otherwise it randomly generates a group. I fixed the random part as well so it wouldn't throw out bad group numbers.
Reply With Quote
  #20  
Old 12-10-2004, 05:17 PM
The Equivocate The Equivocate is offline
 
Join Date: Sep 2004
Location: Chicago
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, your fix worked - thanks!
Reply With Quote
  #21  
Old 12-10-2004, 07:47 PM
Andrew's Avatar
Andrew Andrew is offline
 
Join Date: Nov 2004
Location: Pennsylvania
Posts: 441
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by The Equivocate
Yep, your fix worked - thanks!
No problem - Glad I could help out !
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:16 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.14997 seconds
  • Memory Usage 2,328KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete