hi andy!
right, but I don't want to make moderators admins, hence I can't use that setting (I think) – or could I possibly make them admins with “no capabilities” e.g. to ?
here is what I did and the code piece that works (changes are highlighted). the only drawback is, that it requires the custom field to be the first custom field since it's hardcoded below (I'm sure this could be done a tad more elegant to make it dynamic).
with this change, moderators can now opt-in via their profile.
$admins_email = '';
### oliver:
### $admins = $wpdb->get_results(“SELECT user_id, admin_options FROM “.SFMEMBERS.” WHERE admin = 1″);
$admins = $wpdb->get_results(“SELECT user_id, admin_options FROM “.SFMEMBERS.” WHERE admin = 1 OR moderator = 1“);if ($admins)
{
foreach ($admins as $admin)
{
if ($admin->user_id != $newpost['userid'])
{
$admin_opts = unserialize($admin->admin_options);
###oliver: 2 lines below changed
$mod_opts = get_usermeta($admin->user_id, 'sfcustomfield0'); ### custom field hardcoded
if ($admin_opts['sfnotify'] || $mod_opts=='on')
{
$email = $wpdb->get_var(“SELECT user_email FROM “.SFUSERS.” WHERE ID = $admin->user_id”);
if ($admins_email != '') $admins_email .= ', ';
$admins_email .= $email;
}
}
}
}