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
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
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
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
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
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
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
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);
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
// 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
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;
global $cacheInstance, $_CONFIG;
$SQLs = array();
+ // Extensions are never active by default
+ $EXT_ALWAYS_ACTIVE = "N";
+
// By default no SQL has been executed
$sqlRan = false;
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) {
// 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__);
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))) {
$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}");
// 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
}
// Return result
- //* DEBUG: */ echo __FUNCTION__.": ret={$ret}<br />\n";
+ //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret={$ret}<br />\n";
return $ret;
}
//
// Language file prefix
$EXT_LANG_PREFIX = "active";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "admins";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "admintheme";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
default: // Do stuff when extension is loaded
break;
}
+
// Language file prefix
$EXT_LANG_PREFIX = "admintheme";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "bank";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "beg";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "birthday";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "bonus";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
$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;
default: // Do stuff when extension is loaded
break;
}
+
// Language file prefix
$EXT_LANG_PREFIX = "demo";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "doubler";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "holiday";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
);
break;
}
+
// Language file prefix
$EXT_LANG_PREFIX = "html_mail";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "mailid";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
default: // Do stuff when extension is loaded
break;
}
+
// Language file prefix
$EXT_LANG_PREFIX = "mods";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "mydata";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "newsletter";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "nickname";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
default: // Do stuff when extension is loaded
break;
}
+
// Language file prefix
$EXT_LANG_PREFIX = "online";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "order";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
default: // Do stuff when extension is loaded
break;
}
+
// Language file prefix
$EXT_LANG_PREFIX = "payout";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "primera";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
// Init array
global $primera;
$primera = array();
// Language file prefix
$EXT_LANG_PREFIX = "profile";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "rallye";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
--- /dev/null
+<?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-Ü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";
+
+//
+?>
// Language file prefix
$EXT_LANG_PREFIX = "register";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
default: // Do stuff when extension is loaded
break;
}
+
// Language file prefix
$EXT_LANG_PREFIX = "repair";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "rewrite";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "safe";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "sponsor";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
}
// 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)
{
(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
$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)";
$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 "theme" 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','Ändern Sie Titel, Freigaben usw. an den Themes. Sie können bis auf das Standart-Theme "default" auch Themes aus der Datenbank entfernen. Vorher sollten Sie es jedoch vom Server lö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,
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";
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ützt nun detailierte Referal-Ü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ü 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önnen nun fünf Stelle hinter dem Komma sein.";
break;
}
break;
default: // Do stuff when extension is loaded
break;
}
+
// Language file prefix
$EXT_LANG_PREFIX = "support";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "surfbar";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "task";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "theme";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "top10";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "transfer";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Language file prefix
$EXT_LANG_PREFIX = "wernis";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
// Init array
global $WERNIS;
$WERNIS = array();
// Language file prefix
$EXT_LANG_PREFIX = "yoomedia";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>
// Free result
SQL_FREERESULT($result);
- }
+ } // END - if
// Generate date/time string
$date_time = MAKE_DATETIME(time(), "1");
// 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))."\");";
} 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)) {
// 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()) {
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... ;-)
$ret = ACCOUNT_LOCKED;
break;
+ case "":
+ case null:
+ $ret = ACCOUNT_DELETED;
+ break;
+
default:
$ret = UNKNOWN_STATUS_1.$status.UNKNOWN_STATUS_2;
break;
} // 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
$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
// 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;
}
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));
$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
} // 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 {
// 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
// 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
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
}
$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);
// 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")
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) {
$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
// 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
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
define('ACCOUNT_UNCONFIRMED', "<SPAN class=\"admin_failed\">Unbestätigt</SPAN>");
define('ACCOUNT_CONFIRMED', "<SPAN class=\"admin_green\">Bestätigt</SPAN>");
define('ACCOUNT_LOCKED', "Gesperrt");
+define('ACCOUNT_DELETED', "Gelö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ätigten Mitglieder-Accounts auflisten");
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
--- /dev/null
+<?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ü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 Übersicht für Referal-Ebene <u>");
+define('MEMBER_REFBACK_LIST_TITLE_2', "</u> (<u>");
+define('MEMBER_REFBACK_LIST_TITLE_3', "</u>% Ref-Vergütung)");
+define('MEMBER_REFBACK_TITLE', "Ref-Back und Referal-Übersicht");
+define('MEMBER_REFBACK_NOTE', "Hier kö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ä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ütung");
+define('MEMBER_REFBACK_EDIT', "Einstellen");
+define('MEMBER_REFBACK_EDIT_TITLE', "Ref-Back für ausgewähltes Mitglied einstellen:");
+define('MEMBER_REFBACK_DELETED_SUBMIT', "Nicht möglich");
+define('MEMBER_REFBACK_DELETED_TITLE', "Einstellen von Ref-Back ist für gelöschte Mitglieder nicht mö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önnen Ref-Backs einstellen.");
+define('MEMBER_REFBACK_ERROR_INVALID_ID_NUMBER', "Ungültige ID-Nummer übertragen.");
+define('MEMBER_REFBACK_ERROR_INVALID_PERCENTAGE', "Prozentsatz ungültig. 0 bis 100 sind gültige Werte.");
+define('MEMBER_REFBACK_ERROR_ID_MISMATCH', "Die ausgewählte Ref-Back ID gehö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ültig.");
+
+//
+?>
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
************************************************************************/
// 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);
}
$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);
}
}
}
} else {
// Cannot create file
- ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+ ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
}
}
else
{
// Cannot create file
- ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+ ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
}
}
}
} 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);
}
}
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);
}
}
}
} else {
// Cannot write to cache!
- ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+ ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
}
}
}
} else {
// Cannot write to cache!
- ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
+ ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
}
}
@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);
}
}
--- /dev/null
+<?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;
+}
+//
+?>
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__);
//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__);
$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)))) {
// 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__);
'sw' => $SW,
'id' => $id,
'lvl' => $lvl,
- 'per' => $perc,
+ 'per' => TRANSLATE_COMMA($perc),
);
// Load row template and switch color
'sw' => $SW,
'id' => $id,
'lvl' => $lvl,
- 'per' => $perc,
+ 'per' => TRANSLATE_COMMA($perc),
);
// Load row template and switch color
'sw' => $SW,
'id' => $id,
'lvl' => $lvl,
- 'per' => $perc,
+ 'per' => TRANSLATE_COMMA($perc),
);
// Load row template and switch color
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
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)
{
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
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__);
// 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
--- /dev/null
+<?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);
+
+//
+?>
// 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)) {
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
}
// Everthing is fine?
- if (SQL_AFFECTEDROWS() == 0) {
+ if (SQL_AFFECTEDROWS() < 1) {
// Something bad happend!
return "major";
} // END - if
$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);
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"))));
}
* 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)) {
$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
// 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
// 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) {
// 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
// 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) {
// 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__);
}
// 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])) {
// 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");
// Free memory
SQL_FREERESULT($result);
}
-
//
?>
* 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>
`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
-<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>
--- /dev/null
+<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">
+
+ </TD>
+</TR>
+</TABLE>
<TR>
- <TD align="center" class="bottom2 right2 switch_sw$content[sw]"
- align="right" valign="top">$content[u_link] </TD>
+ <TD align="center" class="bottom2 right2 switch_sw$content[sw]" align="right" valign="top">$content[u_link] </TD>
<TD align="center" class="bottom2 right2 switch_sw$content[sw]">$content[refs_link]</TD>
- <TD class="bottom2 right2 switch_sw$content[sw]"> $content[gender]
- $content[surname] $content[family]</TD>
+ <TD class="bottom2 right2 switch_sw$content[sw]"> $content[gender] $content[surname] $content[family]</TD>
<TD class="bottom2 right2 switch_sw$content[sw]"> $content[email]</TD>
<TD align="center" class="bottom2 right2 switch_sw$content[sw]"> $content[status]</TD>
<TD class="bottom2 switch_sw$content[sw]"> $content[registered]</TD>
--- /dev/null
+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ür seine Referals ändert,
+erhält der Referal eine Mail zugesandt, wie diese jetzt eingestellt ist.<br />
+<br />
+Das Mitglied kann sehen, wo es welche Referal-<strong>Vergütungen</strong>
+an seine Referals gegeben hat. Es ist in späteren Versionen eine Übersicht
+für erhaltene Ref-Back-Gutschriften geplant.
--- /dev/null
+<form action="{!URL!}/modules.php?module=login&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"> </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"> </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>
--- /dev/null
+<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"> </td></tr>
+$content
+<tr>
+ <td align="center" class="member_footer top2">
+ <span class="member_note">{--MEMBER_REFBACK_NOTE--}</span>
+ </td>
+</tr>
+</table>
--- /dev/null
+<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"> </td></tr>
--- /dev/null
+<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&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>
--- /dev/null
+<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>