vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Random Usergroup On Registration (https://vborg.vbsupport.ru/showthread.php?t=44385)

yzztik 10-07-2002 07:47 PM

Random Usergroup On Registration
 
I have a hack installed on my board that randomly places a new user in one of 6 groups upon registration. The problem is that I did not install the hack, it was my previous admin and he is now gone. I need to upgrade my board but can't seem to find the code for this hack to re-install it after I upgrade.

I have searched the board and cannot find it. Does someone know what it is or where I could find it?

I am not sure if the hack I had does this or not, but I would like it if it could somehow know how many people are in each of the 6 groups and place the new one in the group that has the less users in it.

If someone could write that for me or point me to a place where I could find this I would be forever grateful :) Thanks!

Xenon 10-07-2002 07:59 PM

hmm, i found this old answer by me for a register in a random group:

https://vborg.vbsupport.ru/showthrea...m+register.php

no, it doesn't find out in which group are the less.. people, because if it does, it wouldn't be random anymore ;)

yzztik 10-07-2002 08:05 PM

oops sorry ... thanks ... I think I was looking in the full release forum and the hack database and it didnt find it. Though I could swear I use the search box on top too ... either way ... thanks a million for finding it for me :) I'll be sure to save it this time :)

Xenon 10-07-2002 08:14 PM

:)
you're welcome

Remeber sometimes the best hacks can be found in the requestforum :)

Logician 10-08-2002 10:26 AM

Quote:

Originally posted by Xenon
Remeber sometimes the best hacks can be found in the requestforum :)
Sometimes?!? No way! Always! :p

We'll beat Full Releases soon.. :rambo:

Xenon 10-08-2002 11:35 AM

I bet we'll do, pal :)

yzztik 03-21-2003 08:39 PM

PHP Code:

$newusergroupid=rand(xx,yy); 

I have been using this to sort members into random usergroups when they register but this assumes that all groups are in order. How would I go about it if they were not?

For example, if I wanted them to be sorted randomly into groups 8, 10 and 11.

Any ideas?

Xenon 03-21-2003 10:18 PM

use this way:
PHP Code:

$ugid = array(8,10,11);
$newusergroupid=$ugid[rand(0,2)]; 


yzztik 03-21-2003 10:39 PM

Thanks so much. So I can put as many numbers I want in the array list right?

Xenon 03-22-2003 11:21 AM

yes, put as many numbers as you want in it, but don't forget to increase th second value of the rand function for every added number :)


All times are GMT. The time now is 08:03 AM.

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.01020 seconds
  • Memory Usage 1,730KB
  • 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
  • (10)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