Refback extension in alpha phase finished, users can give refback to all refs in...
authorRoland Häder <roland@mxchange.org>
Mon, 29 Sep 2008 22:38:31 +0000 (22:38 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 29 Sep 2008 22:38:31 +0000 (22:38 +0000)
109 files changed:
.gitattributes
inc/databases.php
inc/db/lib-mysql3.php
inc/extensions.php
inc/extensions/ext-active.php
inc/extensions/ext-admins.php
inc/extensions/ext-admintheme1.php
inc/extensions/ext-admintheme_default.php
inc/extensions/ext-bank.php
inc/extensions/ext-beg.php
inc/extensions/ext-birthday.php
inc/extensions/ext-bonus.php
inc/extensions/ext-cache.php
inc/extensions/ext-demo.php
inc/extensions/ext-doubler.php
inc/extensions/ext-holiday.php
inc/extensions/ext-html_mail.php
inc/extensions/ext-mailid.php
inc/extensions/ext-mods.php
inc/extensions/ext-mydata.php
inc/extensions/ext-newsletter.php
inc/extensions/ext-nickname.php
inc/extensions/ext-online.php
inc/extensions/ext-order.php
inc/extensions/ext-payout.php
inc/extensions/ext-primera.php
inc/extensions/ext-profile.php
inc/extensions/ext-rallye.php
inc/extensions/ext-refback.php [new file with mode: 0644]
inc/extensions/ext-register.php
inc/extensions/ext-repair.php
inc/extensions/ext-rewrite.php
inc/extensions/ext-safe.php
inc/extensions/ext-sponsor.php
inc/extensions/ext-sql_patches.php
inc/extensions/ext-support.php
inc/extensions/ext-surfbar.php
inc/extensions/ext-task.php
inc/extensions/ext-theme.php
inc/extensions/ext-top10.php
inc/extensions/ext-transfer.php
inc/extensions/ext-wernis.php
inc/extensions/ext-yoomedia.php
inc/functions.php
inc/gen_refback.php
inc/header.php
inc/language/active_de.php
inc/language/admins_de.php
inc/language/autopurge_de.php
inc/language/bank_de.php
inc/language/beg_de.php
inc/language/birthday_de.php
inc/language/bonus_de.php
inc/language/cache_de.php
inc/language/country_de.php
inc/language/de.php
inc/language/doubler_de.php
inc/language/holiday_de.php
inc/language/html_mail_de.php
inc/language/install_de.php
inc/language/mailid_de.php
inc/language/maintenance_de.php
inc/language/mediadata_de.php
inc/language/mods_de.php
inc/language/newsletter_de.php
inc/language/nickname_de.php
inc/language/online_de.php
inc/language/optimize_de.php
inc/language/order_de.php
inc/language/other_de.php
inc/language/payout_de.php
inc/language/primera_de.php
inc/language/rallye_de.php
inc/language/refback_de.php [new file with mode: 0644]
inc/language/register_de.php
inc/language/repair_de.php
inc/language/rewrite_de.php
inc/language/sponsor_de.php
inc/language/support_de.php
inc/language/surfbar_de.php
inc/language/task_de.php
inc/language/theme_de.php
inc/language/top10_de.php
inc/language/transfer_de.php
inc/language/user_de.php
inc/language/wernis_de.php
inc/libs/cache_functions.php
inc/libs/refback_functions.php [new file with mode: 0644]
inc/libs/surfbar_functions.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-config_points.php
inc/modules/admin/what-extensions.php
inc/modules/admin/what-memedit.php
inc/modules/guest/what-register.php
inc/modules/member/what-points.php
inc/modules/member/what-refback.php [new file with mode: 0644]
inc/mysql-connect.php
inc/mysql-manager.php
inc/security.php
install/tables.sql
templates/de/html/admin/admin_list_refs.tpl
templates/de/html/admin/admin_list_refs_level.tpl [new file with mode: 0644]
templates/de/html/admin/admin_list_refs_row.tpl
templates/de/html/ext/ext_refback.tpl [new file with mode: 0644]
templates/de/html/member/member_refback_edit.tpl [new file with mode: 0644]
templates/de/html/member/member_refback_list.tpl [new file with mode: 0644]
templates/de/html/member/member_refback_list_level.tpl [new file with mode: 0644]
templates/de/html/member/member_refback_list_row.tpl [new file with mode: 0644]
templates/de/html/member/member_refback_list_row_deleted.tpl [new file with mode: 0644]

index efd717c..51a12c4 100644 (file)
@@ -126,6 +126,7 @@ inc/extensions/ext-payout.php -text
 inc/extensions/ext-primera.php -text
 inc/extensions/ext-profile.php -text
 inc/extensions/ext-rallye.php -text
+inc/extensions/ext-refback.php -text
 inc/extensions/ext-register.php -text
 inc/extensions/ext-repair.php -text
 inc/extensions/ext-rewrite.php -text
@@ -180,6 +181,7 @@ inc/language/other_de.php -text
 inc/language/payout_de.php -text
 inc/language/primera_de.php -text
 inc/language/rallye_de.php -text
+inc/language/refback_de.php -text
 inc/language/register_de.php -text
 inc/language/repair_de.php -text
 inc/language/rewrite_de.php -text
@@ -209,6 +211,7 @@ inc/libs/order_functions.php -text
 inc/libs/payout_functions.php -text
 inc/libs/primera_functions.php -text
 inc/libs/rallye_functions.php -text
+inc/libs/refback_functions.php -text
 inc/libs/register_functions.php -text
 inc/libs/rewrite_functions.php -text
 inc/libs/security_functions.php -text
@@ -459,6 +462,7 @@ inc/modules/member/what-payout.php -text
 inc/modules/member/what-points.php -text
 inc/modules/member/what-primera.php -text
 inc/modules/member/what-rallyes.php -text
+inc/modules/member/what-refback.php -text
 inc/modules/member/what-reflinks.php -text
 inc/modules/member/what-sponsor.php -text
 inc/modules/member/what-stats.php -text
@@ -952,6 +956,7 @@ templates/de/html/admin/admin_list_rallyes.tpl -text
 templates/de/html/admin/admin_list_rallyes_row.tpl -text
 templates/de/html/admin/admin_list_rallyes_row2.tpl -text
 templates/de/html/admin/admin_list_refs.tpl -text
+templates/de/html/admin/admin_list_refs_level.tpl -text
 templates/de/html/admin/admin_list_refs_row.tpl -text
 templates/de/html/admin/admin_list_sponsor.tpl -text
 templates/de/html/admin/admin_list_sponsor_details.tpl -text
@@ -1137,6 +1142,7 @@ templates/de/html/ext/ext_payout.tpl -text
 templates/de/html/ext/ext_primera.tpl -text
 templates/de/html/ext/ext_profile.tpl -text
 templates/de/html/ext/ext_rallye.tpl -text
+templates/de/html/ext/ext_refback.tpl -text
 templates/de/html/ext/ext_register.tpl -text
 templates/de/html/ext/ext_repair.tpl -text
 templates/de/html/ext/ext_rewrite.tpl -text
@@ -1304,6 +1310,11 @@ templates/de/html/member/member_primera_mode_list.tpl -text
 templates/de/html/member/member_primera_mode_list_row.tpl -text
 templates/de/html/member/member_primera_mode_pay.tpl -text
 templates/de/html/member/member_receive_table.tpl -text
+templates/de/html/member/member_refback_edit.tpl -text
+templates/de/html/member/member_refback_list.tpl -text
+templates/de/html/member/member_refback_list_level.tpl -text
+templates/de/html/member/member_refback_list_row.tpl -text
+templates/de/html/member/member_refback_list_row_deleted.tpl -text
 templates/de/html/member/member_reflinks_row.tpl -text
 templates/de/html/member/member_reflinks_table.tpl -text
 templates/de/html/member/member_stats_pool.tpl -text
index fd4c517..f588661 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "412");
+define('CURR_SVN_REVISION', "413");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 1a24f39..fe033ae 100644 (file)
@@ -285,7 +285,7 @@ function SQL_ESCAPE($str, $secureString=true,$strip=true) {
 
        if (function_exists('mysql_real_escape_string')) {
                // The new and improved version
-               //* DEBUG: */ echo __FUNCTION__.":str={$str}<br />\n";
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):str={$str}<br />\n";
                return mysql_real_escape_string($str, $link);
        } elseif (function_exists('mysql_escape_string')) {
                // The obsulete function
index 1851e5d..64e4c48 100644 (file)
@@ -57,6 +57,7 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
        // Does this extension exists?
        if (FILE_READABLE($file)) {
                // Extension was found so we can load it in registration mode
+               $EXT_ALWAYS_ACTIVE = "N";
                require($file);
 
                // And run possible updates
@@ -99,6 +100,7 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
                        if (FILE_READABLE($file)) {
                                // File exists so let's load it
                                $VER_BACKUP = $EXT_VERSION;
+                               $EXT_ALWAYS_ACTIVE = "N";
                                require($file);
                                $EXT_VERSION = $VER_BACKUP;
 
@@ -245,6 +247,9 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) {
        global $cacheInstance, $_CONFIG;
        $SQLs = array();
 
+       // Extensions are never active by default
+       $EXT_ALWAYS_ACTIVE = "N";
+
        // By default no SQL has been executed
        $sqlRan = false;
 
@@ -256,14 +261,14 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) {
        if (empty($ext_name)) return false;
 
        // Load extension in detected mode
-       //* DEBUG: */ echo __FUNCTION__.":ext_name[{$id}]={$ext_name}<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ext_name[{$id}]={$ext_name}<br />\n";
        $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
        if (FILE_READABLE($file)) {
                // Load the include
                require($file);
        } // END - if
 
-       //* DEBUG: */ echo __FUNCTION__.":SQLs::count=".count($SQLs)."<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):SQLs::count=".count($SQLs)."<br />\n";
        if ((is_array($SQLs) && (sizeof($SQLs) > 0))) {
                // Run SQL commands...
                foreach ($SQLs as $sql) {
@@ -273,7 +278,7 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) {
                        // Is there still an SQL query?
                        if (!empty($sql)) {
                                // Do we have an "ALTER TABLE" command?
-                               //* DEBUG: */ echo __FUNCTION__.":SQL={$SQL}<br />\n";
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):SQL={$SQL}<br />\n";
                                if (substr(strtolower($sql), 0, 11) == "alter table") {
                                        // Analyse the alteration command
                                        SQL_ALTER_TABLE($sql, __FILE__, __LINE__);
@@ -294,7 +299,7 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) {
                         array($id), __FILE__, __LINE__);
                } // END - if
 
-               //* DEBUG: */ echo __FUNCTION__.":mode={$EXT_LOAD_MODE}<br />\n";
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):mode={$EXT_LOAD_MODE}<br />\n";
 
                // Remove cache file(s) if extension is active
                if (((EXT_IS_ACTIVE("cache")) || (GET_EXT_VERSION("cache") != "")) && (((SQL_AFFECTEDROWS() == 1) && ($EXT_LOAD_MODE == "remove")) || ($sqlRan === true))) {
@@ -356,9 +361,6 @@ function EXT_IS_ACTIVE ($ext_name) {
                $cacheArray['extensions']['ext_active'][$ext_name] = "N";
        }
 
-       // Create FQFN for extension file
-       $inc = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
-
        // Debug message
        //DEBUG_LOG(__FUNCTION__.": ext_name={$ext_name},active={$active}");
 
@@ -372,12 +374,12 @@ function GET_EXT_VERSION ($ext_name) {
 
        // Extensions are all inactive during installation
        if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return "";
-       //* DEBUG: */ echo __FUNCTION__.": ext_name={$ext_name}<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ext_name={$ext_name}<br />\n";
 
        // Is the cache written?
        if (!empty($cacheArray['extensions']['ext_version'][$ext_name])) {
                // Load data from cache
-               //* DEBUG: */ echo __FUNCTION__.": CACHE!<br />\n";
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): CACHE!<br />\n";
                $ret = $cacheArray['extensions']['ext_version'][$ext_name];
 
                // Count cache hits
@@ -394,7 +396,7 @@ function GET_EXT_VERSION ($ext_name) {
        }
 
        // Return result
-       //* DEBUG: */ echo __FUNCTION__.": ret={$ret}<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret={$ret}<br />\n";
        return $ret;
 }
 //
index 82f8c63..d3d013a 100644 (file)
@@ -127,8 +127,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "active";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 2fd0852..8b389d0 100644 (file)
@@ -292,8 +292,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "admins";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 1118d05..4780f01 100644 (file)
@@ -87,8 +87,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "admintheme";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 9d997f8..6e3c8be 100644 (file)
@@ -84,11 +84,9 @@ case "update": // Update an extension
 default: // Do stuff when extension is loaded
        break;
 }
+
 // Language file prefix
 $EXT_LANG_PREFIX = "admintheme";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 24e410c..12f02fa 100644 (file)
@@ -191,8 +191,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "bank";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 9adc358..3b1daa7 100644 (file)
@@ -271,8 +271,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "beg";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 94f1ae0..17d5386 100644 (file)
@@ -201,8 +201,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "birthday";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 913982f..9e22079 100644 (file)
@@ -558,8 +558,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "bonus";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index b57a15f..f1db9c8 100644 (file)
@@ -200,7 +200,7 @@ default: // Do stuff when extension is loaded
                $cacheInstance = new mxchange_cache($_CONFIG['cache_update'], PATH."inc/".$_CONFIG['cache_path'], $_CONFIG['cache_tested']);
                if ($cacheInstance->getStatus() != "done") {
                        // Failed to initialize cache sustem
-                       ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_INITIALIZE);
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_INITIALIZE);
                }
        }
        break;
index 916b0ad..220a5e2 100644 (file)
@@ -81,11 +81,9 @@ case "update": // Update an extension
 default: // Do stuff when extension is loaded
        break;
 }
+
 // Language file prefix
 $EXT_LANG_PREFIX = "demo";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index c2bf799..edd3ee3 100644 (file)
@@ -245,8 +245,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "doubler";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 5a8c2a9..1d6a318 100644 (file)
@@ -229,8 +229,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "holiday";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index aa27079..9c223e3 100644 (file)
@@ -163,11 +163,9 @@ default: // Do stuff when extension is loaded
        );
        break;
 }
+
 // Language file prefix
 $EXT_LANG_PREFIX = "html_mail";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 4848fd7..be23ece 100644 (file)
@@ -242,8 +242,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "mailid";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 506759b..01f5954 100644 (file)
@@ -115,11 +115,9 @@ case "update": // Update an extension
 default: // Do stuff when extension is loaded
        break;
 }
+
 // Language file prefix
 $EXT_LANG_PREFIX = "mods";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 0eaf6a2..32b1f1e 100644 (file)
@@ -169,8 +169,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "mydata";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 89757db..648cdb1 100644 (file)
@@ -175,8 +175,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "newsletter";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index f226afa..3ef849f 100644 (file)
@@ -210,8 +210,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "nickname";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 196d3cf..6b1fa94 100644 (file)
@@ -114,11 +114,9 @@ case "update": // Update an extension
 default: // Do stuff when extension is loaded
        break;
 }
+
 // Language file prefix
 $EXT_LANG_PREFIX = "online";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 56d730d..5a7d2a9 100644 (file)
@@ -314,8 +314,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "order";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index c11afdc..be3ef40 100644 (file)
@@ -241,11 +241,9 @@ case "update": // Update an extension
 default: // Do stuff when extension is loaded
        break;
 }
+
 // Language file prefix
 $EXT_LANG_PREFIX = "payout";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 8e2253d..11ea3b3 100644 (file)
@@ -116,9 +116,6 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "primera";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 // Init array
 global $primera;
 $primera = array();
index 42c4992..c8da120 100644 (file)
@@ -130,8 +130,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "profile";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 4424c36..5d34c75 100644 (file)
@@ -348,8 +348,5 @@ LIMIT 1", __FILE__, __LINE__);
 // Language file prefix
 $EXT_LANG_PREFIX = "rallye";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
diff --git a/inc/extensions/ext-refback.php b/inc/extensions/ext-refback.php
new file mode 100644 (file)
index 0000000..446d0d6
--- /dev/null
@@ -0,0 +1,115 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/29/2008 *
+ * ================                             Last change: 09/29/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-refback.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Refback and ref overview                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ref-Back und Ref-Uebersicht                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0";
+
+// Auto-set extension version
+if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_refs`";
+       $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_refs` (
+`id` bigint(20) NOT NULL auto_increment,
+`userid` bigint(20) NOT NULL DEFAULT 0,
+`level` smallint(6) NOT NULL DEFAULT 0,
+`refid` bigint(20) NOT NULL DEFAULT 0,
+`refback` float(4,1) NOT NULL DEFAULT 0.0,
+`points` FLOAT( 20,5) DEFAULT '0.00000' NOT NULL,
+PRIMARY KEY (`id`),
+UNIQUE `user_refid` (`userid`,`level`,`refid`),
+KEY (`level`),
+KEY (`refid`)
+) ENGINE=MyISAM COMMENT='User Referals With Refback'";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','refback','Ref-Back/Ref-&Uuml;bersicht',4,'N','N')";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_refs";
+       $SQLS[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='refback' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       // When the refback is not installed we cannot load it's configuration... *sigh*
+       break;
+}
+
+// Shall we include special files?
+if ($EXT_LOAD_MODE == "register") {
+       // Execute this special file on this update
+       $INC_POOL[] = PATH."inc/gen_refback.php";
+} // END - if
+
+// Language file prefix (hmmm, what shall I write with SQL fixes? ;-) )
+$EXT_LANG_PREFIX = "refback";
+
+// Extension is always active?
+$EXT_ALWAYS_ACTIVE = "Y";
+
+//
+?>
index a179131..2090697 100644 (file)
@@ -328,8 +328,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "register";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 21935c7..20e442d 100644 (file)
@@ -111,11 +111,9 @@ case "update": // Update an extension
 default: // Do stuff when extension is loaded
        break;
 }
+
 // Language file prefix
 $EXT_LANG_PREFIX = "repair";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index fc04a65..d0741fd 100644 (file)
@@ -141,8 +141,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "rewrite";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 759bce2..690d683 100644 (file)
@@ -84,8 +84,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "safe";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 2140112..262e75c 100644 (file)
@@ -432,8 +432,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "sponsor";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 1cfd760..11c808f 100644 (file)
@@ -38,13 +38,13 @@ if (!defined('__SECURITY')) {
 }
 
 // Version number
-$EXT_VERSION = "0.5.0";
+$EXT_VERSION = "0.5.2";
 
 // Auto-set extension version
 if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
 
 // Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "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", "0.4.9", "0.5.0");
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "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", "0.4.9", "0.5.0", "0.5.1", "0.5.2");
 
 switch ($EXT_LOAD_MODE)
 {
@@ -76,7 +76,8 @@ what='stats2' OR
 (action='stats' AND (what='' OR what IS NULL)) OR
 (action='extras' AND (what='' OR what IS NULL)) OR
 (action='rals' AND (what='' OR what IS NULL)) OR
-(action='account' AND (what='' OR what IS NULL)) LIMIT 8";
+(action='account' AND (what='' OR what IS NULL))
+LIMIT 8";
        $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='main' WHERE
 action='stats' OR
 action='extras' OR
@@ -85,12 +86,9 @@ action='account'";
        $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las";
        $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data";
        $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats";
-       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_refs";
 
        // Drop indexes
        $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP UNIQUE KEY (ext_name)";
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes DROP UNIQUE KEY (theme_path)";
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes DROP INDEX (theme_active)";
        $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins DROP UNIQUE KEY (login)";
        $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (status)";
        $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refbanner DROP INDEX (visible)";
@@ -238,8 +236,8 @@ case "update": // Update an extension
                $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme', NULL, 'Themes','Verwalten Sie hier alle Designs (Themes) Ihres Mailtausch-Scriptes.', 8)";
                $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_import','Importieren','Es wird das Verzeichnis &quot;theme&quot; nach neuen Ordnern durchsucht und anschliessend in die Datenbank gesperrt aufgenommen.', 1)";
                $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_edit','Modifizieren','&Auml;ndern Sie Titel, Freigaben usw. an den Themes. Sie k&ouml;nnen bis auf das Standart-Theme &quot;default&quot; auch Themes aus der Datenbank entfernen. Vorher sollten Sie es jedoch vom Server l&ouml;schen, damit es niht erneut importiert werden kann.', 2)";
-               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (action,what,title,sort,visible,locked) VALUES ('themes',NULL,'Design-Auswahl',4,'Y','N')";
-               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action,what,title,sort,visible,locked) VALUES ('themes',NULL,'Design-Auswahl',3,'Y','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',4,'Y','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',3,'Y','N')";
                $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_themes";
                $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_themes (
 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -351,7 +349,7 @@ PRIMARY KEY(id)
                break;
 
        case "0.2.7": // SQL queries for v0.2.7
-               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, sort) VALUES ('main','themes','Designs', 6)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action,what,title,sort) VALUES ('main','themes','Designs', 6)";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD curr_theme VARCHAR(255) NOT NULL DEFAULT 'default'";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD stats_limit BIGINT(20) UNSIGNED NOT NULL DEFAULT '10'";
                $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='config_stats' WHERE what='stats' LIMIT 1";
@@ -637,25 +635,23 @@ PRIMARY KEY (id)
        case "0.5.0": // SQL queries for v0.5.0
                $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `level`";
                $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `userid`, ADD UNIQUE `userid_level` (`userid`,`level`)";
-               $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_refs`";
-               $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_refs` (
-`id` bigint(20) NOT NULL auto_increment,
-`userid` bigint(20) NOT NULL DEFAULT 0,
-`level` smallint(6) NOT NULL DEFAULT 0,
-`refid` bigint(20) NOT NULL DEFAULT 0,
-`refback` float(4,1) NOT NULL DEFAULT 0.0,
-`points` FLOAT( 20,5) DEFAULT '0.00000' NOT NULL,
-PRIMARY KEY (`id`),
-UNIQUE `user_refid` (`userid`,`level`,`refid`),
-KEY (`level`),
-KEY (`refid`),
-) ENGINE=MyISAM COMMENT='User Referals With Refback'";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Referal-System unterst&uuml;tzt nun detailierte Referal-&Uuml;bersicht und vieles mehr.";
+               break;
+
+       case "0.5.1": // SQL queries for v0.5.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP `descr`";
 
-               // Execute this special file on this update
-               $INC_POOL[] = PATH."inc/gen_refback.php";
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Beschreibungsspalte von Mitgliedsmen&uuml; entfernt, welche ohnehin nicht genutzt wird.";
+               break;
+
+       case "0.5.2": // SQL queries for v0.5.2
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refdepths` CHANGE `percents` `percents` FLOAT(8,5) NOT NULL DEFAULT '0.00000'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Prozents&aum;tze k&ouml;nnen nun f&uuml;nf Stelle hinter dem Komma sein.";
                break;
        }
        break;
index ccfe197..b8d6d89 100644 (file)
@@ -128,11 +128,9 @@ case "update": // Update an extension
 default: // Do stuff when extension is loaded
        break;
 }
+
 // Language file prefix
 $EXT_LANG_PREFIX = "support";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 14f9427..e67e15b 100644 (file)
@@ -232,8 +232,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "surfbar";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 1611eea..2fd0a1f 100644 (file)
@@ -247,8 +247,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "task";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 20520b2..84a4728 100644 (file)
@@ -117,8 +117,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "theme";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 1b48c09..358367b 100644 (file)
@@ -146,8 +146,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "top10";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 7814a95..55402eb 100644 (file)
@@ -287,8 +287,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "transfer";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 5518a3f..672ec50 100644 (file)
@@ -131,9 +131,6 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "wernis";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 // Init array
 global $WERNIS;
 $WERNIS = array();
index a38bd27..9972440 100644 (file)
@@ -85,8 +85,5 @@ default: // Do stuff when extension is loaded
 // Language file prefix
 $EXT_LANG_PREFIX = "yoomedia";
 
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>
index 3dcee7a..1c22981 100644 (file)
@@ -236,7 +236,7 @@ function LOAD_TEMPLATE($template, $return=false, $content=array()) {
 
                // Free result
                SQL_FREERESULT($result);
-       }
+       } // END - if
 
        // Generate date/time string
        $date_time = MAKE_DATETIME(time(), "1");
@@ -351,7 +351,7 @@ function LOAD_TEMPLATE($template, $return=false, $content=array()) {
 
 // Send mail out to an email address
 function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") {
-       //* DEBUG: */ echo __FUNCTION__.":TO={$TO},SUBJECT={$SUBJECT}<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$TO},SUBJECT={$SUBJECT}<br />\n";
 
        // Compile subject line (for POINTS constant etc.)
        $eval = "\$SUBJECT = html_entity_decode(\"".COMPILE_CODE(addslashes($SUBJECT))."\");";
@@ -366,7 +366,7 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") {
                } else {
                        // Load email address
                        $result_email = SQL_QUERY_ESC("SELECT email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array(bigintval($TO)), __FILE__, __LINE__);
-                       //* DEBUG: */ echo __FUNCTION__.":numRows=".SQL_NUMROWS($result_email)."<br />\n";
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result_email)."<br />\n";
 
                        // Does the user exist?
                        if (SQL_NUMROWS($result_email)) {
@@ -384,7 +384,7 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") {
                // Is the webmaster!
                $TO = WEBMASTER;
        }
-       //* DEBUG: */ echo __FUNCTION__.":TO={$TO}<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$TO}<br />\n";
 
        // Check for PHPMailer or debug-mode
        if (!CHECK_PHPMAILER_USAGE()) {
@@ -562,8 +562,8 @@ function TRANSLATE_COMMA ($dotted, $cut=true) {
                if (count($com) > 1) {
                        // Commata found, so only zeros?
                        if ($com[1] == str_repeat("0", strlen($com[1]))) {
-                               // Only zeros, so don't display them
-                               $maxComma = 0;
+                               // Only zeros, so display only one
+                               $maxComma = 1;
                        } // END - if
                } else {
                        // Don't display commatas even if there are none... ;-)
@@ -645,6 +645,11 @@ function TRANSLATE_STATUS($status) {
                $ret = ACCOUNT_LOCKED;
                break;
 
+       case "":
+       case null:
+               $ret = ACCOUNT_DELETED;
+               break;
+
        default:
                $ret = UNKNOWN_STATUS_1.$status.UNKNOWN_STATUS_2;
                break;
@@ -738,27 +743,27 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") {
        } // END - if
 
        // Load user's data
-       //* DEBUG: */ echo __FUNCTION__.":UID={$UID},template={$template}<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):UID={$UID},template={$template}<br />\n";
        if ($UID > 0) {
                if (EXT_IS_ACTIVE("nickname")) {
-                       //* DEBUG: */ echo __FUNCTION__.":NICKNAME!<br />\n";
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NICKNAME!<br />\n";
                        // Load nickname
                        $result = SQL_QUERY_ESC("SELECT surname, family, gender, email, nickname FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
                                array(bigintval($UID)), __FILE__, __LINE__);
                } else {
-                       //* DEBUG: */ echo __FUNCTION__.":NO-NICK!<br />\n";
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NO-NICK!<br />\n";
                        /// Load normal data
                        $result = SQL_QUERY_ESC("SELECT surname, family, gender, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
                                array(bigintval($UID)), __FILE__, __LINE__);
                }
 
                // Is content an array?
-               //* DEBUG: */ echo __FUNCTION__.":content[]=".gettype($content)."<br />\n";
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content[]=".gettype($content)."<br />\n";
                if (is_array($content)) {
                        // Fetch and migrate data
-                       //* DEBUG: */ echo __FUNCTION__.":content()=".count($content)." - PRE<br />\n";
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - PRE<br />\n";
                        $content = array_merge($content, SQL_FETCHARRAY($result));
-                       //* DEBUG: */ echo __FUNCTION__.":content()=".count($content)." - AFTER<br />\n";
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - AFTER<br />\n";
                } // END - if
 
                // Free result
@@ -952,10 +957,10 @@ function COMPILE_CODE($code, $simple = false, $constants = true, $full = true) {
                                $test = substr($found, 0, strlen($match));
 
                                // Does this entry exist?
-                               //* DEBUG: */ echo __FUNCTION__.":found={$found},match={$match},set={$set}<br />\n";
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found={$found},match={$match},set={$set}<br />\n";
                                if ($test == $match) {
                                        // Match found!
-                                       //* DEBUG: */ echo __FUNCTION__.":fuzzyFound!<br />\n";
+                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):fuzzyFound!<br />\n";
                                        $fuzzyFound = true;
                                        break;
                                } // END - if
@@ -967,14 +972,14 @@ function COMPILE_CODE($code, $simple = false, $constants = true, $full = true) {
                        // Take all string elements
                        if ((is_string($matches[4][$key])) && (!isset($matchesFound[$match])) && (!isset($matchesFound[$key."_".$matches[4][$key]]))) {
                                // Replace it in the code
-                               //* DEBUG: */ echo __FUNCTION__.":key={$key},match={$match}<br />\n";
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):key={$key},match={$match}<br />\n";
                                $newMatch = str_replace("[".$matches[4][$key]."]", "['".$matches[4][$key]."']", $match);
                                $code = str_replace($match, "\".".$newMatch.".\"", $code);
                                $matchesFound[$key."_".$matches[4][$key]] = 1;
                                $matchesFound[$match] = 1;
                        } elseif (!isset($matchesFound[$match])) {
                                // Not yet replaced!
-                               //* DEBUG: */ echo __FUNCTION__.":match={$match}<br />\n";
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):match={$match}<br />\n";
                                $code = str_replace($match, "\".".$match.".\"", $code);
                                $matchesFound[$match] = 1;
                        }
@@ -1648,7 +1653,7 @@ function EXTRACT_HOST (&$script) {
        if (ereg("/", $host)) $host = substr($host, 0, strpos($host, "/"));
 
        // Generate relative URL
-       //* DEBUG */ print("SCRIPT=".$script."<br />\n");
+       //* DEBUG: */ print("SCRIPT=".$script."<br />\n");
        if (substr(strtolower($script), 0, 7) == "http://") {
                // But only if http:// is in front!
                $script = substr($script, (strlen($url) + 7));
@@ -1657,7 +1662,7 @@ function EXTRACT_HOST (&$script) {
                $script = substr($script, (strlen($url) + 8));
        }
 
-       //* DEBUG */ print("SCRIPT=".$script."<br />\n");
+       //* DEBUG: */ print("SCRIPT=".$script."<br />\n");
        if (substr($script, 0, 1) == "/") $script = substr($script, 1);
 
        // Return host name
@@ -1740,7 +1745,7 @@ function SEND_RAW_REQUEST ($host, $request) {
        } // END - if
 
        // Open connection
-       //* DEBUG */ die("SCRIPT=".$script."<br />\n");
+       //* DEBUG: */ die("SCRIPT=".$script."<br />\n");
        if ($useProxy) {
                $fp = @fsockopen(COMPILE_CODE($_CONFIG['proxy_host']), $_CONFIG['proxy_port'], $errno, $errdesc, 30);
        } else {
@@ -2245,11 +2250,11 @@ function isBooleanConstantAndTrue($constName) { // : Boolean
        // In cache?
        if (isset($constCache[$constName])) {
                // Use cache
-               //* DEBUG: */ echo __FUNCTION__.": ".$constName."-CACHE!<br />\n";
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$constName."-CACHE!<br />\n";
                $res = $constCache[$constName];
        } else {
                // Check constant
-               //* DEBUG: */ echo __FUNCTION__.": ".$constName."-RESOLVE!<br />\n";
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$constName."-RESOLVE!<br />\n";
                if (defined($constName)) $res = (constant($constName) === true);
 
                // Set cache
@@ -2263,7 +2268,7 @@ function isBooleanConstantAndTrue($constName) { // : Boolean
 
 // Check wether a session variable is set
 function isSessionVariableSet($var) {
-       //* DEBUG: */ echo __FUNCTION__.":var={$var}<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):var={$var}<br />\n";
        return (isset($_SESSION[$var]));
 }
 // Returns wether the value of the session variable or NULL if not set
@@ -2326,7 +2331,7 @@ function DEBUG_LOG ($message, $force=false) {
        if ((isBooleanConstantAndTrue('DEBUG_MODE')) || ($force)) {
                // Log this message away
                $fp = fopen(PATH."inc/cache/debug.log", 'a') or mxchange_die("Cannot write logfile debug.log!");
-               fwrite($fp, date("d.m.Y|H:i:s", time())."|{$message}\n");
+               fwrite($fp, date("d.m.Y|H:i:s", time())."|".strip_tags($message)."\n");
                fclose($fp);
        } // END - if
 }
@@ -2344,7 +2349,7 @@ function GET_DIR_AS_ARRAY ($baseDir, $prefix) {
                $file = $baseDir.$baseFile;
 
                // Is this a valid reset file?
-               //* DEBUG: */ echo __FUNCTION__.":baseDir={$baseDir},prefix={$prefix},baseFile={$baseFile}<br />\n";
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):baseDir={$baseDir},prefix={$prefix},baseFile={$baseFile}<br />\n";
                if ((FILE_READABLE($file)) && (substr($baseFile, 0, strlen($prefix)) == $prefix) && (substr($baseFile, -4, 4) == ".php")) {
                        // Remove both for extension name
                        $extName = substr($baseFile, strlen($prefix), -4);
@@ -2510,7 +2515,7 @@ function HANDLE_LOGIN_FAILTURES ($accessLevel) {
                // Ignore zero values
                if (get_session('mxchange_'.$accessLevel.'_failtures') > 0) {
                        // Non-guest has login failtures found, get both data and prepare it for template
-                       //* DEBUG: */ echo __FUNCTION__.":accessLevel={$accessLevel}<br />\n";
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):accessLevel={$accessLevel}<br />\n";
                        $content = array(
                                'login_failtures' => get_session('mxchange_'.$accessLevel.'_failtures'),
                                'last_failture'   => MAKE_DATETIME(get_session('mxchange_'.$accessLevel.'_last_fail'), "2")
index 3e79ad1..be1a3a7 100644 (file)
@@ -37,6 +37,9 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
+// Make sure our functions are there
+require_once(PATH."inc/libs/refback_functions.php");
+
 // Sanity-check: Do we have ref level 0?
 $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_refsystem WHERE level=0", __FILE__, __LINE__);
 if (SQL_NUMROWS($result) > 0) {
@@ -66,7 +69,7 @@ if (SQL_NUMROWS($result_direct) > 0) {
                $cacheArray['back_level'] = 1;
 
                // Update refback table
-               /* DEBUG: */ echo "uid={$uid}<br />\n";
+               //* DEBUG: */ echo "uid={$uid}<br />\n";
                UPDATE_REFBACK_TABLE($uid);
        } // END - while
 } // END - if
index 8f2d54d..fe18f73 100644 (file)
@@ -104,13 +104,15 @@ if (($header != "1") && ($header != "2")) {
                // Output page header code
                LOAD_TEMPLATE("page_header");
 
-               // Include meta data here
-               LOAD_TEMPLATE("metadata");
-
-               // Add meta description to header
-               if ((isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && ($GLOBALS['module'] != "admin") && ($GLOBALS['module'] != "login") && (isset($db)) && (isset($link))) {
-                       // Add meta description not in admin and login module and when the script is installed
-                       META_DESCRIPTION($GLOBALS['module'], $GLOBALS['what']);
+               // Include meta data in "guest" module
+               if ($GLOBALS['module'] == "index") {
+                       LOAD_TEMPLATE("metadata");
+
+                       // Add meta description to header
+                       if ((isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (isset($db)) && (is_resource($link))) {
+                               // Add meta description not in admin and login module and when the script is installed
+                               META_DESCRIPTION($GLOBALS['module'], $GLOBALS['what']);
+                       } // END - if
                } // END - if
 
                // Include more header data here
index 11347e2..2f692a4 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 76a56e2..c715072 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index b4f8c0b..f5b9566 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 281ae6d..f08218a 100644 (file)
@@ -32,7 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index ac4cbe9..2b25ea2 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index c387313..17733a4 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 150aa91..aa873c6 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index c66f0fc..66f0b04 100644 (file)
@@ -32,7 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index ba04f5a..ebb1d03 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 03305c6..46b9208 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
@@ -513,6 +512,7 @@ define('ACCOUNT_STATUS', "Account-Status");
 define('ACCOUNT_UNCONFIRMED', "<SPAN class=\"admin_failed\">Unbest&auml;tigt</SPAN>");
 define('ACCOUNT_CONFIRMED', "<SPAN class=\"admin_green\">Best&auml;tigt</SPAN>");
 define('ACCOUNT_LOCKED', "Gesperrt");
+define('ACCOUNT_DELETED', "Gel&ouml;scht");
 define('ADMIN_ALL_ACCOUNTS', "Alle Mitglieder-Accounts auflisten");
 define('ADMIN_LIST_LOCKED_ACCOUNTS', "Alle gesperrten Mitglieder-Accounts auflisten");
 define('ADMIN_LIST_CONFIRMED_ACCOUNTS', "Alle best&auml;tigten Mitglieder-Accounts auflisten");
index 4ec574f..d54e12f 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 248cb3a..2233d5d 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index ddec173..239d7d0 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index c9dd1e2..540f550 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index c9d4896..43df81b 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 6028a8c..939ccac 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 6e05e5b..5a85c73 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 29694f8..9e1fbf5 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 8c50201..f4d29c3 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 11a23c6..d3bd0b5 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 8c21f88..db5313d 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 4f2f778..fa2e35d 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 1acea0a..be9999d 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index cf6d294..eaaee73 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 264578a..8ad9e0d 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 1e2eb96..9e8bc90 100644 (file)
@@ -32,7 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index b877f3a..0094713 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
diff --git a/inc/language/refback_de.php b/inc/language/refback_de.php
new file mode 100644 (file)
index 0000000..f85bb27
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/29/2008 *
+ * ===============                              Last change: 09/29/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : refback_de.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterst&uuml;tzung                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Member language strings
+define('MEMBER_REFBACK_LIST_TITLE_1', "Ref-Back &Uuml;bersicht f&uuml;r Referal-Ebene <u>");
+define('MEMBER_REFBACK_LIST_TITLE_2', "</u> (<u>");
+define('MEMBER_REFBACK_LIST_TITLE_3', "</u>% Ref-Verg&uuml;tung)");
+define('MEMBER_REFBACK_TITLE', "Ref-Back und Referal-&Uuml;bersicht");
+define('MEMBER_REFBACK_NOTE', "Hier k&ouml;nnen Sie in jeder Referal-Ebene jedem von Ihnen geworbenen Mitglied Ref-Back einstellen. Sollte Ihr Referal {!POINTS!} verdienen und diese ihm/ihr nicht direkt gutgeschrieben werden, so erh&auml;lt Ihr Referal die eingestellten Prozente von dem Verdienst aufgebucht, den Sie als Ref-Verdienst erhalten. Unter <strong>{--MEMBER_REFBACK_POINTS--}</strong> sind die {!POINTS!}-Gutschriften durch Ref-Back an das jeweilige Mitglied zu verstehen.");
+define('MEMBER_REFBACK_NO_ENTRIES', "Es gibt technische Probleme mit der Refback-Tabelle. Bitte Support benachrichtigen.");
+define('MEMBER_REFBACK_EDIT_SUBMIT', "Refback einstellen");
+define('MEMBER_REFBACK_COUNTER_1', "In dieser Ebene haben Sie <u>");
+define('MEMBER_REFBACK_COUNTER_2', "</u> Mitglieder geworben.");
+define('MEMBER_REFBACK_REFID', "User-ID (Nickname)");
+define('MEMBER_REFBACK_STATUS', "Referal-Status");
+define('MEMBER_REFBACK_PERCENTS', "Ref-Back Prozente");
+define('MEMBER_REFBACK_POINTS', "Ref-Back Verg&uuml;tung");
+define('MEMBER_REFBACK_EDIT', "Einstellen");
+define('MEMBER_REFBACK_EDIT_TITLE', "Ref-Back f&uuml;r ausgew&auml;hltes Mitglied einstellen:");
+define('MEMBER_REFBACK_DELETED_SUBMIT', "Nicht m&ouml;glich");
+define('MEMBER_REFBACK_DELETED_TITLE', "Einstellen von Ref-Back ist f&uuml;r gel&ouml;schte Mitglieder nicht m&ouml;glich.");
+
+// Error messages for members
+define('MEMBER_REFBACK_ERROR_MESSAGE', "Fehler beim Einstellen des Ref-Backs. Fehlermeldung:<br />\n<u>%s</u>");
+define('MEMBER_REFBACK_ERROR_GENERAL', "Allgemeiner Scriptefehler. Bitte beim Support melden.");
+define('MEMBER_REFBACK_ERROR_NO_MEMBER', "Nur Mitglieder k&ouml;nnen Ref-Backs einstellen.");
+define('MEMBER_REFBACK_ERROR_INVALID_ID_NUMBER', "Ung&uuml;ltige ID-Nummer &uuml;bertragen.");
+define('MEMBER_REFBACK_ERROR_INVALID_PERCENTAGE', "Prozentsatz ung&uuml;ltig. 0 bis 100 sind g&uuml;ltige Werte.");
+define('MEMBER_REFBACK_ERROR_ID_MISMATCH', "Die ausgew&auml;hlte Ref-Back ID geh&ouml;rt Ihnen nicht.");
+define('MEMBER_REFBACK_ERROR_NOT_UPDATED', "Ref-Back nicht aktualisiert.");
+define('MEMBER_REFBACK_DONE', "Ref-Back eingestellt. Dieser ist ab jetzt g&uuml;ltig.");
+
+//
+?>
index 8371c0b..05a1944 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index db90d96..da5bdd0 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index f9b8ec1..a8c590f 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index b9b7c19..902e017 100644 (file)
@@ -31,8 +31,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
        require($INC);
 }
index 1a9eeea..f3be1f2 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 680bbe5..294e2c0 100644 (file)
@@ -32,7 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 4792d0e..24801c6 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index c954c4f..82ce511 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index fbc7acf..9bf4337 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 038f372..b08ae72 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index a0382a7..28aa38b 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index df862d6..0efed1d 100644 (file)
@@ -32,7 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 44df62b..93af044 100644 (file)
@@ -132,7 +132,7 @@ class mxchange_cache
                        $this->cache_pointer = $fp;
                } else {
                        // Cannot create file
-                       ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
                }
        }
 
@@ -162,7 +162,7 @@ class mxchange_cache
                        }
                } else {
                        // Cannot create file
-                       ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
                }
        }
 
@@ -184,7 +184,7 @@ class mxchange_cache
                else
                {
                        // Cannot create file
-                       ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
                }
        }
 
@@ -219,7 +219,7 @@ class mxchange_cache
                        }
                } else {
                        // Cache file not found or not readable
-                       ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_LOAD_1.$this->cache_inc.CACHE_CANNOT_LOAD_2);
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_LOAD_1.$this->cache_inc.CACHE_CANNOT_LOAD_2);
                }
        }
 
@@ -237,13 +237,13 @@ class mxchange_cache
                        else
                        {
                                // Not removed!
-                               ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_UNLINK_1.$this->cache_inc.CACHE_CANNOT_UNLINK_2);
+                               ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_UNLINK_1.$this->cache_inc.CACHE_CANNOT_UNLINK_2);
                        }
                }
                else
                {
                        // Does not exist!
-                       ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_UNLINK_1.$this->cache_inc.CACHE_CANNOT_UNLINK_2);
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_UNLINK_1.$this->cache_inc.CACHE_CANNOT_UNLINK_2);
                }
        }
 
@@ -288,7 +288,7 @@ class mxchange_cache
                        }
                } else {
                        // Cannot write to cache!
-                       ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
                }
        }
 
@@ -341,7 +341,7 @@ class mxchange_cache
                        }
                } else {
                        // Cannot write to cache!
-                       ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
                }
        }
 
@@ -355,7 +355,7 @@ class mxchange_cache
                        @fwrite($this->cache_pointer, "\$cache_version['".$ext_name."'] = \"".$ext_ver."\";\n");
                } else {
                        // Cannot create file
-                       ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
                }
        }
 
diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php
new file mode 100644 (file)
index 0000000..1009819
--- /dev/null
@@ -0,0 +1,379 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2008 *
+ * ===============                              Last change: 09/28/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : refback_functions.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for refback extension                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer Refback-Erweiterung              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Payback refback for refid and reduce it for current user
+function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       global $DEPTH, $cacheArray;
+
+       // Back ref depths
+       $cacheArray['depth'][$uid][$ref] = $DEPTH; 
+
+       // Init points
+       $return = $points;
+
+       // Get all ref levels
+       $result_refs = SQL_QUERY("SELECT level, percents FROM "._MYSQL_PREFIX."_refdepths WHERE level > 0 ORDER BY level ASC", __FILE__, __LINE__);
+
+       // "Walk" through all level
+       while (list($level, $perc) = SQL_FETCHROW($result_refs)) {
+               // Reset ref depths
+               $DEPTH = -1;
+
+               // "Walk through all refids
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},level={$level},points={$points}<br />\n";
+               foreach (GET_REFBACK_USERID_ARRAY($uid, $level) as $refid) {
+                       // Skip level zero or if both are the same
+                       if ($uid == $refid) continue;
+
+                       // Get refback percents
+                       $percents = GET_REFBACK_PERCENTS($uid, $refid);
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},refid={$refid},points={$points},percents={$percents}<br />\n";
+
+                       // Some percents given?
+                       if ($percents > 0) {
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$points},perc={$perc},percents={$percents},level={$level}<br />\n";
+                               // Get points for refback
+                               $refback = $points * ($perc / 100) * ($percents / 100);
+
+                               // Update refback table ("refid" and "uid" must be exchanged!)
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_refs SET points=points+%s WHERE userid=%s AND refid=%s LIMIT 1",
+                                       array($refback, $refid, $uid), __FILE__, __LINE__);
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback},uid={$uid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")<br />\n";
+
+                               // Add points again, but only directly
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback}<br />\n";
+                               ADD_POINTS_REFSYSTEM($uid, $refback, false, "0", false, "direct");
+
+                               // Reduce points if refid is found
+                               if ($refid == $ref) {
+                                       // Reduce points here!
+                                       $return = $points * ($perc / 100) - $refback;
+                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$return} - REDUCED<br />\n";
+                               } // END - if
+                       } // END - if
+               } // END foreach
+       } // END - while
+
+       // Free result
+       SQL_FREERESULT($result_refs);
+
+       // Restore ref depth
+       $DEPTH = $cacheArray['depth'][$uid][$ref];
+
+       // Return them
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       return $return;
+}
+// "Getter" for refback percents
+function GET_REFBACK_PERCENTS ($uid, $ref) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref}<br />\n";
+       // Skip identical ids
+       if ($uid == $ref) return 0;
+
+       // Default is zero
+       $percents = 0;
+
+       // Get percents from database
+       $result = SQL_QUERY_ESC("SELECT refback FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND refid=%s LIMIT 1",
+               array($ref, $uid), __FILE__, __LINE__);
+
+       // Entry found? (Should be!)
+       if (SQL_NUMROWS($result) == 1) {
+               // Fetch percents
+               list($percents) = SQL_FETCHROW($result);
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):percents={$percents}<br />\n";
+       } else {
+               // Debug log
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): NO ENTRY FOUND! :-(<br />\n";
+               DEBUG_LOG(__FUNCTION__.": uid={$uid},ref={$ref} - No entry found! :-(");
+       }
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return percents
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       return $percents;
+}
+// "Getter" for userid array which will return only one entry
+function GET_REFBACK_USERID_ARRAY ($rid, $level) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level}<br />\n";
+       // Init userids
+       $userIds = array();
+
+       // Look for all
+       $result = SQL_QUERY_ESC("SELECT userid
+FROM "._MYSQL_PREFIX."_user_refs
+WHERE refid=%s AND level=%s
+ORDER BY userid ASC",
+               array($rid,$level), __FILE__, __LINE__);
+
+       // Entries found?
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />\n";
+       if (SQL_NUMROWS($result) > 0) {
+               // Add all
+               while (list($userid) = SQL_FETCHROW($result)) {
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level},userid={$userid}<br />\n";
+                       $userIds[] = $userid;
+               } // END - while
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return array
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},count()=".count($userIds)."<br />\n";
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       return $userIds;
+}
+// Update "refback table"
+function UPDATE_REFBACK_TABLE($uid) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       global $cacheArray, $cacheInstance;
+
+       // Make it sure referral level zero (member him-/herself) is at least selected
+       if (empty($cacheArray['back_level'])) $cacheArray['back_level'] = 1;
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']}<br />\n";
+
+       // Init refid
+       $cacheArray['up_refid'][$cacheArray['back_level']] = 0;
+       $old = 0; $minus = 0;
+
+       // Check for his referral
+       $result_refid = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE refid=%s ORDER BY userid ASC",
+               array(bigintval($uid)), __FILE__, __LINE__);
+
+       // When no entry was updated then we have to create it here
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found=".SQL_NUMROWS($result_refid)."<br />\n";
+       if (SQL_NUMROWS($result_refid) > 0) {
+               // Load all refids
+               while(list($cacheArray['up_refid'][$cacheArray['back_level']]) = SQL_FETCHROW($result_refid)) {
+                       // Remmber userid
+                       $cacheArray['up_userid'][$cacheArray['up_refid'][$cacheArray['back_level']]] = $uid;
+
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$cacheArray['up_refid'][$cacheArray['back_level']]}<br />\n";
+                       // Refid set?
+                       if (($cacheArray['up_refid'][$cacheArray['back_level']] > 0) && ($cacheArray['up_refid'][$cacheArray['back_level']] != $uid) && (!empty($cacheArray['up_refid'][$cacheArray['back_level']]))) {
+                               // New userid?
+                               if ((isset($cacheArray['up_refid'][$cacheArray['back_level']-1])) && (isset($cacheArray['up_userid'][$cacheArray['up_refid'][$cacheArray['back_level']-1]]))) {
+                                       // New userid!
+                                       $old = $uid;
+                                       $uid = $cacheArray['up_userid'][$cacheArray['up_refid'][$cacheArray['back_level']-1]];
+                                       $minus = 1;
+                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},old={$old},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - NEW UID!<br />\n";
+                               } // END - if
+
+                               // Check existence
+                               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
+                                       array(bigintval($uid), $cacheArray['back_level'], bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
+
+                               // Do we have no entry?
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]},minus={$minus},numRows=".SQL_NUMROWS($result)." - FOUND!<br />\n";
+                               if (SQL_NUMROWS($result) == 0) {
+                                       // Insert this level
+                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - ADD!<br />\n";
+                                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_refs (userid,level,refid) VALUES (%s,%s,%s)",
+                                               array(bigintval($uid), $cacheArray['back_level'], bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
+
+                                       // Move to next referral level and count his counter one up!
+                                       $cacheArray['back_level']++; UPDATE_REFBACK_TABLE($cacheArray['up_refid'][($cacheArray['back_level'] - 1)]);
+                               } // END - if
+
+                               // Do we have another level here?
+                               if ((($cacheArray['back_level']-$minus) > 0) && ($old > 0)) {
+                                       // Restore old one
+                                       $uid = $old;
+
+                                       // Shall we add this as well?
+                                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
+                                               array(bigintval($uid), ($cacheArray['back_level']-$minus), bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
+
+                                       // Do we have no entry?
+                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($cacheArray['back_level']-$minus).",ref={$cacheArray['up_refid'][$cacheArray['back_level']]},numRows=".SQL_NUMROWS($result)." - BACK!<br />\n";
+                                       if (SQL_NUMROWS($result) == 0) {
+                                               // Insert this level
+                                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_refs (userid,level,refid) VALUES (%s,%s,%s)",
+                                                       array(bigintval($uid), ($cacheArray['back_level']-$minus), bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
+                                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($cacheArray['back_level']-$minus).",ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - RETURNED!<br />\n";
+                                       } // END - if
+                               } // END - if
+                       } // END - if
+               } // END - while
+
+               // Free memory
+               SQL_FREERESULT($result_refid);
+       } // END - if
+
+       // When he has a referral...
+       if ((($cacheArray['up_refid'][$cacheArray['back_level']] == $uid) || ($cacheArray['up_refid'][$cacheArray['back_level']] == 0)) && (GET_EXT_VERSION("cache") >= "0.1.2") && (!isset($cacheArray['back_cached']))) {
+               // Remove cache here
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - CACHE!<br />\n";
+               if ($cacheInstance->cache_file("refback", true)) $cacheInstance->cache_destroy();
+               $cacheArray['back_cached'] = 1;
+       } // END - if
+
+       // "Walk" back here
+       $cacheArray['back_level']--;
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']} - LEVEL!<br />\n";
+
+       // Fix empty refid
+       if (!isset($cacheArray['up_refid'][$cacheArray['back_level']-1])) $cacheArray['up_refid'][$cacheArray['back_level']-1] = 0;
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']-1]} - BACK!<br />\n";
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+}
+// "Getter" for array for user refs in given level
+function GET_USER_REFS ($uid, $level) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       // Default is no refs and no nickname
+       $ADD = "";
+       $refs = array();
+
+       // Do we have nickname installed?
+       if (EXT_IS_ACTIVE("nickname")) {
+               $ADD = ", d.nickname";
+       } // END - if
+
+       // Get refs from database
+       $result = SQL_QUERY_ESC("SELECT r.id, r.refid, r.refback, r.points, d.status".$ADD."
+FROM "._MYSQL_PREFIX."_user_refs AS r
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
+ON r.refid=d.userid
+WHERE r.userid=%s AND r.level=%s
+ORDER BY r.refid ASC",
+               array(bigintval($uid), bigintval($level)), __FILE__, __LINE__);
+
+       // Are there some entries?
+       if (SQL_NUMROWS($result) > 0) {
+               // Fetch all entries
+               while ($row = SQL_FETCHARRAY($result)) {
+                       // Add row
+                       $refs[$row['id']] = $row;
+               } // END - while
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return result
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       return $refs;
+}
+// "Getter" for refback entry
+function GET_USER_REF_ENTRY ($id) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       // Default data is nothing
+       $data = array();
+
+       // Secure id number
+       $id = bigintval($id);
+
+       // Get entry from database
+       $result = SQL_QUERY_ESC("SELECT id, refid, refback FROM "._MYSQL_PREFIX."_user_refs WHERE id=%s AND userid=%s LIMIT 1",
+               array($id, $GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Is there an entry?
+       if (SQL_NUMROWS($result) == 1) {
+               // Fetch data
+               $data = SQL_FETCHARRAY($result);
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return entry
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       return $data;
+}
+// Update refback percents (but with some sanity-checks!
+function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       // Default status is failed
+       $status['message'] = MEMBER_REFBACK_ERROR_GENERAL;
+
+       // Do some sanity-checks
+       if (!IS_MEMBER()) {
+               // No member!
+               $status['message'] = MEMBER_REFBACK_ERROR_NO_MEMBER;
+               return $status;
+       } elseif ("".$id."" != "".bigintval($id)."") {
+               // No number!
+               $status['message'] = MEMBER_REFBACK_INVALID_ID_NUMBER;
+               return $status;
+       } elseif (($percents < 0) || ($percents > 100)) {
+               // Percentage is not valid!
+               $status['message'] = MEMBER_REFBACK_INVALID_PERCENTAGE;
+               return $status;
+       }
+
+       // Get ref entry
+       $dummy = GET_USER_REF_ENTRY($id);
+
+       // Is this valid?
+       if (count($dummy) == 0) {
+               // ID does not belong to user!
+               $status['message'] = MEMBER_REFBACK_ID_MISMATCH;
+               return $status;
+       } // END - if
+
+       // Revert german commata
+       $percents = REVERT_COMMA($percents);
+
+       // Update entry
+       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_refs SET refback='%s' WHERE id=%s AND userid=%s LIMIT 1",
+               array($percents, $id, $GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Entry updated?
+       if (SQL_AFFECTEDROWS() < 1) {
+               // Entry not updated!
+               $status['message'] = MEMBER_REFBACK_NOT_UPDATED;;
+               return $status;
+       } // END - if
+
+       // All fine!
+       $status['ok'] = true;
+
+       // Return status array
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       return $status;
+}
+//
+?>
index 4cf38f0..f83d4fa 100644 (file)
@@ -850,7 +850,7 @@ function SURFBAR_UPDATE_INSERT_STATS_RECORD () {
                array($GLOBALS['userid'], SURFBAR_GET_ID()), __FILE__, __LINE__);
 
        // Was that update okay?
-       if (SQL_AFFECTEDROWS() == 0) {
+       if (SQL_AFFECTEDROWS() < 1) {
                // No, then insert entry
                SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_stats (userid,url_id,count) VALUES(%s,%s,1)",
                        array($GLOBALS['userid'], SURFBAR_GET_ID()), __FILE__, __LINE__);
@@ -878,7 +878,7 @@ function SURFBAR_UPDATE_SALT_STATS () {
        //DEBUG_LOG(__FUNCTION__.":salt=".SURFBAR_GET_SALT().",id=".SURFBAR_GET_ID().",uid=".$GLOBALS['userid']."");
 
        // Was that okay?
-       if (SQL_AFFECTEDROWS() == 0) {
+       if (SQL_AFFECTEDROWS() < 1) {
                // Insert missing entry!
                SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_salts (url_id,userid,last_salt) VALUES(%s, %s, '%s')",
                        array(SURFBAR_GET_ID(), $GLOBALS['userid'], SURFBAR_GET_SALT()), __FILE__, __LINE__);
index 74ba0ce..528da4a 100644 (file)
@@ -216,7 +216,7 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password) {
        $pass = GET_ADMIN_HASH($admin_login);
        if ($pass != "-1") $ret = "pass";
 
-       //* DEBUG: */ echo __FUNCTION__.":".generatePassString($pass)."(".strlen($pass).")/".$password."(".strlen($password).")<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass)."(".strlen($pass).")/".$password."(".strlen($password).")<br />\n";
 
        // Check if password matches
        if (($ret == "pass") && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass)))) {
index 8307ed9..10f003d 100644 (file)
@@ -82,6 +82,9 @@ if (isset($_POST['ok'])) {
                                // Secure ID
                                $id = bigintval($id);
 
+                               // Revert german commata
+                               $_POST['perc'][$id] = REVERT_COMMA($_POST['perc'][$id]);
+
                                // Update entry
                                $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refdepths SET level='%s', percents='%s' WHERE id=%s LIMIT 1",
                                 array(bigintval($value), $_POST['perc'][$id], $id), __FILE__, __LINE__);
@@ -211,7 +214,7 @@ WHERE mails_confirmed < %s", $REF, $REF);
                                'sw'  => $SW,
                                'id'  => $id,
                                'lvl' => $lvl,
-                               'per' => $perc,
+                               'per' => TRANSLATE_COMMA($perc),
                        );
 
                        // Load row template and switch color
@@ -239,7 +242,7 @@ WHERE mails_confirmed < %s", $REF, $REF);
                                'sw'  => $SW,
                                'id'  => $id,
                                'lvl' => $lvl,
-                               'per' => $perc,
+                               'per' => TRANSLATE_COMMA($perc),
                        );
 
                        // Load row template and switch color
@@ -268,7 +271,7 @@ WHERE mails_confirmed < %s", $REF, $REF);
                                        'sw'  => $SW,
                                        'id'  => $id,
                                        'lvl' => $lvl,
-                                       'per' => $perc,
+                                       'per' => TRANSLATE_COMMA($perc),
                                );
 
                                // Load row template and switch color
index e81f62f..14b4f72 100644 (file)
@@ -170,11 +170,15 @@ if (!empty($_GET['reg_ext'])) {
                if ($_CONFIG['verbose_sql']) {
                        // Load SQL commands in remove mode
                        $EXT_LOAD_MODE = "remove";
+                       $EXT_ALWAYS_ACTIVE = "N";
                        $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
-                       include($file);
+                       if (FILE_READABLE($file)) {
+                               // Load file
+                               include($file);
 
-                       // Generate extra table with loaded SQL commands
-                       $VERBOSE_OUT = EXTENSION_VERBOSE_TABLE($SQLs);
+                               // Generate extra table with loaded SQL commands
+                               $VERBOSE_OUT = EXTENSION_VERBOSE_TABLE($SQLs);
+                       }
                } // END - if
 
                // Prepare data for the row template
index f14b121..cfd4b3b 100644 (file)
@@ -64,7 +64,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO()))
                if ($confirm == 1)
                {
                        $cnt++;
-                       $result = SQL_QUERY_ESC("SELECT title, action, what, descr FROM "._MYSQL_PREFIX."_member_menu WHERE ".$AND." AND id=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT title, action, what FROM "._MYSQL_PREFIX."_member_menu WHERE ".$AND." AND id=%s LIMIT 1",
                         array(bigintval($sel)), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 1)
                        {
@@ -200,8 +200,8 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO()))
                switch ($_POST['ok'])
                {
                case "edit": // Edit menu
-                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_member_menu SET title='%s', action='%s', what='%s', descr='%s' WHERE ".$AND." AND id=%s LIMIT 1",
-                        array($menu, $_POST['sel_act'][$sel], $_POST['sel_what'][$sel], $_POST['sel_descr'][$sel], $sel), __FILE__, __LINE__);
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_member_menu SET title='%s', action='%s', what='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+                        array($menu, $_POST['sel_act'][$sel], $_POST['sel_what'][$sel], $sel), __FILE__, __LINE__);
                        break;
 
                case "del": // Delete menu
index 1acda59..860cd24 100644 (file)
@@ -262,6 +262,12 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF
                return;
        } // END - if
 
+       // Is the refback extension there?
+       if (EXT_IS_ACTIVE("refback")) {
+               // Update refback table
+               UPDATE_REFBACK_TABLE($userid);
+       } // END - if
+
        // Write his welcome-points
        $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND ref_depth=0 LIMIT 1",
         array(bigintval($userid)), __FILE__, __LINE__);
index 46387bf..ec7275b 100644 (file)
@@ -86,9 +86,9 @@ while (list($lvl, $per) = SQL_FETCHROW($result_depths)) {
        // Transfer data to array for template
        $content = array(
                'lvl'    => $lvl,
-               'per'    => $per,
+               'per'    => TRANSLATE_COMMA($per),
                'points' => TRANSLATE_COMMA($points),
-               'refs'   => $REFS,
+               'refs'   => TRANSLATE_COMMA($REFS),
        );
 
        // Output row
diff --git a/inc/modules/member/what-refback.php b/inc/modules/member/what-refback.php
new file mode 100644 (file)
index 0000000..280aba6
--- /dev/null
@@ -0,0 +1,145 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ================                             Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-refback.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Refback setup                                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Refback-Einstellungen                            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       // User is not logged in
+       LOAD_URL("modules.php?module=index");
+} elseif ((!EXT_IS_ACTIVE("refback")) && (!IS_ADMIN())) {
+       // Extension "refback" is not active
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "refback");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Was the form submitted?
+if ((isset($_POST['edit'])) && (isset($_POST['id']))) {
+       // Okay, has the user entered some values?
+       if (isset($_POST['percents'])) {
+               // Change ref-back for this direct id
+               $status = REFBACK_CHANGE_MEMBER_PERCENTS($_POST['id'], $_POST['percents']);
+
+               // Check status
+               if (isset($status['ok'])) {
+                       // No message found
+                       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DONE);
+               } elseif (isset($status['message'])) {
+                       // Something went wrong with error message
+                       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_MESSAGE, $status['message']));
+               } else {
+                       // No message found
+                       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_ERROR_EMPTY_MESSAGE);
+               }
+
+               // Insert line
+               OUTPUT_HTML("<br />");
+       } else {
+               // Read data from refback table
+               $content = GET_USER_REF_ENTRY($_POST['id']);
+
+               // Translate comma
+               $content['refback'] = TRANSLATE_COMMA($content['refback']);
+
+               // Load form for editing
+               LOAD_TEMPLATE("member_refback_edit", false, $content);
+       }
+} // END - if
+
+// Load all referal levels
+$result = SQL_QUERY_ESC("SELECT r.level, r.percents
+FROM "._MYSQL_PREFIX."_refdepths AS r
+WHERE r.level > 0
+ORDER BY r.level ASC",
+       array($GLOBALS['userid']), __FILE__, __LINE__);
+
+// Are there some entries? (Shall be!)
+if (SQL_NUMROWS($result) > 0) {
+       // List all levels
+       $OUT = "";
+       while ($content = SQL_FETCHARRAY($result)) {
+               // Init variables
+               $rows = "";
+               $counter = 0;
+               $SW = 2;
+
+               // Check for users ref in this level
+               foreach (GET_USER_REFS($GLOBALS['userid'], $content['level']) as $refRow) {
+                       // Not-deleted account is default
+                       $deleted = false;
+                       if (is_null($refRow['status'])) $deleted = true;
+
+                       // Add/"translate" more content
+                       $refRow['sw']      = $SW;
+                       $refRow['points']  = TRANSLATE_COMMA($refRow['points']);
+                       $refRow['refback'] = TRANSLATE_COMMA($refRow['refback']);
+                       $refRow['status']  = TRANSLATE_STATUS($refRow['status']);
+                       if (empty($refRow['nickname'])) $refRow['nickname'] = "---";
+
+                       // Load row template
+                       if ($deleted) {
+                               $rows .= LOAD_TEMPLATE("member_refback_list_row_deleted", true, $refRow);
+                       } else {
+                               $rows .= LOAD_TEMPLATE("member_refback_list_row", true, $refRow);
+                       }
+
+                       // Count this ref and switch color
+                       $counter++;
+                       $SW = 3 - $SW;
+               } // END - foreach
+
+               // Remember the content
+               $content['counter']  = TRANSLATE_COMMA($counter);
+               $content['percents'] = TRANSLATE_COMMA($content['percents']);
+               $content['rows']     = $rows;
+
+               // Load level template
+               $OUT .= LOAD_TEMPLATE("member_refback_list_level", true, $content);
+       } // END - while
+
+       // Load main template
+       LOAD_TEMPLATE("member_refback_list", false, $OUT);
+} else {
+       // No entries
+       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_NO_ENTRIES);
+}
+
+// Free result
+SQL_FREERESULT($result);
+
+//
+?>
index 15badd9..65ef918 100644 (file)
@@ -137,6 +137,8 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
                                        // Administrative functions
                                        require_once(PATH."inc/modules/admin/admin-inc.php");
                                } // END - if
+                               //* DEBUG: */ ADD_POINTS_REFSYSTEM(36,1000);
+                               //* DEBUG: */ die();
 
                                // Get all values
                                if (($CSS != 1) && ($CSS != -1)) {
@@ -156,7 +158,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
                                UPDATE_ONLINE_LIST($PHPSESSID, $GLOBALS['module'], $GLOBALS['action'], $GLOBALS['what']);
 
                                // Set default 'what' value
-                               //* DEBUG */ echo "-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />\n";
+                               //* DEBUG: */ echo "-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />\n";
                                if ((empty($GLOBALS['what'])) && (empty($GLOBALS['action'])) && ($CSS != 1) && ($CSS != -1)) {
                                        if ($GLOBALS['module'] == "admin") {
                                                // Set 'action' value to 'login' in admin menu
index 26e6870..186b1d4 100644 (file)
@@ -168,7 +168,7 @@ function CHECK_MODULE($mod) {
                        }
 
                        // Everthing is fine?
-                       if (SQL_AFFECTEDROWS() == 0) {
+                       if (SQL_AFFECTEDROWS() < 1) {
                                // Something bad happend!
                                return "major";
                        } // END - if
@@ -286,7 +286,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) {
                                $DEPTH="0";
 
                                // Handle failed logins here if not in guest
-                               //* DEBUG: */ echo __FUNCTION__.":type={$type},action={$GLOBALS['action']},what={$GLOBALS['what']},lvl={$ACC_LVL}<br />\n";
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):type={$type},action={$GLOBALS['action']},what={$GLOBALS['what']},lvl={$ACC_LVL}<br />\n";
                                if ((($type == "what") || ($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview") || ($GLOBALS['what'] == $_CONFIG['index_home']))) && ($ACC_LVL != "guest") && ((GET_EXT_VERSION("sql_patches") >= "0.4.7") || (GET_EXT_VERSION("admins") >= "0.7.0"))) {
                                        // Handle failture
                                        $OUT .= HANDLE_LOGIN_FAILTURES($ACC_LVL);
@@ -476,7 +476,7 @@ function IS_ADMIN($admin="")
 
        if (!empty($valPass)) {
                // Check if password is valid
-               //* DEBUG: */ echo __FUNCTION__."*".$valPass."/".$passCookie."*<br />\n";
+               //* DEBUG: */ print __FUNCTION__."*".$valPass."/".$passCookie."*<br />\n";
                $ret = (($valPass == $passCookie) || ((strlen($valPass) == 32) && ($valPass == md5($passCookie))) || (($valPass == "*FAILED*") && (!EXT_IS_ACTIVE("cache"))));
        }
 
@@ -1129,26 +1129,24 @@ function GET_REF_LEVEL_PERCENTS ($level) {
  * uid         = Referral ID wich should receive...
  * points      = ... xxx points
  * send_notify = shall I send the referral an email or not?
- * rid         = inc/modules/guest/what-confirm.php need this
+ * rid         = inc/modules/guest/what-confirm.php need this (DEPRECATED???)
  * locked      = Shall I pay it to normal (false) or locked (true) points ammount?
  * add_mode    = Add points only to $uid or also refs? (WARNING! Changing "ref" to "direct"
  *               for default value will cause no referral will get points ever!!!)
  */
 function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $locked=false, $add_mode="ref") {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
        global $DEPTH, $_CONFIG, $DATA, $cacheArray;
 
        // Convert mode to lower-case
        $add_mode = strtolower($add_mode);
 
-       // Debug message
-       //DEBUG_LOG(__FUNCTION__.": uid={$uid},points={$points}");
-
        // When $uid = 0 add points to jackpot
        if ($uid == "0") {
                // Add points to jackpot
                ADD_JACKPOT($points);
                return;
-       }
+       } // END - if
 
        // Count up referral depth
        if (!isset($DEPTH)) {
@@ -1169,50 +1167,39 @@ function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $lock
        $result_user = SQL_QUERY_ESC("SELECT refid, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
         array(bigintval($uid)), __FILE__, __LINE__);
 
-       //* DEBUG */ echo "+".SQL_NUMROWS($result_user).":".$points."+<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},numRows=".SQL_NUMROWS($result_user).",points={$points}<br />\n";
        if (SQL_NUMROWS($result_user) == 1) {
                // This is the user and his ref
                list($ref, $email) = SQL_FETCHROW($result_user);
                $cacheArray['add_uid'][$ref] = $uid;
 
-               // Debug message
-               //DEBUG_LOG(__FUNCTION__.": ref={$ref},email={$email},DEPTH={$DEPTH}");
-
                // Get percents
                $per = GET_REF_LEVEL_PERCENTS($DEPTH);
-               //* DEBUG: */ echo __FUNCTION__.":uid={$uid},points={$points},depth={$DEPTH},per={$per},mode={$add_mode}<br />\n";
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},points={$points},depth={$DEPTH},per={$per},mode={$add_mode}<br />\n";
 
                // Some percents found?
                if ($per > 0) {
                        // Calculate new points
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},points={$points},per={$per},depth={$DEPTH}<br />\n";
                        $ref_points = $points * $per / 100;
 
                        // Pay refback here if level > 0 and in ref-mode
-                       if (($DEPTH > 0) && ($per < 100) && ($add_mode == "ref")) {
-                               //* DEBUG: */ echo __FUNCTION__.":uid={$uid},data={$cacheArray['add_uid'][$uid]},ref_points={$ref_points},depth={$DEPTH} - BEFORE!<br />\n";
-                               $ref_points = ADD_REFBACK_POINTS($cacheArray['add_uid'][$uid], $uid, $ref_points, $DEPTH);
-                               //* DEBUG: */ echo __FUNCTION__.":uid={$uid},data={$cacheArray['add_uid'][$uid]},ref_points={$ref_points},depth={$DEPTH} - AFTER!<br />\n";
+                       if ((EXT_IS_ACTIVE("refback")) && ($DEPTH > 0) && ($per < 100) && ($add_mode == "ref") && (isset($cacheArray['add_uid'][$uid]))) {
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$cacheArray['add_uid'][$uid]},ref_points={$ref_points},depth={$DEPTH} - BEFORE!<br />\n";
+                               $ref_points = ADD_REFBACK_POINTS($cacheArray['add_uid'][$uid], $uid, $points, $ref_points);
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$cacheArray['add_uid'][$uid]},ref_points={$ref_points},depth={$DEPTH} - AFTER!<br />\n";
                        } // END - if
 
-                       // Debug message
-                       //DEBUG_LOG(__FUNCTION__.": percent={$per},ref_points={$ref_points}");
-
                        // Update points...
-                       //* DEBUG: */ echo __FUNCTION__.":data={$data},ref_points={$ref_points},uid={$uid},depth={$DEPTH} - UPDATE!<br />\n";
-                       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET %s=%s+%s WHERE userid=%s AND ref_depth=%d LIMIT 1",
+                       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET %s=%s+%s WHERE userid=%s AND ref_depth='%s' LIMIT 1",
                         array($data, $data, $ref_points, bigintval($uid), bigintval($DEPTH)), __FILE__, __LINE__);
-
-                       // Debug log
-                       //DEBUG_LOG(__FUNCTION__.": affectedRows=".SQL_AFFECTEDROWS().",DEPTH={$DEPTH}");
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$DEPTH},mode={$add_mode} - UPDATE! (".SQL_AFFECTEDROWS().")<br />\n";
 
                        // No entry updated?
-                       if (SQL_AFFECTEDROWS() == 0) {
+                       if (SQL_AFFECTEDROWS() < 1) {
                                // First ref in this level! :-)
-                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_points (userid, ref_depth, %s) VALUES (%s, %d, %s)",
+                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_points (userid,ref_depth,%s) VALUES (%s,%s,%s)",
                                 array($data, bigintval($uid), bigintval($DEPTH), $ref_points), __FILE__, __LINE__);
-
-                               // Debug log
-                               //DEBUG_LOG(__FUNCTION__.": insertedRows=".SQL_AFFECTEDROWS()."");
                        } // END - if
 
                        // Update mediadata as well
@@ -1256,6 +1243,7 @@ function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $lock
                        // Maybe there's another ref?
                        if (($ref > 0) && ($points > 0) && ($ref != $uid) && ($add_mode == "ref")) {
                                // Then let's credit him here...
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},points={$points} - ADVANCE!<br />\n";
                                ADD_POINTS_REFSYSTEM($ref, $points, $send_notify, $ref, $locked);
                        } // END - if
                } // END - if
@@ -1263,112 +1251,7 @@ function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $lock
 
        // Free result
        SQL_FREERESULT($result_user);
-}
-// Payback refback for refid and reduce it for current user
-function ADD_REFBACK_POINTS ($uid, $ref, $points) {
-       global $DEPTH, $cacheArray;
-
-       // Backup and reset ref depth
-       $cacheArray['depth'][$uid][$ref] = $DEPTH; $DEPTH = -1;
-
-       // Init points
-       $return = $points;
-
-       // "Walk through all refids
-       //* DEBUG: */ echo __FUNCTION__.":uid={$uid},ref={$ref},points={$points}<br />\n";
-       foreach (GET_REFBACK_USERID_ARRAY($uid) as $refid) {
-               // Skip level zero or if both are the same
-               if ($uid == $refid) continue;
-
-               // Get refback percents
-               $percents = GET_REFBACK_PERCENTS($uid, $refid);
-               //* DEBUG: */ echo __FUNCTION__.":uid={$uid},ref={$ref},refid={$refid},points={$points},percents={$percents}<br />\n";
-
-               // Some percents given?
-               if ($percents > 0) {
-                       // Get points for refback
-                       $refback = $points * $percents / 100;
-       
-                       // Add points again, but only directly
-                       //* DEBUG: */ echo __FUNCTION__.":refback={$refback}<br />\n";
-                       ADD_POINTS_REFSYSTEM($uid, $refback, false, "0", false, "direct");
-
-                       // Update refback table
-                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_refs SET points=points+%s WHERE userid=%s AND refid=%s LIMIT 1",
-                               array($refback, $uid, $refid), __FILE__, __LINE__);
-
-                       // Reduce points if refid is found
-                       if ($refid == $ref) {
-                               // Reduce points here!
-                               $return = $points - $refback;
-                               //* DEBUG: */ echo __FUNCTION__.":points={$return} - REDUCED<br />\n";
-                       } // END - if
-               } // END - if
-       } // END foreach
-
-       // Restore ref depth
-       $DEPTH = $cacheArray['depth'][$uid][$ref];
-
-       // Return them
-       return $return;
-}
-// "Getter" for refback percents
-function GET_REFBACK_PERCENTS ($uid, $ref) {
-       //* DEBUG: */ echo __FUNCTION__.":uid={$uid},ref={$ref}<br />\n";
-       // Skip identical ids
-       if ($uid == $ref) return 0;
-
-       // Default is zero
-       $percents = 0;
-
-       // Get percents from database
-       $result = SQL_QUERY_ESC("SELECT refback FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND refid=%s LIMIT 1",
-               array($ref, $uid), __FILE__, __LINE__);
-
-       // Entry found? (Should be!)
-       if (SQL_NUMROWS($result) == 1) {
-               // Fetch percents
-               list($percents) = SQL_FETCHROW($result);
-       } else {
-               // Debug log
-               DEBUG_LOG(__FUNCTION__.": uid={$uid},ref={$ref} - No entry found! :-(");
-       }
-
-       // Free result
-       SQL_FREERESULT($result);
-
-       // Return percents
-       return $percents;
-}
-// "Getter" for userid array
-function GET_REFBACK_USERID_ARRAY ($rid) {
-       //* DEBUG: */ echo __FUNCTION__.":rid={$rid}<br />\n";
-       // Init userids
-       $userIds = array();
-
-       // Look for all
-       $result = SQL_QUERY_ESC("SELECT userid
-FROM "._MYSQL_PREFIX."_user_refs
-WHERE refid=%s
-GROUP BY level
-ORDER BY userid ASC",
-               array($rid), __FILE__, __LINE__);
-
-       // Entries found?
-       if (SQL_NUMROWS($result) > 0) {
-               // Add all
-               while (list($userid) = SQL_FETCHROW($result)) {
-                       //* DEBUG: */ echo __FUNCTION__.":rid={$rid},userid={$userid}<br />\n";
-                       $userIds[] = $userid;
-               } // END - while
-       } // END - if
-
-       // Free result
-       SQL_FREERESULT($result);
-
-       // Return array
-       //* DEBUG: */ echo __FUNCTION__.":rid={$rid},count()=".count($userIds)."<br />\n";
-       return $userIds;
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
 }
 //
 function UPDATE_REF_COUNTER ($uid) {
@@ -1376,19 +1259,19 @@ function UPDATE_REF_COUNTER ($uid) {
 
        // Make it sure referral level zero (member him-/herself) is at least selected
        if (empty($cacheArray['ref_level'][$uid])) $cacheArray['ref_level'][$uid] = 1;
-       //* DEBUG: */ echo __FUNCTION__.":uid={$uid},level={$cacheArray['ref_level'][$uid]}<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['ref_level'][$uid]}<br />\n";
 
        // Update counter
        $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refsystem SET counter=counter+1 WHERE userid=%s AND level='%s' LIMIT 1",
                array(bigintval($uid), $cacheArray['ref_level'][$uid]), __FILE__, __LINE__);
 
        // When no entry was updated then we have to create it here
-       //* DEBUG: */ echo __FUNCTION__.":updated=".SQL_AFFECTEDROWS()."<br />\n";
-       if (SQL_AFFECTEDROWS() == 0) {
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):updated=".SQL_AFFECTEDROWS()."<br />\n";
+       if (SQL_AFFECTEDROWS() < 1) {
                // First count!
                $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_refsystem (userid, level, counter) VALUES (%s,%s,1)",
                        array(bigintval($uid), $cacheArray['ref_level'][$uid]), __FILE__, __LINE__);
-               //* DEBUG: */ echo __FUNCTION__.":uid={$uid}<br />\n";
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid}<br />\n";
        } // END - if
 
        // Check for his referral
@@ -1400,118 +1283,26 @@ function UPDATE_REF_COUNTER ($uid) {
 
        // Free memory
        SQL_FREERESULT($result);
-       //* DEBUG: */ echo __FUNCTION__.":uid={$uid},ref={$ref}<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref}<br />\n";
 
        // When he has a referral...
        if (($ref > 0) && ($ref != $uid)) {
                // Move to next referral level and count his counter one up!
-               //* DEBUG: */ echo __FUNCTION__.":ref={$ref} - ADVANCE!<br />\n";
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - ADVANCE!<br />\n";
                $cacheArray['ref_level'][$uid]++; UPDATE_REF_COUNTER($ref);
        } elseif ((($ref == $uid) || ($ref == 0)) && (GET_EXT_VERSION("cache") >= "0.1.2")) {
                // Remove cache here
-               //* DEBUG: */ echo __FUNCTION__.":ref={$ref} - CACHE!<br />\n";
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - CACHE!<br />\n";
                if ($cacheInstance->cache_file("refsystem", true)) $cacheInstance->cache_destroy();
        }
 
        // "Walk" back here
        $cacheArray['ref_level'][$uid]--;
 
-       // Handle refback here
-       UPDATE_REFBACK_TABLE($uid);
-}
-// Update "refback table"
-function UPDATE_REFBACK_TABLE($uid)
-{
-       global $cacheArray, $cacheInstance;
-
-       // Make it sure referral level zero (member him-/herself) is at least selected
-       if (empty($cacheArray['back_level'])) $cacheArray['back_level'] = 1;
-       //* DEBUG: */ echo __FUNCTION__.":uid={$uid},level={$cacheArray['back_level']}<br />\n";
-
-       // Init refid
-       $cacheArray['up_refid'][$cacheArray['back_level']] = 0;
-       $old = 0; $minus = 0;
-
-       // Check for his referral
-       $result_refid = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE refid=%s ORDER BY userid ASC",
-               array(bigintval($uid)), __FILE__, __LINE__);
-
-       // When no entry was updated then we have to create it here
-       //* DEBUG: */ echo __FUNCTION__.":found=".SQL_NUMROWS($result_refid)."<br />\n";
-       if (SQL_NUMROWS($result_refid) > 0) {
-               // Load all refids
-               while(list($cacheArray['up_refid'][$cacheArray['back_level']]) = SQL_FETCHROW($result_refid)) {
-                       // Remmber userid
-                       $cacheArray['up_userid'][$cacheArray['up_refid'][$cacheArray['back_level']]] = $uid;
-
-                       //* DEBUG: */ echo __FUNCTION__.":uid={$uid},ref={$cacheArray['up_refid'][$cacheArray['back_level']]}<br />\n";
-                       // Refid set?
-                       if (($cacheArray['up_refid'][$cacheArray['back_level']] > 0) && ($cacheArray['up_refid'][$cacheArray['back_level']] != $uid) && (!empty($cacheArray['up_refid'][$cacheArray['back_level']]))) {
-                               // New userid?
-                               if ((isset($cacheArray['up_refid'][$cacheArray['back_level']-1])) && (isset($cacheArray['up_userid'][$cacheArray['up_refid'][$cacheArray['back_level']-1]]))) {
-                                       // New userid!
-                                       $old = $uid;
-                                       $uid = $cacheArray['up_userid'][$cacheArray['up_refid'][$cacheArray['back_level']-1]];
-                                       $minus = 1;
-                                       //* DEBUG: */ echo __FUNCTION__.":uid={$uid},old={$old},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - NEW UID!<br />\n";
-                               } // END - if
-
-                               // Check existence
-                               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
-                                       array(bigintval($uid), $cacheArray['back_level'], bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
-
-                               // Do we have no entry?
-                               //* DEBUG: */ echo __FUNCTION__.":uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]},minus={$minus},numRows=".SQL_NUMROWS($result)." - FOUND!<br />\n";
-                               if (SQL_NUMROWS($result) == 0) {
-                                       // Insert this level
-                                       //* DEBUG: */ echo __FUNCTION__.":uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - ADD!<br />\n";
-                                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_refs (userid, level, refid) VALUES (%s,%s,%s)",
-                                               array(bigintval($uid), $cacheArray['back_level'], bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
-
-                                       // Move to next referral level and count his counter one up!
-                                       $cacheArray['back_level']++; UPDATE_REFBACK_TABLE($cacheArray['up_refid'][($cacheArray['back_level'] - 1)]);
-                               } // END - if
-
-                               // Do we have another level here?
-                               if ((($cacheArray['back_level']-$minus) > 0) && ($old > 0)) {
-                                       // Restore old one
-                                       $uid = $old;
-
-                                       // Shall we add this as well?
-                                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
-                                               array(bigintval($uid), ($cacheArray['back_level']-$minus), bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
-
-                                       // Do we have no entry?
-                                       //* DEBUG: */ echo __FUNCTION__.":uid={$uid},level=".($cacheArray['back_level']-$minus).",ref={$cacheArray['up_refid'][$cacheArray['back_level']]},numRows=".SQL_NUMROWS($result)." - BACK!<br />\n";
-                                       if (SQL_NUMROWS($result) == 0) {
-                                               // Insert this level
-                                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_refs (userid, level, refid) VALUES (%s,%s,%s)",
-                                                       array(bigintval($uid), ($cacheArray['back_level']-$minus), bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
-                                               //* DEBUG: */ echo __FUNCTION__.":uid={$uid},level=".($cacheArray['back_level']-$minus).",ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - RETURNED!<br />\n";
-                                       } // END - if
-                               } // END - if
-                       } // END - if
-               } // END - while
-
-               // Free memory
-               SQL_FREERESULT($result_refid);
+       // Handle refback here if extension is installed
+       if (EXT_IS_ACTIVE("refback")) {
+               UPDATE_REFBACK_TABLE($uid);
        } // END - if
-
-       // When he has a referral...
-       if ((($cacheArray['up_refid'][$cacheArray['back_level']] == $uid) || ($cacheArray['up_refid'][$cacheArray['back_level']] == 0)) && (GET_EXT_VERSION("cache") >= "0.1.2") && (!isset($cacheArray['back_cached']))) {
-               // Remove cache here
-               //* DEBUG: */ echo __FUNCTION__.":uid={$uid},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - CACHE!<br />\n";
-               if ($cacheInstance->cache_file("refback", true)) $cacheInstance->cache_destroy();
-               $cacheArray['back_cached'] = 1;
-       } // END - if
-
-       // "Walk" back here
-       $cacheArray['back_level']--;
-       //* DEBUG: */ echo __FUNCTION__.":uid={$uid},level={$cacheArray['back_level']} - LEVEL!<br />\n";
-
-       // Fix empty refid
-       if (!isset($cacheArray['up_refid'][$cacheArray['back_level']-1])) $cacheArray['up_refid'][$cacheArray['back_level']-1] = 0;
-       //* DEBUG: */ echo __FUNCTION__.":uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']-1]} - BACK!<br />\n";
 }
 // Updates/extends the online list
 function UPDATE_ONLINE_LIST($SID, $mod, $act, $wht) {
@@ -1834,7 +1625,7 @@ WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__);
 
        // Remove from rallye if found
        if (EXT_IS_ACTIVE("rallye")) {
-               $result = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_users WHERE userid=%s",
+               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_users WHERE userid=%s",
                 array(bigintval($uid)), __FILE__, __LINE__);
        }
 
@@ -1977,7 +1768,7 @@ function MODULE_HAS_MENU($mod, $forceDb = false)
 
        // All is false by default
        $ret = false;
-       //* DEBUG: */ echo __FUNCTION__.":mod={$mod},cache=".GET_EXT_VERSION("cache")."<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):mod={$mod},cache=".GET_EXT_VERSION("cache")."<br />\n";
        if (GET_EXT_VERSION("cache") >= "0.1.2") {
                // Cache version is okay, so let's check the cache!
                if (isset($cacheArray['modules']['has_menu'][$mod])) {
@@ -2064,7 +1855,7 @@ function UPDATE_CONFIG ($entries, $values, $updateMode="") {
 
        // Get affected rows
        $affectedRows = SQL_AFFECTEDROWS();
-       //* DEBUG: */ echo __FUNCTION__.":entries={$entries},affectedRows={$affectedRows}<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):entries={$entries},affectedRows={$affectedRows}<br />\n";
 
        // Rebuild cache
        REBUILD_CACHE("config", "config");
@@ -2119,6 +1910,5 @@ VALUES (%s,0,'NEW','EXTENSION','%s','%s',UNIX_TIMESTAMP())",
        // Free memory
        SQL_FREERESULT($result);
 }
-
 //
 ?>
index 2bf08fc..e636e64 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
  * MA  02110-1301  USA                                                  *
  ************************************************************************/
-
+/*
+print "<pre>";
+debug_print_backtrace();
+die("</pre>");
+*/
 echo "<HTML>
 <HEAD>
 <TITLE>Protected file ".basename($_SERVER['PHP_SELF'])." - ACCESS DENIED!</TITLE>
index d4ba588..61f7bfb 100644 (file)
@@ -76,7 +76,6 @@ CREATE TABLE `mxchange_member_menu` (
   `sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,\r
   `visible` ENUM('Y','N') NOT NULL DEFAULT 'Y',\r
   `locked` ENUM('Y','N') NOT NULL DEFAULT 'Y',\r
-  `descr` blob NOT NULL,\r
   `counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,\r
   PRIMARY KEY  (`id`)\r
 ) TYPE=MyISAM;\r
index 7b61491..5b8266b 100644 (file)
@@ -1,21 +1,21 @@
-<TABLE border="0" cellspacing="0" cellpadding="0" width="99%"
-       class="admin_table dashed">
-       <TR>
-               <TD colspan="6" class="admin_title" height="30"><STRONG>{--ADMIN_LIST_REFERRALS_1--}<U>{--_UID--}</U>{--ADMIN_LIST_REFERRALS_2--}</STRONG>
-               </TD>
-       </TR>
-       <TR>
-               <TD width="5%" align="center" class="admin_header bottom2 right2"><STRONG>{--_UID--}</STRONG></TD>
-               <TD width="5%" align="center" class="admin_header bottom2 right2"><STRONG>{--REFS_COUNT--}</STRONG></TD>
-               <TD width="35%" align="center" class="admin_header bottom2 right2"><STRONG>{--SURNAME_FAMILY--}</STRONG></TD>
-               <TD width="35%" align="center" class="admin_header bottom2 right2"><STRONG>{--ADDY--}</STRONG></TD>
-               <TD width="10%" align="center" class="admin_header bottom2 right2"><STRONG>{--ACCOUNT_STATUS--}</STRONG></TD>
-               <TD width="10%" align="center" class="admin_header bottom2"><STRONG>{--MEMBER_JOINED--}</STRONG></TD>
-       </TR>
-       {!__REF_ROWS!}
-       <TR>
-               <TD colspan="6" class="admin_footer"
-                       style="padding-top: 7px; padding-bottom: 7px"><FONT
-                       class="admin_note">{--ADMIN_LIST_REFERRALS_NOTE--}</FONT></TD>
-       </TR>
+<TABLE border="0" cellspacing="0" cellpadding="0" width="99%" class="admin_table dashed">
+<TR>
+       <TD colspan="6" class="admin_title" height="30">
+               <STRONG>{--ADMIN_LIST_REFERRALS_1--}<U>$content[uid]</U>{--ADMIN_LIST_REFERRALS_2--}</STRONG>
+       </TD>
+</TR>
+<TR>
+       <TD width="5%" align="center" class="admin_header bottom2 right2"><STRONG>{--_UID--}</STRONG></TD>
+       <TD width="5%" align="center" class="admin_header bottom2 right2"><STRONG>{--REFS_COUNT--}</STRONG></TD>
+       <TD width="35%" align="center" class="admin_header bottom2 right2"><STRONG>{--SURNAME_FAMILY--}</STRONG></TD>
+       <TD width="35%" align="center" class="admin_header bottom2 right2"><STRONG>{--ADDY--}</STRONG></TD>
+       <TD width="10%" align="center" class="admin_header bottom2 right2"><STRONG>{--ACCOUNT_STATUS--}</STRONG></TD>
+       <TD width="10%" align="center" class="admin_header bottom2"><STRONG>{--MEMBER_JOINED--}</STRONG></TD>
+</TR>
+$content[rows]
+<TR>
+       <TD colspan="6" class="admin_footer" style="padding-top: 7px; padding-bottom: 7px">
+               <FONT class="admin_note">{--ADMIN_LIST_REFERRALS_NOTE--}</FONT>
+       </TD>
+</TR>
 </TABLE>
diff --git a/templates/de/html/admin/admin_list_refs_level.tpl b/templates/de/html/admin/admin_list_refs_level.tpl
new file mode 100644 (file)
index 0000000..45cd439
--- /dev/null
@@ -0,0 +1,13 @@
+<TABLE border="0" cellspacing="0" cellpadding="0" width="99%" class="admin_table dashed">
+<TR>
+       <TD colspan="6" class="admin_title" height="30">
+               <STRONG>{--ADMIN_LIST_REFERRALS_LEVEL_1--}<U>$content[level]</U>{--ADMIN_LIST_REFERRALS_LEVEL_2--}</STRONG>
+       </TD>
+</TR>
+$content[rows]
+<TR>
+       <TD colspan="6" class="admin_footer seperator">
+               &nbsp;
+       </TD>
+</TR>
+</TABLE>
index 7ba25b3..fba5cfd 100644 (file)
@@ -1,9 +1,7 @@
 <TR>
-       <TD align="center" class="bottom2 right2 switch_sw$content[sw]"
-               align="right" valign="top">$content[u_link]&nbsp;&nbsp;</TD>
+       <TD align="center" class="bottom2 right2 switch_sw$content[sw]" align="right" valign="top">$content[u_link]&nbsp;&nbsp;</TD>
        <TD align="center" class="bottom2 right2 switch_sw$content[sw]">$content[refs_link]</TD>
-       <TD class="bottom2 right2 switch_sw$content[sw]">&nbsp;$content[gender]
-       $content[surname] $content[family]</TD>
+       <TD class="bottom2 right2 switch_sw$content[sw]">&nbsp;$content[gender] $content[surname] $content[family]</TD>
        <TD class="bottom2 right2 switch_sw$content[sw]">&nbsp;$content[email]</TD>
        <TD align="center" class="bottom2 right2 switch_sw$content[sw]">&nbsp;$content[status]</TD>
        <TD class="bottom2 switch_sw$content[sw]">&nbsp;$content[registered]</TD>
diff --git a/templates/de/html/ext/ext_refback.tpl b/templates/de/html/ext/ext_refback.tpl
new file mode 100644 (file)
index 0000000..9302d8e
--- /dev/null
@@ -0,0 +1,8 @@
+Ref-Back ist ein Prozentsatz, der von dem Referal-Guthaben Ihrer Mitglieder
+abgezogen wird und dem geworbenen, der gerade {!POINTS!} erwirtschaftet,
+gutgeschrieben. Sobald das Mitglied Ref-Back f&uuml;r seine Referals &auml;ndert,
+erh&auml;lt der Referal eine Mail zugesandt, wie diese jetzt eingestellt ist.<br />
+<br />
+Das Mitglied kann sehen, wo es welche Referal-<strong>Verg&uuml;tungen</strong>
+an seine Referals gegeben hat. Es ist in sp&auml;teren Versionen eine &Uuml;bersicht
+f&uuml;r erhaltene Ref-Back-Gutschriften geplant.
diff --git a/templates/de/html/member/member_refback_edit.tpl b/templates/de/html/member/member_refback_edit.tpl
new file mode 100644 (file)
index 0000000..d5264fb
--- /dev/null
@@ -0,0 +1,27 @@
+<form action="{!URL!}/modules.php?module=login&amp;what=refback" method="post" style="padding-bottom:10px">
+<input type="hidden" name="id" value="$content[id]" />
+<table border="0" cellspacing="0" cellpadding="0" class="member_table dashed" width="400">
+<tr>
+       <td align="center" class="member_header bottom2" colspan="2">
+               <strong>{--MEMBER_REFBACK_EDIT_TITLE--}</strong><br />
+               <span class="member_note">{--MEMBER_REFBACK_REFID--}: $content[refid]</span>
+       </td>
+</tr>
+<tr><td colspan="2" class="seperator" height="5">&nbsp;</td></tr>
+<tr>
+       <td width="60%" align="right" style="padding-right:5px">
+               {--MEMBER_REFBACK_PERCENTS--}:
+       </td>
+       <td width="40%">
+               <input type="text" class="member_normal" name="percents" size="6" maxlength="7" value="$content[refback]" /> %
+       </td>
+</tr>
+<tr><td colspan="2" class="seperator bottom2" height="6">&nbsp;</td></tr>
+<tr>
+       <td align="center" class="member_footer" colspan="2">
+               <input type="reset" class="member_reset" value="{--CLEAR_FORM--}" />
+               <input type="submit" class="member_submit" name="edit" value="{--MEMBER_REFBACK_EDIT_SUBMIT--}" />
+       </td>
+</tr>
+</table>
+</form>
diff --git a/templates/de/html/member/member_refback_list.tpl b/templates/de/html/member/member_refback_list.tpl
new file mode 100644 (file)
index 0000000..07835f7
--- /dev/null
@@ -0,0 +1,14 @@
+<table border="0" cellspacing="0" cellpadding="0" class="member_table dashed" width="740">
+<tr>
+       <td align="center" class="member_header bottom2">
+               <strong>{--MEMBER_REFBACK_TITLE--}</strong>
+       </td>
+</tr>
+<tr><td class="seperator" height="5">&nbsp;</td></tr>
+$content
+<tr>
+       <td align="center" class="member_footer top2">
+               <span class="member_note">{--MEMBER_REFBACK_NOTE--}</span>
+       </td>
+</tr>
+</table>
diff --git a/templates/de/html/member/member_refback_list_level.tpl b/templates/de/html/member/member_refback_list_level.tpl
new file mode 100644 (file)
index 0000000..45e03f9
--- /dev/null
@@ -0,0 +1,35 @@
+<tr>
+       <td align="center">
+<table border="0" cellspacing="0" cellpadding="0" class="member_table dashed" width="730">
+<tr>
+       <td align="center" class="member_header" colspan="5">
+               <strong>{--MEMBER_REFBACK_LIST_TITLE_1--}$content[level]{--MEMBER_REFBACK_LIST_TITLE_2--}$content[percents]{--MEMBER_REFBACK_LIST_TITLE_3--}</strong>
+       </td>
+</tr>
+<tr>
+       <td align="center" class="member_title2 bottom2 right2">
+               <strong>{--MEMBER_REFBACK_REFID--}</strong>
+       </td>
+       <td align="center" class="member_title2 bottom2 right2">
+               <strong>{--MEMBER_REFBACK_STATUS--}</strong>
+       </td>
+       <td align="center" class="member_title2 bottom2 right2">
+               <strong>{--MEMBER_REFBACK_PERCENTS--}</strong>
+       </td>
+       <td align="center" class="member_title2 bottom2 right2">
+               <strong>{--MEMBER_REFBACK_POINTS--}</strong>
+       </td>
+       <td align="center" class="member_title2 bottom2" width="142">
+               <strong>{--MEMBER_REFBACK_EDIT--}</strong>
+       </td>
+</tr>
+$content[rows]
+<tr>
+       <td align="center" class="member_footer" colspan="5">
+               <span class="member_note">{--MEMBER_REFBACK_COUNTER_1--}$content[counter]{--MEMBER_REFBACK_COUNTER_2--}</span>
+       </td>
+</tr>
+</table>
+       </td>
+</tr>
+<tr><td class="seperator" height="5">&nbsp;</td></tr>
diff --git a/templates/de/html/member/member_refback_list_row.tpl b/templates/de/html/member/member_refback_list_row.tpl
new file mode 100644 (file)
index 0000000..64456ca
--- /dev/null
@@ -0,0 +1,20 @@
+<tr>
+       <td align="center" class="switch_sw$content[sw] bottom2 right2">
+               $content[refid] ($content[nickname])
+       </td>
+       <td align="center" class="switch_sw$content[sw] bottom2 right2">
+               $content[status]
+       </td>
+       <td align="center" class="switch_sw$content[sw] bottom2 right2">
+               $content[refback] %
+       </td>
+       <td align="center" class="switch_sw$content[sw] bottom2 right2">
+               $content[points] {!POINTS!}
+       </td>
+       <td align="center" class="switch_sw$content[sw] bottom2" style="padding:3px">
+               <form action="{!URL!}/modules.php?module=login&amp;what=refback" method="post" style="paddin-bottom:0px">
+                       <input type="hidden" name="id" value="$content[id]" />
+                       <input type="submit" name="edit" class="member_submit" value="{--MEMBER_REFBACK_EDIT_SUBMIT--}" />
+               </form>
+       </td>
+</tr>
diff --git a/templates/de/html/member/member_refback_list_row_deleted.tpl b/templates/de/html/member/member_refback_list_row_deleted.tpl
new file mode 100644 (file)
index 0000000..257b0c0
--- /dev/null
@@ -0,0 +1,20 @@
+<tr>
+       <td align="center" class="switch_sw$content[sw] bottom2 right2">
+               $content[refid] ($content[nickname])
+       </td>
+       <td align="center" class="switch_sw$content[sw] bottom2 right2">
+               $content[status]
+       </td>
+       <td align="center" class="switch_sw$content[sw] bottom2 right2">
+               $content[refback] %
+       </td>
+       <td align="center" class="switch_sw$content[sw] bottom2 right2">
+               $content[points] {!POINTS!}
+       </td>
+       <td align="center" class="switch_sw$content[sw] bottom2" style="padding:3px">
+               <form style="paddin-bottom:0px">
+                       <input type="button" name="edit" class="member_submit disabled" title="{--MEMBER_REFBACK_DELETED_TITLE--}"
+                        disabled="disabled" value="{--MEMBER_REFBACK_DELETED_SUBMIT--}" />
+               </form>
+       </td>
+</tr>