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
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
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");
}
}
$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
// 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, "");
}
}
// 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, "");
}
}
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, "");
}
}
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, "");
}
}
$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)";
return $ret;
}
//
-function GET_POOL_TYPE($PT)
-{
+function GET_POOL_TYPE($PT) {
switch ($PT)
{
case "TEMP" : $ret = POOL_TEMP; break;
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 "<IMG border=\"0\" alt=\"Code\" src=\"".URL."/mailid_top.php?uid=".$uid."&".$type."=".$DATA."&mode=img&code=".$code."\">";
}
//
-function TRANSLATE_STATUS($status)
-{
+function TRANSLATE_STATUS($status) {
switch ($status)
{
case "UNCONFIRMED":
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);
// Return result
return $ret;
}
+
// Fix "deleted" cookies
function FIX_DELETED_COOKIES ($cookies) {
// Is this an array with entries?
}
}
}
+
// Output error messages in a fasioned way and die...
function mxchange_die ($msg) {
global $footer;
//* 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
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! ;-)
// 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);
+ }
+}
//
//////////////////////////////////////////////////
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.<br />\nBitte installieren Sie die Erweiterung <strong>surfbar</strong> neu.");
define('ADMIN_SURFBAR_ADD_NEW_REFDEPTH', "Neue Referal-Ebene zur Surfbar hinzufügen");
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, "");
}
}
//
}
// 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
}
}
- // 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);
}
// 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)
$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",
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")
} // 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);
}
//
?>
$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);
}
}
//
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);
}
// 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);
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)
$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);
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);
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'];
// 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())",
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);
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);
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);
************************************************************************/
// 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
$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);
+
//
?>
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
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&what=transfer\">".TRANSFER_CONTINUE_OVERVIEW."</A>");
- OUTPUT_HTML("</P>");
}
elseif (!$valid_code)
{
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);
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
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']);
}
}
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;
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;
}
//
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",
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");
}
}
}
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!
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.
--- /dev/null
+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!})
</TR>
<TR><TD height="8" colspan="2" class="seperator bottom2"> </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"> </TD></TR>
+ <TR><TD height="3" colspan="2" class="seperator bottom2"> </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"> </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"> </TD></TR>
<TR>
<TD colspan="2" align="center" class="admin_footer">
<INPUT type="reset" class="admin_reset" value="{--CLEAR_FORM--}" /> *
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.