From 19cd0d37b2bcbf9dd4f3c38a9cecd7f5011d6b66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 2 Sep 2008 22:47:25 +0000 Subject: [PATCH] * Member template added for the surfbar which notifies the user that the URL is booked as email and in surfbar likewise. * Surfbar extended with notification option (PLEASE RE-INSTALL!) * Member order mails improved ($TARGET_URL and $SUBJECT are obsolete) * Whole admin notification simplified with function SEND_ADMIN_NOTIFICATION() * Surfbar continued in admin area while adding unlocked url from email orders --- .gitattributes | 1 + inc/autopurge.php | 60 +--------- inc/extensions/ext-surfbar.php | 1 + inc/functions.php | 48 +++++--- inc/language/surfbar_de.php | 3 + inc/libs/bonus_functions.php | 10 +- inc/libs/holiday_functions.php | 12 +- inc/libs/rallye_functions.php | 40 +------ inc/libs/sponsor_functions.php | 12 +- inc/libs/surfbar_functions.php | 109 +++++++++++++++++- inc/libs/transfer_functions.php | 13 +-- inc/modules/admin/what-config_surfbar.php | 11 ++ inc/modules/admin/what-unlock_emails.php | 11 +- inc/modules/frametester.php | 8 +- inc/modules/guest/what-register.php | 12 +- inc/modules/guest/what-sponsor_login.php | 12 +- inc/modules/guest/what-sponsor_reg.php | 12 +- inc/modules/member/what-holiday.php | 19 +-- inc/modules/member/what-newsletter.php | 9 +- inc/modules/member/what-payout.php | 11 +- inc/modules/member/what-stats.php | 95 ++++++++++----- inc/modules/member/what-support.php | 12 +- inc/modules/member/what-transfer.php | 14 +-- inc/modules/order.php | 7 +- inc/monthly/monthly_newsletter.php | 7 +- inc/monthly_newsletter.php | 10 +- inc/mysql-manager.php | 51 ++++---- inc/pool-update.php | 20 +--- templates/de/emails/order-accept.tpl | 4 +- templates/de/emails/order-reject.tpl | 5 +- templates/de/emails/order_accept_sb.tpl | 20 ++++ .../de/html/admin/admin_config_surfbar.tpl | 23 +++- templates/de/html/ext/ext_surfbar.tpl | 6 +- 33 files changed, 346 insertions(+), 342 deletions(-) create mode 100644 templates/de/emails/order_accept_sb.tpl diff --git a/.gitattributes b/.gitattributes index dadb96df82..ac8b497136 100644 --- a/.gitattributes +++ b/.gitattributes @@ -670,6 +670,7 @@ templates/de/emails/order-admin.tpl -text templates/de/emails/order-deleted.tpl -text templates/de/emails/order-member.tpl -text templates/de/emails/order-reject.tpl -text +templates/de/emails/order_accept_sb.tpl -text templates/de/emails/profile-updte.tpl -text templates/de/emails/register-admin.tpl -text templates/de/emails/register-member.tpl -text diff --git a/inc/autopurge.php b/inc/autopurge.php index 7c98694ed7..39c630bdeb 100644 --- a/inc/autopurge.php +++ b/inc/autopurge.php @@ -149,15 +149,7 @@ WHERE s.timestamp_ordered <= %s ORDER BY s.userid", if ($admin_points > 0) { // Send mail to admin - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO(AUTOPURGE_ADMIN_SUBJECT, "admin_autopurge_points", TRANSLATE_COMMA($points), "0"); - } - else - { - $msg = LOAD_EMAIL_TEMPLATE("admin_autopurge_points", TRANSLATE_COMMA($points), "0"); - SEND_ADMIN_EMAILS(AUTOPURGE_ADMIN_SUBJECT, $msg); - } + SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_SUBJECT, "admin_autopurge_points", TRANSLATE_COMMA($points), "0"); } } @@ -215,15 +207,7 @@ ORDER BY d.userid", array($since, $since, $since), __FILE__, __LINE__); $UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2)); // Send mail notification to admin - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO(AUTOPURGE_ADMIN_INACTIVE_SUBJECT, "admin_autopurge_inactive", $UIDs, ""); - } - else - { - $msg = LOAD_EMAIL_TEMPLATE("admin_autopurge_inactive", $UIDs, ""); - SEND_ADMIN_EMAILS(AUTOPURGE_ADMIN_INACTIVE_SUBJECT, $msg); - } + SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_INACTIVE_SUBJECT, "admin_autopurge_inactive", $UIDs, ""); } // Free memory @@ -262,15 +246,7 @@ ORDER BY userid", // Send mail notification to admin if ($_CONFIG['ap_un_mail'] == "Y") { - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO(AUTOPURGE_ADMIN_DELETE_SUBJECT, "admin_autopurge_delete", $UIDs, ""); - } - else - { - $msg = LOAD_EMAIL_TEMPLATE("admin_autopurge_delete", $UIDs, ""); - SEND_ADMIN_EMAILS(AUTOPURGE_ADMIN_DELETE_SUBJECT, $msg); - } + SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_DELETE_SUBJECT, "admin_autopurge_delete", $UIDs, ""); } } @@ -310,15 +286,7 @@ if ($_CONFIG['ap_unconfirmed'] == "Y") // Send mail notification to admin if ($_CONFIG['ap_un_mail'] == "Y") { - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO(AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT, "admin_autopurge_unconfirmed", $UIDs, ""); - } - else - { - $msg = LOAD_EMAIL_TEMPLATE("admin_autopurge_unconfirmed", $UIDs, ""); - SEND_ADMIN_EMAILS(AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT, $msg); - } + SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT, "admin_autopurge_unconfirmed", $UIDs, ""); } } @@ -338,15 +306,7 @@ if ((GET_EXT_VERSION("task") > "0.0") && ($_CONFIG['ap_tasks'] == "Y")) if (($DELETED > 0) && ($_CONFIG['ap_tasks_mail'] == "Y")) { // Send out email to admin - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO(AUTOPURGE_ADMIN_TASKS_SUBJECT, "admin_autopurge_tsks", $DELETED, ""); - } - else - { - $msg = LOAD_EMAIL_TEMPLATE("admin_autopurge_tsks", $DELETED, ""); - SEND_ADMIN_EMAILS(AUTOPURGE_ADMIN_TASKS_SUBJECT, $msg); - } + SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_TASKS_SUBJECT, "admin_autopurge_tsks", $DELETED, ""); } } @@ -421,15 +381,7 @@ if ($_CONFIG['ap_del_mails']) if (($DELETED > 0) && ($_CONFIG['ap_dm_notify'] == "Y")) { // Send out email to admin - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO(AUTOPURGE_ADMIN_DEL_MAILS_SUBJECT, "admin_autopurge_del_mails", $DELETED, ""); - } - else - { - $msg = LOAD_EMAIL_TEMPLATE("admin_autopurge_del_mails", $DELETED, ""); - SEND_ADMIN_EMAILS(AUTOPURGE_ADMIN_DEL_MAILS_SUBJECT, $msg); - } + SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_DEL_MAILS_SUBJECT, "admin_autopurge_del_mails", $DELETED, ""); } } diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index fccd16b36b..01002a892a 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -94,6 +94,7 @@ PRIMARY KEY(`id`) $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_reward` FLOAT(20,5) NOT NULL DEFAULT '0.25000'"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_time` SMALLINT(6) NOT NULL DEFAULT '60'"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_lock` SMALLINT(6) NOT NULL DEFAULT '".(60*60)."'"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_notify_admin_unlock` ENUM('N', 'Y') NOT NULL DEFAULT 'N'"; // Member menus $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar',NULL,'Surfbar','Y','Y',5)"; diff --git a/inc/functions.php b/inc/functions.php index d94a0336fe..2a9f001e7c 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -577,8 +577,7 @@ function TRANSLATE_SEX($sex) { return $ret; } // -function GET_POOL_TYPE($PT) -{ +function GET_POOL_TYPE($PT) { switch ($PT) { case "TEMP" : $ret = POOL_TEMP; break; @@ -592,33 +591,30 @@ function GET_POOL_TYPE($PT) return $ret; } // -function FRAMETESTER($URL) -{ - global $_SERVER; - $URL = URL."/modules.php?module=frametester&url=".urlencode(base64_encode(COMPILE_CODE($URL))); - return $URL; +function FRAMETESTER($URL) { + // Prepare frametester URL + $frametesterUrl = sprintf("%s/modules.php?module=frametester&url=%s", + URL, + urlencode(base64_encode(COMPILE_CODE($URL))) + ); + return $frametesterUrl; } // -function SELECTION_COUNT($array) -{ +function SELECTION_COUNT($array) { $ret = "0"; - if (is_array($array)) - { - foreach ($array as $key=>$sel) - { + if (is_array($array)) { + foreach ($array as $key => $sel) { if (!empty($sel)) $ret++; } } return $ret; } // -function IMG_CODE ($code, $type, $DATA, $uid) -{ +function IMG_CODE ($code, $type, $DATA, $uid) { return "\"Code\""; } // -function TRANSLATE_STATUS($status) -{ +function TRANSLATE_STATUS($status) { switch ($status) { case "UNCONFIRMED": @@ -1543,7 +1539,8 @@ function CREATE_TIMESTAMP_FROM_SELECTIONS($prefix, $POST) { return $ret; } // Sends out mail to all administrators -function SEND_ADMIN_EMAILS_PRO($subj, $template, $content="", $UID="0") { +// IMPORTANT: Please use SEND_ADMIN_NOTIFCATION() for now! +function SEND_ADMIN_EMAILS_PRO($subj, $template, $content, $UID) { // Trim template name $template = trim($template); @@ -2109,6 +2106,7 @@ function generatePassString($passHash) { // Return result return $ret; } + // Fix "deleted" cookies function FIX_DELETED_COOKIES ($cookies) { // Is this an array with entries? @@ -2122,6 +2120,7 @@ function FIX_DELETED_COOKIES ($cookies) { } } } + // Output error messages in a fasioned way and die... function mxchange_die ($msg) { global $footer; @@ -2196,6 +2195,7 @@ function set_session ($var, $value) { //* DEBUG: */ echo "IGNORED:".$var."=".$value."
\n"; return true; } + // Check wether a boolean constant is set // Taken from user comments in PHP documentation for function constant() function isBooleanConstantAndTrue($constname) { // : Boolean @@ -2208,7 +2208,6 @@ function isBooleanConstantAndTrue($constname) { // : Boolean function isSessionVariableSet($var) { return (isset($_SESSION[$var])); } - // Returns wether the value of the session variable or NULL if not set function get_session($var) { // Default is not found! ;-) @@ -2223,6 +2222,17 @@ function get_session($var) { // Return the value return $value; } +// Send notification to admin +function SEND_ADMIN_NOTIFICATION($subject, $templateName, $content="", $uid="0") { + if (GET_EXT_VERSION("admins") >= "0.4.1") { + // Send new way + SEND_ADMIN_EMAILS_PRO($subject, $templateName, $content, $uid); + } else { + // Send outdated way + $msg = LOAD_EMAIL_TEMPLATE($templateName, $content, $uid); + SEND_ADMIN_EMAILS($subject, $msg); + } +} // ////////////////////////////////////////////////// diff --git a/inc/language/surfbar_de.php b/inc/language/surfbar_de.php index 40afc1071f..6d71bb1e2e 100644 --- a/inc/language/surfbar_de.php +++ b/inc/language/surfbar_de.php @@ -45,6 +45,9 @@ define('ADMIN_CONFIG_SURFBAR_STATIC_LOCK', "Statische Reload-Sperre (oberes Fram define('ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL', "Vergütungsmodel auswählen:"); define('ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_STATIC', "Statische Werte verwenden."); define('ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_DYNAMIC', "Dynamische Werte errechnen."); +define('ADMIN_CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK', "Admin bei Freigabe von Mailbuchungen informieren, dass die URL in die Surfbar aufgenommen wurde?"); +define('ADMIN_SURFBAR_NOTIFY_UNLOCK_YES', "Ja, Admin(s) informieren."); +define('ADMIN_SURFBAR_NOTIFY_UNLOCK_NO', "Nein, nicht informieren."); define('ADMIN_SURFBAR_NO_REF_LEVELS_FOUND', "Zur Zeit sind keine Referal-Ebenen für die Surfbar eingestellt.
\nBitte installieren Sie die Erweiterung surfbar neu."); define('ADMIN_SURFBAR_ADD_NEW_REFDEPTH', "Neue Referal-Ebene zur Surfbar hinzufügen"); diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index e619dff3d4..ebd186a483 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -260,15 +260,7 @@ function BONUS_PURGE_EXPIRED_TURBO_BONUS() if ($DELETED > 0) { // Send out email to admin - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", $DELETED, ""); - } - else - { - $msg = LOAD_EMAIL_TEMPLATE("admin_autopurge_turbo", $DELETED, ""); - SEND_ADMIN_EMAILS(AUTOPURGE_ADMIN_TURBO_SUBJECT, $msg); - } + SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", $DELETED, ""); } } // diff --git a/inc/libs/holiday_functions.php b/inc/libs/holiday_functions.php index 5e10287d2f..49ab3b2be6 100644 --- a/inc/libs/holiday_functions.php +++ b/inc/libs/holiday_functions.php @@ -76,17 +76,7 @@ WHERE userid=%d LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); } // Send mail to admins - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - // Use new system - SEND_ADMIN_EMAILS_PRO(HOLIDAY_ADMIN_UNLOCK_SUBJ, "admin_holiday_unlock", $admin, "0"); - } - else - { - // Use old system - $msg = LOAD_EMAIL_TEMPLATE("admin_holiday_unlock", $admin, "0"); - SEND_ADMIN_EMAILS(HOLIDAY_ADMIN_UNLOCK_SUBJ, $msg); - } + SEND_ADMIN_NOTIFICATION(HOLIDAY_ADMIN_UNLOCK_SUBJ, "admin_holiday_unlock", $admin, "0"); } // Free memory diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index 69dc4de3b2..2a4f228c1f 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -135,20 +135,12 @@ VALUES ('%s', '%s', '%s', '%s')", } } - // Send email to admin + // Choose the right admin template $templ = "admin_rallye_no_notify"; if ($notify == "Y") $templ = "admin_rallye_notify"; - if (GET_EXT_VERSION("admins") < "0.4.1") - { - // Use old method to send out - $msg = LOAD_EMAIL_TEMPLATE($templ, $prices, 0); - SEND_ADMIN_EMAILS(RALLYE_ADMIN_NOTIFY.$title, $msg); - } - else - { - // Use new system to send out - SEND_ADMIN_EMAILS_PRO(RALLYE_ADMIN_NOTIFY.$title, $templ, $prices, "0"); - } + + // Send email to admin + SEND_ADMIN_NOTIFICATION(RALLYE_ADMIN_NOTIFY.$title, $templ, $prices, "0"); // Free memory SQL_FREERESULT($result_user); @@ -473,17 +465,7 @@ LIMIT 1", array(bigintval($uid), $since), __FILE__, __LINE__); } // Send mail to admin - if (GET_EXT_VERSION("admins") < "0.4.1") - { - // Use old method to send out - $msg = LOAD_EMAIL_TEMPLATE($templ, $cnt, 0); - SEND_ADMIN_EMAILS(RALLYE_ADMIN_EXPIRED.": ".$title, $msg); - } - else - { - // Use new system to send out - SEND_ADMIN_EMAILS_PRO(RALLYE_ADMIN_EXPIRED.": ".$title, $templ, $cnt, 0); - } + SEND_ADMIN_NOTIFICATION(RALLYE_ADMIN_EXPIRED.": ".$title, $templ, $cnt, 0); // Add task $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (status, task_type, subject, text, task_created) @@ -691,17 +673,7 @@ function RALLYE_DELETE_EXPIRED_RALLYES() $DATA['now_t'] = MAKE_DATETIME(time(), "1"); // Send mail to admin - if (GET_EXT_VERSION("admins") < "0.4.1") - { - // Use old method to send out - $msg = LOAD_EMAIL_TEMPLATE("admin_rallye_purged", "", 0); - SEND_ADMIN_EMAILS(RALLYE_ADMIN_PURGED.": ".$title, $msg); - } - else - { - // Use new system to send out - SEND_ADMIN_EMAILS_PRO(RALLYE_ADMIN_PURGED.": ".$title, "admin_rallye_purged", "", 0); - } + SEND_ADMIN_NOTIFICATION(RALLYE_ADMIN_PURGED.": ".$title, "admin_rallye_purged", "", 0); // Purge whole rallye $result_purge = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_data WHERE id=%d LIMIT 1", diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 6f43da5bb6..d76263196e 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -593,17 +593,7 @@ function SPONSOR_SAVE_DATA($POST, $content) if (isset($content['warning_interval'])) $DATA['interval'] = CREATE_FANCY_TIME($POST['warning_interval']); // Send email to admins - if (GET_EXT_VERSION("admins") < "0.4.1") - { - // Use old method to send out - $msg = LOAD_EMAIL_TEMPLATE($templ, $content); - SEND_ADMIN_EMAILS($subj, $msg); - } - else - { - // Use new system to send out - SEND_ADMIN_EMAILS_PRO($subj, $templ, $content); - } + SEND_ADMIN_NOTIFICATION($subj, $templ, $content); // Shall we send mail to the sponsor's new email address? if ($content['receive_warnings'] == "Y") diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 9680740da2..64d5ea0ec7 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -46,13 +46,118 @@ function SURFBAR_ADMIN_ADD_URL ($url, $uid, $reward) { } // END - if // Check if that URL does not exist - if (SURFBAR_LOOKUP_URL($url, $uid)) { + if (SURFBAR_LOOKUP_BY_URL($url, $uid)) { // Already found! return false; } // END - if // Register the new URL - return SURFBAR_REGISTER_URL($url, $uid, $reward, "CONFIRMED"); + return SURFBAR_REGISTER_URL($url, $uid, $reward, "CONFIRMED", "unlock"); +} +// Looks up by an URL +function SURFBAR_LOOKUP_BY_URL ($url) { + // Now lookup that given URL by itself + $urlArray = SURFBAR_GET_URL_DATA($url, "url"); + + // Was it found? + return (count($urlArray) > 0); +} +// Load URL data by given search term and column +function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="ASC", $group="id") { + global $lastUrlData; + + // By default nothing is found + $lastUrlData = array(); + + // Is the column an id number? + if (($column == "id") || ($column == "userid")) { + // Extra secure input + $searchTerm = bigintval($searchTerm); + } // END - if + + // Look up the record + $result = SQL_QUERY_ESC("SELECT id, userid, url, reward, views_total, status, registered, last_locked, lock_reason +FROM "._MYSQL_PREFIX."_surfbar_urls +WHERE %s='%s' +ORDER BY %s %s", + array($column, $searchTerm, $order, $sort), __FILE__, __LINE__); + + // Is there at least one record? + if (SQL_NUMROWS($result) > 0) { + // Then load all! + while ($dataRow = SQL_FETCHARRAY($result)) { + // Shall we group these results? + if ($group == "id") { + // Add the row by id as index + $lastUrlData[$dataRow['id']] = $dataRow; + } else { + // Group entries + $lastUrlData[$dataRow[$group]][$dataRow['id']] = $dataRow; + } + } // END - while + } // END - if + + // Free the result + SQL_FREERESULT($result); + + // Return the result + return $lastUrlData; +} +// Registers an URL with the surfbar. You should have called SURFBAR_LOOKUP_BY_URL() first! +function SURFBAR_REGISTER_URL ($url, $uid, $reward, $status="PENDING", $addMode="reg") { + global $_CONFIG; + + // Make sure by the user registered URLs are always pending + if ($addMode == "reg") $status = "PENDING"; + + // Prepare content + $content = array( + 'url' => $url, + 'frametester' => FRAMETESTER($url), + 'uid' => $uid, + 'reward' => $reward, + 'status' => $status + ); + + // Insert the URL into database + $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") { + // Notify admin even when he as unlocked an email + SURFBAR_NOTIFY_ADMIN("url_unlock", $content); + } + + // Send mail to user + SURFBAR_NOTIFY_USER("url_{$addMode}", $content); + + // Return the insert id + return $content['insert_id']; +} +// Inserts an url by given data array and return the insert id +function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) { + // Just run the insert query for now + /* + SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_urls (userid, url, reward, status) VALUES(%s, '%s', %s, '%s')", + array( + bigintval($urlData['userid']), + bigintval($urlData['url']), + (float)$urlData['reward'], + $urlData['status'] + ), __FILE__, __LINE__ + ); + */ + + // Return insert id + return SQL_INSERTID(); +} +// Notify admin(s) with a selected message and content +function SURFBAR_NOTIFY_ADMIN ($messageType, $content) { + // Prepare template name + $template = sprintf("admin_surfbar_%s", $messageType); } // ?> diff --git a/inc/libs/transfer_functions.php b/inc/libs/transfer_functions.php index 80ebfab0bb..c86eb51bc4 100644 --- a/inc/libs/transfer_functions.php +++ b/inc/libs/transfer_functions.php @@ -71,17 +71,8 @@ function TRANSFER_AUTPPURGE($max, $age) $REMOVE += SQL_AFFECTEDROWS($link); // Only send email to admin(s) when we have removed entries - if ($REMOVE > 0) - { - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO(TRANSFER_ADMIN_AUTOPURGE, "admin_transfer_ap", $REMOVE, 0); - } - else - { - $msg = LOAD_EMAIL_TEMPLATE("admin_transfer_ap", $REMOVE, 0); - SEND_ADMIN_EMAILS(TRANSFER_ADMIN_AUTOPURGE, $msg); - } + if ($REMOVE > 0) { + SEND_ADMIN_NOTIFICATION(TRANSFER_ADMIN_AUTOPURGE, "admin_transfer_ap", $REMOVE, 0); } } // diff --git a/inc/modules/admin/what-config_surfbar.php b/inc/modules/admin/what-config_surfbar.php index 10d587c675..f0343342bc 100644 --- a/inc/modules/admin/what-config_surfbar.php +++ b/inc/modules/admin/what-config_surfbar.php @@ -66,6 +66,17 @@ if (isset($_POST['ok'])) { define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', " checked=\"checked\""); } + // Prepare admin notify + if ($_CONFIG['surfbar_notify_admin_unlock'] == "Y") { + // Yes selected + define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y' , " checked=\"checked\""); + define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', ""); + } else { + // No selected + define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y' , ""); + define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', " checked=\"checked\""); + } + // Load template LOAD_TEMPLATE("admin_config_surfbar", false, $content); } diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php index 37eec82c61..3947745f46 100644 --- a/inc/modules/admin/what-unlock_emails.php +++ b/inc/modules/admin/what-unlock_emails.php @@ -93,11 +93,14 @@ LIMIT 1", // Check for surfbar extension if (EXT_IS_ACTIVE("surfbar")) { // Add the url - SURFBAR_ADMIN_ADD_URL($DATA[0], $DATA[2], $DATA[3]); - } // END - if + $insertId = SURFBAR_ADMIN_ADD_URL($DATA[0], $DATA[2], $DATA[3]); - // Load email template - $msg_user = LOAD_EMAIL_TEMPLATE("order-accept", "", $DATA[2]); + // Load email template + $msg_user = LOAD_EMAIL_TEMPLATE("order_accept_sb", $insertId, $DATA[2]); + } else { + // Load email template + $msg_user = LOAD_EMAIL_TEMPLATE("order-accept", "", $DATA[2]); + } // Send email SEND_EMAIL($DATA[2], MEMBER_ORDER_ACCEPTED, $msg_user); diff --git a/inc/modules/frametester.php b/inc/modules/frametester.php index a6daa40721..2f44befb0a 100644 --- a/inc/modules/frametester.php +++ b/inc/modules/frametester.php @@ -73,8 +73,14 @@ if (!empty($_GET['order'])) { if ((!empty($_POST['url'])) || (!empty($_GET['url'])) || (!empty($_GET['frame']))) { $url = URL; if (!empty($_POST['url'])) $url = $_POST['url']; + + // Decode URL if set if (!empty($_GET['url'])) $url = base64_decode(urldecode(COMPILE_CODE($_GET['url']))); - switch ($_GET['frame']) + + // Add missing element + $frame = ""; + if (!empty($_GET['frame'])) $frame = SQL_ESCAPE($_GET['frame']); + switch ($frame) { case "": switch ($MODE) diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index 758da7a7e4..c0eeb66f5b 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -338,17 +338,7 @@ array( $DATA['email'] = $EMAIL; // Send mail to admin - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - // Use new system - SEND_ADMIN_EMAILS_PRO(ADMIN_NEW_ACCOUNT, "register-admin", $DATA, $userid); - } - else - { - // Use old system - $msg_admin = LOAD_EMAIL_TEMPLATE("register-admin", $DATA, $userid); - SEND_ADMIN_EMAILS (ADMIN_NEW_ACCOUNT, $msg_admin); - } + SEND_ADMIN_NOTIFICATION(ADMIN_NEW_ACCOUNT, "register-admin", $DATA, $userid); // Output success registration LOAD_TEMPLATE("admin_settings_saved", false, REGISTRATION_DONE); diff --git a/inc/modules/guest/what-sponsor_login.php b/inc/modules/guest/what-sponsor_login.php index 2c00d2ec86..ed600bdd8c 100644 --- a/inc/modules/guest/what-sponsor_login.php +++ b/inc/modules/guest/what-sponsor_login.php @@ -88,17 +88,7 @@ WHERE id='%s' AND hash='%s' AND status='UNCONFIRMED' LIMIT 1", SEND_EMAIL($SPONSOR['email'], SPONSOR_ACCOUNT_PENDING_SUBJ, $MSG); // Send email to admin - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - // Use new system - SEND_ADMIN_EMAILS_PRO (ADMIN_NEW_SPONSOR, "admin_sponsor_pending", $SPONSOR); - } - else - { - // Send over old system - $msg_admin = LOAD_EMAIL_TEMPLATE("admin_sponsor_pending", $SPONSOR); - SEND_ADMIN_EMAILS (ADMIN_NEW_SPONSOR, $msg_admin); - } + SEND_ADMIN_NOTIFICATION(ADMIN_NEW_SPONSOR, "admin_sponsor_pending", $SPONSOR); // Sponsor account set to pending LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACCOUNT_IS_PENDING); diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php index 3d54c25b2c..875a6584ae 100644 --- a/inc/modules/guest/what-sponsor_reg.php +++ b/inc/modules/guest/what-sponsor_reg.php @@ -263,17 +263,7 @@ WHERE id='%s' LIMIT 1", array($_POST['pay_type']), __FILE__, __LINE__); SEND_EMAIL($_POST['email'], SPONSOR_PLEASE_CONFIRM_SUBJ, $EMAIL_MSG); // Send mail to admin - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - // Use new system - SEND_ADMIN_EMAILS_PRO(ADMIN_NEW_SPONSOR, "admin_sponsor_reg", $hash); - } - else - { - // Send over old system - $msg_admin = LOAD_EMAIL_TEMPLATE("admin_sponsor_reg", $hash); - SEND_ADMIN_EMAILS (ADMIN_NEW_SPONSOR, $msg_admin); - } + SEND_ADMIN_NOTIFICATION(ADMIN_NEW_SPONSOR, "admin_sponsor_reg", $hash); // Output message: DONE $MSG = $MSGs['added']; diff --git a/inc/modules/member/what-holiday.php b/inc/modules/member/what-holiday.php index f2db3cf65d..57c5e38485 100644 --- a/inc/modules/member/what-holiday.php +++ b/inc/modules/member/what-holiday.php @@ -132,14 +132,7 @@ WHERE userid=%d LIMIT 1", // Send mail to all admins $msg = LOAD_EMAIL_TEMPLATE("admin_holiday_request", $_POST['comments'], $GLOBALS['userid']); - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO(HOLIDAY_ADMIN_SUBJECT, "admin_holiday_request", $_POST['comments'], $GLOBALS['userid']); - } - else - { - SEND_ADMIN_EMAILS(HOLIDAY_ADMIN_SUBJECT, $msg); - } + SEND_ADMIN_NOTIFICATION(HOLIDAY_ADMIN_SUBJECT, "admin_holiday_request", $_POST['comments'], $GLOBALS['userid']); // Create task $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (userid, assigned_admin, status, task_type, subject, text, task_created) VALUES ('%s', '0', 'NEW', 'HOLIDAY_REQUEST', '%s', '%s', UNIX_TIMESTAMP())", @@ -184,15 +177,7 @@ WHERE userid=%d LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); WHERE userid=%d LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Send email to admin - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO(HOLIDAY_ADMIN_DEAC_SUBJ, "admin_holiday_deactivated", "", $GLOBALS['userid']); - } - else - { - $msg = LOAD_EMAIL_TEMPLATE("admin_holiday_deactivated", "", $GLOBALS['userid']); - SEND_ADMIN_EMAILS(HOLIDAY_ADMIN_DEAC_SUBJ, $msg); - } + SEND_ADMIN_NOTIFICATION(HOLIDAY_ADMIN_DEAC_SUBJ, "admin_holiday_deactivated", "", $GLOBALS['userid']); // Display message to user LOAD_TEMPLATE("admin_settings_saved", false, HOLIDAY_MEMBER_DEACTIVATED_NOW); diff --git a/inc/modules/member/what-newsletter.php b/inc/modules/member/what-newsletter.php index 6d21c0c0aa..04a8dbfc31 100644 --- a/inc/modules/member/what-newsletter.php +++ b/inc/modules/member/what-newsletter.php @@ -77,14 +77,7 @@ VALUES ('0', 'NEW', 'NL_UNSUBSCRIBE', '".ADMIN_NL_SUBJECT."', '".addslashes($adm SEND_EMAIL($GLOBALS['userid'], NL_MEMBER_SUBJECT, $msg); // Send mail to all admins - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO(NL_ADMIN_SUBJECT, "admin_newsletter_request", "", $GLOBALS['userid']); - } - else - { - SEND_ADMIN_EMAILS(NL_ADMIN_SUBJECT, $admin_msg); - } + SEND_ADMIN_NOTIFICATION(NL_ADMIN_SUBJECT, "admin_newsletter_request", "", $GLOBALS['userid']); // Display message LOAD_TEMPLATE("admin_settings_saved", false, NL_MEMBER_REQUEST_DONE); diff --git a/inc/modules/member/what-payout.php b/inc/modules/member/what-payout.php index 3ed797f332..a61a58bf3c 100644 --- a/inc/modules/member/what-payout.php +++ b/inc/modules/member/what-payout.php @@ -267,16 +267,7 @@ VALUES (0, 'NEW', 'PAYOUT_REQUEST', '[payout:] ".PAYOUT_REQUEST_ADMIN."', '%s', SEND_EMAIL($GLOBALS['userid'], PAYOUT_REQUEST_MEMBER, $msg_mem); // To admin(s) - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - // Use new method - SEND_ADMIN_EMAILS_PRO(PAYOUT_REQUEST_ADMIN, $admin_tpl, "", $GLOBALS['userid']); - } - else - { - // Use old method - SEND_ADMIN_EMAILS(PAYOUT_REQUEST_ADMIN, $msg_adm); - } + SEND_ADMIN_NOTIFICATION(PAYOUT_REQUEST_ADMIN, $admin_tpl, "", $GLOBALS['userid']); // Load template and output it LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_REQUEST_SENT); diff --git a/inc/modules/member/what-stats.php b/inc/modules/member/what-stats.php index 5ffeb58d6d..a6a9468d83 100644 --- a/inc/modules/member/what-stats.php +++ b/inc/modules/member/what-stats.php @@ -32,43 +32,86 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_LOGGED_IN()) -{ +} elseif (!IS_LOGGED_IN()) { LOAD_URL("modules.php?module=index"); } // Add description as navigation point ADD_DESCR("member", basename(__FILE__)); +// Load waiting/pending orders +$result = SQL_QUERY_ESC("SELECT id, cat_id, payment_id, subject, url, timestamp, target_send, data_type, zip +FROM "._MYSQL_PREFIX."_pool +WHERE sender=%d AND data_type != 'SEND' +ORDER BY timestamp DESC", + array($GLOBALS['userid']), __FILE__, __LINE__); + +// Are there mails left in pool? +if (SQL_NUMROWS($result) > 0) { + // Load all orders + $OUT = ""; $SW = 2; + while ($data = SQL_FETCHARRAY($result)) { + // Is the ZIP code set? If not, set dashes + if (empty($data['zip'])) $data['zip'] = "---"; + + // Prepare content for output + $content = array( + 'sw' => $SW, + 'id' => $data['id'] + 'cat' => GET_CATEGORY($data['cat_id']), + 'pay' => GET_PAYMENT($data['payment_id']), + 'subj' => COMPILE_CODE($data['subject']), + 'url' => DEREFERER($data['url']), + 'stamp' => MAKE_DATETIME($data['timestamp'], "0"), + 'recs' => $data['target_send'], + 'type' => TRANSLATE_POOL_TYPE($data['data_type']), + 'zip' => bigintval($data['zip']) + ); + + // Load template + $OUT .= LOAD_TEMPLATE("member_pool_row", true, $content); + + // Switch color + $SW = 3 - $SW; + } // END - if + + // Load main template + LOAD_TEMPLATE("member_pool", false, $OUT); +} else { + // No mails in pool! + LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_NO_MAILS_IN_POOL); +} + +// Free result +SQL_FREERESULT($result); + +// Load sent orders // 0 1 2 3 4 5 6 7 8 $result = SQL_QUERY_ESC("SELECT id, cat_id, payment_id, subject, url, timestamp_ordered, max_rec, timestamp_send, clicks FROM "._MYSQL_PREFIX."_user_stats -WHERE userid=%d ORDER BY timestamp_ordered DESC", - array($GLOBALS['userid']), __FILE__, __LINE__); +WHERE userid=%d +ORDER BY timestamp_ordered DESC", + array($GLOBALS['userid']), __FILE__, __LINE__); -if (SQL_NUMROWS($result) > 0) -{ +if (SQL_NUMROWS($result) > 0) { // Mail orders are in pool so we can display them $SW = 2; $OUT = ""; - while ($pool = SQL_FETCHROW($result)) - { + while ($data = SQL_FETCHROW($result)) { // Prepare data for the template $content = array( 'sw' => $SW, - 'cat' => GET_CATEGORY(bigintval($pool[1])), - 'pay' => GET_PAYMENT(bigintval($pool[2])), - 'subj' => COMPILE_CODE($pool[3]), - 'url' => DEREFERER($pool[4]), - 'stamp' => MAKE_DATETIME($pool[5], "0"), - 'recs' => $pool[6], - 'sent' => MAKE_DATETIME($pool[7], "0"), - 'clix' => $pool[8], - 'perc' => COMPILE_CODE($pool[8] / $pool[6] * 100)."%", + 'cat' => GET_CATEGORY($data[1]), + 'pay' => GET_PAYMENT($data[2]), + 'subj' => COMPILE_CODE($data[3]), + 'url' => DEREFERER($data[4]), + 'stamp' => MAKE_DATETIME($data[5], "0"), + 'recs' => $data[6], + 'sent' => MAKE_DATETIME($data[7], "0"), + 'clix' => $data[8], + 'perc' => COMPILE_CODE($data[8] / $data[6] * 100)."%", ); // Load row template and switch colors @@ -76,20 +119,18 @@ if (SQL_NUMROWS($result) > 0) $SW = 3 - $SW; } - // Free memory - SQL_FREERESULT($result); - // Remember rows in template define('__STATS_ROWS', $OUT); // Load main template LOAD_TEMPLATE("member_stats_table"); -} - else -{ +} else { // No mail orders fond - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_NO_MAILS_IN_POOL); + LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_NO_MAILS_IN_STATS); } +// Free result +SQL_FREERESULT($result); + // ?> diff --git a/inc/modules/member/what-support.php b/inc/modules/member/what-support.php index 6a723d1ed8..d98a7808ee 100644 --- a/inc/modules/member/what-support.php +++ b/inc/modules/member/what-support.php @@ -76,16 +76,10 @@ if ((!isset($_POST['ok'])) || (empty($_POST['qsummary']))) case "unconfirmed": $subj_a = SUPPORT_SUBJ_ADMIN_UNCONFIRMED; $subj_m = SUPPORT_SUBJ_MEMBER_UNCONFIRMED; break; } - // Send mails away - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO($subj_a, $a_tpl, $_POST['qdetails'], $GLOBALS['userid']); - } - else - { - SEND_ADMIN_EMAILS($subj_a, $msg_a); - } + // Send mail to admin + SEND_ADMIN_NOTIFICATION($subj_a, $a_tpl, $_POST['qdetails'], $GLOBALS['userid']); + // Send mail to user SEND_EMAIL($GLOBALS['userid'], $subj_m, $msg_m); // Drop a message in the admin's area diff --git a/inc/modules/member/what-transfer.php b/inc/modules/member/what-transfer.php index a3193b89b3..6028b1567f 100644 --- a/inc/modules/member/what-transfer.php +++ b/inc/modules/member/what-transfer.php @@ -217,21 +217,11 @@ case "new": // Start new transfer SEND_EMAIL(__SENDER_EMAIL, TRANSFER_MEMBER_SENDER_SUBJ.": ".$RECIPIENT, $msg); // At last send admin mail(s) - $ADMIN_SUBJ = TRANSFER_ADMIN_SUBJECT." (".$SENDER."->".$RECIPIENT.")"; - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO($ADMIN_SUBJ, "admin_transfer_points"); - } - else - { - $msg = LOAD_EMAIL_TEMPLATE("admin_transfer_points"); - SEND_ADMIN_EMAILS($ADMIN_SUBJ, $msg); - } + $ADMIN_SUBJ = sprintf("%s (%s->%s)", TRANSFER_ADMIN_SUBJECT, $SENDER, $RECIPIENT); + SEND_ADMIN_NOTIFICATION($ADMIN_SUBJ, "admin_transfer_points"); // Transfer is completed - OUTPUT_HTML("

"); LOAD_TEMPLATE("admin_settings_saved", false, TRANSFER_COMPLETED."
".TRANSFER_CONTINUE_OVERVIEW.""); - OUTPUT_HTML("

"); } elseif (!$valid_code) { diff --git a/inc/modules/order.php b/inc/modules/order.php index e51354e30e..53d88eb778 100644 --- a/inc/modules/order.php +++ b/inc/modules/order.php @@ -104,12 +104,7 @@ if (empty($URL)) { SEND_EMAIL($email, MEMBER_NEW_QUEUE, $msg_mem); // Notify admins about this - if (GET_EXT_VERSION("admins") >= "0.4.1") { - SEND_ADMIN_EMAILS_PRO(ADMIN_NEW_QUEUE, "order-admin", "", $GLOBALS['userid']); - } else { - $msg_admin = LOAD_EMAIL_TEMPLATE("order-admin", "", $GLOBALS['userid']); - SEND_ADMIN_EMAILS(ADMIN_NEW_QUEUE, $msg_admin); - } + SEND_ADMIN_NOTIFICATION(ADMIN_NEW_QUEUE, "order-admin", "", $GLOBALS['userid']); // Output back bottom LOAD_TEMPLATE("member_order-back", false); diff --git a/inc/monthly/monthly_newsletter.php b/inc/monthly/monthly_newsletter.php index fdbfd59054..1afaf04c61 100644 --- a/inc/monthly/monthly_newsletter.php +++ b/inc/monthly/monthly_newsletter.php @@ -67,12 +67,7 @@ if ($_CONFIG['nl_month'] != $curr) SEND_EMAIL($uid, NL_MEMBER_RESET_SUBJECT, $msg); // Send email to admin - if (GET_EXT_VERSION("admins") >= "0.4.1") { - SEND_ADMIN_EMAILS_PRO(NL_ADMIN_SUBJECT, "admin_newsletter_reset", "", $GLOBALS['userid']); - } else { - $msg = LOAD_EMAIL_TEMPLATE("admin_newsletter_reset", true, bigintval($uid)); - SEND_ADMIN_EMAILS(NL_ADMIN_SUBJECT, $msg); - } + SEND_ADMIN_NOTIFICATION(NL_ADMIN_SUBJECT, "admin_newsletter_reset", "", $GLOBALS['userid']); } // Free memory diff --git a/inc/monthly_newsletter.php b/inc/monthly_newsletter.php index bcb50202e5..018f57fdd3 100644 --- a/inc/monthly_newsletter.php +++ b/inc/monthly_newsletter.php @@ -53,15 +53,7 @@ if (SQL_NUMROWS($result) > 0) SEND_EMAIL($uid, NL_MEMBER_RESET_SUBJECT, $msg); // Send email to admin - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO(NL_ADMIN_SUBJECT, "admin_newsletter_reset", "", $GLOBALS['userid']); - } - else - { - $msg = LOAD_EMAIL_TEMPLATE("admin_newsletter_reset", true, $uid); - SEND_ADMIN_EMAILS(NL_ADMIN_SUBJECT, $msg); - } + SEND_ADMIN_NOTIFICATION(NL_ADMIN_SUBJECT, "admin_newsletter_reset", "", $GLOBALS['userid']); } } diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 88c5f62138..4be52eb6d6 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -827,11 +827,7 @@ function SEND_MODE_MAILS($mod, $modes) if (empty($content)) { if ((!empty($sub_adm)) && (!empty($msg_admin))) { // Send admin mail - if (GET_EXT_VERSION("admins") >= "0.4.1") { - SEND_ADMIN_EMAILS_PRO($sub_adm, $msg_admin, $content, $GLOBALS['userid']); - } else { - SEND_ADMIN_EMAILS($sub_adm, LOAD_EMAIL_TEMPLATE($msg_admin, $content, $GLOBALS['userid'])); - } + SEND_ADMIN_NOTIFICATION($sub_adm, $msg_admin, $content, $GLOBALS['userid']); } elseif ($_CONFIG['admin_notify'] == "Y") { // Cannot send mails to admin! $content = CANNOT_SEND_ADMIN_MAILS; @@ -919,39 +915,48 @@ function GET_ACTION ($MODE, &$wht) return $ret; } // -function GET_CATEGORY ($cid) -{ +function GET_CATEGORY ($cid) { + // Default is not found $ret = _CATEGORY_404; - $result = SQL_QUERY_ESC("SELECT cat FROM "._MYSQL_PREFIX."_cats WHERE id=%d LIMIT 1", array($cid), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) - { + + // Lookup the category + $result = SQL_QUERY_ESC("SELECT cat FROM "._MYSQL_PREFIX."_cats WHERE id=%d LIMIT 1", + array(bigintval($cid)), __FILE__, __LINE__); + if (SQL_NUMROWS($result) == 1) { // Category found... :-) list($ret) = SQL_FETCHROW($result); - SQL_FREERESULT($result); - } + } // END - if + + // Free result + SQL_FREERESULT($result); + + // Return result return $ret; } // -function GET_PAYMENT ($pid, $full=false) -{ +function GET_PAYMENT ($pid, $full=false) { + // Default is not found $ret = _PAYMENT_404; - $result = SQL_QUERY_ESC("SELECT mail_title, price FROM "._MYSQL_PREFIX."_payments WHERE id=%d LIMIT 1", array($pid), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) - { + + // Load payment data + $result = SQL_QUERY_ESC("SELECT mail_title, price FROM "._MYSQL_PREFIX."_payments WHERE id=%d LIMIT 1", + array(bigintval($pid)), __FILE__, __LINE__); + if (SQL_NUMROWS($result) == 1) { // Payment type found... :-) - if (!$full) - { + if (!$full) { // Return only title list($ret) = SQL_FETCHROW($result); - SQL_FREERESULT($result); - } - else - { + } else { // Return title and price list($t, $p) = SQL_FETCHROW($result); $ret = $t." / ".TRANSLATE_COMMA($p)." ".POINTS; } } + + // Free result + SQL_FREERESULT($result); + + // Return result return $ret; } // diff --git a/inc/pool-update.php b/inc/pool-update.php index c110f34306..d69a008cd0 100644 --- a/inc/pool-update.php +++ b/inc/pool-update.php @@ -184,16 +184,7 @@ if (SQL_NUMROWS($result_main) > 0) if ((($cnt >= $DATA[8])) && ($LAST_SENT_ID != $DATA[0])) { // Yes we do, so we notify admin and sender about fully sent mail! - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - // New method - SEND_ADMIN_EMAILS_PRO(ADMIN_SUBJ_SEND_DONE, "done-admin", $DATA[3], $uid); - } - else - { - // Old method - SEND_ADMIN_EMAILS(ADMIN_SUBJ_SEND_DONE, LOAD_EMAIL_TEMPLATE("done-admin", $DATA[3], $uid)); - } + SEND_ADMIN_NOTIFICATION(ADMIN_SUBJ_SEND_DONE, "done-admin", $DATA[3], $uid); // Get sender's data $result_sender = SQL_QUERY_ESC("SELECT surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1", @@ -313,14 +304,7 @@ if (SQL_NUMROWS($result_main) > 0) ADD_JACKPOT($PB); // Send mail out to admin - if (GET_EXT_VERSION("admins") >= "0.4.1") - { - SEND_ADMIN_EMAILS_PRO(ADMIN_BACK_JACKPOT." (".$uid.")", "back-admin", "", "admin"); - } - else - { - SEND_ADMIN_EMAILS(ADMIN_BACK_JACKPOT." (".$uid.")", LOAD_TEMPLATE("back-admin", "", "admin")); - } + SEND_ADMIN_NOTIFICATION(ADMIN_BACK_JACKPOT." (".$uid.")", "back-admin", "", "admin"); } } } diff --git a/templates/de/emails/order-accept.tpl b/templates/de/emails/order-accept.tpl index 7613e650d6..68e501390d 100644 --- a/templates/de/emails/order-accept.tpl +++ b/templates/de/emails/order-accept.tpl @@ -3,9 +3,9 @@ Hallo $salut $surname, $family, Einer unserer Administratoren hat soeben Ihre Mailbuchung freigegeben. Sie wird von unserem System automatisch versendet! Bitte beachten Sie, dass dies ggf. zeitversetzt zu dieser Mail versendet wird. Hier sind nochmals URL und Betreff Ihrer Mailbuchung: ----------------------------- -Beworbene URL: $TARGET_URL +Beworbene URL: $DATA[url] ----------------------------- -Betreffzeile: $SUBJECT +Betreffzeile: $DATA[subject] ----------------------------- Sie koennen den Versand-Fortschritt im Mitgliedsmenue unter "Unbestaetigte Mails" verfolgen. Sobald die Mail vollstaendig versendet wurde, erhalten Sie eine weitere Mail! diff --git a/templates/de/emails/order-reject.tpl b/templates/de/emails/order-reject.tpl index e533bded98..f332d2aba8 100644 --- a/templates/de/emails/order-reject.tpl +++ b/templates/de/emails/order-reject.tpl @@ -3,8 +3,9 @@ Hallo $salut $surname $family, Einer unserer Administratoren hat soeben Ihre Mailbuchung abgelehnt. Bite beachten Sie unsere AGBs! Bei weiteren Verstoessen gegen unsere AGBs werden wir Ihre URL und ggf. auch Ihren Account sperren. Hier sind nochmals Ihre URL und Betreff Ihrer Mailbuchung: ----------------------------- -Beworbene URL: $TARGET_URL -Betreffzeile: $SUBJECT +Beworbene URL: $DATA[url] +----------------------------- +Betreffzeile: $DATA[subject] ----------------------------- Ihre Mailbuchung wurde somit gelöscht. Sollten Sie Fragen hierzu haben, so wenden Sie sich bitte an unseren Support. diff --git a/templates/de/emails/order_accept_sb.tpl b/templates/de/emails/order_accept_sb.tpl new file mode 100644 index 0000000000..7f431b8bd2 --- /dev/null +++ b/templates/de/emails/order_accept_sb.tpl @@ -0,0 +1,20 @@ +Hallo $salut $surname, $family, + +Einer unserer Administratoren hat soeben Ihre Mailbuchung freigegeben. Sie wird von unserem System automatisch versendet! Bitte beachten Sie, dass dies ggf. zeitversetzt zu dieser Mail versendet wird. Hier sind nochmals URL und Betreff Ihrer Mailbuchung: + +----------------------------- +Beworbene URL: $TARGET_URL +----------------------------- +Betreffzeile: $SUBJECT +----------------------------- + +Sie koennen den Versand-Fortschritt im Mitgliedsmenue unter "Unbestaetigte Mails" verfolgen. Sobald die Mail vollstaendig versendet wurde, erhalten Sie eine weitere Mail! + +Ihre URL wurde zusätzlich unter der Id-Nummer $content für die Surfbar freigegeben. + +Vielen Dank. + +Mit freundlichem Gruss, + Ihr {!MAIN_TITLE!} Team + +{!URL!} ({!WEBMASTER!}) diff --git a/templates/de/html/admin/admin_config_surfbar.tpl b/templates/de/html/admin/admin_config_surfbar.tpl index 715d56b632..36149f6806 100644 --- a/templates/de/html/admin/admin_config_surfbar.tpl +++ b/templates/de/html/admin/admin_config_surfbar.tpl @@ -33,7 +33,7 @@   - + {--ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL--} @@ -46,13 +46,30 @@ - + {--ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_DYNAMIC--} - + +   +   + + + {--ADMIN_CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK--} + + +   + + + {--ADMIN_SURFBAR_NOTIFY_UNLOCK_YES--} + + + {--ADMIN_SURFBAR_NOTIFY_UNLOCK_NO--} + + +    * diff --git a/templates/de/html/ext/ext_surfbar.tpl b/templates/de/html/ext/ext_surfbar.tpl index 4ea079e30d..d3bc44093d 100644 --- a/templates/de/html/ext/ext_surfbar.tpl +++ b/templates/de/html/ext/ext_surfbar.tpl @@ -22,4 +22,8 @@ Vergütung eingestellt haben oder dynamisch. Dabei richtet sich ebenfalls die Basiswartezeit nach der Verweildauer aus der gebuchten Mails. Bei direkt in der Surbar gebuchten URLs gilt eine eingestellte Festzeit und Festpreis.

-Das Mitglied kann nicht seine eigenen Seiten besuchen! +Das Mitglied kann nicht seine eigenen Seiten besuchen! Sobald alle gebuchten +- also freigegebenen - URLs in Reload-Sperre sind, wird ein grafischer Code +nach einer einstellbaren Wartezeit angezeigt, den der User wiederholen muss, +um weiter zu verdienen. Dies geht jedoch nur, wenn URLs aus der Reload-Sperre +heraus sind. -- 2.39.5