X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fforced_functions.php;h=761e5bd73c72168afb6936305dc9fbc027a11282;hp=1705959c9353480cd4ec253f261aa63ca961bd2c;hb=e5dffd4249c97200cbad02f3f4eaf5c373fdb89a;hpb=2164ff00dd24d381e1d412ae248f486230b2019a diff --git a/inc/libs/forced_functions.php b/inc/libs/forced_functions.php index 1705959c93..761e5bd73c 100644 --- a/inc/libs/forced_functions.php +++ b/inc/libs/forced_functions.php @@ -358,7 +358,6 @@ function changeForcedCampaignStatus ($campaignId, $prevStatus, $newStatus, $data 'prev_status' => $prevStatus, 'new_status' => $newStatus, 'data' => $data, - 'abort' => NULL ); // Run pre filter chain @@ -401,12 +400,16 @@ function changeForcedCampaignStatus ($campaignId, $prevStatus, $newStatus, $data // Notify admin(s) with a selected message and content function doForcedNotifyAdmin ($messageType, $content) { // Prepare template name - $templateName = sprintf("admin_forced_%s", $messageType); + $templateName = sprintf('admin_forced_%s', $messageType); + + // Is the user id valid? + if (!isValidId($content['forced_campaign_userid'])) { + // No, then use admin-only template + $templateName = sprintf('admin_only_forced_%s', $messageType); + } // END - if // Prepare subject - $subject = sprintf("{--ADMIN_FORCED_NOTIFY_%s_SUBJECT--}", - strtoupper($messageType) - ); + $subject = sprintf('{--ADMIN_FORCED_NOTIFY_%s_SUBJECT--}', strtoupper($messageType)); // Is the subject line there? if ((substr($subject, 0, 1) == '!') && (substr($subject, -1, 1) == '!')) { @@ -430,12 +433,10 @@ function doForcedNotifyMember ($messageType, $content) { } // END - if // Prepare template name - $templateName = sprintf("member_forced_%s", $messageType); + $templateName = sprintf('member_forced_%s', $messageType); // Prepare subject - $subject = sprintf("{--MEMBER_FORCED_NOTIFY_%s_SUBJECT--}", - strtoupper($messageType) - ); + $subject = sprintf('{--MEMBER_FORCED_NOTIFY_%s_SUBJECT--}', strtoupper($messageType)); // Is the subject line there? if ((substr($subject, 0, 1) == '!') && (substr($subject, -1, 1) == '!')) { @@ -502,7 +503,7 @@ function doTemplateForcedAdSelectionBox ($templateName, $clear, $default = NULL) $forcedAds = getArrayFromForcedAdsByType(); // Handle it over to generateSelectionBoxFromArray() - $content = generateSelectionBoxFromArray($forcedAds, 'forced_ads_id', 'forced_ads_id', '', '', '', $default, 'forced_ads_type', FALSE, TRUE); + $content = generateSelectionBoxFromArray($forcedAds, 'forced_ads_id', 'forced_ads_id', '', '', '', $default, 'forced_ads_type'); // Return prepared content return $content; @@ -514,7 +515,7 @@ function doTemplateForcedCostsSelectionBox ($templateName, $clear, $default = NU $forcedCosts = getArrayFromForcedCostsByVisibility(); // Handle it over to generateSelectionBoxFromArray() - $content = generateSelectionBoxFromArray($forcedCosts, 'forced_costs_id', 'forced_costs_id', '', '', '', $default, '', TRUE, TRUE); + $content = generateSelectionBoxFromArray($forcedCosts, 'forced_costs_id', 'forced_costs_id', '', '', '', $default, '', TRUE); // Return prepared content return $content; @@ -523,7 +524,7 @@ function doTemplateForcedCostsSelectionBox ($templateName, $clear, $default = NU // Template helper function to create selection box for foreced campaign userid function doTemplateForcedCampaignUseridSelectionBox ($templateName, $clear, $default = NULL) { // Generate the selection box without all - $content = addMemberSelectionBox($default, FALSE, TRUE, TRUE, 'forced_campaign_userid[]'); + $content = addMemberSelectionBox($default, FALSE, TRUE, TRUE, 'forced_campaign_userid'); // Return prepared content return $content;