Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2005, 09:51 PM
JustAskJulie JustAskJulie is offline
 
Join Date: Nov 2002
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Convert Secondary UserGroup to Primary UserGroup

I'm looking for an easy way to convert a secondary usergroup to the primary usergroup for a group of members. All are in the same usergroup, but are currently listed as secondary users. In order to be able to build a mailing list or mail the users, they have to be listed as primary users of the group, so I need to know how to convert their primary usergroup.

They are currently listed as primary usergroup: Registered
with secondary usergroup: Club Owner

I need their primary usergroup to be Club Owner.
Reply With Quote
  #2  
Old 01-05-2005, 03:30 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If people in this group have a custom usertitle of for example Club Owner, you might wanna select on that.
Reply With Quote
  #3  
Old 01-05-2005, 09:02 PM
JustAskJulie JustAskJulie is offline
 
Join Date: Nov 2002
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
you might wanna select on that.
Not sure what you mean.
Reply With Quote
  #4  
Old 01-05-2005, 09:33 PM
JustAskJulie JustAskJulie is offline
 
Join Date: Nov 2002
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I figured out what you mean, you can build a mailing list based on a user title. I tried that and out of about 200 users that are in that user group (both primary and secondary users) that pulled about 69 (about 9 more than are listed as primary users)

I need some way to just convert all those secondary users to primary users, short of going through each one individually and doing it by hand.
Reply With Quote
  #5  
Old 01-05-2005, 09:34 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I mean that you can select on the user title when generating a mail list, so if this group got a unique user title, you could use that to select the members for the mailing.
Reply With Quote
  #6  
Old 01-06-2005, 04:09 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got a better solution for you

Do the following modifications in your includes/adminfunctions_user.php (2 edits) and you will be able to select your users for the mailing also based on secondary membergroups.

In file includes/adminfunctions_user.php

Find:
PHP Code:
        print_membergroup_row($vbphrase['primary_usergroup'], 'user[usergroupid]'2$userarray); 
Add under:
PHP Code:
        // Start hack MarcoH64
        
print_membergroup_row($vbphrase['additional_usergroups'], 'user[membergroupids]'2$userarray);
        
// End hack MarcoH64 
In the same file find:
PHP Code:
    if (is_array($user['usergroupid']))
    { 
// for emails
        
foreach($user['usergroupid'] AS $id)
        {
            
$u_condition[] = "usergroupid = $id";
        } 
REPLACE by:
PHP Code:
    // Start hack MarcoH64
    
if (is_array($user['usergroupid']) OR is_array($user['membergroupids']))
    { 
// for emails
        
if (is_array($user['usergroupid']))
        {
            foreach(
$user['usergroupid'] AS $id)
            {
                
$u_condition[] = "usergroupid = $id";
            }
        }
        if (
is_array($user['membergroupids']))
        {
            foreach(
$user['membergroupids'] AS $id)
            {
                
$u_condition[] = "find_in_set($id, membergroupids)";
            }
        }
        
// End hack MarcoH64 
As usual test first on a test board, only limited tested by me.
Reply With Quote
  #7  
Old 01-08-2005, 07:26 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No feedback? Did this solve your problem?
Reply With Quote
  #8  
Old 01-10-2005, 03:45 PM
JustAskJulie JustAskJulie is offline
 
Join Date: Nov 2002
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, I'll give it a try.
Reply With Quote
  #9  
Old 03-04-2005, 10:15 PM
trulylowcarb's Avatar
trulylowcarb trulylowcarb is offline
 
Join Date: Apr 2004
Location: Colorado
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried another hack for this that didn't work; I will try yours soon and will definitely come back with feedback. This is a much-needed feature... I can't believe it's not part of VB, for some reason I was under the impression it was, - right up until I actually needed it... what a rude awakening that was.
I have already changed the one group by hand, 224 of them, but I would still like to be able to email other now-secondary groups....
cross everything!

I got
Quote:
Parse error: parse error, unexpected T_ELSE in /includes/adminfunctions_user.php on line 279
when I tried to Send mail ...

Running vb3.07 and CMPS 1.0...1? (newest one...)
Reply With Quote
  #10  
Old 03-05-2005, 09:05 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you missed something in the second change in the file.

Please double check you edit
Reply With Quote
Reply


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 01:52 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.04526 seconds
  • Memory Usage 2,274KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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