Support Forum
yes, thats the only change for notifications to optionally go to mods too...
Visit Cruise Talk Central and Mr Papa's World
Thank you!
Of course I always have something else up my sleave 🙂
So I also thought of connected the above with another criteria which stems from a new (custom) user pfoile field I added to allow a moderator to opt-in/out of receiving these emails.
...in addition I would have to add
, is this possible?
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.
### 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;
}
}
}
}
I didn't write this part and I can't easily test at the moment as my local codebase is in upheaval from a big restructuring. But as I understand it, your Moderator should be able to have access to the manage Admins personal options tab without having any of the actual Admin capabilities turned on. So they should be able to opt in for email notifications on that panel.
YELLOW
SWORDFISH
|
you do not have to be an admin to have access to the admin/moderator options (noitce the name of the tab). if a user is a moderator (in a usergroup with the moderator flag checked), the user will be shown the tab with the options in the wp admin. dont confuse the individual admin/moderator options with the global admin options. just verified its working properly.
perhaps I am misunderstanding what you are trying to do...
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)