]> git.mxchange.org Git - mailer.git/commitdiff
Cleanups and all "base scripts" fixed:
authorRoland Häder <roland@mxchange.org>
Tue, 16 Aug 2011 15:16:13 +0000 (15:16 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 16 Aug 2011 15:16:13 +0000 (15:16 +0000)
- Referral listing in admin area fixed and deprecated code removed (cleanup)
- All "base scripts" now set start time (to avoid later missing elements)
- I missed to update 0.4.6 for ext-user, now it is updated
- Non-set timestamps are now NULL (was still in ext-user)
- TODOs.txt updated

25 files changed:
DOCS/TODOs.txt
admin.php
agb.php
click.php
confirm.php
css.php
debug.php
img.php
inc/extensions/ext-user.php
inc/language/de.php
inc/language/refback_de.php
inc/modules/admin/what-list_refs.php
inc/modules/guest/what-login.php
js.php
login.php
modules.php
network-vcheck.php
ref.php
sponsor_confirm.php
sponsor_ref.php
surfbar.php
templates/de/html/admin/admin_list_refs.tpl
templates/de/html/admin/admin_list_refs2.tpl
templates/de/html/admin/admin_list_refs_level.tpl
view.php

index d7f2f6460f0f79f3c64f960715e976cd1d20524b..5d45fbe32bcfa5eeff966347a5c80be2ca0912d0 100644 (file)
 ./inc/functions.php:2199:      // @TODO Rename column data_type to e.g. mail_status
 ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter
 ./inc/install-functions.php:57:        // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestElement('omode'), 0);
-./inc/language/de.php:1074:    // @TODO Rewrite these two constants
-./inc/language/de.php:1090:    // @TODO Rewrite these three constants
+./inc/language/de.php:1073:    // @TODO Rewrite these two constants
+./inc/language/de.php:1089:    // @TODO Rewrite these three constants
 ./inc/language/de.php:758:// @TODO Are these constants longer used?
 ./inc/language-functions.php:255:      // @TODO These are all valid languages, again hard-coded
 ./inc/language-functions.php:44:// @TODO Rewrite all language constants to this function.
 ./inc/language/newsletter_de.php:13: * @TODO This language file is completely out-dated, please do no       *
 ./inc/language/rallye_de.php:13: * @TODO Naming convention not applied for language strings             *
-./inc/language/refback_de.php:53:      // @TODO Rewrite these constants to one
+./inc/language/refback_de.php:51:      // @TODO Rewrite these constants to one
 ./inc/language/sponsor_de.php:117:// @TODO Rewrite these four constants to one and use sprintf()
 ./inc/libs/admins_functions.php:495:           // @TODO This can be, somehow, rewritten
 ./inc/libs/bonus_functions.php:194:            // @TODO Move this HTML to a template
 ./inc/modules/admin/what-list_links.php:55:            // @TODO Try to rewrite this to a filter
 ./inc/modules/admin/what-list_links.php:85:                            // @TODO Find a way to rewrite this. See some lines above for different queries
 ./inc/modules/admin/what-list_links.php:93:                                    // @TODO Rewrite this to includes/filter
-./inc/modules/admin/what-list_refs.php:99:                                                             // @TODO Try to rewrite some to EL
+./inc/modules/admin/what-list_refs.php:100:                                                    // @TODO Try to rewrite some to EL
 ./inc/modules/admin/what-list_unconfirmed.php:107:     // @TODO "Please do not call me directly." Should be rewritten to a nice selection depending on ext-bonus
 ./inc/modules/admin/what-list_unconfirmed.php:84:      // @TODO This constant might be unused? define('__LIST_UNCON_TITLE', '{--ADMIN_LIST_UNCONFIRMED_BONUS_LINKS--}');
 ./inc/modules/admin/what-list_user.php:247:            // @TODO Rewrite this into a filter
 ./inc/modules/member/what-unconfirmed.php:162: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
 ./inc/modules/member/what-unconfirmed.php:227:                         // @TODO This 'userid' cannot be saved because of encapsulated EL code
 ./inc/modules/order.php:78:            // @TODO Unused: 2,4
-./inc/mysql-manager.php:1381:          // @TODO Rewrite these lines to a filter
-./inc/mysql-manager.php:1405:  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1664:                  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1710:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1410:          // @TODO Rewrite these lines to a filter
+./inc/mysql-manager.php:1434:  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1693:                  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1739:// @TODO Fix inconsistency between last_module and getWhat()
 ./inc/mysql-manager.php:387:   // @TODO Try to rewrite this to one or more functions
 ./inc/mysql-manager.php:44:// @TODO Can we cache this?
 ./inc/purge/purge-inact.php:55:        // @TODO Rewrite these if() blocks to a filter
 ./mailid_top.php:18: * @TODO Merge this script with mailid.php                              *
 ./mailid_top.php:196:                                                                  // @TODO Rewrite this to a filter
 ./mailid_top.php:231:                                                                  // @TODO Rewrite these blocks to filter
-./network-vcheck.php:54:// @TODO Add processing of request here
-./view.php:68:         // @TODO No banner found, output some default banner
+./network-vcheck.php:57:// @TODO Add processing of request here
+./view.php:71:         // @TODO No banner found, output some default banner
 ./templates/de/html/admin/admin_add_country.tpl:23:                    <!-- @TODO Rewrite this selection box to our generic functions //-->
 ./templates/de/html/admin/admin_config_other.tpl:79:                   <!-- @TODO Rewrite this selection to one of our functions //-->
 ./templates/de/html/admin/admin_config_rewrite.tpl:4:  <!-- @TODO No title here? //-->
 ./templates/de/html/admin/admin_edit_admin_menu.tpl:4:<!-- @TODO Shouldn't we add a title here? //-->
-./templates/de/html/admin/admin_list_refs_level.tpl:21:                <!-- @TODO Nothing to say here? //-->
+./templates/de/html/admin/admin_list_refs_level.tpl:20:                <!-- @TODO Nothing to say here? //-->
 ./templates/de/html/admin/admin_list_unconfirmed_list.tpl:3:<!-- @TODO Shouldn't we add a title here? //-->
 ./templates/de/html/admin/admin_login_form.tpl:34:     @TODO Doesn't work with sessions
 ./templates/de/html/admin/admin_login_form.tpl:37:             @TODO Try to move the select box to our generic functions
 ./templates/de/html/admin/admin_list_country_edit_row.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/admin/admin_list_network_config_row.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/admin/admin_list_network_config.tpl:1:<!-- @DEPRECATED //-->
+./templates/de/html/admin/admin_list_refs2.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/admin/admin_list_user_sort_form.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/admin/admin_mods_stats2_row.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/admin/admin_mods_stats2.tpl:1:<!-- @DEPRECATED //-->
index be967cd479ad44ea6b7b31889fa61a824867cc4b..c7e2aab0b35760e6e82e9abd4080630e8b177878 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -38,6 +38,9 @@
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
+
 // Set module
 $GLOBALS['module'] = 'admin';
 $GLOBALS['output_mode'] = -1;
diff --git a/agb.php b/agb.php
index f31b02d0a159cd319606c32b152be0c4f09781a8..089de85075de757cc7a9ed988677294a5d3a8635 100644 (file)
--- a/agb.php
+++ b/agb.php
@@ -38,6 +38,9 @@
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
+
 // Set module
 $GLOBALS['module'] = 'agb';
 $GLOBALS['output_mode'] = -1;
index 48263106174f5353955977679c8c7747551da0f9..2b0d1dd1f04f7e5d7e4baf6851c5f54aed80a744 100644 (file)
--- a/click.php
+++ b/click.php
@@ -38,6 +38,9 @@
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
+
 // Set module
 $GLOBALS['module'] = 'click';
 $GLOBALS['output_mode'] = -1;
index 9c7db6f02a0cd8fcf7d5d6c94bf701ff2c615d0f..21da585962bf16983a300e3077c4440a17ad413d 100644 (file)
@@ -38,6 +38,9 @@
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
+
 // Set module to confirm
 $GLOBALS['module'] = 'confirm';
 $GLOBALS['output_mode'] = -1;
diff --git a/css.php b/css.php
index 6a81ed5f49707a274c2bc7177b52e729483c0ca0..73374f3f16225fefdb7a5c4d1ba94cd8e4636530 100644 (file)
--- a/css.php
+++ b/css.php
@@ -41,9 +41,12 @@ require('inc/libs/security_functions.php');
 // Footer is disabled in CSS mode
 $GLOBALS['footer_sent'] = -1;
 
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
+
 // This is a CSS file loader!
-$GLOBALS['output_mode'] = 1;
 $GLOBALS['module'] = 'css';
+$GLOBALS['output_mode'] = 1;
 
 // Load the required file(s)
 require('inc/config-global.php');
index 5029019b66694a41751c1594ce4c9ac9106a0b64..23005da37095fae2319dc9ae5240e03f123a8981 100644 (file)
--- a/debug.php
+++ b/debug.php
@@ -38,6 +38,9 @@
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
+
 // Set module and fake "CSS mode"
 $GLOBALS['module'] = 'debug';
 $GLOBALS['output_mode'] = -1;
diff --git a/img.php b/img.php
index 64e22fa2e7fa3aa0c0b10f20be538fedd2df49c3..92f464d0e725133220505c2d988b25663c6295f1 100644 (file)
--- a/img.php
+++ b/img.php
@@ -38,6 +38,9 @@
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
+
 // Set module
 $GLOBALS['module'] = 'img';
 $GLOBALS['output_mode'] = -1;
index ab95aae6bf5c513e3000109a1b050746a042bfab..345120bbdf0750d7f84c2a1d306eb373f23e864c 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.4.6');
+setThisExtensionVersion('0.4.8');
 
 // Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6'));
+setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8'));
 
 // Keep this extension always active!
 setExtensionAlwaysActive('Y');
@@ -348,7 +348,7 @@ INDEX (`stats_type`)",
 
                        case '0.3.5': // SQL queries for v0.3.5
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_reason` TINYTEXT");
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00'");
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_timestamp` TIMESTAMP NULL DEFAULT NULL");
                                addConfigAddSql('user_delete_purge', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 30));
                                addAdminMenuSql('user', 'list_user_del', 'L&ouml;schungen auflisten', 'Listet die L&ouml;schungen von Usern auf.', 9);
                                addDropTableSql('user_del');
@@ -456,7 +456,6 @@ INDEX (`userid`)",
                                break;
 
                        case '0.4.4': // SQL queries for v0.4.4
-                               // SQL commands to run
                                addDropTableSql('user_refs');
                                addCreateTableSql('user_refs', "
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -477,7 +476,6 @@ INDEX (`refid`)",
                                break;
 
                        case '0.4.5': // SQL queries for v0.4.5
-                               // SQL commands to run
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `link_type` `link_type` VARCHAR(255) NOT NULL DEFAULT 'NORMAL'");
 
                                // Update notes (these will be set as task text!)
@@ -485,7 +483,6 @@ INDEX (`refid`)",
                                break;
 
                        case '0.4.6': // SQL queries for v0.4.6
-                               // SQL commands to run
                                addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='{OPEN_CONFIG}POINTS{CLOSE_CONFIG} gutschreiben' WHERE `what` = 'add_points' LIMIT 1");
                                addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='{OPEN_CONFIG}POINTS{CLOSE_CONFIG} abziehen' WHERE `what` = 'sub_points' LIMIT 1");
                                addAdminMenuSql('user','sub_points','{OPEN_CONFIG}POINTS{CLOSE_CONFIG} abziehen','Allen oder einem Mitglied {OPEN_CONFIG}POINTS{CLOSE_CONFIG} abziehen.', 8);
@@ -496,6 +493,14 @@ INDEX (`refid`)",
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Abzug von {?POINTS?} sollte nun dabei sein und Hinzuf&uuml;gen gefixt (war zu kurze Spalte).");
                                break;
+
+                       case '0.4.7': // SQL queries for v0.4.7
+                               addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `lock_timestamp` `lock_timestamp` TIMESTAMP NULL DEFAULT NULL');
+                               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `lock_timestamp`=NULL WHERE `lock_timestamp`='0000-00-00 00:00:00'");
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("0000-00-00  00:00:00 ist kein Standardwert mehr, NULL ist dies.");
+                               break;
                } // END - switch
                break;
 
index febff5cb85852fcb5837b0a09123f347c6c13d87..1cfe6cad4abab92f743e1fb71b2d4501630f80f8 100644 (file)
@@ -196,7 +196,7 @@ addMessages(array(
        'ENTER_EMAIL' => "Bitte geben Sie Ihre Email-Adresse ein! Diese muss auch erreichbar sein.",
        'ENTER_SURNAME' => "Bitte geben Sie Ihren Vornamen ein.",
        'ENTER_FAMILY' => "Bitte geben Sie Ihren Nachnamen ein.",
-       'ADMIN_CONFIG_SECURITY_TITLE' => "&Auml;ndern von sicherheits-relevanten Einstellungen",
+       'ADMIN_CONFIG_SECURITY_TITLE' => "Sicherheitseinstellungen",
        'ADMIN_CONFIG_MIN_PASS_LENGTH' => "Minimale Passwortl&auml;nge",
        'SETTINGS_NOT_SAVED' => "Einstellungen NICHT gespeichert / ge&auml;ndert.",
        'SETTINGS_SAVED' => "Einstellungen gespeichert.",
@@ -1011,7 +1011,6 @@ addMessages(array(
        'MEMBER_ORDER_TEST_STARTED' => "Framekiller-Test startet...",
        'MEMBER_ORDER_PLEASE_WAIT_1' => "Ihre Seite wird auf Framekiller getestet. Bitte noch ",
        'MEMBER_ORDER_PLEASE_WAIT_2' => " Sekunden warten.",
-       'ADMIN_NO_REFERRAL_LEVELS' => "In Ihrem {?mt_word?} sind keine Referral-Ebenen eingerichtet! Ihre Mitglieder erhalten <u>keine</u> {?POINTS?} gutgeschrieben. Richten Sie mindestens Referral-Ebene 0 mit 100% Verg&uuml;tung ein.",
        'ADMIN_SESSION_SAVE_PATH_INVALID' => "Pfad f&uuml;r Sitzungsdateien ung&uuml;tig.",
        'ADMIN_CONFIG_SESSION_TITLE' => "Einstellungen zum Sitzungsmanagement",
        'ADMIN_CONFIG_SESSION_SAVE_PATH' => "Speicherpfad f. Sitzungsdateien",
@@ -1180,6 +1179,11 @@ addMessages(array(
        'POINTS_SUBJECT_ADMIN_ADD_SINGLE' => "Einzelgutschrift durch den Administrator",
        'POINTS_SUBJECT_ADMIN_SUB_ALL'    => "Abzug aller Accounts durch den Administrator",
        'POINTS_SUBJECT_ADMIN_SUB_SINGLE' => "Einzelabzug durch den Administrator",
+
+       // Admin - List referrals
+       'ADMIN_LIST_USER_NO_REFERRALS' => "Das Mitglied <span class=\"data\">%s</span> hat in dieser Referral-Ebene keine Mitglieder geworben.",
+       'ADMIN_NO_REFERRAL_LEVELS' => "In Ihrem {?mt_word?} sind keine Referral-Ebenen eingerichtet! Ihre Mitglieder erhalten <u>keine</u> {?POINTS?} gutgeschrieben. Richten Sie mindestens Referral-Ebene 0 mit 100% Verg&uuml;tung ein.",
+       'ADMIN_LIST_USER_NODATA' => "Das Mitglied <span class=\"data\">%s</span> wurde bereits gel&ouml;scht.",
 ));
 
 // Description of all months
index 2dc668170a1f267e5745ca321164d6741b63972c..05c9a63e724c2f4fe3a37ed48e88d39d7b5d5f98 100644 (file)
@@ -42,8 +42,6 @@ if (!defined('__SECURITY')) {
 
 // Admin language strings
 addMessages(array(
-       'ADMIN_LIST_USER_NO_REFERRALS' => "Das Mitglied <span class=\"data\">%s</span> hat in dieser Referral-Ebene keine Refs.",
-       'ADMIN_LIST_USER_NODATA' => "Das Mitglied <span class=\"data\">%s</span> wurde bereits gel&ouml;scht.",
        'ADMIN_CONFIG_REFBACK_TITLE' => "Refback-Einstellungen",
        'ADMIN_CONFIG_REFBACK_ENABLED' => "Refback eingeschaltet? (Wenn nein, ist nur die Referral-&Uuml;bersicht funktionell.)",
        'ADMIN_CONFIG_REFBACK_MIN_PERCENTS' => "Minimum erlaubte Refback-Prozente:<br /><span class=\"notice\">(0&#37; ist immer erlaubt!)</span>",
index 3632c774ffab026f5606cfbb78ebc6b42d6cac7e..2c410a5e8af5954a446d4af0a4f0abd04323e441 100644 (file)
@@ -69,97 +69,74 @@ ORDER BY
                        // List all ref levels or entries if no refback is installed
                        $OUT = '';
                        while ($levels = SQL_FETCHARRAY($result_levels)) {
-                               // Is the refback still active? ;-)
-                               if (isExtensionActive('refback')) {
-                                       // Load all refs of this user
-                                       $result_refs = SQL_QUERY_ESC("SELECT `refid` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `level`=%s ORDER BY `refid` ASC",
-                                               array($userid, $levels['level']), __FILE__, __LINE__);
-                                       //* DEBUG: */ debugOutput($userid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs));
-
-                                       // Do we have levels?
-                                       if (!SQL_HASZERONUMS($result_refs)) {
-                                               // Count entries
-                                               $menge =     countSumTotalData($userid, 'user_data', 'userid', 'refid', true);
-                                               $menge_lck = countSumTotalData($userid, 'user_data', 'userid', 'refid', true, " AND `status` != 'CONFIRMED'");
-
-                                               // Output info message
-                                               $levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink($userid), $menge, $menge_lck);
-
-                                               // Init variables
-                                               $OUT_REFS = '';
-
-                                               // Load all refs
-                                               while ($content = SQL_FETCHARRAY($result_refs)) {
-                                                       // Is the data there?
-                                                       if (fetchUserData($content['refid'])) {
-                                                               // Check for referrals
-                                                               $refs_cnt = countSumTotalData(getUserData('userid'), 'user_refs', 'id', 'userid', true);
-
-                                                               // Prepare data for the template
-                                                               // @TODO Try to rewrite some to EL
-                                                               $content = array(
-                                                                       'userid'     => getUserData('userid'),
-                                                                       'gender'     => getUserData('gender'),
-                                                                       'refs_link'  => 0,
-                                                                       'surname'    => getUserData('surname'),
-                                                                       'family'     => getUserData('family'),
-                                                                       'email'      => '[<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . getUserData('email') . '</a>]',
-                                                                       'status'     => getUserData('status'),
-                                                                       'registered' => generateDateTime(getUserData('joined'), 3),
-                                                               );
-
-                                                               // Check if referral count is larger 0 and update link
-                                                               if ($refs_cnt > 0) {
-                                                                       $content['refs_link'] = generateUserProfileLink(getUserData('userid'), $refs_cnt, 'list_refs');
-                                                               } // END - if
-
-                                                               // Load template for level one
-                                                               $OUT_REFS .= loadTemplate('admin_list_refs_row', true, $content);
-                                                       } else {
-                                                               // No refs found
-                                                               $OUT_REFS = loadTemplate('admin_list_refs_nodata', true, $content);
-                                                       }
-
-                                                       // Add content
-                                                       $levels['rows'] = $OUT_REFS;
-                                               } // END - while
-                                       } else {
-                                               // Output info message
-                                               $levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink($userid), 0, 0);
-
-                                               // No refs found
-                                               $levels['rows'] = loadTemplate('admin_list_refs_norefs', true, array('userid' => $userid));
-                                       }
-
-                                       // Free result
-                                       SQL_FREERESULT($result_refs);
-
-                                       // Load level template
-                                       $OUT .= loadTemplate('admin_list_refs_level', true, $levels);
+                               // Load all refs of this user
+                               $result_refs = SQL_QUERY_ESC("SELECT `refid` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `level`=%s ORDER BY `refid` ASC",
+                                       array(
+                                               $userid,
+                                               $levels['level']
+                                       ), __FILE__, __LINE__);
+                               //* DEBUG: */ debugOutput($userid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs));
+
+                               // Do we have levels?
+                               if (!SQL_HASZERONUMS($result_refs)) {
+                                       // Count entries
+                                       $menge =     countSumTotalData($userid, 'user_data', 'userid', 'refid', true);
+                                       $menge_lck = countSumTotalData($userid, 'user_data', 'userid', 'refid', true, " AND `status` != 'CONFIRMED'");
+
+                                       // Output info message
+                                       $levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink($userid), $menge, $menge_lck);
+
+                                       // Init variables
+                                       $OUT_REFS = '';
+
+                                       // Load all refs
+                                       while ($content = SQL_FETCHARRAY($result_refs)) {
+                                               // Is the data there?
+                                               if (fetchUserData($content['refid'])) {
+                                                       // Check for referrals
+                                                       $refs_cnt = countSumTotalData(getUserData('userid'), 'user_refs', 'id', 'userid', true);
+
+                                                       // Prepare data for the template
+                                                       // @TODO Try to rewrite some to EL
+                                                       $content = array(
+                                                               'userid'     => getUserData('userid'),
+                                                               'gender'     => getUserData('gender'),
+                                                               'refs_link'  => 0,
+                                                               'surname'    => getUserData('surname'),
+                                                               'family'     => getUserData('family'),
+                                                               'email'      => '[<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . getUserData('email') . '</a>]',
+                                                               'status'     => getUserData('status'),
+                                                               'registered' => generateDateTime(getUserData('joined'), 3),
+                                                       );
+
+                                                       // Check if referral count is larger 0 and update link
+                                                       if ($refs_cnt > 0) {
+                                                               $content['refs_link'] = generateUserProfileLink(getUserData('userid'), $refs_cnt, 'list_refs');
+                                                       } // END - if
+
+                                                       // Load template for level one
+                                                       $OUT_REFS .= loadTemplate('admin_list_refs_row', true, $content);
+                                               } else {
+                                                       // No refs found
+                                                       $OUT_REFS = loadTemplate('admin_list_refs_nodata', true, $content);
+                                               }
+
+                                               // Add content
+                                               $levels['rows'] = $OUT_REFS;
+                                       } // END - while
                                } else {
-                                       // Check for referrals
-                                       $refs_cnt = countSumTotalData($levels['userid'], 'user_data', 'userid', 'refid', true);
-
-                                       // Prepare data for the template
-                                       $content = array(
-                                               'userid'     => $levels['userid'],
-                                               'gender'     => $levels['gender'],
-                                               'refs_link'  => 0,
-                                               'surname'    => $levels['surname'],
-                                               'family'     => $levels['family'],
-                                               'email'      => '[<a href="' . generateEmailLink($levels['email'], 'user_data') . '">' . $levels['email'] . '</a>]',
-                                               'status'     => $levels['status'],
-                                               'registered' => generateDateTime($levels['joined'], 3),
-                                       );
-
-                                       // Check if referral count is larger 0 and update link
-                                       if ($refs_cnt > 0) {
-                                               $content['refs_link'] = generateUserProfileLink($levels['userid'], $refs_cnt, 'list_refs');
-                                       } // END - if
-
-                                       // Load template for level one
-                                       $OUT .= loadTemplate('admin_list_refs_row', true, $content);
+                                       // Output info message
+                                       $levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink($userid), 0, 0);
+
+                                       // No refs found
+                                       $levels['rows'] = loadTemplate('admin_list_refs_norefs', true, array('userid' => $userid));
                                }
+
+                               // Free result
+                               SQL_FREERESULT($result_refs);
+
+                               // Load level template
+                               $OUT .= loadTemplate('admin_list_refs_level', true, $levels);
                        } // END - while
 
                        // Prepare content
@@ -169,14 +146,7 @@ ORDER BY
                        );
 
                        // Load main template
-                       if (isExtensionActive('refback')) {
-                               loadTemplate('admin_list_refs2', false, $content);
-                       } else {
-                               loadTemplate('admin_list_refs', false, $content);
-                       }
-               } elseif (isExtensionActive('refback')) {
-                       // No levels found, very bad!
-                       displayMessage('{--ADMIN_NO_REFERRAL_LEVELS--}');
+                       loadTemplate('admin_list_refs', false, $content);
                } else {
                        // No refs made so far
                        displayMessage('{--USER_REFERRAL_404--}');
index f45d269bced5f62349c3150e6a34dcbd66f633ca..60228452a64087e401424d8b2d586f4a6ad6044f 100644 (file)
@@ -100,7 +100,7 @@ if (isMember()) {
 } elseif (isFormSent()) {
        // Try the login (see inc/libs/user_functions.php)
        $url = doUserLogin(postRequestElement('id'), postRequestElement('password'));
-} elseif ((isPostRequestElementSet('new_pass')) && (isset($userid))) {
+} elseif ((isPostRequestElementSet('new_pass')) && (!empty($userid))) {
        // Try the userid/email lookup (see inc/libs/user_functions.php)
        $errorCode = doNewUserPassword(postRequestElement('email'), $userid);
 }
diff --git a/js.php b/js.php
index 0e44f38e503224e257659df42056deee08ace7a6..ae623feb862d42e78a35804756145676c673f34e 100644 (file)
--- a/js.php
+++ b/js.php
@@ -41,6 +41,9 @@
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
+
 // This is a fake-CSS file loader, more a JavaScript loader...
 // This is in one way good and in one not. The whole reset part will be
 // by-passed even in this "faked" CSS mode. The bad news is that this makes all
@@ -48,8 +51,8 @@ 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['module'] = 'js';
+$GLOBALS['output_mode'] = 1;
 
 // Load the required file(s)
 require('inc/config-global.php');
index 0f9b80c5a8497fce23379424b41d01140891d998..d628789f0b0a09697143892e57a90935db0195cd 100644 (file)
--- a/login.php
+++ b/login.php
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
-// Set module
-$GLOBALS['module'] = 'login';
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
 
-// Set 'CSS-Mode'
+// Set module / output mode
+$GLOBALS['module'] = 'login';
 $GLOBALS['output_mode'] = -2;
 
 // Load the required file(s)
index eca084fa11aca80bf9dae5320e8b90bb59db398c..78ab8920bce4cf7fd3cf7ef3e3882165f2edbf7c 100644 (file)
@@ -45,8 +45,8 @@ require('inc/libs/security_functions.php');
 $GLOBALS['startTime'] = microtime(true);
 
 // Init output mode and module
-$GLOBALS['output_mode'] = '0';
 $GLOBALS['module'] = 'unknown';
+$GLOBALS['output_mode'] = '0';
 
 // Needed include files
 require('inc/config-global.php');
index b3ccf6f96c8bb441971ad53e0ef3be8fc10d0086..3d379f4d1930dead7dbe0c5bcabf418ce10cfb8b 100644 (file)
@@ -38,6 +38,9 @@
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
+
 // Set module
 $GLOBALS['module'] = 'network-vcheck';
 $GLOBALS['output_mode'] = -1;
diff --git a/ref.php b/ref.php
index 6683a7603c1250f0ca6df7eb30c6b2eae1daa38a..e2a7c62a3021619d37526fdb5d48fd34f1ca850c 100644 (file)
--- a/ref.php
+++ b/ref.php
@@ -38,6 +38,9 @@
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
+
 // Set module
 $GLOBALS['module'] = 'ref';
 $GLOBALS['output_mode'] = -1;
index 64fed3f9603339ccdf28afbc427331d23e85ff4c..fe3e583a6edbde6d3300001b437e4dd3c18a98c3 100644 (file)
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
-// Set module
-$GLOBALS['module'] = 'sponsor_confirm';
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
 
-// Set 'CSS-Mode'
+// Set module / output mode
+$GLOBALS['module'] = 'sponsor_confirm';
 $GLOBALS['output_mode'] = -2;
 
 // Load the required file(s)
index 4d7d467beb1cde20e1aeef441554943193e7b040..daebebb9f76113dde7895cafff25f92c74061cd7 100644 (file)
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
-// Set module
-$GLOBALS['module'] = 'sponsor_ref';
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
 
-// Set 'CSS-Mode'
+// Set module / output mode
+$GLOBALS['module'] = 'sponsor_ref';
 $GLOBALS['output_mode'] = -2;
 
 // Load the required file(s)
index 4c1632f7338aacbe5227c8d1320538b69524dda6..2c29e256912e536f57870f1a5edad723706d9f87 100644 (file)
@@ -41,7 +41,7 @@ require('inc/libs/security_functions.php');
 // Init start time
 $GLOBALS['startTime'] = microtime(true);
 
-// Set module
+// Set module output mode
 $GLOBALS['module'] = 'surfbar';
 $GLOBALS['output_mode'] = '0';
 $GLOBALS['header_sent'] = 3;
index 80d9b6f880232622db1bf3c2c9ebb497ce485929..6e5bfebe1f215654862b3ba8e9ca4dcb594f2b10 100644 (file)
@@ -1,23 +1,13 @@
 <div align="center">
-<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
-<tr>
-       <td colspan="6" class="table_header">
+<div class="table2 dashed">
+       <div class="table_header bottom" style="margin-bottom: 3px">
                <strong>{%message,ADMIN_LIST_REFERRALS=$content[userid]%}</strong>
-       </td>
-</tr>
-<tr>
-       <td width="5%" align="center" class="header_column bottom right"><strong>{--_USERID--}</strong></td>
-       <td width="5%" align="center" class="header_column bottom right"><strong>{--REFS_COUNT--}</strong></td>
-       <td width="35%" align="center" class="header_column bottom right"><strong>{--SURNAME_FAMILY--}</strong></td>
-       <td width="35%" align="center" class="header_column bottom right"><strong>{--EMAIL--}</strong></td>
-       <td width="10%" align="center" class="header_column bottom right"><strong>{--ACCOUNT_STATUS--}</strong></td>
-       <td width="10%" align="center" class="header_column bottom"><strong>{--MEMBER_JOINED--}</strong></td>
-</tr>
+       </div>
+
 $content[rows]
-<tr>
-       <td colspan="6" class="table_footer" style="padding-top: 7px; padding-bottom: 7px">
+
+       <div class="table_footer top" style="padding-top: 7px; padding-bottom: 7px">
                <div class="notice">{--ADMIN_LIST_REFERRALS_NOTE--}</div>
-       </td>
-</tr>
-</table>
+       </div>
+</div>
 </div>
index aec71c010cf44938272178657225a8177c364fa7..11f5d85d80b1ca4d16cf4c19e14af24e5ec2a60f 100644 (file)
@@ -1,15 +1 @@
-<div align="center">
-<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
-<tr>
-       <td class="table_header bottom">
-               <strong>{%message,ADMIN_LIST_REFERRALS=$content[userid]%}</strong>
-       </td>
-</tr>
-$content[rows]
-<tr>
-       <td class="table_footer top" style="padding-top: 7px; padding-bottom: 7px">
-               <span class="notice">{--ADMIN_LIST_REFERRALS_NOTE--}</span>
-       </td>
-</tr>
-</table>
-</div>
+<!-- @DEPRECATED //-->
index 8d8a291a2a9d93e174eeecd355235a89d37a6e50..d2daccb67a7451133e60ff300f52f1fbc7a7a8f1 100644 (file)
@@ -1,5 +1,4 @@
-<tr>
-       <td align="center" style="padding-bottom:5px">
+<div>
 <table border="0" cellspacing="0" cellpadding="0" class="table dashed">
 <tr>
        <td colspan="6" class="table_header" align="center">
@@ -23,5 +22,4 @@ $content[rows]
        </td>
 </tr>
 </table>
-       </td>
-</tr>
+</div>
index 9ecb261c3d7d1d7ebcb916b75bc4b9017d86ccc2..5c05e73e1bff5a566c3546a124444e0e4903b2b7 100644 (file)
--- a/view.php
+++ b/view.php
@@ -38,6 +38,9 @@
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
+
 // Set module
 $GLOBALS['module'] = 'view';
 $GLOBALS['output_mode'] = -1;