]> git.mxchange.org Git - mailer.git/commitdiff
* Member template added for the surfbar which notifies the user that the URL is
authorRoland Häder <roland@mxchange.org>
Tue, 2 Sep 2008 22:47:25 +0000 (22:47 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 2 Sep 2008 22:47:25 +0000 (22:47 +0000)
  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

33 files changed:
.gitattributes
inc/autopurge.php
inc/extensions/ext-surfbar.php
inc/functions.php
inc/language/surfbar_de.php
inc/libs/bonus_functions.php
inc/libs/holiday_functions.php
inc/libs/rallye_functions.php
inc/libs/sponsor_functions.php
inc/libs/surfbar_functions.php
inc/libs/transfer_functions.php
inc/modules/admin/what-config_surfbar.php
inc/modules/admin/what-unlock_emails.php
inc/modules/frametester.php
inc/modules/guest/what-register.php
inc/modules/guest/what-sponsor_login.php
inc/modules/guest/what-sponsor_reg.php
inc/modules/member/what-holiday.php
inc/modules/member/what-newsletter.php
inc/modules/member/what-payout.php
inc/modules/member/what-stats.php
inc/modules/member/what-support.php
inc/modules/member/what-transfer.php
inc/modules/order.php
inc/monthly/monthly_newsletter.php
inc/monthly_newsletter.php
inc/mysql-manager.php
inc/pool-update.php
templates/de/emails/order-accept.tpl
templates/de/emails/order-reject.tpl
templates/de/emails/order_accept_sb.tpl [new file with mode: 0644]
templates/de/html/admin/admin_config_surfbar.tpl
templates/de/html/ext/ext_surfbar.tpl

index dadb96df82cf680b63c73ed9e524f876a3747ca1..ac8b497136649aa57d726abc967b28039372a058 100644 (file)
@@ -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
index 7c98694ed7e1dc7c2c3e8ca624136116ed96ea63..39c630bdebd3f6f110c219283d75937dd55ef4c0 100644 (file)
@@ -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, "");
        }
 }
 
index fccd16b36b0a963cc61ded315529094cf29116fe..01002a892af37b29660d00f2aa819a6a4e7da254 100644 (file)
@@ -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)";
index d94a0336fee24b04d53de9fb23c67cc9fd9ece54..2a9f001e7cf776493be8b6678a539f3d8013d2ea 100644 (file)
@@ -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&amp;url=".urlencode(base64_encode(COMPILE_CODE($URL)));
-       return $URL;
+function FRAMETESTER($URL) {
+       // Prepare frametester URL
+       $frametesterUrl = sprintf("%s/modules.php?module=frametester&amp;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 "<IMG border=\"0\" alt=\"Code\" src=\"".URL."/mailid_top.php?uid=".$uid."&amp;".$type."=".$DATA."&amp;mode=img&amp;code=".$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."<br />\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);
+       }
+}
 
 //
 //////////////////////////////////////////////////
index 40afc1071f10d78ed2a8aa81e18dc796672aa2ac..6d71bb1e2e09ab39d93d19d13e27d7f97ff571b6 100644 (file)
@@ -45,6 +45,9 @@ define('ADMIN_CONFIG_SURFBAR_STATIC_LOCK', "Statische Reload-Sperre (oberes Fram
 define('ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL', "Verg&uuml;tungsmodel ausw&auml;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&uuml;r die Surfbar eingestellt.<br />\nBitte installieren Sie die Erweiterung <strong>surfbar</strong> neu.");
 define('ADMIN_SURFBAR_ADD_NEW_REFDEPTH', "Neue Referal-Ebene zur Surfbar hinzuf&uuml;gen");
 
index e619dff3d4946d4e1f915754261df0a64e2b9e5f..ebd186a483860ca374665957387d0849c10c6330 100644 (file)
@@ -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, "");
        }
 }
 //
index 5e10287d2f9b267d072c740c707f8da50232a933..49ab3b2be69de49a0195f40106fa185d36196ad4 100644 (file)
@@ -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
index 69dc4de3b288695f2e0a66bfd9bb99475a801c42..2a4f228c1f6c8e919f7eee267f893dbfb81b76c8 100644 (file)
@@ -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",
index 6f43da5bb6f92b86db3eed27f3b3683915f865df..d76263196e04fcc1e3de56e04a09e210729604c2 100644 (file)
@@ -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")
index 9680740da282f097a687db8f23229b2c6f5d34ab..64d5ea0ec7207c049592ea30128ab3fe0ba3b352 100644 (file)
@@ -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);
 }
 //
 ?>
index 80ebfab0bb892dca04645946694261d1f1bcbb64..c86eb51bc4bea6eeacabcc5e40e69eca71a90509 100644 (file)
@@ -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);
        }
 }
 //
index 10d587c6758c94b5d73d2e1cb4782b75a846f607..f0343342bc03e044b0eadbb0c94417b198310463 100644 (file)
@@ -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);
 }
index 37eec82c610cf30b41c9734f7b24977230a408c1..3947745f46bdbb7eb7468d68228817c0ba4ec6ca 100644 (file)
@@ -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);
index a6daa40721cd307f0ec7313acc5ac36bd93642e9..2f44befb0afbd27e669900c21d15bf8c16215587 100644 (file)
@@ -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)
index 758da7a7e41b8a7f67ff58e9c7d81f5f985fe593..c0eeb66f5b82e40a23c8eba0e0f57136b9b06549 100644 (file)
@@ -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);
index 2c00d2ec863356f7f7548eb06b001fcb3889225c..ed600bdd8c7fd3f96dc1f30636d0366633c36175 100644 (file)
@@ -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);
index 3d54c25b2ccd7a10c185248537d53b5bcf73bb53..875a6584ae249de3f57a911dd99448cdbced4bec 100644 (file)
@@ -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'];
index f2db3cf65d2101aadc14764e95f86c675ace1071..57c5e3848506393062505f42110774c178af9d2f 100644 (file)
@@ -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);
index 6d21c0c0aa7b47bff1ebbd04b35f196f28e92ee9..04a8dbfc31f4a171b9deb242b335ba6c3e8ca0a6 100644 (file)
@@ -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);
index 3ed797f332370ec48011270ee23c4c9b18c3cdfe..a61a58bf3cc65435de6702eb2a4f91d8e7207649 100644 (file)
@@ -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);
index 5ffeb58d6d81abfb6bbc785e9c84fc72b1a329e3..a6a9468d838d0721da798c0921bfe03805bee606 100644 (file)
  ************************************************************************/
 
 // 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);
+
 //
 ?>
index 6a723d1ed877c1780b0ca41cffb27b421e113272..d98a7808eef7b1c5ace5dbe6a0ae178e21620649 100644 (file)
@@ -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
index a3193b89b3462adac78641d3b30ce634058659ca..6028b1567f850c6e56c1712106d127cc3f9567af 100644 (file)
@@ -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("<P>");
                        LOAD_TEMPLATE("admin_settings_saved", false, TRANSFER_COMPLETED."<br /><A href=\"".URL."/modules.php?module=login&amp;what=transfer\">".TRANSFER_CONTINUE_OVERVIEW."</A>");
-                       OUTPUT_HTML("</P>");
                }
                 elseif (!$valid_code)
                {
index e51354e30e89598b5f833d2e416755d06795bd7f..53d88eb7783fea5cee0bfeb440f1ff1da0e68b19 100644 (file)
@@ -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);
index fdbfd590545ccf3b992c60a92b098ef183271301..1afaf04c616755620faf3d42db60b6d859db5980 100644 (file)
@@ -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
index bcb50202e579e145612a68e31a11e3c8afecf9ea..018f57fdd3d7f8f3d8c568716040f99285817c25 100644 (file)
@@ -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']);
        }
 }
 
index 88c5f62138298de9fb1466e1a2ce294f7d211f23..4be52eb6d64ad6284509abd822d8a45170a6ad60 100644 (file)
@@ -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;
 }
 //
index c110f343069ee611c0e834b9d9240fbe351a720b..d69a008cd00e476af0039f05a6ba108558bf5864 100644 (file)
@@ -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");
                                }
                        }
                }
index 7613e650d69e0c0d47fb3efda4fec6c17504dee5..68e501390db732623671ce7c1270df8a88e4d130 100644 (file)
@@ -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!
index e533bded98caa3de2f5317973cbb1eb071e1a851..f332d2aba86d91d7bb795dbf42c3f1a4972d5e99 100644 (file)
@@ -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&ouml;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 (file)
index 0000000..7f431b8
--- /dev/null
@@ -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&auml;tzlich unter der Id-Nummer $content f&uuml;r die Surfbar freigegeben.
+
+Vielen Dank.
+
+Mit freundlichem Gruss,
+  Ihr {!MAIN_TITLE!} Team
+
+{!URL!} ({!WEBMASTER!})
index 715d56b6322a1cf4a7f6099a5e5eadb297bb6f21..36149f68063daabd156aada5d55bba3ee4d7a28c 100644 (file)
@@ -33,7 +33,7 @@
        </TR>
        <TR><TD height="8" colspan="2" class="seperator bottom2">&nbsp;</TD></TR>
        <TR>
-               <TD height="20" align="center" colspan="2" class="admin_footer bottom2">
+               <TD align="center" colspan="2" class="admin_footer bottom2">
                        {--ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL--}
                </TD>
        </TR>
                </TD>
        </TR>
        <TR>
-               <TD class="bottom2" height="30" align="right" style="padding-right:5px">
+               <TD align="center" style="padding-right:5px">
                        {--ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_DYNAMIC--}
                </TD>
-               <TD class="bottom2">
+               <TD>
                        <INPUT type="radio" name="surfbar_pay_model" size="10" maxlength="20" value="DYNAMIC"{--__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC--} />
                </TD>
        </TR>
+       <TR><TD height="8" colspan="2" class="seperator">&nbsp;</TD></TR>
+       <TR><TD height="3" colspan="2" class="seperator bottom2">&nbsp;</TD></TR>
+       <TR>
+               <TD height="30" align="center" colspan="2" class="admin_footer bottom2">
+                       {--ADMIN_CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK--}
+               </TD>
+       </TR>
+       <TR><TD height="8" colspan="2" class="seperator">&nbsp;</TD></TR>
+       <TR>
+               <TD align="center">
+                       <INPUT type="radio" name="surfbar_notify_admin_unlock" size="10" maxlength="20" value="Y"{--__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y--} /> {--ADMIN_SURFBAR_NOTIFY_UNLOCK_YES--}
+               </TD>
+               <TD align="center">
+                       <INPUT type="radio" name="surfbar_notify_admin_unlock" size="10" maxlength="20" value="N"{--__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N--} /> {--ADMIN_SURFBAR_NOTIFY_UNLOCK_NO--}
+               </TD>
+       </TR>
+       <TR><TD height="8" colspan="2" class="seperator bottom2">&nbsp;</TD></TR>
        <TR>
                <TD colspan="2" align="center" class="admin_footer">
                        <INPUT type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />&nbsp;*
index 4ea079e30d4dab4ec34d2cb76419ad4aa908052a..d3bc44093df546c0acc6d484abade8df0cda320c 100644 (file)
@@ -22,4 +22,8 @@ Verg&uuml;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.<br />
 <br />
-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.