Several fixes for broken actions (sorry for lame text)
authorRoland Häder <roland@mxchange.org>
Wed, 28 Oct 2009 23:11:25 +0000 (23:11 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 28 Oct 2009 23:11:25 +0000 (23:11 +0000)
28 files changed:
.gitattributes
inc/autopurge/purge-mails.php
inc/extensions/ext-bonus.php
inc/extensions/ext-newsletter.php
inc/functions.php
inc/header.php
inc/language/de.php
inc/language/order_de.php
inc/libs/bonus_functions.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-del_email.php
inc/modules/admin/what-email_details.php
inc/modules/admin/what-usr_online.php
inc/modules/guest/action-themes.php
inc/modules/member/action-themes.php
inc/modules/order.php
inc/pool/pool-user.php
install/menu-de.sql
install/menu-en.sql
mailid.php
mailid_top.php
show_bonus.php
templates/de/html/admin/admin_list_online.tpl
templates/de/html/admin/admin_mini_online.tpl
templates/de/html/admin/admin_task_order.tpl [new file with mode: 0644]
templates/de/html/mailid/mailid_enter_code.tpl
templates/de/html/show_bonus_msg.tpl
templates/de/html/show_bonus_yr.tpl

index 9c5e4f2..ed65ee1 100644 (file)
@@ -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
index 1528fc2..5741d36 100644 (file)
@@ -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
index a74f7e0..822c154 100644 (file)
@@ -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&ouml;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&ouml;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` (
index 7ff6a38..6e6d017 100644 (file)
@@ -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'");
 
index e32114a..9cd97a5 100644 (file)
@@ -136,7 +136,7 @@ function outputHtml ($htmlCode, $newLine = true) {
                        // Was that eval okay?
                        if (empty($newContent)) {
                                // Something went wrong!
-                               debug_report_bug('Evaluation error:<pre>' . htmlentities($eval) . '</pre>');
+                               debug_report_bug('Evaluation error:<pre>' . linenumberCode($eval) . '</pre>');
                        } // 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:<br />";
+       foreach($codeE as $line => $c) {
+               $r .= "<div class=\"line\"><span class=\"linenum\">";
+               if ($count_lines == 1) {
+                       $r .= '1';
+               } else {
+                       $r .= ($line == ($count_lines - 1)) ? '' :  ($line+1);
+               }
+               $r .= "</span>|";
+
+               // Add code
+               $r .= "<span class=\"linetext\">" . htmlentities($c) . "</span></div>";
+       }
+
+       return "<div class=\"code\">" . $r . "</div>\n";
+}
+
 //////////////////////////////////////////////////
 // AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
 //////////////////////////////////////////////////
index 3ea5b4a..9cff89d 100644 (file)
@@ -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
index 8762613..f82881b 100644 (file)
@@ -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' => "&Auml;ndern",
        'ADMIN_EDIT_EXTENSIONS' => "&Auml;ndern von Erweiterungen",
        'POOL_DELETED' => "Bereinigt",
-// @TODO Are these constants still used?
-       'ONLINE_TIMEOUT_IS_1' => "Die Liste zeigt die Besucher der letzten <strong>",
-       'ONLINE_TIMEOUT_IS_2' => "</strong> an.",
+       'ONLINE_TIMEOUT_IS' => "Die Liste zeigt die Besucher der letzten <strong>%s</strong> 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",
index ec3c567..59b7ec9 100644 (file)
@@ -82,6 +82,9 @@ addMessages(array(
        'ADMIN_CFG_REPAY_POINTS_JACKPOT' => "In den Jackpot legen",
        'ADMIN_CFG_REPAY_POINTS_SHRED' => "Nicht gutschreiben (verf&auml;llt dann)",
        'ADMIN_REPAY_ON_DELETE_MODE' => "Wie sollen {?POINTS?} von gel&ouml;schten Mails verbucht werden?",
+
+       'ADMIN_TASK_IS_MEMBER_ORDER' => "Mailbuchung vom Mitglied",
+       'ADMIN_UNLOCK_EMAIL_LINK' => "Mailbuchung ansehen",
 ));
 
 // [EOF]
index 445857c..9cbf52d 100644 (file)
@@ -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 .= "<tr>
-  <td class=\"bonus_rank_".$content['level']." bottom2 switch_sw".$content['sw']."\">&nbsp;".$content['level'].".</td>
-  <td class=\"bonus_rank_".$content['level']." bottom2 switch_sw".$content['sw']."\" align=\"center\">".$content['userid']."</td>
-  <td class=\"bonus_rank_".$content['level']." bottom2 switch_sw".$content['sw']."\" align=\"center\">".$content['points']."</td>
+  <td class=\"bonus_rank_".$GLOBALS['ranking_content']['rank']." bottom2 switch_sw".$GLOBALS['ranking_content']['sw']."\">&nbsp;".$GLOBALS['ranking_content']['rank'].".</td>
+  <td class=\"bonus_rank_".$GLOBALS['ranking_content']['rank']." bottom2 switch_sw".$GLOBALS['ranking_content']['sw']."\" align=\"center\">".$GLOBALS['ranking_content']['userid']."</td>
+  <td class=\"bonus_rank_".$GLOBALS['ranking_content']['rank']." bottom2 switch_sw".$GLOBALS['ranking_content']['sw']."\" align=\"center\">".$GLOBALS['ranking_content']['points']."</td>
 </tr>\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!
index 97679cc..957e836 100644 (file)
@@ -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 .= "<div class=\"admin_failed medium\">".sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $type, $id)."</div>\n";
index d87a510..48ec07d 100644 (file)
@@ -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) {
index a71abba..dada51d 100644 (file)
@@ -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('<br /><br />');
        }
 }
 
-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
index eb9e1db..fc8b6e7 100644 (file)
@@ -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);
index b239377..8b95657 100644 (file)
@@ -40,7 +40,7 @@
 if (!defined('__SECURITY')) {
        die();
 } elseif (!isBlockModeEnabled()) {
-       // Block mode detected
+       // Non-block mode detected
        return;
 }
 
index 22a2272..ba9ab29 100644 (file)
@@ -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;
index b82fb34..d26647b 100644 (file)
@@ -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--}',
+                       '<pre>'.loadEmailTemplate('order-admin', $content, getUserId()).'</pre>',
+                       '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');
index 49e4913..f5afc02 100644 (file)
@@ -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)."!<br />");
                                        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
 
index e2332fd..8c8de91 100644 (file)
@@ -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&uuml;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 &auml;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 &auml;ndern','Hier k&ouml;nnen Sie u.a. die gebuchte URL der Emails um&auml;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);
index e2332fd..8c8de91 100644 (file)
@@ -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&uuml;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 &auml;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 &auml;ndern','Hier k&ouml;nnen Sie u.a. die gebuchte URL der Emails um&auml;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);
index a573a24..f87ef34 100644 (file)
@@ -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');
                                                }
index fa10da8..f1e8313 100644 (file)
@@ -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) {
index 616973e..cf45a31 100644 (file)
@@ -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);
 
index 928f5f0..9d58095 100644 (file)
@@ -27,6 +27,6 @@
 </tr>
 $content[rows]
 <tr>
-       <td colspan="8" class="admin_footer">$content</td>
+       <td colspan="8" class="admin_footer">$content[online_timeout]</td>
 </tr>
 </table>
index 9ac55c4..ea05588 100644 (file)
@@ -1,3 +1,4 @@
+<div align="center">
 <table border="0" cellspacing="0" cellpadding="0" width="170" class="admin_table dashed">
        <tr>
                <td colspan="3" class="admin_title bottom2" align="center" height="30">
@@ -20,3 +21,5 @@
                <td><strong>$content[admins_online]</strong></td>
        </tr>
 </table>
+</div>
+<br />
\ 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 (file)
index 0000000..8e42838
--- /dev/null
@@ -0,0 +1 @@
+<a href="{?URL?}/modules.php?module=admin&amp;what=unlock_emails&amp;task_id=$content">{--ADMIN_UNLOCK_EMAIL_LINK--}</a>
index 6d09c48..b688bf7 100644 (file)
@@ -4,7 +4,7 @@
                <td width="10" class="seperator">&nbsp;</td>
                <td width="220" align="center">
                <form accept-charset="utf-8"
-                       action="{?URL?}/mailid_top.php?userid=$content[userid]&amp;$content[type]=$content[data]&amp;mode=add&amp;code={--_CODE_VALUE!}"
+                       action="{?URL?}/mailid_top.php?userid=$content[userid]&amp;$content[type]=$content[data]&amp;mode=add&amp;code=$content[code]"
                        method="post" style="margin-bottom: 0px">{--ENTER_CODE--}:
                $content[image]<br />
                <input type="text" name="gfx_check" class="member_normal" size="5"
index 7d9bcd4..2f8e57e 100644 (file)
@@ -1,7 +1,7 @@
 {--HELLO--} $content[gender] $content[surname] $content[family]!
 <br />
 <br />
-{--BONUS_SHOW_HEADER_LINE_1--}<strong>{?POINTS?}</strong>{--BONUS_SHOW_HEADER_LINE_2--}<strong>$content[mailid]</strong>{--BONUS_SHOW_HEADER_LINE_3--}:
+{--BONUS_SHOW_HEADER_LINE_1--} <strong>{?POINTS?}</strong> {--BONUS_SHOW_HEADER_LINE_2--} <strong>$content[mailid]</strong> {--BONUS_SHOW_HEADER_LINE_3--}:
 <br />
 <br />
 <table border="0" cellspacing="0" cellpadding="0" width="300" class="member_table dashed">
        </tr>
 </table>
 
-<div>{?__rankings?}</div>
+<div>
+       $content[rankings]
+</div>
 
 <div class="member_note">
        Wir w&uuml;nschen allen Gewinnern viel Gl&uuml;ck bei der monatlichen Aktiv-Rallye!<br />
-       Es k&ouml;nnen nur die ersten <u>$content[total_ranks]</u> die Aktiv-Rallye gewinnen. Der Rechtsweg ist ausgeschlossen.
+       Es k&ouml;nnen nur die ersten <u>{?bonus_ranks?}</u> die Aktiv-Rallye gewinnen. Der Rechtsweg ist ausgeschlossen.
 </div>
index 0f72388..1143e3c 100644 (file)
@@ -3,7 +3,7 @@
        <td align="center">
                {--BONUS_SHOW_YOU_HAVE_CONFIRMED--} <strong class="nobr">$content[yr_tmark]</strong>
                {--_ON--} <strong>$content[yr_level].</strong>
-               {--BONUS_SHOW_CONFIRMED_BONUS_IS--}:&nbsp;<strong class="nobr">$content[yr_points] ?POINTS?}</strong>
+               {--BONUS_SHOW_CONFIRMED_BONUS_IS--}:&nbsp;<strong class="nobr">$content[yr_points] {?POINTS?}</strong>
        </td>
 </tr>
 </table>