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)
-   -   AUTOJOIN - Auto-entry in membergroup via field in profile (https://vborg.vbsupport.ru/showthread.php?t=111870)

makaiguy 06-06-2006 03:29 AM

Amazing. It worked right out of the box with no debugging at all. Must have held my mouth just right while coding, or something. Anyhow, here's what to use as the control in place of the ones in the downloadable autojoin.txt file:
PHP Code:

// Add or remove user from secondary usergroup
// according checkboxes selected in user's profile
// Ver 1.4

global $vbulletin;

// Enter values in the strings below for your forum
  // number of the custom field containing your checkboxes
        
$boxes_field 'fieldX';
  
// Usergroup number for FIRST checkbox option
        
$ug[0] = 'X';                     
  
// Usergroup number for SECOND checkbox option 
        
$ug[1] = 'Y';                     
  
// add additional checkbox options as needed 

// You need make no changes below here
                         
// Derive additional needed variables
  // userid of user
        
$userid = ($vbulletin->userinfo['userid']);                           
  
// current usergroups as array
        
$ugarr explode(',' , (''.$vbulletin->userinfo['membergroupids']));  
  
// boxes selected
        
if ($vbulletin->userinfo[$boxes_field] == '')
        {
           
$fieldval 0;
        }   
        else
        {
           
$fieldval $vbulletin->userinfo[$boxes_field];
        } 

// Do the work
$iii 0;
foreach (
$ug as $value
{
   if (
$fieldval pow(2$iii))
   {
      
$ugarr IntoGroup($ugarr$ug[$iii], $userid);
   } 
   else
   {
      
$ugarr OutOfGroup($ugarr$ug[$iii], $userid);      
   } 
   
$iii++; 


.. then just add in the code for the two functions as in the downloaded autojoin.txt file.

I'll get this added to the autojoin.txt file real soon now ...

[Edit:] Has now been added to the downloadable autojoin.txt file, as version 1.05.

cavyspirit 08-26-2006 04:01 PM

I really need this in 3.6. First attempt isn't working.

makaiguy 08-31-2006 10:03 PM

Quote:

Originally Posted by cavyspirit
I really need this in 3.6. First attempt isn't working.

I haven't updated my board to 3.6 yet. But since this hack is very important to my board's operation, you can be sure I'll be updating it to work with 3.6 in the near future.

cavyspirit 11-12-2006 10:29 PM

I now need to make this work on the regular Birthday field.

I want one secondary user group assigned if the member is under 16 and another secondary user group assigned if the member is under 21. Is this possible? Can someone suggest the code change?

Thanks

RFViet 11-14-2006 01:49 PM

Quote:

Originally Posted by The Chief (Post 954573)
screen shots?

The same question !!

makaiguy 11-14-2006 10:35 PM

Quote:

Originally Posted by RFViet (Post 1117097)
The same question !!

The same answer: There are no screen shots because nothing is displayed onscreen. It just sets the user's secondary usergroups when he logs on, according to whatever you have set up.

Cocko 11-15-2006 06:30 PM

any product scripts .xml out for 3.6x ?

makaiguy 12-07-2006 01:31 PM

I've finally started playing with getting my board updated to 3.6 (3.6.4, actually).

AutoJoin has continued to work for me without modification to the original 3.5.4 installation.

salata 12-08-2006 01:42 AM

can you have them not enter the password at every login in? basically have them choose what usergroup they belong to at registration, I.E. if i had separate sections for men and women

makaiguy 12-08-2006 01:57 AM

Quote:

Originally Posted by salata (Post 1134248)
can you have them not enter the password at every login in? basically have them choose what usergroup they belong to at registration, I.E. if i had separate sections for men and women

The idea of this addon is that you create a special field in their profile. They enter the required value in this field in the profile one time, and on every subsequent login it checks for the required value in that profile field, and puts them into or out of the specified secondary user group.

[Edited to add] Code is provided to do this via several different formats for the custom profile field. You may do it as:
  1. Password for single usergroup (alternative to password-protected forum where user must enter password for every session - this way they only enter into their profile one time. Set your forum persmissions to only admit members of the specified usergroup.)
  2. Yes/No choice for single usergroup via radio button
  3. Choose one of several usergroups via radio buttons
  4. Choose any of several usergroups via multiple checkboxes


All times are GMT. The time now is 03:31 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.01193 seconds
  • Memory Usage 1,757KB
  • 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
  • (3)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