]> git.mxchange.org Git - mailer.git/commitdiff
More fixes for bonus ranking
authorRoland Häder <roland@mxchange.org>
Thu, 29 Oct 2009 00:13:08 +0000 (00:13 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 29 Oct 2009 00:13:08 +0000 (00:13 +0000)
20 files changed:
beg.php
css.php
inc/classes/cachesystem.class.php
inc/db/lib-mysql3.php
inc/footer.php
inc/header.php
inc/language/bonus_de.php
inc/libs/bonus_functions.php
inc/mysql-connect.php
inc/request-functions.php
index.php
js.php
lead-confirm.php
login.php
mailid.php
mailid_top.php
sponsor_confirm.php
sponsor_ref.php
templates/de/html/admin/admin_config_other.tpl
templates/de/html/show_bonus_msg.tpl

diff --git a/beg.php b/beg.php
index c411b85b9e7ef9fe3389bca403eea47b27242a6f..139a4e633e3cba850102d3fe06e622d1b1f3aab7 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -206,7 +206,7 @@ if (isGetRequestElementSet('userid')) {
                $errorCode = generateErrorCodeFromUserStatus($status);
        } elseif (($userid == '0') || ($status == 'failed')) {
                // Inalid or locked account, so let's find out
-               $result = SQL_QUERY_ESC("SELECT userid FROM `{?_MYSQL_PREFIX?}_user_data` WHERE nickname='%s' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE nickname='%s' LIMIT 1",
                        array(getRequestElement('userid')), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Locked account
diff --git a/css.php b/css.php
index e271b11ecabc3a3ba07d071a2390656f0f399a91..a2307fb42e371859da5bd99295763835d9213899 100644 (file)
--- a/css.php
+++ b/css.php
@@ -43,7 +43,7 @@ require('inc/libs/security_functions.php');
 $GLOBALS['footer_sent'] = '-1';
 
 // This is a CSS file loader!
-$GLOBALS['output_mode'] = '1';
+$GLOBALS['output_mode'] = 1;
 $GLOBALS['module'] = 'css';
 
 // Load the required file(s)
index e19c9e8f7809b23227a70d7e60cc5602e3f50b36..0a58a1dd31d788e88bd734045cd2b35db2b172c9 100644 (file)
@@ -65,26 +65,14 @@ class CacheSystem {
 
                // Check if path exists
                if (isDirectory(getConfig('CACHE_PATH'))) {
-                       // Make FQFN for dummy file
-                       $FQFN = getConfig('CACHE_PATH') . 'dummy.tmp';
-
-                       // Check if we can create a file inside the path
-                       touch($FQFN, 'w');
-
-                       // Is the file there?
-                       if (isFileReadable($FQFN)) {
-                               // Yes, we can do. So let's remove it
-                               removeFile($FQFN);
-
-                               // Is there a .htaccess file?
-                               if (isFileReadable(getConfig('CACHE_PATH') . '.htaccess')) {
-                                       // All done!
-                                       $this->ret = $this->statusDone;
-                               } else {
-                                       // Stop! Set a .htaccess file first
-                                       $this->ret = 'htaccess';
-                               }
-                       } // END - if
+                       // Is there a .htaccess file?
+                       if (isFileReadable(getConfig('CACHE_PATH') . '.htaccess')) {
+                               // All done!
+                               $this->ret = $this->statusDone;
+                       } else {
+                               // Stop! Set a .htaccess file first
+                               $this->ret = 'htaccess';
+                       }
                } // END - if
        }
 
index 44f5fd4366055e108896dc2ea06e9a7b2665bccf..e709c8a0d95d03dcc8c3a4584c58be7297c97a60 100644 (file)
@@ -78,7 +78,7 @@ function SQL_QUERY ($sqlString, $F, $L) {
        $querytimeBefore = array_sum(explode(' ', microtime()));
 
        // Run SQL command
-       //* DEBUG: */ outputHtml($sqlString."<br />");
+       //* DEBUG: */ print($sqlString . '<br />');
        $result = mysql_query($sqlString, SQL_GET_LINK())
                or addFatalMessage(__FUNCTION__, __LINE__, $F . ' (' . $L . '):' . mysql_error() . '<br />
 Query string:<br />
index 9c97434af5092f2a7b4a73b4ecf7266927e698b8..0e9518d91faaa20d1975dc2a5a065214e309ae94 100644 (file)
@@ -61,7 +61,7 @@ if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != '1') &&
        } // END - if
 
        // Shall we display the parsing time and number of queries?
-       if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestElementSet('frame'))) || (isInstallationPhase())) && ($GLOBALS['header_sent'] == '2')) {
+       if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestElementSet('frame'))) || (isInstallationPhase())) && (getOutputMode() != 0) && ($GLOBALS['header_sent'] == '2')) {
                // Then display it here
                displayParsingTime();
        } // END - if
index 9cff89dd5818d3a84b81ec12badfec54a94d5ce7..d248ce7714753eb95df09082e1ddf97adecab06e 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 // Is the header already sent?
 if (($GLOBALS['header_sent'] != '1') && ($GLOBALS['header_sent'] != '2')) {
        // If not in CSS mode generate the header
-       if (getOutputMode() != '1') {
+       if (getOutputMode() != 1) {
                // Config and database connection valid?
                if ((isConfigLocalLoaded()) && (isConfigLoaded()) && (SQL_IS_LINK_UP()) && (isExtensionActive('sql_patches'))) {
                        // Init title
@@ -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) && (getOutputMode() != -1) && ($GLOBALS['header_sent'] == 1) && ((getModule() != 'frametester') || (isGetRequestElementSet('frame')))) {
        loadTemplate('page_body');
        $GLOBALS['header_sent'] = 2;
 } // END - if
index e723c3878c8de895b3c83dc2c866f270377a3d37..349effe354a224a1cda580483dbb4c7bfc11adbf 100644 (file)
@@ -69,7 +69,7 @@ addMessages(array(
        'BONUS_SHOW_HEADER_LINE_2' => "f&uuml;r die Mail",
        'BONUS_SHOW_HEADER_LINE_3' => "erhalten hat",
        'BONUS_SHOW_YOU_HAVE_CONFIRMED' => "Sie haben diese Mail am",
-       'BONUS_SHOW_CONFIRMED_BONUS_IS' => "Stelle best&auml;tigt. Ihre Gutschrift f&uuml;r diese eMail",
+       'BONUS_SHOW_CONFIRMED_BONUS_IS' => "Stelle best&auml;tigt. Ihre Zusatz-Gutschrift f&uuml;r diese Mail",
        'BONUS_TOTAL' => "Gesamtbonus",
        'BONUS_RALLYE_NO_ONE_JOINED' => "Niemand nimmt an unserer Aktiv-Rallye dran teil. :-(",
        'BONUS_RALLYE_NOTE' => "Bitte beachten Sie, dass Ihr Login-Bonus hier nicht mit angezeigt wird. Bei der monatlichen Auswertung wird er Ihnen jedoch gutgeschrieben.",
index 9cbf52d1ffb2ec2129d88b429ef04a2b499c3035..5b7358917ef5bec4e9a2ba12e4b24bdc0c207ee6 100644 (file)
@@ -73,7 +73,7 @@ function addTurboBonus ($mid, $userid, $type) {
        } // END - if
 
        // Check for entry
-       $rank = countSumTotalData($userid, 'bonus_turbo', 'id', 'userid', true, sprintf(" AND `%s`=%s", $column, $mid)) + 1;
+       $rank = countSumTotalData($mid, 'bonus_turbo', 'id', $column, true) + 1;
 
        // Which rank?
        if ($rank == 1) {
@@ -135,7 +135,7 @@ function addBonusRanks ($data, $type, $userid) {
                $GLOBALS['ranking_content']['yr_tmark']  = generateDateTime($GLOBALS['ranking_content']['timemark'], '1');
 
                // Load template
-               $GLOBALS['ranking_content']['rankings'] = loadTemplate('show_bonus_yr', true, $GLOBALS['ranking_content']);
+               $GLOBALS['ranking_content']['own'] = loadTemplate('show_bonus_yr', true, $GLOBALS['ranking_content']);
        } // END - if
 
        // Load rankings
@@ -151,31 +151,41 @@ function addBonusRanks ($data, $type, $userid) {
                // Output all ranks (levels)
                for ($rank = 1; $rank <= $max; $rank++) {
                        // Load data
-                       $result_users = SQL_QUERY_ESC("SELECT `userid`, `points`, `timemark` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `%s`=%s AND level=%s LIMIT 1",
+                       $result_users = SQL_QUERY_ESC("SELECT
+       `userid`, `points`
+FROM
+       `{?_MYSQL_PREFIX?}_bonus_turbo`
+WHERE
+       `%s`=%s AND
+       `level`=%s
+LIMIT 1",
                                array($type, $data, $rank), __FUNCTION__, __LINE__);
 
                        // Nothing found by default
-                       $GLOBALS['ranking_content']['userid'] = '---';
-                       $GLOBALS['ranking_content']['points'] = '---';
+                       $rows['userid'] = '---';
+                       $rows['points'] = '---';
 
                        // Are you one of them?
                        if (SQL_NUMROWS($result_users) == 1) {
                                // Load data
-                               $GLOBALS['ranking_content'] = merge_array($GLOBALS['ranking_content'], SQL_FETCHARRAY($result_users));
+                               $rows = merge_array($rows, SQL_FETCHARRAY($result_users));
 
                                // Translate comma
-                               $GLOBALS['ranking_content']['points'] = translateComma($GLOBALS['ranking_content']['points']);
+                               $rows['points'] = translateComma($rows['points']);
                        } // END - if
 
+                       // Free result
+                       SQL_FREERESULT($result_users);
+
                        // Add more
-                       $GLOBALS['ranking_content']['rank'] = $rank;
-                       $GLOBALS['ranking_content']['sw']   = $SW;
+                       $rows['rank'] = $rank;
+                       $rows['sw']   = $SW;
 
                        // Output row
                        $OUT .= "<tr>
-  <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>
+  <td class=\"bonus_rank_".$rows['rank']." bottom2 switch_sw".$rows['sw']."\">&nbsp;".$rows['rank'].".</td>
+  <td class=\"bonus_rank_".$rows['rank']." bottom2 switch_sw".$rows['sw']."\" align=\"center\">".$rows['userid']."</td>
+  <td class=\"bonus_rank_".$rows['rank']." bottom2 switch_sw".$rows['sw']."\" align=\"center\">".$rows['points']."</td>
 </tr>\n";
 
                        // Switch color
index eaa939dc584e815308a8679cf361bee6af90e78f..d799dedfebab43ae84a41f34f886dc9da390552b 100644 (file)
@@ -77,7 +77,7 @@ if ((!isInstalling()) && (!isInstallationPhase())) {
        loadIncludeOnce('inc/db/lib.php');
 
        // Set missing module
-       if (!isModuleSet()) setModule(getRequestElement('module'));
+       if ((!isModuleSet()) && (isGetRequestElementSet('module'))) setModule(getRequestElement('module'));
        if (!isModuleSet()) setModule('index');
 
        // Load configuration file(s) here
index 1320843bd26c63c014471ca9f59917c33a14bd5b..5afd40c3dfed634e578d6b7437aeebfff6fcec74 100644 (file)
@@ -150,7 +150,7 @@ function postRequestElement ($element, $subElement=null) {
 // Checks if an element in $_POST exists
 function isPostRequestElementSet ($element, $subElement=null) {
        if (is_null($subElement)) {
-               return ((isset($GLOBALS['raw_request']['post'][$element])) && (!empty($GLOBALS['raw_request']['post'][$element])));
+               return ((isset($GLOBALS['raw_request']['post'][$element])) && (isset($GLOBALS['raw_request']['post'][$element])));
        } else {
                return ((isset($GLOBALS['raw_request']['post'][$element][$subElement])) && (isset($GLOBALS['raw_request']['post'][$element][$subElement])));
        }
index e9a77ff4f382ba65322d713a7c9ab3a51442fe1b..4eb6036f9483682e9ec5f84fa522bf4c2ac38422 100644 (file)
--- a/index.php
+++ b/index.php
@@ -47,7 +47,7 @@ $GLOBALS['startTime'] = microtime(true);
 $GLOBALS['module'] = 'index';
 
 // Set 'CSS-Mode'
-$GLOBALS['output_mode'] = '0';
+$GLOBALS['output_mode'] = 0;
 
 // Load config.php
 require('inc/config-global.php');
diff --git a/js.php b/js.php
index 88ae66ee0021d398ad550449c6927203b1404060..c4e57f9ae3fecd64437fb4beda96f13a6ccc9548 100644 (file)
--- a/js.php
+++ b/js.php
@@ -46,7 +46,7 @@ require('inc/libs/security_functions.php');
 // pattern is given...
 //
 // But mxchange 0.3.0 will show that in better way! :D :D :D
-$GLOBALS['output_mode'] = '1';
+$GLOBALS['output_mode'] = 1;
 $GLOBALS['module'] = 'js';
 
 // Load the required file(s)
index 6f2b0ef79d55ce252b547cc943234fc4062a2c95..fdaaf12bb8ee9026562b2afd9f255fb28992040e 100644 (file)
@@ -46,7 +46,7 @@ $GLOBALS['startTime'] = microtime(true);
 $GLOBALS['module'] = 'lead-confirm';
 
 // Set "CSS-Mode"
-$GLOBALS['output_mode'] = '0';
+$GLOBALS['output_mode'] = 0;
 
 // Load config.php
 require('inc/config-global.php');
index 45fc27fc3dd9ec1a3ec67139b52cccdbe0bd4f89..4266bc4fc2cd07d310178255571def8196b12ce0 100644 (file)
--- a/login.php
+++ b/login.php
@@ -43,7 +43,7 @@ require('inc/libs/security_functions.php');
 $GLOBALS['module'] = 'login';
 
 // Set 'CSS-Mode'
-$GLOBALS['output_mode'] = '0';
+$GLOBALS['output_mode'] = 0;
 
 // Load the required file(s)
 require('inc/config-global.php');
index f87ef349eb2d3af583f74408fe55c7c8a6cd8d11..78c1948e26cb5de6fe988dd675d2ff2243b7d49f 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)
@@ -97,7 +97,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr
                        case 'NORMAL':
                                // Is the stats ID valid?
                                $result = SQL_QUERY_ESC("SELECT pool_id, url, subject FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1",
-                               array($url_mid), __FILE__, __LINE__);
+                                       array($url_mid), __FILE__, __LINE__);
                                break;
 
                        case 'BONUS':
@@ -106,7 +106,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr
 
                                // Bonus-Mails
                                $result = SQL_QUERY_ESC("SELECT id, url, subject FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
-                               array($url_bid), __FILE__, __LINE__);
+                                       array($url_bid), __FILE__, __LINE__);
                                break;
 
                        default: // Invalid mail type
@@ -133,8 +133,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr
                                if ($status == 'CONFIRMED') {
                                        // User has confirmed his account so we can procede...
                                        // @TODO Rewrite this to a filter
-                                       switch ($ltype)
-                                       {
+                                       switch ($ltype) {
                                                case 'NORMAL':
                                                        $result = SQL_QUERY_ESC("SELECT payment_id FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1",
                                                                array(bigintval($pool)), __FILE__, __LINE__);
@@ -192,7 +191,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr
                                                $errorCode = getCode('POSSIBLE_INVALID');
                                        }
                                } else {
-                                       $errorCode = getCode('ACCOUNT_LOCKED');
+                                       $errorCode = getCode('ACCOUNT_' . $status);
                                }
                        } else {
                                SQL_FREERESULT($result);
index f1e83132d403e9ebae7a440ad436634c13b538b0..e60943d5b44768fbe44b1334912bfeda952ff475 100644 (file)
@@ -131,14 +131,9 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr
                                SQL_FREERESULT($result);
 
                                if ($status == 'CONFIRMED') {
-                                       // Update last activity
-                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `last_online`=UNIX_TIMESTAMP(), `last_module`='mailid_top' WHERE `userid`=%s LIMIT 1",
-                                               array($url_userid), __FILE__, __LINE__);
-
                                        // User has confirmed his account so we can procede...
                                        // @TODO Rewrite this to a filter
-                                       switch ($ltype)
-                                       {
+                                       switch ($ltype) {
                                                case 'NORMAL':
                                                        $result = SQL_QUERY_ESC("SELECT `payment_id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1",
                                                                array(bigintval($pool)), __FILE__, __LINE__);
index d1335e3793b975fe871322b347aaeaafa38b3dab..ec0c52d0c20765a7051475d0918787c568d1e6f0 100644 (file)
@@ -42,7 +42,7 @@ require('inc/libs/security_functions.php');
 $GLOBALS['module'] = 'sponsor_confirm';
 
 // Set 'CSS-Mode'
-$GLOBALS['output_mode'] = '0';
+$GLOBALS['output_mode'] = 0;
 
 // Load the required file(s)
 require('inc/config-global.php');
index 702b6b505f9cd3206a3aca0ee3faef6e6af2194d..5c8de09dc8c71b4bcfb9b27ab6ba05d8bccd6809 100644 (file)
@@ -42,7 +42,7 @@ require('inc/libs/security_functions.php');
 $GLOBALS['module'] = 'sponsor_ref';
 
 // Set 'CSS-Mode'
-$GLOBALS['output_mode'] = '0';
+$GLOBALS['output_mode'] = 0;
 
 // Load the required file(s)
 require('inc/config-global.php');
index a2f6c7295f19050e17d44914bc99980b3d407b3a..7debb5a4389014a0626a6e59bdbfaef01b75f60d 100644 (file)
@@ -81,7 +81,7 @@
 
        <tr>
                <td width="10" class="seperator">&nbsp;</td>
-               <td align="right">{--ADMIN_OPTION?mt_word?-}:</td>
+               <td align="right">{--ADMIN_OPTION_MT_WORD--}:</td>
                <td width="10" class="seperator">&nbsp;</td>
                <td>
                        <input type="text" name="mt_word" class="admin_normal" size="15" maxlength="255" value="{?mt_word?}" />
@@ -95,7 +95,7 @@
 
        <tr>
                <td width="10" class="seperator">&nbsp;</td>
-               <td align="right">{--ADMIN_OPTION?mt_word?--}:</td>
+               <td align="right">{--ADMIN_OPTION_MT_WORD2--}:</td>
                <td width="10" class="seperator">&nbsp;</td>
                <td>
                        <input type="text" name="mt_word2" class="admin_normal" size="15" maxlength="255" value="{?mt_word2?}" />
 
        <tr>
                <td width="10" class="seperator">&nbsp;</td>
-               <td align="right">{--ADMIN_OPTION?mt_word?--}:</td>
+               <td align="right">{--ADMIN_OPTION_MT_WORD3--}:</td>
                <td width="10" class="seperator">&nbsp;</td>
                <td>
                        <input type="text" name="mt_word3" class="admin_normal" size="15" maxlength="255" value="{?mt_word3?}" />
index 2f8e57ef2251ae8a16a734ae334e531e30cb7423..a051b30765bccc6b65815a8ad24e8783f33171fa 100644 (file)
@@ -12,7 +12,9 @@
        </tr>
        $content[rows]
        <tr>
-               <td colspan="3" class="member_footer" align="center"><div class="tiny member_note">&nbsp;</div></td>
+               <td colspan="3" class="member_footer" align="center">
+                       <div class="tiny">$content[own]</div>
+               </td>
        </tr>
 </table>
 
@@ -20,7 +22,7 @@
        $content[rankings]
 </div>
 
-<div class="member_note">
+<div style="padding-top:5px;padding-bottom:5px" 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>{?bonus_ranks?}</u> die Aktiv-Rallye gewinnen. Der Rechtsweg ist ausgeschlossen.
 </div>