$content['insert_id'] = SURFBAR_INSERT_URL_BY_ARRAY($content);
// If in reg-mode we notify admin
- if ($addMode == "reg") {
- // Notify admin of newly added URL in surfbar
- SURFBAR_NOTIFY_ADMIN("url_reg", $content);
- } elseif ($_CONFIG['surfbar_notify_admin_unlock'] == "Y") {
+ if (($addMode == "reg") || ($_CONFIG['surfbar_notify_admin_unlock'] == "Y")) {
// Notify admin even when he as unlocked an email
- SURFBAR_NOTIFY_ADMIN("url_unlock", $content);
- }
+ SURFBAR_NOTIFY_ADMIN("url_{$addMode}", $content);
+ } // END - if
// Send mail to user
SURFBAR_NOTIFY_USER("url_{$addMode}", $content);
// Notify admin(s) with a selected message and content
function SURFBAR_NOTIFY_ADMIN ($messageType, $content) {
// Prepare template name
- $template = sprintf("admin_surfbar_%s", $messageType);
+ $templateName = sprintf("admin_surfbar_%s", $messageType);
+
+ // Prepare subject
+ $eval = sprintf("\$subject = ADMIN_SURFBAR_NOTIFY_%s_SUBJECT;",
+ strtoupper($messageType)
+ );
+ eval($eval);
+
+ // Send the notification out
+ SEND_ADMIN_NOTIFICATION($subject, $templateName, $content, $content['uid']);
+}
+// Notify the user about the performed action
+function SURFBAR_NOTIFY_USER ($messageType, $content) {
+ // Prepare template name
+ $templateName = sprintf("admin_surfbar_%s", $messageType);
+
+ // Prepare subject
+ $eval = sprintf("\$subject = MEMBER_SURFBAR_NOTIFY_%s_SUBJECT;",
+ strtoupper($messageType)
+ );
+ eval($eval);
+
+ // Load template
+ $mailText = LOAD_EMAIL_TEMPLATE($templateName, $content);
+
+ // Send the email
+ SEND_EMAIL($content['uid'], $subject, $mailText);
}
//
?>