Quote:
Originally Posted by 68 Z-28
However, this hack will only send PM's to people in a usergroup which they are a primary member of. I have made more usergroups for different regions, and the members have that as a secondary usergroup. If I try to send a PM to a specific regional group(all members are secondary not primary) it says that there are no members in that usergroup.
How would I go about modifying the code so it will also do a check for members that have a usergroup as the second one.
|
We use secondary groups too, primarily.

(We leave everyone except admins in Reg users (and banned, unregistered, etc). Additional permissions are in secondary groups, so we needed this to.
Here's what you need to do:
In admin_pmall.php
Find:
Code:
// Collect Array Of Members Within Specified Usergroup
$Get_Members=$DB->query("select * from ".TABLE_PREFIX."user where usergroupid='{$_POST['to_usergroup']}' order by userid");
REPLACE WITH:
Code:
// Collect Array Of Members Within Specified Usergroup
$Get_Members=$DB->query("select * from ".TABLE_PREFIX."user where usergroupid='{$_POST['to_usergroup']}' or membergroupids REGEXP '[[:<:]]{$_POST['to_usergroup']}[[:>:]]' order by userid");
Find:
Code:
// Collect Array Of Members Within Specified Usergroup
$Get_Members=$DB->query("select * from ".TABLE_PREFIX."user where usergroupid='{$_GET['usergroup']}' order by userid");
REPLACE WITH:
Code:
// Collect Array Of Members Within Specified Usergroup
$Get_Members=$DB->query("select * from ".TABLE_PREFIX."user where usergroupid='{$_GET['usergroup']}' or membergroupids REGEXP '[[:<:]]{$_GET['usergroup']}[[:>:]]' order by userid");
This will find members who are in the specified group as EITHER their primary or as a secondary. Hope that helps. Credit for the REGEXP goes to my sysadmin Dan (the Man).