From 3c8df4406f9247182f4dbe4494d62ac229a7bd28 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 28 Oct 2009 23:11:25 +0000 Subject: [PATCH] Several fixes for broken actions (sorry for lame text) --- .gitattributes | 1 + inc/autopurge/purge-mails.php | 4 +- inc/extensions/ext-bonus.php | 2 +- inc/extensions/ext-newsletter.php | 2 +- inc/functions.php | 26 +++++++++++- inc/header.php | 2 +- inc/language/de.php | 5 +-- inc/language/order_de.php | 3 ++ inc/libs/bonus_functions.php | 40 +++++++++---------- inc/modules/admin/overview-inc.php | 4 ++ inc/modules/admin/what-del_email.php | 2 +- inc/modules/admin/what-email_details.php | 10 ++--- inc/modules/admin/what-usr_online.php | 32 +++++++-------- inc/modules/guest/action-themes.php | 2 +- inc/modules/member/action-themes.php | 6 +-- inc/modules/order.php | 12 +++++- inc/pool/pool-user.php | 6 +-- install/menu-de.sql | 1 - install/menu-en.sql | 1 - mailid.php | 8 ++-- mailid_top.php | 38 ++++++++++-------- show_bonus.php | 12 ++++-- templates/de/html/admin/admin_list_online.tpl | 2 +- templates/de/html/admin/admin_mini_online.tpl | 3 ++ templates/de/html/admin/admin_task_order.tpl | 1 + .../de/html/mailid/mailid_enter_code.tpl | 2 +- templates/de/html/show_bonus_msg.tpl | 8 ++-- templates/de/html/show_bonus_yr.tpl | 2 +- 28 files changed, 145 insertions(+), 92 deletions(-) create mode 100644 templates/de/html/admin/admin_task_order.tpl diff --git a/.gitattributes b/.gitattributes index 9c5e4f2bdd..ed65ee1c84 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1196,6 +1196,7 @@ templates/de/html/admin/admin_surfbar_stats_row.tpl -text templates/de/html/admin/admin_surfbar_url_stats.tpl -text templates/de/html/admin/admin_surfbar_url_stats_row.tpl -text templates/de/html/admin/admin_task_holiday.tpl -text +templates/de/html/admin/admin_task_order.tpl -text templates/de/html/admin/admin_theme_edit.tpl -text templates/de/html/admin/admin_theme_edit_row.tpl -text templates/de/html/admin/admin_theme_import.tpl -text diff --git a/inc/autopurge/purge-mails.php b/inc/autopurge/purge-mails.php index 1528fc2ebe..5741d36d20 100644 --- a/inc/autopurge/purge-mails.php +++ b/inc/autopurge/purge-mails.php @@ -93,7 +93,7 @@ ORDER BY // Now let's check for stats entries as well; $result_mails = SQL_QUERY("SELECT - `sender` + `userid` AS sender FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE @@ -116,7 +116,7 @@ ORDER BY // Reset query (to prevent possible errors) ... $result_mails = SQL_QUERY("SELECT - `sender` + `userid` AS sender FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index a74f7e0f86..822c154a5d 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0', '0.1.6', '0.2.0', '0.2.1', '0.2.2', '0.2 switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run - addAdminMenuSql('email','send_bonus','Bonusmail senden',5,'Versenden Sie hier Bonus-Mails an alle Mitglieder oder nur an alle aus einer Kategorie. Es spielt keine Rolle, wie viele Mails bereits versendet worden, Sie können hier immer senden.'); + addAdminMenuSql('email','send_bonus','Bonusmail senden','Versenden Sie hier Bonus-Mails an alle Mitglieder oder nur an alle aus einer Kategorie. Es spielt keine Rolle, wie viele Mails bereits versendet worden, Sie können hier immer senden.', 5); addMemberMenuSql('main','bonus','Bonuspunkte','N','Y',7); addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus`"); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bonus` ( diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index 7ff6a38547..6e6d0174b1 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -77,7 +77,7 @@ switch (getExtensionMode()) { case '0.0.1': // SQL queries for v0.0.1 addAdminMenuSql('newsletter', NULL, 'Newsletter','Einstellungen am Newsletter, Newsletter versenden, usw.', 3); addAdminMenuSql('newsletter','config_newsletter','Einstellungen','Einstellungen am Newsletter vornehmen.', 3); - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `action`='newsletter', `what`='send_newsletter', `title`='Versenden', `sort`='1' WHERE `what`='newsletter' LIMIT 1"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='newsletter' LIMIT 1"); addMemberMenuSql('main','newsletter','Newsletter-Empfang','N','Y', 10); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `nl_receive` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); diff --git a/inc/functions.php b/inc/functions.php index e32114a46e..9cd97a5890 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -136,7 +136,7 @@ function outputHtml ($htmlCode, $newLine = true) { // Was that eval okay? if (empty($newContent)) { // Something went wrong! - debug_report_bug('Evaluation error:
' . htmlentities($eval) . '
'); + debug_report_bug('Evaluation error:
' . linenumberCode($eval) . '
'); } // END - if $GLOBALS['output'] = $newContent; @@ -561,7 +561,7 @@ function loadEmailTemplate ($template, $content = array(), $UID = '0') { unset($DATA); // Compile the code and eval it - $eval = '$newContent = "' . compileCode(addSmartSlashes($newContent)) . '";'; + $eval = '$newContent = "' . compileCode(smartAddSlashes($newContent)) . '";'; eval($eval); // Return content @@ -3599,6 +3599,28 @@ function handleFatalErrors () { shutdown(); } +// Print code with line numbers +function linenumberCode ($code) { + if (!is_array($code)) $codeE = explode("\n", $code); else $codeE = $code; + $count_lines = count($codeE); + + $r = "Line | Code:
"; + foreach($codeE as $line => $c) { + $r .= "
"; + if ($count_lines == 1) { + $r .= '1'; + } else { + $r .= ($line == ($count_lines - 1)) ? '' : ($line+1); + } + $r .= "|"; + + // Add code + $r .= "" . htmlentities($c) . "
"; + } + + return "
" . $r . "
\n"; +} + ////////////////////////////////////////////////// // AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS // ////////////////////////////////////////////////// diff --git a/inc/header.php b/inc/header.php index 3ea5b4acfb..9cff89dd58 100644 --- a/inc/header.php +++ b/inc/header.php @@ -128,7 +128,7 @@ if (($GLOBALS['header_sent'] != '1') && ($GLOBALS['header_sent'] != '2')) { } // END - if // Add BODY tag or not? -if ((getOutputMode() != '1') && ($GLOBALS['header_sent'] == 1) && ((getModule() != 'frametester') || (isGetRequestElementSet('frame')))) { +if ((getOutputMode() != 1) && ($GLOBALS['header_sent'] == 1) && ((getModule() != 'frametester') || (isGetRequestElementSet('frame')))) { loadTemplate('page_body'); $GLOBALS['header_sent'] = 2; } // END - if diff --git a/inc/language/de.php b/inc/language/de.php index 8762613836..f82881b937 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -423,6 +423,7 @@ addMessages(array( 'ADMIN_NO_MAILS_IN_POOL' => "Es wurden noch keine Mailbuchungen aufgegeben, kann somit keine Mails anzeigen!", 'ADMIN_POOL_CONTENT' => "Mailbuchungen im Sende-Pool", 'POOL_TYPE_UNKNOWN' => "Unbekannt (%s)", + 'POOL_TYPE_DELETED' => "Bereinigt", 'POOL_TYPE_TEMP' => "Neuer Auftrag", 'POOL_TYPE_SEND' => "Gesendet", 'POOL_TYPE_NEW' => "Wartet auf Versand", @@ -829,9 +830,7 @@ addMessages(array( 'ADMIN_EDIT' => "Ändern", 'ADMIN_EDIT_EXTENSIONS' => "Ändern von Erweiterungen", 'POOL_DELETED' => "Bereinigt", -// @TODO Are these constants still used? - 'ONLINE_TIMEOUT_IS_1' => "Die Liste zeigt die Besucher der letzten ", - 'ONLINE_TIMEOUT_IS_2' => " an.", + 'ONLINE_TIMEOUT_IS' => "Die Liste zeigt die Besucher der letzten %s an.", 'ADMIN_CONFIG_EXTENSIONS_SETTINGS' => "Erweiterungs-Management konfigurieren", 'ADMIN_VERBOSE_SQL' => "SQL-Anweisungen beim Registrieren/Updates/Entfernen ausgeben", 'ADMIN_REMOVING_THESE_EXTENSIONS' => "Diese Erweiterungen werden deinstalliert", diff --git a/inc/language/order_de.php b/inc/language/order_de.php index ec3c5673c7..59b7ec91f2 100644 --- a/inc/language/order_de.php +++ b/inc/language/order_de.php @@ -82,6 +82,9 @@ addMessages(array( 'ADMIN_CFG_REPAY_POINTS_JACKPOT' => "In den Jackpot legen", 'ADMIN_CFG_REPAY_POINTS_SHRED' => "Nicht gutschreiben (verfällt dann)", 'ADMIN_REPAY_ON_DELETE_MODE' => "Wie sollen {?POINTS?} von gelöschten Mails verbucht werden?", + + 'ADMIN_TASK_IS_MEMBER_ORDER' => "Mailbuchung vom Mitglied", + 'ADMIN_UNLOCK_EMAIL_LINK' => "Mailbuchung ansehen", )); // [EOF] diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index 445857c6ae..9cbf52d1ff 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -47,11 +47,10 @@ function addTurboBonus ($mid, $userid, $type) { if (getConfig('bonus_active') != 'Y') return false; // Init variables - $sql = ''; $bonys = 0; $mail = 0; $column = ''; + $sql = ''; $bonus = 0; $mail = 0; $column = ''; // Select SQL command - switch ($type) - { + switch ($type) { case 'bonusid': $column = 'bonus_id'; $bonus = $mid; @@ -112,10 +111,10 @@ function addTurboBonus ($mid, $userid, $type) { // function addBonusRanks ($data, $type, $userid) { // Init variables - $self = false; $OUT = ''; $content = array(); + $self = false; $OUT = ''; $GLOBALS['ranking_content'] = array(); // Clear rankings by default - setConfigEntry('__rankings', ''); + $GLOBALS['ranking_content']['rankings'] = ''; // How many ranks do we have? $ranks = count(explode(';', getConfig('turbo_rates'))) + 1; @@ -125,18 +124,18 @@ function addBonusRanks ($data, $type, $userid) { array($type, $data, $userid), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data - $content = merge_array($content, SQL_FETCHARRAY($result)); + $GLOBALS['ranking_content'] = merge_array($GLOBALS['ranking_content'], SQL_FETCHARRAY($result)); // Remember all values for later use $self = true; // Transfer data to template - $content['yr_level'] = $content['level']; - $content['yr_points'] = translateComma($content['points']); - $content['yr_tmark'] = generateDateTime($content['timemark'], '1'); + $GLOBALS['ranking_content']['yr_level'] = $GLOBALS['ranking_content']['level']; + $GLOBALS['ranking_content']['yr_points'] = translateComma($GLOBALS['ranking_content']['points']); + $GLOBALS['ranking_content']['yr_tmark'] = generateDateTime($GLOBALS['ranking_content']['timemark'], '1'); // Load template - setConfigEntry('__rankings', loadTemplate('show_bonus_yr', true, $content)); + $GLOBALS['ranking_content']['rankings'] = loadTemplate('show_bonus_yr', true, $GLOBALS['ranking_content']); } // END - if // Load rankings @@ -147,7 +146,7 @@ function addBonusRanks ($data, $type, $userid) { $max = SQL_NUMROWS($result); // Init variables - $SW = 2; $content = array(); + $SW = 2; // Output all ranks (levels) for ($rank = 1; $rank <= $max; $rank++) { @@ -156,26 +155,27 @@ function addBonusRanks ($data, $type, $userid) { array($type, $data, $rank), __FUNCTION__, __LINE__); // Nothing found by default - $content['userid'] = '---'; $content['points'] = '---'; + $GLOBALS['ranking_content']['userid'] = '---'; + $GLOBALS['ranking_content']['points'] = '---'; // Are you one of them? if (SQL_NUMROWS($result_users) == 1) { // Load data - $content = merge_array($content, SQL_FETCHARRAY($result_users)); + $GLOBALS['ranking_content'] = merge_array($GLOBALS['ranking_content'], SQL_FETCHARRAY($result_users)); // Translate comma - $content['points'] = translateComma($content['points']); + $GLOBALS['ranking_content']['points'] = translateComma($GLOBALS['ranking_content']['points']); } // END - if // Add more - $content['rank'] = $rank; - $content['sw'] = $SW; + $GLOBALS['ranking_content']['rank'] = $rank; + $GLOBALS['ranking_content']['sw'] = $SW; // Output row $OUT .= " -  ".$content['level'].". - ".$content['userid']." - ".$content['points']." +  ".$GLOBALS['ranking_content']['rank'].". + ".$GLOBALS['ranking_content']['userid']." + ".$GLOBALS['ranking_content']['points']." \n"; // Switch color @@ -185,7 +185,7 @@ function addBonusRanks ($data, $type, $userid) { if ($self === false) { // If current user was not found set constant // @TODO Try to find a way for rewriting this constant - setConfigEntry('__rankings', getMessage('BONUS_RANK_YOU_ARE_404')); + $GLOBALS['ranking_content']['rankings'] = getMessage('BONUS_RANK_YOU_ARE_404'); } // END - if } else { // No entries found! diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 97679cc87b..957e836586 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -373,6 +373,10 @@ LIMIT 1", $OUT .= loadTemplate('admin_task_holiday', true, $userid); break; + case 'MEMBER_ORDER': // Member mail orders + $OUT .= loadTemplate('admin_task_order', true, $id); + break; + default: // Unknown task type logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $type)); $OUT .= "
".sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $type, $id)."
\n"; diff --git a/inc/modules/admin/what-del_email.php b/inc/modules/admin/what-del_email.php index d87a510964..48ec07db39 100644 --- a/inc/modules/admin/what-del_email.php +++ b/inc/modules/admin/what-del_email.php @@ -86,7 +86,7 @@ LEFT JOIN ON s.pool_id=p.id WHERE - s.pool_id=%s + s.`pool_id`=%s LIMIT 1", array(bigintval(getRequestElement('mid'))), __FILE__, __LINE__); if (SQL_NUMROWS($result_pool) == 1) { diff --git a/inc/modules/admin/what-email_details.php b/inc/modules/admin/what-email_details.php index a71abbac3a..dada51d2cb 100644 --- a/inc/modules/admin/what-email_details.php +++ b/inc/modules/admin/what-email_details.php @@ -82,7 +82,7 @@ ORDER by timestamp DESC"; $WHO = getMessage('USER_ID').": ".getRequestElement('userid'); } -if ((isExtensionActive('bonus')) && ($WHO == _ALL)) { +if ((isExtensionActive('bonus')) && ($WHO == getMessage('_ALL'))) { // Bonus mails sent by you // 0 1 2 3 4 5 6 7 8 9 10 11 12 $SQL2 = "SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent, clicks @@ -124,7 +124,7 @@ if (!isGetRequestElementSet(('mid'))) { // Run SQL query for normal mails $result_list = SQL_QUERY($sql, __FILE__, __LINE__); -if ((!empty($SQL2)) && ($WHO == _ALL)) $result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__); +if ((!empty($SQL2)) && ($WHO == getMessage('_ALL'))) $result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__); // Calculate pages $PAGES = 0; @@ -143,7 +143,7 @@ if (SQL_NUMROWS($result_list) > 0) { // Walk through all entries while ($pool = SQL_FETCHARRAY($result_list)) { // Unconfirmed mails and sent mails - $result_uncon = SQL_QUERY_ESC("SELECT max_rec, clicks FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE pool_id=%s LIMIT 1", + $result_uncon = SQL_QUERY_ESC("SELECT max_rec, clicks FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1", array(bigintval($pool['id'])), __FILE__, __LINE__); list($pool['sent_email'], $pool['clicks']) = SQL_FETCHROW($result_uncon); SQL_FREERESULT($result_uncon); @@ -187,13 +187,13 @@ if (SQL_NUMROWS($result_list) > 0) { loadTemplate('admin_list_emails', false, $content); $MAIL = true; - if ((isExtensionActive('bonus')) && ($WHO == _ALL)) { + if ((isExtensionActive('bonus')) && ($WHO == getMessage('_ALL'))) { // Check only if bonus extension is active if (SQL_NUMROWS($result_bonus) > 0) outputHtml('

'); } } -if ((isExtensionActive('bonus')) && ($WHO == _ALL)) { +if ((isExtensionActive('bonus')) && ($WHO == getMessage('_ALL'))) { // Load bonus mails only when extension is active if (SQL_NUMROWS($result_bonus) > 0) { // Calculate pages diff --git a/inc/modules/admin/what-usr_online.php b/inc/modules/admin/what-usr_online.php index eb9e1dbb93..fc8b6e782c 100644 --- a/inc/modules/admin/what-usr_online.php +++ b/inc/modules/admin/what-usr_online.php @@ -53,7 +53,7 @@ if (isExtensionActive('online')) { $content['members_online'] = countSumTotalData('N', 'online', 'id', 'is_admin', true); // Load template - loadTemplate('admin_mini_online'); + loadTemplate('admin_mini_online', false, $content); // Check for online users $result = SQL_QUERY("SELECT `id`, `ip`, `userid`, `refid`, `module`, `action`, `what`, `is_member`, `is_admin`, `timestamp` FROM `{?_MYSQL_PREFIX?}_online` ORDER by `timestamp` DESC", @@ -61,34 +61,34 @@ if (isExtensionActive('online')) { if (SQL_NUMROWS($result) > 0) { // List all online users $OUT = ''; $SW = 2; - while ($content = SQL_FETCHARRAY($result)) { + while ($row = SQL_FETCHARRAY($result)) { // Fix empty action/what - if (empty($content['action'])) $content['action'] = '---'; - if (empty($content['what'])) $content['what'] = '---'; + if (empty($row['action'])) $row['action'] = '---'; + if (empty($row['what'])) $row['what'] = '---'; - if ($content['is_admin'] == 'Y') { + if ($row['is_admin'] == 'Y') { // Is an administrator - $content['userid'] = getMessage('_IS_ADMIN'); - } elseif (($content['is_member'] != 'Y') && ($content['is_admin'] != 'Y')) { + $row['userid'] = getMessage('_IS_ADMIN'); + } elseif (($row['is_member'] != 'Y') && ($row['is_admin'] != 'Y')) { // Is a guest - $content['userid'] = getMessage('_IS_GUEST'); - } elseif ($content['userid'] > 0) { + $row['userid'] = getMessage('_IS_GUEST'); + } elseif ($row['userid'] > 0) { // Add profile link to userid - $content['userid'] = generateUserProfileLink($content['userid']); + $row['userid'] = generateUserProfileLink($row['userid']); } // END - if // Is the refid set? - if ($content['refid'] > 0) { + if ($row['refid'] > 0) { // Add profile link to referer id - $content['refid'] = generateUserProfileLink($content['refid']); + $row['refid'] = generateUserProfileLink($row['refid']); } // END - if // Add more content - $content['sw'] = $SW; - $content['timestamp'] = generateDateTime($content['timestamp'], '2'); + $row['sw'] = $SW; + $row['timestamp'] = generateDateTime($row['timestamp'], '2'); // Load row template and switch color - $OUT .= loadTemplate('admin_list_online_row', true, $content); + $OUT .= loadTemplate('admin_list_online_row', true, $row); $SW = 3 - $SW; } // END - while @@ -97,7 +97,7 @@ if (isExtensionActive('online')) { // Remember rows and fancy time in array $content['rows'] = $OUT; - $content['online_timeout'] = createFancyTime(getConfig('online_timeout')); + $content['online_timeout'] = sprintf(getMessage('ONLINE_TIMEOUT_IS'), createFancyTime(getConfig('online_timeout'))); // Load footer template loadTemplate('admin_list_online', false, $content); diff --git a/inc/modules/guest/action-themes.php b/inc/modules/guest/action-themes.php index b239377473..8b95657478 100644 --- a/inc/modules/guest/action-themes.php +++ b/inc/modules/guest/action-themes.php @@ -40,7 +40,7 @@ if (!defined('__SECURITY')) { die(); } elseif (!isBlockModeEnabled()) { - // Block mode detected + // Non-block mode detected return; } diff --git a/inc/modules/member/action-themes.php b/inc/modules/member/action-themes.php index 22a22725ce..ba9ab29a93 100644 --- a/inc/modules/member/action-themes.php +++ b/inc/modules/member/action-themes.php @@ -41,11 +41,11 @@ if (!defined('__SECURITY')) { die(); } elseif (!isMember()) { redirectToIndexMemberOnlyModule(); +} elseif (!isBlockModeEnabled()) { + // Non-block mode detected + return; } -// Add description as navigation point -addMenuDescription('member', __FILE__); - if ((!isExtensionActive('theme')) && (!isAdmin())) { loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('theme')); return; diff --git a/inc/modules/order.php b/inc/modules/order.php index b82fb34b9d..d26647bff3 100644 --- a/inc/modules/order.php +++ b/inc/modules/order.php @@ -99,8 +99,18 @@ if (empty($URL)) { // Notify admins about this sendAdminNotification(getMessage('ADMIN_NEW_QUEUE'), 'order-admin', $content, getUserId()); + // Create new task + createNewTask( + '{--ADMIN_NEW_QUEUE--}', + '
'.loadEmailTemplate('order-admin', $content, getUserId()).'
', + 'MEMBER_ORDER', + getUserId(), + 0, + false + ); + // Output back bottom - loadTemplate('member_order-back', false); + loadTemplate('member_order-back'); } else { // Matching line not found or already 'placed' in send queue redirectToUrl('modules.php?module=login'); diff --git a/inc/pool/pool-user.php b/inc/pool/pool-user.php index 49e4913d07..f5afc02e4c 100644 --- a/inc/pool/pool-user.php +++ b/inc/pool/pool-user.php @@ -105,18 +105,18 @@ if (SQL_NUMROWS($result_main) > 0) { SQL_FREERESULT($result_user); // Do we have a stats entry? - $result_stats = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE pool_id=%s AND `userid`=%s AND timestamp_ordered='%s' LIMIT 1", + $result_stats = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s AND `userid`=%s AND timestamp_ordered='%s' LIMIT 1", array($DATA['id'], $DATA['sender'], $DATA['timestamp']), __FILE__, __LINE__); // If there's no stats entry add it! //* DEBUG: */ outputHtml("!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!
"); if (SQL_NUMROWS($result_stats) == 0) { // No entry was found, so we add him! - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats` (pool_id , userid, cat_id, payment_id, subject, url , max_rec , timestamp_ordered, timestamp_sstart) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())", + SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats` (`pool_id` , `userid`, `cat_id`, `payment_id`, `subject`, `url` , `max_rec` , `timestamp_ordered`, `timestamp_sstart`) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())", array(bigintval($DATA['id']), bigintval($DATA['sender']), bigintval($DATA['cat_id']), bigintval($DATA['payment_id']), $DATA['subject'], $DATA['url'], $DATA['target_send'], bigintval($DATA['timestamp'])), __FILE__, __LINE__); // Receive it's ID for the links table - $result_stats = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE pool_id=%s AND `userid`=%s AND timestamp_ordered='%s' LIMIT 1", + $result_stats = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s AND `userid`=%s AND timestamp_ordered='%s' LIMIT 1", array(bigintval($DATA['id']), bigintval($DATA['sender']), bigintval($DATA['timestamp'])), __FILE__, __LINE__); } // END - if diff --git a/install/menu-de.sql b/install/menu-de.sql index e2332fd269..8c8de91910 100644 --- a/install/menu-de.sql +++ b/install/menu-de.sql @@ -3,7 +3,6 @@ INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sor INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email',NULL,'Email-Management','Gebuchte Mails umleiten, Details zu den Buchungen anzeigen, Emails freigeben, registrierte Email-Adress auf Verfügbarkeit testen (Mass-Mailing!), Newsletter versenden, Email-Adressen sperren (Email-Backlist), gebuchte URLs sperren (URL-Blacklist)',4); INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup',NULL,'Einstellungen','Interessen ändern, News schreiben, allgmeine Einstellungen (Auto-Versand usw.). Auto-Lock Funktion einrichten, manueller Lock des Versandes einrichten, Teile der Homepage sperren (wegen Wartungsarbeiten)',5); INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc',NULL,'Verschiedenes','Verschiedene Einstellungen / Info-Seiten, die sonst nirgenswo reinpassten...',6); -INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','newsletter','Newsletter versenden','Text- oder HTML-Newsletter verschicken.',5); INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','email_stats','Email-Statistiken','Schauen Sie sich detailierte Statistiken zu den bereits versanden Mails an.',5); INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','edit_emails','Email-Daten ändern','Hier können Sie u.a. die gebuchte URL der Emails umändern, usw.',5); INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','unlock_emails','Emails freigeben','Geben Sie bei manuellem Versand gebuchte Mails hier frei.',5); diff --git a/install/menu-en.sql b/install/menu-en.sql index e2332fd269..8c8de91910 100644 --- a/install/menu-en.sql +++ b/install/menu-en.sql @@ -3,7 +3,6 @@ INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sor INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email',NULL,'Email-Management','Gebuchte Mails umleiten, Details zu den Buchungen anzeigen, Emails freigeben, registrierte Email-Adress auf Verfügbarkeit testen (Mass-Mailing!), Newsletter versenden, Email-Adressen sperren (Email-Backlist), gebuchte URLs sperren (URL-Blacklist)',4); INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup',NULL,'Einstellungen','Interessen ändern, News schreiben, allgmeine Einstellungen (Auto-Versand usw.). Auto-Lock Funktion einrichten, manueller Lock des Versandes einrichten, Teile der Homepage sperren (wegen Wartungsarbeiten)',5); INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc',NULL,'Verschiedenes','Verschiedene Einstellungen / Info-Seiten, die sonst nirgenswo reinpassten...',6); -INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','newsletter','Newsletter versenden','Text- oder HTML-Newsletter verschicken.',5); INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','email_stats','Email-Statistiken','Schauen Sie sich detailierte Statistiken zu den bereits versanden Mails an.',5); INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','edit_emails','Email-Daten ändern','Hier können Sie u.a. die gebuchte URL der Emails umändern, usw.',5); INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','unlock_emails','Emails freigeben','Geben Sie bei manuellem Versand gebuchte Mails hier frei.',5); diff --git a/mailid.php b/mailid.php index a573a245ff..f87ef349eb 100644 --- a/mailid.php +++ b/mailid.php @@ -44,7 +44,7 @@ $GLOBALS['startTime'] = microtime(true); // Tell everyone we are in this module $GLOBALS['module'] = 'mailid'; -$GLOBALS['output_mode'] = -1; +$GLOBALS['output_mode'] = 1; $errorCode = ''; // Load the required file(s) @@ -125,7 +125,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr setExtraTitle($title); // Is the user's ID unlocked? - $result = SQL_QUERY_ESC("SELECT `status`, `gender`, `surname`,` family` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `status`, `gender`, `surname`, `family` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1", array($url_userid), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { list($status, $gender, $surname, $family) = SQL_FETCHROW($result); @@ -136,7 +136,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr switch ($ltype) { case 'NORMAL': - $result = SQL_QUERY_ESC("SELECT payment_id FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE pool_id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT payment_id FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1", array(bigintval($pool)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { list($pay) = SQL_FETCHROW($result); @@ -184,7 +184,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr ); // Load template - loadTemplate('mailid_frames'); + loadTemplate('mailid_frames', false, $content); } else { $errorCode = getCode('DATA_INVALID'); } diff --git a/mailid_top.php b/mailid_top.php index fa10da86cb..f1e83132d4 100644 --- a/mailid_top.php +++ b/mailid_top.php @@ -56,12 +56,17 @@ setContentType('text/html'); redirectOnUninstalledExtension('mailid'); // Secure all data -$url_userid = 0; $url_bid = 0; $url_mid = 0; $code = 0; $mode = ''; -if (isGetRequestElementSet('userid')) $url_userid = bigintval(getRequestElement('userid')); -if (isGetRequestElementSet('mailid')) $url_mid = bigintval(getRequestElement('mailid')); -if (isGetRequestElementSet('bonusid')) $url_bid = bigintval(getRequestElement('bonusid')); -if (isGetRequestElementSet('code')) $code = bigintval(getRequestElement('code')); -if (isGetRequestElementSet('mode')) $mode = getRequestElement('mode'); +$url_userid = 0; +$url_bid = 0; +$url_mid = 0; +$code = 0; +$mode = ''; + +if (isGetRequestElementSet('userid')) $url_userid = bigintval(getRequestElement('userid')); +if (isGetRequestElementSet('mailid')) $url_mid = bigintval(getRequestElement('mailid')); +if (isGetRequestElementSet('bonusid')) $url_bid = bigintval(getRequestElement('bonusid')); +if (isGetRequestElementSet('code')) $code = bigintval(getRequestElement('code')); +if (isGetRequestElementSet('mode')) $mode = getRequestElement('mode'); // 01 1 12 2 2 21 1 22 10 if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors() == 0)) { @@ -71,7 +76,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr // Maybe he wants to confirm an email? if ($url_mid > 0) { $result = SQL_QUERY_ESC("SELECT `id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1", - array($url_mid, $url_userid), __FILE__, __LINE__); + array($url_mid, $url_userid), __FILE__, __LINE__); $type = 'mailid'; $urlId = $url_mid; } elseif ($url_bid > 0) { $result = SQL_QUERY_ESC("SELECT `id`, link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1", @@ -116,8 +121,8 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr if ($ltype == 'BONUS') $sender = 0; // Is the user's ID unlocked? - $result = SQL_QUERY_ESC("SELECT status, gender, surname, family, ref_payout FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1", - array($url_userid), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT `status`, `gender`, `surname`, `family`, `ref_payout` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1", + array($url_userid), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data list($status, $gender, $surname, $family, $ref_pay) = SQL_FETCHROW($result); @@ -170,9 +175,10 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr } // Is this entry valid? - if ($isValid) { + if ($isValid === true) { if (($time == '0') && ($payment > 0)) $time = '1'; if (($time > 0) && ($payment > 0)) { + $img_code = 0; if (!empty($code)) { // Generate code $img_code = generateRandomCode(getConfig('code_length'), $code, $url_userid, $urlId); @@ -267,14 +273,14 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr // Shall I exclude the webmaster's own userid from the active-rallye? if ((((getConfig('bonus_userid') == $url_userid) && (getConfig('bonus_include_own') == 'Y')) || (getConfig('bonus_userid') != $url_userid)) && (getConfig('def_refid') != $url_userid)) { // Add points and remember ranking are done in this function.... - addTurboBonus($payment, $url_userid, $type); + addTurboBonus($urlId, $url_userid, $type); // Set template to mailid_points_done2 which contains a link to the ranking list $template = 'mailid_points_done2'; if ($locked) $template = 'mailid_points_locked2'; $content['userid'] = $url_userid; - $content['type'] = $type; - $content['data'] = translateComma($payment); + $content['type'] = $type; + $content['data'] = $urlId; } // END - if } // END - if } // END - if @@ -307,9 +313,9 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr case 'confirm': if ($code > 0) { // Export data into constants for the template - $content['code'] = $code; - $content['userid'] = $url_userid; - $content['type'] = $type; + $content['code'] = $code; + $content['userid'] = $url_userid; + $content['type'] = $type; $content['data'] = $urlId; $content['banner'] = loadTemplate('mailid_banner', true); if (getConfig('code_length') > 0) { diff --git a/show_bonus.php b/show_bonus.php index 616973e472..cf45a31fe1 100644 --- a/show_bonus.php +++ b/show_bonus.php @@ -88,7 +88,11 @@ ON WHERE d.`status`='CONFIRMED' AND d.userid=%s AND b.%s=%s LIMIT 1", - array(bigintval(getRequestElement('userid')), $t, bigintval(getRequestElement('d'))), __FILE__, __LINE__); + array( + bigintval(getRequestElement('userid')), + $t, + bigintval(getRequestElement('d')) + ), __FILE__, __LINE__); // Entry found? if (SQL_NUMROWS($result) == 1) { @@ -101,6 +105,9 @@ LIMIT 1", $content['mailid'] = bigintval(getRequestElement('d')); $content['rows'] = addBonusRanks(bigintval(getRequestElement('d')), $t, bigintval(getRequestElement('userid'))); + // Get some prepared content + $content = merge_array($content, $GLOBALS['ranking_content']); + // Load pre-template $content['message'] = loadTemplate('show_bonus_msg', true, $content); } else { @@ -125,9 +132,6 @@ $content['header'] = loadTemplate('show_bonus_header', true); // Load show_bonus footer template (for your banners, e.g.?) $content['footer'] = loadTemplate('show_bonus_footer', true); -// Total ranks who can win -$content['total_ranks'] = getConfig('bonus_ranks'); - // Load final template loadTemplate('show_bonus', false, $content); diff --git a/templates/de/html/admin/admin_list_online.tpl b/templates/de/html/admin/admin_list_online.tpl index 928f5f0047..9d58095771 100644 --- a/templates/de/html/admin/admin_list_online.tpl +++ b/templates/de/html/admin/admin_list_online.tpl @@ -27,6 +27,6 @@ $content[rows] - $content + $content[online_timeout] diff --git a/templates/de/html/admin/admin_mini_online.tpl b/templates/de/html/admin/admin_mini_online.tpl index 9ac55c4adc..ea05588636 100644 --- a/templates/de/html/admin/admin_mini_online.tpl +++ b/templates/de/html/admin/admin_mini_online.tpl @@ -1,3 +1,4 @@ +
@@ -20,3 +21,5 @@ $content[admins_online]
+
+
\ No newline at end of file diff --git a/templates/de/html/admin/admin_task_order.tpl b/templates/de/html/admin/admin_task_order.tpl new file mode 100644 index 0000000000..8e4283884d --- /dev/null +++ b/templates/de/html/admin/admin_task_order.tpl @@ -0,0 +1 @@ +{--ADMIN_UNLOCK_EMAIL_LINK--} diff --git a/templates/de/html/mailid/mailid_enter_code.tpl b/templates/de/html/mailid/mailid_enter_code.tpl index 6d09c4879f..b688bf7620 100644 --- a/templates/de/html/mailid/mailid_enter_code.tpl +++ b/templates/de/html/mailid/mailid_enter_code.tpl @@ -4,7 +4,7 @@  
{--ENTER_CODE--}: $content[image]

-{--BONUS_SHOW_HEADER_LINE_1--}{?POINTS?}{--BONUS_SHOW_HEADER_LINE_2--}$content[mailid]{--BONUS_SHOW_HEADER_LINE_3--}: +{--BONUS_SHOW_HEADER_LINE_1--} {?POINTS?} {--BONUS_SHOW_HEADER_LINE_2--} $content[mailid] {--BONUS_SHOW_HEADER_LINE_3--}:

@@ -16,9 +16,11 @@
-
{?__rankings?}
+
+ $content[rankings] +
Wir wünschen allen Gewinnern viel Glück bei der monatlichen Aktiv-Rallye!
- Es können nur die ersten $content[total_ranks] die Aktiv-Rallye gewinnen. Der Rechtsweg ist ausgeschlossen. + Es können nur die ersten {?bonus_ranks?} die Aktiv-Rallye gewinnen. Der Rechtsweg ist ausgeschlossen.
diff --git a/templates/de/html/show_bonus_yr.tpl b/templates/de/html/show_bonus_yr.tpl index 0f7238870b..1143e3c8c5 100644 --- a/templates/de/html/show_bonus_yr.tpl +++ b/templates/de/html/show_bonus_yr.tpl @@ -3,7 +3,7 @@ {--BONUS_SHOW_YOU_HAVE_CONFIRMED--} $content[yr_tmark] {--_ON--} $content[yr_level]. - {--BONUS_SHOW_CONFIRMED_BONUS_IS--}: $content[yr_points] ?POINTS?} + {--BONUS_SHOW_CONFIRMED_BONUS_IS--}: $content[yr_points] {?POINTS?} -- 2.39.5