X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-unlock_emails.php;h=1d95092fa81bba5c0075b3654377962054579d38;hp=881f9c21c7aa8a7b2bf1b9f067f09d3205bb4db0;hb=0f3a135204757cc8750262871c8e62c42300acb4;hpb=30ae22f62ae87c53a56baf0d134569ba91011111 diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php index 881f9c21c7..1d95092fa8 100644 --- a/inc/modules/admin/what-unlock_emails.php +++ b/inc/modules/admin/what-unlock_emails.php @@ -14,11 +14,9 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -43,11 +41,11 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { } // END - if // Add description as navigation point -addMenuDescription('admin', __FILE__); +addYouAreHereLink('admin', __FILE__); // Check for mails $result_main = SQL_QUERY("SELECT - `id`, `sender`, `subject`, `payment_id`, `timestamp`, `url`, `target_send`, `cat_id` + `id`,`sender`,`subject`,`payment_id`,`timestamp`,`url`,`target_send`,`cat_id` FROM `{?_MYSQL_PREFIX?}_pool` WHERE @@ -65,15 +63,15 @@ if ((!SQL_HASZERONUMS($result_main)) || (isFormSent('lock'))) { // Order placed in queue... $result = SQL_QUERY_ESC("SELECT - po.url, po.subject, po.sender, pay.payment, po.payment_id + po.`url`, po.`subject`, po.`sender`, pay.`payment`, po.`payment_id` FROM - `{?_MYSQL_PREFIX?}_pool` AS po + `{?_MYSQL_PREFIX?}_pool` AS `po` INNER JOIN - `{?_MYSQL_PREFIX?}_payments` AS pay + `{?_MYSQL_PREFIX?}_payments` AS `pay` ON - po.payment_id=pay.id + po.`payment_id`=pay.`id` WHERE - po.id=%s + po.`id`=%s LIMIT 1", array($id), __FILE__, __LINE__); @@ -82,9 +80,6 @@ LIMIT 1", // Load data $content = SQL_FETCHARRAY($result); - // Free result - SQL_FREERESULT($result); - // Is the surfbar installed? // @TODO Rewrite these if-blocks to a filter if ((isExtensionActive('surfbar')) && (getConfig('surfbar_migrate_order') == 'Y')) { @@ -93,7 +88,7 @@ LIMIT 1", } // END - if // Check for bonus extension version >= 0.4.4 for the order bonus - if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (ifBonusRallyeActive())) { + if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (isBonusRallyeActive())) { // Add points directly SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_order`=`bonus_order`+{?bonus_order?} WHERE `userid`=%s LIMIT 1", array(bigintval($content['sender'])), __FILE__, __LINE__); @@ -103,7 +98,7 @@ LIMIT 1", } // END - if // Load email template - $message_user = loadEmailTemplate('order-accept', $content, $content['sender']); + $message_user = loadEmailTemplate('member_order_accepted', $content, $content['sender']); // Send email sendEmail($content['sender'], '{--MEMBER_ORDER_ACCEPTED--}', $message_user); @@ -112,6 +107,9 @@ LIMIT 1", SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='NEW' WHERE `id`=%s AND `data_type`='ADMIN' LIMIT 1", array($id), __FILE__, __LINE__); } // END - if + + // Free result + SQL_FREERESULT($result); } // END - foreach // Set message @@ -122,8 +120,8 @@ LIMIT 1", } // Mails unlocked for mail delivery - loadTemplate('admin_settings_saved', false, $message); - } elseif (isPostRequestParameterSet(('reject'))) { + displayMessage($message); + } elseif (isPostRequestParameterSet('reject')) { if (ifPostContainsSelections()) { // Reject mail orders $OUT = ''; @@ -132,7 +130,7 @@ LIMIT 1", $id = bigintval($id); // Load URL and subject from pool - $result = SQL_QUERY_ESC("SELECT `url`, `subject`, `sender` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `url`,`subject`,`sender` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1", array($id), __FILE__, __LINE__); // Load data @@ -142,14 +140,16 @@ LIMIT 1", SQL_FREERESULT($result); // Load email template and send it away - $message_user = loadEmailTemplate('order-reject', $content, $content['sender']); + $message_user = loadEmailTemplate('member_order_rejected', $content, $content['sender']); sendEmail($content['sender'], '{--MEMBER_ORDER_REJECTED--}', $message_user); // If you do not enter an URL to redirect to, your URL will be set! - if ((!isPostRequestParameterSet('redirect')) || (postRequestParameter('redirect') == 'http://')) setPostRequestParameter('redirect', getUrl()); + if ((!isPostRequestParameterSet('redirect')) || (postRequestParameter('redirect') == 'http://')) { + setPostRequestParameter('redirect', getUrl()); + } // END - if // Redirect URL - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET url='%s', `data_type`='NEW' WHERE `id`=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `url`='%s', `data_type`='NEW' WHERE `id`=%s LIMIT 1", array(postRequestParameter('redirect'), $id),__FILE__, __LINE__); // Prepare data for the row template @@ -166,9 +166,9 @@ LIMIT 1", loadTemplate('admin_unlock_emails_redir', false, $OUT); } else { // Nothing selected - loadTemplate('admin_settings_saved', false, '{--ADMIN_MAILS_NOTHING_CHECKED--}'); + displayMessage('{--ADMIN_MAILS_NOTHING_CHECKED--}'); } - } elseif ((isFormSent('lock')) && (ifPostContainsSelections()) && (getConfig('url_blacklist') == 'Y')) { + } elseif ((isFormSent('lock')) && (ifPostContainsSelections()) && (isUrlBlacklistEnabled())) { // Lock URLs foreach (postRequestParameter('sel') as $id => $url) { // Secure id number @@ -188,7 +188,7 @@ LIMIT 1", } // END - foreach // Output message - loadTemplate('admin_settings_saved', false, '{--ADMIN_URLS_BLOCKED--}'); + displayMessage('{--ADMIN_URLS_BLOCKED--}'); } elseif ((!isFormSent('lock')) && (!isFormSent('accept')) && (!isFormSent('reject'))) { // Mail orders are in pool so we can display them $OUT = ''; @@ -208,16 +208,16 @@ LIMIT 1", // Load main template loadTemplate('admin_unlock_emails', false, $content); - } elseif ((isFormSent('lock')) && (getConfig('url_blacklist') != 'Y')) { + } elseif ((isFormSent('lock')) && (!isUrlBlacklistEnabled())) { // URL blacklist not activated - loadTemplate('admin_settings_saved', false, '{--ADMIN_URL_BLACKLIST_DISABLED--}'); + displayMessage('{--ADMIN_URL_BLACKLIST_DISABLED--}'); } else { // Wrong call! - loadTemplate('admin_settings_saved', false, '{--ADMIN_WRONG_CALL--}'); + displayMessage('{--ADMIN_WRONG_CALL--}'); } } else { // No mail orders fond - loadTemplate('admin_settings_saved', false, '{--ADMIN_NO_MAILS_IN_POOL--}'); + displayMessage('{--ADMIN_NO_MAILS_IN_POOL--}'); } // [EOF]