vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Add User to Secondary Usergroup Based on the Value of a Custom Profile Field at Reg. (https://vborg.vbsupport.ru/showthread.php?t=82993)

patrickstar 06-29-2006 11:08 PM

ok so basically i have the plug in enabled, i have email verification on and the code as above. i have registered usergroup permissions to the girls forum off and the custom permissions for the custom usergroup 'female' granted. will the registerred usergroup settings over ride the 'female' usergroup settings on this? and when i register as a female with the required field 'F', i do not see that as a secondary usergroup.

please help, even suggestions.

patrickstar 06-30-2006 08:40 PM

<font size="1">chirp</font>

JenniferK 08-28-2006 04:10 PM

Quote:

Quote:
Originally Posted by Cyricx
Would it be possible to use this code to check their and thereby age?

Like I have an 18+ forum that I use a secondary usergroup to control access to.

Quote:
Originally Posted by amykhar
Yes, you could use this basic structure. It wouldn't check the value of the userfield. It would do the math on their age.

Amy
Can I have a little help with how to do this exactly?

moonclamp 09-08-2006 02:37 PM

Can anyone tell me the SQL query I'd need to run if I wanted to add the relevent existing members to the secondary group too?

criscokid 09-16-2006 10:16 AM

Quote:

Originally Posted by moonclamp
Can anyone tell me the SQL query I'd need to run if I wanted to add the relevent existing members to the secondary group too?

Take a look at the mySQL commands - make user a secondary usergroup member thread.

moonclamp 09-16-2006 10:47 AM

Quote:

Originally Posted by criscokid

Cheers :)

criscokid 09-17-2006 10:16 AM

How would I edit the XML file to add users to Usergroup ID 15 when Profile field16 = Male and Profile field17 = 1 or 2?

criscokid 09-18-2006 06:20 PM

Quote:

Originally Posted by moonclamp
Can anyone tell me the SQL query I'd need to run if I wanted to add the relevent existing members to the secondary group too?

Following on from my previous post elling you how to achieve this... I ran the two commands and now I all of the females are now members of the secondary group that I was setting. I assume this is beacuse the 'Male' appears in the word 'Female'?

Toopac 09-24-2006 03:06 PM

What would i need to do to get this working with email validation turned off?

I have not downloaded or installed anything yet.

Any help is most appreciated:cool:

wes_517 12-01-2006 01:52 AM

While trying to find something that will require moderation before giving access to the group, I saw a few people were interested, here's one version of code, it may not be pretty, but it works...

it also doesn't email out, but it does the job.

when they register, if field 23 is a hit, it adds them into the moderation table of the database.

PHP Code:

// Get the value for field 23
        
$user $db->query_first("
            SELECT field23
            FROM " 
TABLE_PREFIX "userfield
            WHERE userid = " 
$vbulletin->userinfo['userid'] . "
        "
);
        
$id $vbulletin->userinfo['userid'];
        
$time time();
        
$sql_string "SELECT field23
            FROM " 
TABLE_PREFIX "userfieldWHERE userid = " $vbulletin->userinfo['userid'] . "";



        switch (
$user['field23']) {
        
            case 
"CASE1":
            break;
            
            case 
"CASE2":
                
$sql_string "INSERT INTO vb_usergrouprequest (userid, usergroupid, reason, dateline) 
                    VALUES ('
$id','77','New Registration','$time')";
            break;
            
            case 
"CASE3":
                
$sql_string "INSERT INTO vb_usergrouprequest (userid, usergroupid, reason, dateline) 
                    VALUES ('
$id','67','New Registration','$time')";
            break;
            
            case 
"CASE4":
                
$sql_string "INSERT INTO vb_usergrouprequest (userid, usergroupid, reason, dateline) 
                    VALUES ('
$id','14','New Registration','$time')";
            break;
            
            case 
"CASE5":
                
$sql_string "INSERT INTO vb_usergrouprequest (userid, usergroupid, reason, dateline) 
                    VALUES ('
$id','13','New Registration','$time')";
            break;
            
            case 
"CASE6":
                
$sql_string "INSERT INTO vb_usergrouprequest (userid, usergroupid, reason, dateline) 
                    VALUES ('
$id','32','New Registration','$time')";
            break;
            
        }
    
$answer $db->query_first($sql_string); 

I can do PHP, but efficiency isn't a strong point within VB yet for me, so if anyone would like to improve the code, feel free and I'd appreciate it.

the duplicate SQL string is me after a long day just trying to make sure that SOME sql happens if none of the cases are hit, it would probably be just as good to check the sql to see if there is a string...


All times are GMT. The time now is 12:48 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.01272 seconds
  • Memory Usage 1,759KB
  • 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
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete