Quote:
Originally Posted by MarcoH64
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.
|
there needs to be a line added for 3.5.4, then it works just fine:
REPLACE by:
PHP Code:
// Start hack MarcoH64
if (is_array($user['usergroupid']) OR is_array($user['membergroupids']))
{ // for emails
// start addition, by tylneyt
// this line is necessary to create the variable in this scope
//
$u_condition = array();
// end addition
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
hope that helps, should actually be a standard feature of next vB if you ask me!