From dfaa8c1675da4071ea451406a6f6fedd4c568416 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 29 Sep 2008 22:38:31 +0000 Subject: [PATCH] Refback extension in alpha phase finished, users can give refback to all refs in all levels --- .gitattributes | 11 + inc/databases.php | 2 +- inc/db/lib-mysql3.php | 2 +- inc/extensions.php | 22 +- inc/extensions/ext-active.php | 3 - inc/extensions/ext-admins.php | 3 - inc/extensions/ext-admintheme1.php | 3 - inc/extensions/ext-admintheme_default.php | 4 +- inc/extensions/ext-bank.php | 3 - inc/extensions/ext-beg.php | 3 - inc/extensions/ext-birthday.php | 3 - inc/extensions/ext-bonus.php | 3 - inc/extensions/ext-cache.php | 2 +- inc/extensions/ext-demo.php | 4 +- inc/extensions/ext-doubler.php | 3 - inc/extensions/ext-holiday.php | 3 - inc/extensions/ext-html_mail.php | 4 +- inc/extensions/ext-mailid.php | 3 - inc/extensions/ext-mods.php | 4 +- inc/extensions/ext-mydata.php | 3 - inc/extensions/ext-newsletter.php | 3 - inc/extensions/ext-nickname.php | 3 - inc/extensions/ext-online.php | 4 +- inc/extensions/ext-order.php | 3 - inc/extensions/ext-payout.php | 4 +- inc/extensions/ext-primera.php | 3 - inc/extensions/ext-profile.php | 3 - inc/extensions/ext-rallye.php | 3 - inc/extensions/ext-refback.php | 115 ++++++ inc/extensions/ext-register.php | 3 - inc/extensions/ext-repair.php | 4 +- inc/extensions/ext-rewrite.php | 3 - inc/extensions/ext-safe.php | 3 - inc/extensions/ext-sponsor.php | 3 - inc/extensions/ext-sql_patches.php | 44 +- inc/extensions/ext-support.php | 4 +- inc/extensions/ext-surfbar.php | 3 - inc/extensions/ext-task.php | 3 - inc/extensions/ext-theme.php | 3 - inc/extensions/ext-top10.php | 3 - inc/extensions/ext-transfer.php | 3 - inc/extensions/ext-wernis.php | 3 - inc/extensions/ext-yoomedia.php | 3 - inc/functions.php | 55 +-- inc/gen_refback.php | 5 +- inc/header.php | 16 +- inc/language/active_de.php | 3 +- inc/language/admins_de.php | 3 +- inc/language/autopurge_de.php | 3 +- inc/language/bank_de.php | 2 +- inc/language/beg_de.php | 3 +- inc/language/birthday_de.php | 3 +- inc/language/bonus_de.php | 3 +- inc/language/cache_de.php | 2 +- inc/language/country_de.php | 3 +- inc/language/de.php | 4 +- inc/language/doubler_de.php | 3 +- inc/language/holiday_de.php | 3 +- inc/language/html_mail_de.php | 3 +- inc/language/install_de.php | 3 +- inc/language/mailid_de.php | 3 +- inc/language/maintenance_de.php | 3 +- inc/language/mediadata_de.php | 3 +- inc/language/mods_de.php | 3 +- inc/language/newsletter_de.php | 3 +- inc/language/nickname_de.php | 3 +- inc/language/online_de.php | 3 +- inc/language/optimize_de.php | 3 +- inc/language/order_de.php | 3 +- inc/language/other_de.php | 3 +- inc/language/payout_de.php | 3 +- inc/language/primera_de.php | 2 +- inc/language/rallye_de.php | 3 +- inc/language/refback_de.php | 70 ++++ inc/language/register_de.php | 3 +- inc/language/repair_de.php | 3 +- inc/language/rewrite_de.php | 3 +- inc/language/sponsor_de.php | 3 +- inc/language/support_de.php | 3 +- inc/language/surfbar_de.php | 2 +- inc/language/task_de.php | 3 +- inc/language/theme_de.php | 3 +- inc/language/top10_de.php | 3 +- inc/language/transfer_de.php | 3 +- inc/language/user_de.php | 3 +- inc/language/wernis_de.php | 2 +- inc/libs/cache_functions.php | 18 +- inc/libs/refback_functions.php | 379 ++++++++++++++++++ inc/libs/surfbar_functions.php | 4 +- inc/modules/admin/admin-inc.php | 2 +- inc/modules/admin/what-config_points.php | 9 +- inc/modules/admin/what-extensions.php | 10 +- inc/modules/admin/what-memedit.php | 6 +- inc/modules/guest/what-register.php | 6 + inc/modules/member/what-points.php | 4 +- inc/modules/member/what-refback.php | 145 +++++++ inc/mysql-connect.php | 4 +- inc/mysql-manager.php | 274 ++----------- inc/security.php | 6 +- install/tables.sql | 1 - templates/de/html/admin/admin_list_refs.tpl | 40 +- .../de/html/admin/admin_list_refs_level.tpl | 13 + .../de/html/admin/admin_list_refs_row.tpl | 6 +- templates/de/html/ext/ext_refback.tpl | 8 + .../de/html/member/member_refback_edit.tpl | 27 ++ .../de/html/member/member_refback_list.tpl | 14 + .../html/member/member_refback_list_level.tpl | 35 ++ .../html/member/member_refback_list_row.tpl | 20 + .../member_refback_list_row_deleted.tpl | 20 + 109 files changed, 1081 insertions(+), 543 deletions(-) create mode 100644 inc/extensions/ext-refback.php create mode 100644 inc/language/refback_de.php create mode 100644 inc/libs/refback_functions.php create mode 100644 inc/modules/member/what-refback.php create mode 100644 templates/de/html/admin/admin_list_refs_level.tpl create mode 100644 templates/de/html/ext/ext_refback.tpl create mode 100644 templates/de/html/member/member_refback_edit.tpl create mode 100644 templates/de/html/member/member_refback_list.tpl create mode 100644 templates/de/html/member/member_refback_list_level.tpl create mode 100644 templates/de/html/member/member_refback_list_row.tpl create mode 100644 templates/de/html/member/member_refback_list_row_deleted.tpl diff --git a/.gitattributes b/.gitattributes index efd717ce99..51a12c4cc3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -126,6 +126,7 @@ inc/extensions/ext-payout.php -text inc/extensions/ext-primera.php -text inc/extensions/ext-profile.php -text inc/extensions/ext-rallye.php -text +inc/extensions/ext-refback.php -text inc/extensions/ext-register.php -text inc/extensions/ext-repair.php -text inc/extensions/ext-rewrite.php -text @@ -180,6 +181,7 @@ inc/language/other_de.php -text inc/language/payout_de.php -text inc/language/primera_de.php -text inc/language/rallye_de.php -text +inc/language/refback_de.php -text inc/language/register_de.php -text inc/language/repair_de.php -text inc/language/rewrite_de.php -text @@ -209,6 +211,7 @@ inc/libs/order_functions.php -text inc/libs/payout_functions.php -text inc/libs/primera_functions.php -text inc/libs/rallye_functions.php -text +inc/libs/refback_functions.php -text inc/libs/register_functions.php -text inc/libs/rewrite_functions.php -text inc/libs/security_functions.php -text @@ -459,6 +462,7 @@ inc/modules/member/what-payout.php -text inc/modules/member/what-points.php -text inc/modules/member/what-primera.php -text inc/modules/member/what-rallyes.php -text +inc/modules/member/what-refback.php -text inc/modules/member/what-reflinks.php -text inc/modules/member/what-sponsor.php -text inc/modules/member/what-stats.php -text @@ -952,6 +956,7 @@ templates/de/html/admin/admin_list_rallyes.tpl -text templates/de/html/admin/admin_list_rallyes_row.tpl -text templates/de/html/admin/admin_list_rallyes_row2.tpl -text templates/de/html/admin/admin_list_refs.tpl -text +templates/de/html/admin/admin_list_refs_level.tpl -text templates/de/html/admin/admin_list_refs_row.tpl -text templates/de/html/admin/admin_list_sponsor.tpl -text templates/de/html/admin/admin_list_sponsor_details.tpl -text @@ -1137,6 +1142,7 @@ templates/de/html/ext/ext_payout.tpl -text templates/de/html/ext/ext_primera.tpl -text templates/de/html/ext/ext_profile.tpl -text templates/de/html/ext/ext_rallye.tpl -text +templates/de/html/ext/ext_refback.tpl -text templates/de/html/ext/ext_register.tpl -text templates/de/html/ext/ext_repair.tpl -text templates/de/html/ext/ext_rewrite.tpl -text @@ -1304,6 +1310,11 @@ templates/de/html/member/member_primera_mode_list.tpl -text templates/de/html/member/member_primera_mode_list_row.tpl -text templates/de/html/member/member_primera_mode_pay.tpl -text templates/de/html/member/member_receive_table.tpl -text +templates/de/html/member/member_refback_edit.tpl -text +templates/de/html/member/member_refback_list.tpl -text +templates/de/html/member/member_refback_list_level.tpl -text +templates/de/html/member/member_refback_list_row.tpl -text +templates/de/html/member/member_refback_list_row_deleted.tpl -text templates/de/html/member/member_reflinks_row.tpl -text templates/de/html/member/member_reflinks_table.tpl -text templates/de/html/member/member_stats_pool.tpl -text diff --git a/inc/databases.php b/inc/databases.php index fd4c517cca..f588661844 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "412"); +define('CURR_SVN_REVISION', "413"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 1a24f39289..fe033aeb96 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -285,7 +285,7 @@ function SQL_ESCAPE($str, $secureString=true,$strip=true) { if (function_exists('mysql_real_escape_string')) { // The new and improved version - //* DEBUG: */ echo __FUNCTION__.":str={$str}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):str={$str}
\n"; return mysql_real_escape_string($str, $link); } elseif (function_exists('mysql_escape_string')) { // The obsulete function diff --git a/inc/extensions.php b/inc/extensions.php index 1851e5d4a8..64e4c48699 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -57,6 +57,7 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false) // Does this extension exists? if (FILE_READABLE($file)) { // Extension was found so we can load it in registration mode + $EXT_ALWAYS_ACTIVE = "N"; require($file); // And run possible updates @@ -99,6 +100,7 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false) if (FILE_READABLE($file)) { // File exists so let's load it $VER_BACKUP = $EXT_VERSION; + $EXT_ALWAYS_ACTIVE = "N"; require($file); $EXT_VERSION = $VER_BACKUP; @@ -245,6 +247,9 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) { global $cacheInstance, $_CONFIG; $SQLs = array(); + // Extensions are never active by default + $EXT_ALWAYS_ACTIVE = "N"; + // By default no SQL has been executed $sqlRan = false; @@ -256,14 +261,14 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) { if (empty($ext_name)) return false; // Load extension in detected mode - //* DEBUG: */ echo __FUNCTION__.":ext_name[{$id}]={$ext_name}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):ext_name[{$id}]={$ext_name}
\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)."
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):SQLs::count=".count($SQLs)."
\n"; if ((is_array($SQLs) && (sizeof($SQLs) > 0))) { // Run SQL commands... foreach ($SQLs as $sql) { @@ -273,7 +278,7 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) { // Is there still an SQL query? if (!empty($sql)) { // Do we have an "ALTER TABLE" command? - //* DEBUG: */ echo __FUNCTION__.":SQL={$SQL}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):SQL={$SQL}
\n"; if (substr(strtolower($sql), 0, 11) == "alter table") { // Analyse the alteration command SQL_ALTER_TABLE($sql, __FILE__, __LINE__); @@ -294,7 +299,7 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) { array($id), __FILE__, __LINE__); } // END - if - //* DEBUG: */ echo __FUNCTION__.":mode={$EXT_LOAD_MODE}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):mode={$EXT_LOAD_MODE}
\n"; // Remove cache file(s) if extension is active if (((EXT_IS_ACTIVE("cache")) || (GET_EXT_VERSION("cache") != "")) && (((SQL_AFFECTEDROWS() == 1) && ($EXT_LOAD_MODE == "remove")) || ($sqlRan === true))) { @@ -356,9 +361,6 @@ function EXT_IS_ACTIVE ($ext_name) { $cacheArray['extensions']['ext_active'][$ext_name] = "N"; } - // Create FQFN for extension file - $inc = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name); - // Debug message //DEBUG_LOG(__FUNCTION__.": ext_name={$ext_name},active={$active}"); @@ -372,12 +374,12 @@ function GET_EXT_VERSION ($ext_name) { // Extensions are all inactive during installation if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return ""; - //* DEBUG: */ echo __FUNCTION__.": ext_name={$ext_name}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."): ext_name={$ext_name}
\n"; // Is the cache written? if (!empty($cacheArray['extensions']['ext_version'][$ext_name])) { // Load data from cache - //* DEBUG: */ echo __FUNCTION__.": CACHE!
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."): CACHE!
\n"; $ret = $cacheArray['extensions']['ext_version'][$ext_name]; // Count cache hits @@ -394,7 +396,7 @@ function GET_EXT_VERSION ($ext_name) { } // Return result - //* DEBUG: */ echo __FUNCTION__.": ret={$ret}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."): ret={$ret}
\n"; return $ret; } // diff --git a/inc/extensions/ext-active.php b/inc/extensions/ext-active.php index 82f8c63625..d3d013a19f 100644 --- a/inc/extensions/ext-active.php +++ b/inc/extensions/ext-active.php @@ -127,8 +127,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "active"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index 2fd08526e0..8b389d011a 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -292,8 +292,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "admins"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-admintheme1.php b/inc/extensions/ext-admintheme1.php index 1118d05192..4780f01029 100644 --- a/inc/extensions/ext-admintheme1.php +++ b/inc/extensions/ext-admintheme1.php @@ -87,8 +87,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "admintheme"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-admintheme_default.php b/inc/extensions/ext-admintheme_default.php index 9d997f8874..6e3c8befc0 100644 --- a/inc/extensions/ext-admintheme_default.php +++ b/inc/extensions/ext-admintheme_default.php @@ -84,11 +84,9 @@ case "update": // Update an extension default: // Do stuff when extension is loaded break; } + // Language file prefix $EXT_LANG_PREFIX = "admintheme"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-bank.php b/inc/extensions/ext-bank.php index 24e410c436..12f02fabf1 100644 --- a/inc/extensions/ext-bank.php +++ b/inc/extensions/ext-bank.php @@ -191,8 +191,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "bank"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php index 9adc3583d9..3b1daa75c8 100644 --- a/inc/extensions/ext-beg.php +++ b/inc/extensions/ext-beg.php @@ -271,8 +271,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "beg"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-birthday.php b/inc/extensions/ext-birthday.php index 94f1ae0667..17d538640a 100644 --- a/inc/extensions/ext-birthday.php +++ b/inc/extensions/ext-birthday.php @@ -201,8 +201,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "birthday"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index 913982ff5b..9e22079fe4 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -558,8 +558,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "bonus"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php index b57a15f2b3..f1db9c8cca 100644 --- a/inc/extensions/ext-cache.php +++ b/inc/extensions/ext-cache.php @@ -200,7 +200,7 @@ default: // Do stuff when extension is loaded $cacheInstance = new mxchange_cache($_CONFIG['cache_update'], PATH."inc/".$_CONFIG['cache_path'], $_CONFIG['cache_tested']); if ($cacheInstance->getStatus() != "done") { // Failed to initialize cache sustem - ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_INITIALIZE); + ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_INITIALIZE); } } break; diff --git a/inc/extensions/ext-demo.php b/inc/extensions/ext-demo.php index 916b0ad196..220a5e296e 100644 --- a/inc/extensions/ext-demo.php +++ b/inc/extensions/ext-demo.php @@ -81,11 +81,9 @@ case "update": // Update an extension default: // Do stuff when extension is loaded break; } + // Language file prefix $EXT_LANG_PREFIX = "demo"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index c2bf7992cd..edd3ee345e 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -245,8 +245,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "doubler"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index 5a8c2a9823..1d6a3187ab 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -229,8 +229,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "holiday"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-html_mail.php b/inc/extensions/ext-html_mail.php index aa270798f1..9c223e3f49 100644 --- a/inc/extensions/ext-html_mail.php +++ b/inc/extensions/ext-html_mail.php @@ -163,11 +163,9 @@ default: // Do stuff when extension is loaded ); break; } + // Language file prefix $EXT_LANG_PREFIX = "html_mail"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-mailid.php b/inc/extensions/ext-mailid.php index 4848fd75d1..be23ece91c 100644 --- a/inc/extensions/ext-mailid.php +++ b/inc/extensions/ext-mailid.php @@ -242,8 +242,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "mailid"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-mods.php b/inc/extensions/ext-mods.php index 506759b45e..01f5954c3a 100644 --- a/inc/extensions/ext-mods.php +++ b/inc/extensions/ext-mods.php @@ -115,11 +115,9 @@ case "update": // Update an extension default: // Do stuff when extension is loaded break; } + // Language file prefix $EXT_LANG_PREFIX = "mods"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-mydata.php b/inc/extensions/ext-mydata.php index 0eaf6a2191..32b1f1efa6 100644 --- a/inc/extensions/ext-mydata.php +++ b/inc/extensions/ext-mydata.php @@ -169,8 +169,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "mydata"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index 89757dba25..648cdb1cdd 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -175,8 +175,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "newsletter"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-nickname.php b/inc/extensions/ext-nickname.php index f226afa7cf..3ef849f832 100644 --- a/inc/extensions/ext-nickname.php +++ b/inc/extensions/ext-nickname.php @@ -210,8 +210,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "nickname"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-online.php b/inc/extensions/ext-online.php index 196d3cfe6b..6b1fa94f44 100644 --- a/inc/extensions/ext-online.php +++ b/inc/extensions/ext-online.php @@ -114,11 +114,9 @@ case "update": // Update an extension default: // Do stuff when extension is loaded break; } + // Language file prefix $EXT_LANG_PREFIX = "online"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index 56d730d0bd..5a7d2a924f 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -314,8 +314,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "order"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-payout.php b/inc/extensions/ext-payout.php index c11afdca26..be3ef40a8e 100644 --- a/inc/extensions/ext-payout.php +++ b/inc/extensions/ext-payout.php @@ -241,11 +241,9 @@ case "update": // Update an extension default: // Do stuff when extension is loaded break; } + // Language file prefix $EXT_LANG_PREFIX = "payout"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-primera.php b/inc/extensions/ext-primera.php index 8e2253d0e5..11ea3b372c 100644 --- a/inc/extensions/ext-primera.php +++ b/inc/extensions/ext-primera.php @@ -116,9 +116,6 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "primera"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // Init array global $primera; $primera = array(); diff --git a/inc/extensions/ext-profile.php b/inc/extensions/ext-profile.php index 42c499227e..c8da12066b 100644 --- a/inc/extensions/ext-profile.php +++ b/inc/extensions/ext-profile.php @@ -130,8 +130,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "profile"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php index 4424c369a3..5d34c754f4 100644 --- a/inc/extensions/ext-rallye.php +++ b/inc/extensions/ext-rallye.php @@ -348,8 +348,5 @@ LIMIT 1", __FILE__, __LINE__); // Language file prefix $EXT_LANG_PREFIX = "rallye"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-refback.php b/inc/extensions/ext-refback.php new file mode 100644 index 0000000000..446d0d6a52 --- /dev/null +++ b/inc/extensions/ext-refback.php @@ -0,0 +1,115 @@ + diff --git a/inc/extensions/ext-register.php b/inc/extensions/ext-register.php index a179131f51..2090697556 100644 --- a/inc/extensions/ext-register.php +++ b/inc/extensions/ext-register.php @@ -328,8 +328,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "register"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-repair.php b/inc/extensions/ext-repair.php index 21935c7a17..20e442d81c 100644 --- a/inc/extensions/ext-repair.php +++ b/inc/extensions/ext-repair.php @@ -111,11 +111,9 @@ case "update": // Update an extension default: // Do stuff when extension is loaded break; } + // Language file prefix $EXT_LANG_PREFIX = "repair"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-rewrite.php b/inc/extensions/ext-rewrite.php index fc04a655f1..d0741fd8ae 100644 --- a/inc/extensions/ext-rewrite.php +++ b/inc/extensions/ext-rewrite.php @@ -141,8 +141,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "rewrite"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-safe.php b/inc/extensions/ext-safe.php index 759bce29ee..690d6835ea 100644 --- a/inc/extensions/ext-safe.php +++ b/inc/extensions/ext-safe.php @@ -84,8 +84,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "safe"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index 21401127dd..262e75c16a 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -432,8 +432,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "sponsor"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 1cfd76056c..11c808fc3b 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -38,13 +38,13 @@ if (!defined('__SECURITY')) { } // Version number -$EXT_VERSION = "0.5.0"; +$EXT_VERSION = "0.5.2"; // Auto-set extension version if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION; // Version history array (add more with , "0.1" and so on) -$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0"); +$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0", "0.5.1", "0.5.2"); switch ($EXT_LOAD_MODE) { @@ -76,7 +76,8 @@ what='stats2' OR (action='stats' AND (what='' OR what IS NULL)) OR (action='extras' AND (what='' OR what IS NULL)) OR (action='rals' AND (what='' OR what IS NULL)) OR -(action='account' AND (what='' OR what IS NULL)) LIMIT 8"; +(action='account' AND (what='' OR what IS NULL)) +LIMIT 8"; $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='main' WHERE action='stats' OR action='extras' OR @@ -85,12 +86,9 @@ action='account'"; $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las"; $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data"; $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats"; - $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_refs"; // Drop indexes $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP UNIQUE KEY (ext_name)"; - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes DROP UNIQUE KEY (theme_path)"; - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes DROP INDEX (theme_active)"; $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins DROP UNIQUE KEY (login)"; $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (status)"; $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refbanner DROP INDEX (visible)"; @@ -238,8 +236,8 @@ case "update": // Update an extension $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme', NULL, 'Themes','Verwalten Sie hier alle Designs (Themes) Ihres Mailtausch-Scriptes.', 8)"; $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_import','Importieren','Es wird das Verzeichnis "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, @@ -351,7 +349,7 @@ PRIMARY KEY(id) break; case "0.2.7": // SQL queries for v0.2.7 - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, sort) VALUES ('main','themes','Designs', 6)"; + $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action,what,title,sort) VALUES ('main','themes','Designs', 6)"; $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD curr_theme VARCHAR(255) NOT NULL DEFAULT 'default'"; $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD stats_limit BIGINT(20) UNSIGNED NOT NULL DEFAULT '10'"; $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='config_stats' WHERE what='stats' LIMIT 1"; @@ -637,25 +635,23 @@ PRIMARY KEY (id) case "0.5.0": // SQL queries for v0.5.0 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `level`"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `userid`, ADD UNIQUE `userid_level` (`userid`,`level`)"; - $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_refs`"; - $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_refs` ( -`id` bigint(20) NOT NULL auto_increment, -`userid` bigint(20) NOT NULL DEFAULT 0, -`level` smallint(6) NOT NULL DEFAULT 0, -`refid` bigint(20) NOT NULL DEFAULT 0, -`refback` float(4,1) NOT NULL DEFAULT 0.0, -`points` FLOAT( 20,5) DEFAULT '0.00000' NOT NULL, -PRIMARY KEY (`id`), -UNIQUE `user_refid` (`userid`,`level`,`refid`), -KEY (`level`), -KEY (`refid`), -) ENGINE=MyISAM COMMENT='User Referals With Refback'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Referal-System unterstü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; diff --git a/inc/extensions/ext-support.php b/inc/extensions/ext-support.php index ccfe197467..b8d6d89779 100644 --- a/inc/extensions/ext-support.php +++ b/inc/extensions/ext-support.php @@ -128,11 +128,9 @@ case "update": // Update an extension default: // Do stuff when extension is loaded break; } + // Language file prefix $EXT_LANG_PREFIX = "support"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 14f942796d..e67e15bb1d 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -232,8 +232,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "surfbar"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-task.php b/inc/extensions/ext-task.php index 1611eea800..2fd0a1f676 100644 --- a/inc/extensions/ext-task.php +++ b/inc/extensions/ext-task.php @@ -247,8 +247,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "task"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-theme.php b/inc/extensions/ext-theme.php index 20520b2b73..84a4728350 100644 --- a/inc/extensions/ext-theme.php +++ b/inc/extensions/ext-theme.php @@ -117,8 +117,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "theme"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-top10.php b/inc/extensions/ext-top10.php index 1b48c0953b..358367b597 100644 --- a/inc/extensions/ext-top10.php +++ b/inc/extensions/ext-top10.php @@ -146,8 +146,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "top10"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index 7814a95528..55402ebd20 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -287,8 +287,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "transfer"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/extensions/ext-wernis.php b/inc/extensions/ext-wernis.php index 5518a3feca..672ec5089d 100644 --- a/inc/extensions/ext-wernis.php +++ b/inc/extensions/ext-wernis.php @@ -131,9 +131,6 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "wernis"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // Init array global $WERNIS; $WERNIS = array(); diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php index a38bd27bc3..99724405e3 100644 --- a/inc/extensions/ext-yoomedia.php +++ b/inc/extensions/ext-yoomedia.php @@ -85,8 +85,5 @@ default: // Do stuff when extension is loaded // Language file prefix $EXT_LANG_PREFIX = "yoomedia"; -// Extension is always active? -$EXT_ALWAYS_ACTIVE = "N"; - // ?> diff --git a/inc/functions.php b/inc/functions.php index 3dcee7a5cc..1c22981c1c 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -236,7 +236,7 @@ function LOAD_TEMPLATE($template, $return=false, $content=array()) { // Free result SQL_FREERESULT($result); - } + } // END - if // Generate date/time string $date_time = MAKE_DATETIME(time(), "1"); @@ -351,7 +351,7 @@ function LOAD_TEMPLATE($template, $return=false, $content=array()) { // Send mail out to an email address function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") { - //* DEBUG: */ echo __FUNCTION__.":TO={$TO},SUBJECT={$SUBJECT}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):TO={$TO},SUBJECT={$SUBJECT}
\n"; // Compile subject line (for POINTS constant etc.) $eval = "\$SUBJECT = html_entity_decode(\"".COMPILE_CODE(addslashes($SUBJECT))."\");"; @@ -366,7 +366,7 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") { } else { // Load email address $result_email = SQL_QUERY_ESC("SELECT email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array(bigintval($TO)), __FILE__, __LINE__); - //* DEBUG: */ echo __FUNCTION__.":numRows=".SQL_NUMROWS($result_email)."
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):numRows=".SQL_NUMROWS($result_email)."
\n"; // Does the user exist? if (SQL_NUMROWS($result_email)) { @@ -384,7 +384,7 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") { // Is the webmaster! $TO = WEBMASTER; } - //* DEBUG: */ echo __FUNCTION__.":TO={$TO}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):TO={$TO}
\n"; // Check for PHPMailer or debug-mode if (!CHECK_PHPMAILER_USAGE()) { @@ -562,8 +562,8 @@ function TRANSLATE_COMMA ($dotted, $cut=true) { if (count($com) > 1) { // Commata found, so only zeros? if ($com[1] == str_repeat("0", strlen($com[1]))) { - // Only zeros, so don't display them - $maxComma = 0; + // Only zeros, so display only one + $maxComma = 1; } // END - if } else { // Don't display commatas even if there are none... ;-) @@ -645,6 +645,11 @@ function TRANSLATE_STATUS($status) { $ret = ACCOUNT_LOCKED; break; + case "": + case null: + $ret = ACCOUNT_DELETED; + break; + default: $ret = UNKNOWN_STATUS_1.$status.UNKNOWN_STATUS_2; break; @@ -738,27 +743,27 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") { } // END - if // Load user's data - //* DEBUG: */ echo __FUNCTION__.":UID={$UID},template={$template}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):UID={$UID},template={$template}
\n"; if ($UID > 0) { if (EXT_IS_ACTIVE("nickname")) { - //* DEBUG: */ echo __FUNCTION__.":NICKNAME!
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):NICKNAME!
\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!
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):NO-NICK!
\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)."
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):content[]=".gettype($content)."
\n"; if (is_array($content)) { // Fetch and migrate data - //* DEBUG: */ echo __FUNCTION__.":content()=".count($content)." - PRE
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):content()=".count($content)." - PRE
\n"; $content = array_merge($content, SQL_FETCHARRAY($result)); - //* DEBUG: */ echo __FUNCTION__.":content()=".count($content)." - AFTER
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):content()=".count($content)." - AFTER
\n"; } // END - if // Free result @@ -952,10 +957,10 @@ function COMPILE_CODE($code, $simple = false, $constants = true, $full = true) { $test = substr($found, 0, strlen($match)); // Does this entry exist? - //* DEBUG: */ echo __FUNCTION__.":found={$found},match={$match},set={$set}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):found={$found},match={$match},set={$set}
\n"; if ($test == $match) { // Match found! - //* DEBUG: */ echo __FUNCTION__.":fuzzyFound!
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):fuzzyFound!
\n"; $fuzzyFound = true; break; } // END - if @@ -967,14 +972,14 @@ function COMPILE_CODE($code, $simple = false, $constants = true, $full = true) { // Take all string elements if ((is_string($matches[4][$key])) && (!isset($matchesFound[$match])) && (!isset($matchesFound[$key."_".$matches[4][$key]]))) { // Replace it in the code - //* DEBUG: */ echo __FUNCTION__.":key={$key},match={$match}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):key={$key},match={$match}
\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}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):match={$match}
\n"; $code = str_replace($match, "\".".$match.".\"", $code); $matchesFound[$match] = 1; } @@ -1648,7 +1653,7 @@ function EXTRACT_HOST (&$script) { if (ereg("/", $host)) $host = substr($host, 0, strpos($host, "/")); // Generate relative URL - //* DEBUG */ print("SCRIPT=".$script."
\n"); + //* DEBUG: */ print("SCRIPT=".$script."
\n"); if (substr(strtolower($script), 0, 7) == "http://") { // But only if http:// is in front! $script = substr($script, (strlen($url) + 7)); @@ -1657,7 +1662,7 @@ function EXTRACT_HOST (&$script) { $script = substr($script, (strlen($url) + 8)); } - //* DEBUG */ print("SCRIPT=".$script."
\n"); + //* DEBUG: */ print("SCRIPT=".$script."
\n"); if (substr($script, 0, 1) == "/") $script = substr($script, 1); // Return host name @@ -1740,7 +1745,7 @@ function SEND_RAW_REQUEST ($host, $request) { } // END - if // Open connection - //* DEBUG */ die("SCRIPT=".$script."
\n"); + //* DEBUG: */ die("SCRIPT=".$script."
\n"); if ($useProxy) { $fp = @fsockopen(COMPILE_CODE($_CONFIG['proxy_host']), $_CONFIG['proxy_port'], $errno, $errdesc, 30); } else { @@ -2245,11 +2250,11 @@ function isBooleanConstantAndTrue($constName) { // : Boolean // In cache? if (isset($constCache[$constName])) { // Use cache - //* DEBUG: */ echo __FUNCTION__.": ".$constName."-CACHE!
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."): ".$constName."-CACHE!
\n"; $res = $constCache[$constName]; } else { // Check constant - //* DEBUG: */ echo __FUNCTION__.": ".$constName."-RESOLVE!
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."): ".$constName."-RESOLVE!
\n"; if (defined($constName)) $res = (constant($constName) === true); // Set cache @@ -2263,7 +2268,7 @@ function isBooleanConstantAndTrue($constName) { // : Boolean // Check wether a session variable is set function isSessionVariableSet($var) { - //* DEBUG: */ echo __FUNCTION__.":var={$var}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):var={$var}
\n"; return (isset($_SESSION[$var])); } // Returns wether the value of the session variable or NULL if not set @@ -2326,7 +2331,7 @@ function DEBUG_LOG ($message, $force=false) { if ((isBooleanConstantAndTrue('DEBUG_MODE')) || ($force)) { // Log this message away $fp = fopen(PATH."inc/cache/debug.log", 'a') or mxchange_die("Cannot write logfile debug.log!"); - fwrite($fp, date("d.m.Y|H:i:s", time())."|{$message}\n"); + fwrite($fp, date("d.m.Y|H:i:s", time())."|".strip_tags($message)."\n"); fclose($fp); } // END - if } @@ -2344,7 +2349,7 @@ function GET_DIR_AS_ARRAY ($baseDir, $prefix) { $file = $baseDir.$baseFile; // Is this a valid reset file? - //* DEBUG: */ echo __FUNCTION__.":baseDir={$baseDir},prefix={$prefix},baseFile={$baseFile}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):baseDir={$baseDir},prefix={$prefix},baseFile={$baseFile}
\n"; if ((FILE_READABLE($file)) && (substr($baseFile, 0, strlen($prefix)) == $prefix) && (substr($baseFile, -4, 4) == ".php")) { // Remove both for extension name $extName = substr($baseFile, strlen($prefix), -4); @@ -2510,7 +2515,7 @@ function HANDLE_LOGIN_FAILTURES ($accessLevel) { // Ignore zero values if (get_session('mxchange_'.$accessLevel.'_failtures') > 0) { // Non-guest has login failtures found, get both data and prepare it for template - //* DEBUG: */ echo __FUNCTION__.":accessLevel={$accessLevel}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):accessLevel={$accessLevel}
\n"; $content = array( 'login_failtures' => get_session('mxchange_'.$accessLevel.'_failtures'), 'last_failture' => MAKE_DATETIME(get_session('mxchange_'.$accessLevel.'_last_fail'), "2") diff --git a/inc/gen_refback.php b/inc/gen_refback.php index 3e79ad1d7d..be1a3a7689 100644 --- a/inc/gen_refback.php +++ b/inc/gen_refback.php @@ -37,6 +37,9 @@ if (!defined('__SECURITY')) { require($INC); } +// Make sure our functions are there +require_once(PATH."inc/libs/refback_functions.php"); + // Sanity-check: Do we have ref level 0? $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_refsystem WHERE level=0", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { @@ -66,7 +69,7 @@ if (SQL_NUMROWS($result_direct) > 0) { $cacheArray['back_level'] = 1; // Update refback table - /* DEBUG: */ echo "uid={$uid}
\n"; + //* DEBUG: */ echo "uid={$uid}
\n"; UPDATE_REFBACK_TABLE($uid); } // END - while } // END - if diff --git a/inc/header.php b/inc/header.php index 8f2d54deae..fe18f73c4e 100644 --- a/inc/header.php +++ b/inc/header.php @@ -104,13 +104,15 @@ if (($header != "1") && ($header != "2")) { // Output page header code LOAD_TEMPLATE("page_header"); - // Include meta data here - LOAD_TEMPLATE("metadata"); - - // Add meta description to header - if ((isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && ($GLOBALS['module'] != "admin") && ($GLOBALS['module'] != "login") && (isset($db)) && (isset($link))) { - // Add meta description not in admin and login module and when the script is installed - META_DESCRIPTION($GLOBALS['module'], $GLOBALS['what']); + // Include meta data in "guest" module + if ($GLOBALS['module'] == "index") { + LOAD_TEMPLATE("metadata"); + + // Add meta description to header + if ((isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (isset($db)) && (is_resource($link))) { + // Add meta description not in admin and login module and when the script is installed + META_DESCRIPTION($GLOBALS['module'], $GLOBALS['what']); + } // END - if } // END - if // Include more header data here diff --git a/inc/language/active_de.php b/inc/language/active_de.php index 11347e2c94..2f692a450b 100644 --- a/inc/language/active_de.php +++ b/inc/language/active_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/admins_de.php b/inc/language/admins_de.php index 76a56e20fe..c715072183 100644 --- a/inc/language/admins_de.php +++ b/inc/language/admins_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/autopurge_de.php b/inc/language/autopurge_de.php index b4f8c0b5ab..f5b9566e1f 100644 --- a/inc/language/autopurge_de.php +++ b/inc/language/autopurge_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/bank_de.php b/inc/language/bank_de.php index 281ae6d933..f08218a52c 100644 --- a/inc/language/bank_de.php +++ b/inc/language/bank_de.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/beg_de.php b/inc/language/beg_de.php index ac4cbe9b34..2b25ea2643 100644 --- a/inc/language/beg_de.php +++ b/inc/language/beg_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/birthday_de.php b/inc/language/birthday_de.php index c3873135bc..17733a4f08 100644 --- a/inc/language/birthday_de.php +++ b/inc/language/birthday_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/bonus_de.php b/inc/language/bonus_de.php index 150aa911e7..aa873c6b11 100644 --- a/inc/language/bonus_de.php +++ b/inc/language/bonus_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/cache_de.php b/inc/language/cache_de.php index c66f0fc989..66f0b04c2e 100644 --- a/inc/language/cache_de.php +++ b/inc/language/cache_de.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/country_de.php b/inc/language/country_de.php index ba04f5a6c1..ebb1d03a9a 100644 --- a/inc/language/country_de.php +++ b/inc/language/country_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/de.php b/inc/language/de.php index 03305c6d95..46b9208d04 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -513,6 +512,7 @@ define('ACCOUNT_STATUS', "Account-Status"); define('ACCOUNT_UNCONFIRMED', "Unbestätigt"); define('ACCOUNT_CONFIRMED', "Bestätigt"); 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"); diff --git a/inc/language/doubler_de.php b/inc/language/doubler_de.php index 4ec574fefc..d54e12f51a 100644 --- a/inc/language/doubler_de.php +++ b/inc/language/doubler_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/holiday_de.php b/inc/language/holiday_de.php index 248cb3ab34..2233d5d445 100644 --- a/inc/language/holiday_de.php +++ b/inc/language/holiday_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/html_mail_de.php b/inc/language/html_mail_de.php index ddec173c27..239d7d0a7e 100644 --- a/inc/language/html_mail_de.php +++ b/inc/language/html_mail_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/install_de.php b/inc/language/install_de.php index c9dd1e2820..540f550ce8 100644 --- a/inc/language/install_de.php +++ b/inc/language/install_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/mailid_de.php b/inc/language/mailid_de.php index c9d4896da0..43df81bd4e 100644 --- a/inc/language/mailid_de.php +++ b/inc/language/mailid_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/maintenance_de.php b/inc/language/maintenance_de.php index 6028a8cf00..939ccacc57 100644 --- a/inc/language/maintenance_de.php +++ b/inc/language/maintenance_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/mediadata_de.php b/inc/language/mediadata_de.php index 6e05e5b1ca..5a85c73e52 100644 --- a/inc/language/mediadata_de.php +++ b/inc/language/mediadata_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/mods_de.php b/inc/language/mods_de.php index 29694f8e45..9e1fbf53c5 100644 --- a/inc/language/mods_de.php +++ b/inc/language/mods_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/newsletter_de.php b/inc/language/newsletter_de.php index 8c502016d6..f4d29c3183 100644 --- a/inc/language/newsletter_de.php +++ b/inc/language/newsletter_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/nickname_de.php b/inc/language/nickname_de.php index 11a23c6273..d3bd0b5be8 100644 --- a/inc/language/nickname_de.php +++ b/inc/language/nickname_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/online_de.php b/inc/language/online_de.php index 8c21f889a1..db5313dafc 100644 --- a/inc/language/online_de.php +++ b/inc/language/online_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/optimize_de.php b/inc/language/optimize_de.php index 4f2f778eb7..fa2e35de3c 100644 --- a/inc/language/optimize_de.php +++ b/inc/language/optimize_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/order_de.php b/inc/language/order_de.php index 1acea0adf7..be9999d3a6 100644 --- a/inc/language/order_de.php +++ b/inc/language/order_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/other_de.php b/inc/language/other_de.php index cf6d2948e8..eaaee73860 100644 --- a/inc/language/other_de.php +++ b/inc/language/other_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/payout_de.php b/inc/language/payout_de.php index 264578a9fa..8ad9e0d560 100644 --- a/inc/language/payout_de.php +++ b/inc/language/payout_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/primera_de.php b/inc/language/primera_de.php index 1e2eb96365..9e8bc90810 100644 --- a/inc/language/primera_de.php +++ b/inc/language/primera_de.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/rallye_de.php b/inc/language/rallye_de.php index b877f3a32d..0094713e4f 100644 --- a/inc/language/rallye_de.php +++ b/inc/language/rallye_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/refback_de.php b/inc/language/refback_de.php new file mode 100644 index 0000000000..f85bb270e1 --- /dev/null +++ b/inc/language/refback_de.php @@ -0,0 +1,70 @@ +"); +define('MEMBER_REFBACK_LIST_TITLE_2', " ("); +define('MEMBER_REFBACK_LIST_TITLE_3', "% 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 {--MEMBER_REFBACK_POINTS--} 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 "); +define('MEMBER_REFBACK_COUNTER_2', " 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:
\n%s"); +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."); + +// +?> diff --git a/inc/language/register_de.php b/inc/language/register_de.php index 8371c0b15c..05a19440bf 100644 --- a/inc/language/register_de.php +++ b/inc/language/register_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/repair_de.php b/inc/language/repair_de.php index db90d963de..da5bdd0edd 100644 --- a/inc/language/repair_de.php +++ b/inc/language/repair_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/rewrite_de.php b/inc/language/rewrite_de.php index f9b8ec176c..a8c590f2f2 100644 --- a/inc/language/rewrite_de.php +++ b/inc/language/rewrite_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/sponsor_de.php b/inc/language/sponsor_de.php index b9b7c195c2..902e0171a4 100644 --- a/inc/language/sponsor_de.php +++ b/inc/language/sponsor_de.php @@ -31,8 +31,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/language/support_de.php b/inc/language/support_de.php index 1a9eeea2ab..f3be1f278e 100644 --- a/inc/language/support_de.php +++ b/inc/language/support_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/surfbar_de.php b/inc/language/surfbar_de.php index 680bbe5908..294e2c016e 100644 --- a/inc/language/surfbar_de.php +++ b/inc/language/surfbar_de.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/task_de.php b/inc/language/task_de.php index 4792d0e020..24801c6ba1 100644 --- a/inc/language/task_de.php +++ b/inc/language/task_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/theme_de.php b/inc/language/theme_de.php index c954c4f2ce..82ce511060 100644 --- a/inc/language/theme_de.php +++ b/inc/language/theme_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/top10_de.php b/inc/language/top10_de.php index fbc7acf1a8..9bf43373bf 100644 --- a/inc/language/top10_de.php +++ b/inc/language/top10_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/transfer_de.php b/inc/language/transfer_de.php index 038f372e11..b08ae72b8c 100644 --- a/inc/language/transfer_de.php +++ b/inc/language/transfer_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/user_de.php b/inc/language/user_de.php index a0382a7b29..28aa38be9f 100644 --- a/inc/language/user_de.php +++ b/inc/language/user_de.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/wernis_de.php b/inc/language/wernis_de.php index df862d63d1..0efed1d7f1 100644 --- a/inc/language/wernis_de.php +++ b/inc/language/wernis_de.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/libs/cache_functions.php b/inc/libs/cache_functions.php index 44df62bede..93af044caa 100644 --- a/inc/libs/cache_functions.php +++ b/inc/libs/cache_functions.php @@ -132,7 +132,7 @@ class mxchange_cache $this->cache_pointer = $fp; } else { // Cannot create file - ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); + ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); } } @@ -162,7 +162,7 @@ class mxchange_cache } } else { // Cannot create file - ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); + ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); } } @@ -184,7 +184,7 @@ class mxchange_cache else { // Cannot create file - ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); + ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); } } @@ -219,7 +219,7 @@ class mxchange_cache } } else { // Cache file not found or not readable - ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_LOAD_1.$this->cache_inc.CACHE_CANNOT_LOAD_2); + ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_LOAD_1.$this->cache_inc.CACHE_CANNOT_LOAD_2); } } @@ -237,13 +237,13 @@ class mxchange_cache else { // Not removed! - ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_UNLINK_1.$this->cache_inc.CACHE_CANNOT_UNLINK_2); + ADD_FATAL(__FILE__."(".__LINE__."): ".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__."(".__LINE__."): ".CACHE_CANNOT_UNLINK_1.$this->cache_inc.CACHE_CANNOT_UNLINK_2); } } @@ -288,7 +288,7 @@ class mxchange_cache } } else { // Cannot write to cache! - ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); + ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); } } @@ -341,7 +341,7 @@ class mxchange_cache } } else { // Cannot write to cache! - ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); + ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); } } @@ -355,7 +355,7 @@ class mxchange_cache @fwrite($this->cache_pointer, "\$cache_version['".$ext_name."'] = \"".$ext_ver."\";\n"); } else { // Cannot create file - ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); + ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); } } diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php new file mode 100644 index 0000000000..1009819e4f --- /dev/null +++ b/inc/libs/refback_functions.php @@ -0,0 +1,379 @@ +".__FUNCTION__." - ENTRY ----------------------------------------------- ".__FUNCTION__." - EXIT ------------------------
\n"; + return $return; +} +// "Getter" for refback percents +function GET_REFBACK_PERCENTS ($uid, $ref) { + //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ----------------------------------------------- ".__FUNCTION__." - EXIT ------------------------
\n"; + return $percents; +} +// "Getter" for userid array which will return only one entry +function GET_REFBACK_USERID_ARRAY ($rid, $level) { + //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ----------------------------------------------- ".__FUNCTION__." - EXIT ------------------------
\n"; + return $userIds; +} +// Update "refback table" +function UPDATE_REFBACK_TABLE($uid) { + //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ----------------------------------------------- ".__FUNCTION__." - EXIT ------------------------
\n"; +} +// "Getter" for array for user refs in given level +function GET_USER_REFS ($uid, $level) { + //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ----------------------------------------------- ".__FUNCTION__." - EXIT ------------------------
\n"; + return $refs; +} +// "Getter" for refback entry +function GET_USER_REF_ENTRY ($id) { + //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ----------------------------------------------- ".__FUNCTION__." - EXIT ------------------------
\n"; + return $data; +} +// Update refback percents (but with some sanity-checks! +function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) { + //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ----------------------------------------------- ".__FUNCTION__." - EXIT ------------------------
\n"; + return $status; +} +// +?> diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 4cf38f0d2a..f83d4fac91 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -850,7 +850,7 @@ function SURFBAR_UPDATE_INSERT_STATS_RECORD () { array($GLOBALS['userid'], SURFBAR_GET_ID()), __FILE__, __LINE__); // Was that update okay? - if (SQL_AFFECTEDROWS() == 0) { + if (SQL_AFFECTEDROWS() < 1) { // No, then insert entry SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_stats (userid,url_id,count) VALUES(%s,%s,1)", array($GLOBALS['userid'], SURFBAR_GET_ID()), __FILE__, __LINE__); @@ -878,7 +878,7 @@ function SURFBAR_UPDATE_SALT_STATS () { //DEBUG_LOG(__FUNCTION__.":salt=".SURFBAR_GET_SALT().",id=".SURFBAR_GET_ID().",uid=".$GLOBALS['userid'].""); // Was that okay? - if (SQL_AFFECTEDROWS() == 0) { + if (SQL_AFFECTEDROWS() < 1) { // Insert missing entry! SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_salts (url_id,userid,last_salt) VALUES(%s, %s, '%s')", array(SURFBAR_GET_ID(), $GLOBALS['userid'], SURFBAR_GET_SALT()), __FILE__, __LINE__); diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 74ba0ce258..528da4a94a 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -216,7 +216,7 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password) { $pass = GET_ADMIN_HASH($admin_login); if ($pass != "-1") $ret = "pass"; - //* DEBUG: */ echo __FUNCTION__.":".generatePassString($pass)."(".strlen($pass).")/".$password."(".strlen($password).")
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):".generatePassString($pass)."(".strlen($pass).")/".$password."(".strlen($password).")
\n"; // Check if password matches if (($ret == "pass") && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass)))) { diff --git a/inc/modules/admin/what-config_points.php b/inc/modules/admin/what-config_points.php index 8307ed99a0..10f003dcda 100644 --- a/inc/modules/admin/what-config_points.php +++ b/inc/modules/admin/what-config_points.php @@ -82,6 +82,9 @@ if (isset($_POST['ok'])) { // Secure ID $id = bigintval($id); + // Revert german commata + $_POST['perc'][$id] = REVERT_COMMA($_POST['perc'][$id]); + // Update entry $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refdepths SET level='%s', percents='%s' WHERE id=%s LIMIT 1", array(bigintval($value), $_POST['perc'][$id], $id), __FILE__, __LINE__); @@ -211,7 +214,7 @@ WHERE mails_confirmed < %s", $REF, $REF); 'sw' => $SW, 'id' => $id, 'lvl' => $lvl, - 'per' => $perc, + 'per' => TRANSLATE_COMMA($perc), ); // Load row template and switch color @@ -239,7 +242,7 @@ WHERE mails_confirmed < %s", $REF, $REF); 'sw' => $SW, 'id' => $id, 'lvl' => $lvl, - 'per' => $perc, + 'per' => TRANSLATE_COMMA($perc), ); // Load row template and switch color @@ -268,7 +271,7 @@ WHERE mails_confirmed < %s", $REF, $REF); 'sw' => $SW, 'id' => $id, 'lvl' => $lvl, - 'per' => $perc, + 'per' => TRANSLATE_COMMA($perc), ); // Load row template and switch color diff --git a/inc/modules/admin/what-extensions.php b/inc/modules/admin/what-extensions.php index e81f62f249..14b4f72721 100644 --- a/inc/modules/admin/what-extensions.php +++ b/inc/modules/admin/what-extensions.php @@ -170,11 +170,15 @@ if (!empty($_GET['reg_ext'])) { if ($_CONFIG['verbose_sql']) { // Load SQL commands in remove mode $EXT_LOAD_MODE = "remove"; + $EXT_ALWAYS_ACTIVE = "N"; $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name); - include($file); + if (FILE_READABLE($file)) { + // Load file + include($file); - // Generate extra table with loaded SQL commands - $VERBOSE_OUT = EXTENSION_VERBOSE_TABLE($SQLs); + // Generate extra table with loaded SQL commands + $VERBOSE_OUT = EXTENSION_VERBOSE_TABLE($SQLs); + } } // END - if // Prepare data for the row template diff --git a/inc/modules/admin/what-memedit.php b/inc/modules/admin/what-memedit.php index f14b121913..cfd4b3ba51 100644 --- a/inc/modules/admin/what-memedit.php +++ b/inc/modules/admin/what-memedit.php @@ -64,7 +64,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) if ($confirm == 1) { $cnt++; - $result = SQL_QUERY_ESC("SELECT title, action, what, descr FROM "._MYSQL_PREFIX."_member_menu WHERE ".$AND." AND id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT title, action, what FROM "._MYSQL_PREFIX."_member_menu WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($sel)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -200,8 +200,8 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) switch ($_POST['ok']) { case "edit": // Edit menu - $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_member_menu SET title='%s', action='%s', what='%s', descr='%s' WHERE ".$AND." AND id=%s LIMIT 1", - array($menu, $_POST['sel_act'][$sel], $_POST['sel_what'][$sel], $_POST['sel_descr'][$sel], $sel), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_member_menu SET title='%s', action='%s', what='%s' WHERE ".$AND." AND id=%s LIMIT 1", + array($menu, $_POST['sel_act'][$sel], $_POST['sel_what'][$sel], $sel), __FILE__, __LINE__); break; case "del": // Delete menu diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index 1acda59251..860cd24d90 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -262,6 +262,12 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF return; } // END - if + // Is the refback extension there? + if (EXT_IS_ACTIVE("refback")) { + // Update refback table + UPDATE_REFBACK_TABLE($userid); + } // END - if + // Write his welcome-points $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND ref_depth=0 LIMIT 1", array(bigintval($userid)), __FILE__, __LINE__); diff --git a/inc/modules/member/what-points.php b/inc/modules/member/what-points.php index 46387bf9fc..ec7275b3c5 100644 --- a/inc/modules/member/what-points.php +++ b/inc/modules/member/what-points.php @@ -86,9 +86,9 @@ while (list($lvl, $per) = SQL_FETCHROW($result_depths)) { // Transfer data to array for template $content = array( 'lvl' => $lvl, - 'per' => $per, + 'per' => TRANSLATE_COMMA($per), 'points' => TRANSLATE_COMMA($points), - 'refs' => $REFS, + 'refs' => TRANSLATE_COMMA($REFS), ); // Output row diff --git a/inc/modules/member/what-refback.php b/inc/modules/member/what-refback.php new file mode 100644 index 0000000000..280aba6cf3 --- /dev/null +++ b/inc/modules/member/what-refback.php @@ -0,0 +1,145 @@ +"); + } 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); + +// +?> diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index 15badd903c..65ef9187fa 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -137,6 +137,8 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT // Administrative functions require_once(PATH."inc/modules/admin/admin-inc.php"); } // END - if + //* DEBUG: */ ADD_POINTS_REFSYSTEM(36,1000); + //* DEBUG: */ die(); // Get all values if (($CSS != 1) && ($CSS != -1)) { @@ -156,7 +158,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT UPDATE_ONLINE_LIST($PHPSESSID, $GLOBALS['module'], $GLOBALS['action'], $GLOBALS['what']); // Set default 'what' value - //* DEBUG */ echo "-".$GLOBALS['module']."/".$GLOBALS['what']."-
\n"; + //* DEBUG: */ echo "-".$GLOBALS['module']."/".$GLOBALS['what']."-
\n"; if ((empty($GLOBALS['what'])) && (empty($GLOBALS['action'])) && ($CSS != 1) && ($CSS != -1)) { if ($GLOBALS['module'] == "admin") { // Set 'action' value to 'login' in admin menu diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 26e6870c0c..186b1d43e1 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -168,7 +168,7 @@ function CHECK_MODULE($mod) { } // Everthing is fine? - if (SQL_AFFECTEDROWS() == 0) { + if (SQL_AFFECTEDROWS() < 1) { // Something bad happend! return "major"; } // END - if @@ -286,7 +286,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { $DEPTH="0"; // Handle failed logins here if not in guest - //* DEBUG: */ echo __FUNCTION__.":type={$type},action={$GLOBALS['action']},what={$GLOBALS['what']},lvl={$ACC_LVL}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):type={$type},action={$GLOBALS['action']},what={$GLOBALS['what']},lvl={$ACC_LVL}
\n"; if ((($type == "what") || ($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview") || ($GLOBALS['what'] == $_CONFIG['index_home']))) && ($ACC_LVL != "guest") && ((GET_EXT_VERSION("sql_patches") >= "0.4.7") || (GET_EXT_VERSION("admins") >= "0.7.0"))) { // Handle failture $OUT .= HANDLE_LOGIN_FAILTURES($ACC_LVL); @@ -476,7 +476,7 @@ function IS_ADMIN($admin="") if (!empty($valPass)) { // Check if password is valid - //* DEBUG: */ echo __FUNCTION__."*".$valPass."/".$passCookie."*
\n"; + //* DEBUG: */ print __FUNCTION__."*".$valPass."/".$passCookie."*
\n"; $ret = (($valPass == $passCookie) || ((strlen($valPass) == 32) && ($valPass == md5($passCookie))) || (($valPass == "*FAILED*") && (!EXT_IS_ACTIVE("cache")))); } @@ -1129,26 +1129,24 @@ function GET_REF_LEVEL_PERCENTS ($level) { * uid = Referral ID wich should receive... * points = ... xxx points * send_notify = shall I send the referral an email or not? - * rid = inc/modules/guest/what-confirm.php need this + * rid = inc/modules/guest/what-confirm.php need this (DEPRECATED???) * locked = Shall I pay it to normal (false) or locked (true) points ammount? * add_mode = Add points only to $uid or also refs? (WARNING! Changing "ref" to "direct" * for default value will cause no referral will get points ever!!!) */ function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $locked=false, $add_mode="ref") { + //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ----------------------------------------------- ".__FUNCTION__." - EXIT ------------------------
\n"; } // function UPDATE_REF_COUNTER ($uid) { @@ -1376,19 +1259,19 @@ function UPDATE_REF_COUNTER ($uid) { // Make it sure referral level zero (member him-/herself) is at least selected if (empty($cacheArray['ref_level'][$uid])) $cacheArray['ref_level'][$uid] = 1; - //* DEBUG: */ echo __FUNCTION__.":uid={$uid},level={$cacheArray['ref_level'][$uid]}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},level={$cacheArray['ref_level'][$uid]}
\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()."
\n"; - if (SQL_AFFECTEDROWS() == 0) { + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):updated=".SQL_AFFECTEDROWS()."
\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}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid}
\n"; } // END - if // Check for his referral @@ -1400,118 +1283,26 @@ function UPDATE_REF_COUNTER ($uid) { // Free memory SQL_FREERESULT($result); - //* DEBUG: */ echo __FUNCTION__.":uid={$uid},ref={$ref}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},ref={$ref}
\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!
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):ref={$ref} - ADVANCE!
\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!
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):ref={$ref} - CACHE!
\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']}
\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)."
\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']]}
\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!
\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!
\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!
\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!
\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!
\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!
\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!
\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!
\n"; } // Updates/extends the online list function UPDATE_ONLINE_LIST($SID, $mod, $act, $wht) { @@ -1834,7 +1625,7 @@ WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__); // Remove from rallye if found if (EXT_IS_ACTIVE("rallye")) { - $result = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_users WHERE userid=%s", + $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_users WHERE userid=%s", array(bigintval($uid)), __FILE__, __LINE__); } @@ -1977,7 +1768,7 @@ function MODULE_HAS_MENU($mod, $forceDb = false) // All is false by default $ret = false; - //* DEBUG: */ echo __FUNCTION__.":mod={$mod},cache=".GET_EXT_VERSION("cache")."
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):mod={$mod},cache=".GET_EXT_VERSION("cache")."
\n"; if (GET_EXT_VERSION("cache") >= "0.1.2") { // Cache version is okay, so let's check the cache! if (isset($cacheArray['modules']['has_menu'][$mod])) { @@ -2064,7 +1855,7 @@ function UPDATE_CONFIG ($entries, $values, $updateMode="") { // Get affected rows $affectedRows = SQL_AFFECTEDROWS(); - //* DEBUG: */ echo __FUNCTION__.":entries={$entries},affectedRows={$affectedRows}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):entries={$entries},affectedRows={$affectedRows}
\n"; // Rebuild cache REBUILD_CACHE("config", "config"); @@ -2119,6 +1910,5 @@ VALUES (%s,0,'NEW','EXTENSION','%s','%s',UNIX_TIMESTAMP())", // Free memory SQL_FREERESULT($result); } - // ?> diff --git a/inc/security.php b/inc/security.php index 2bf08fc73b..e636e6481e 100644 --- a/inc/security.php +++ b/inc/security.php @@ -30,7 +30,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * * MA 02110-1301 USA * ************************************************************************/ - +/* +print "
";
+debug_print_backtrace();
+die("
"); +*/ echo " Protected file ".basename($_SERVER['PHP_SELF'])." - ACCESS DENIED! diff --git a/install/tables.sql b/install/tables.sql index d4ba588826..61f7bfb2fa 100644 --- a/install/tables.sql +++ b/install/tables.sql @@ -76,7 +76,6 @@ CREATE TABLE `mxchange_member_menu` ( `sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `visible` ENUM('Y','N') NOT NULL DEFAULT 'Y', `locked` ENUM('Y','N') NOT NULL DEFAULT 'Y', - `descr` blob NOT NULL, `counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) TYPE=MyISAM; diff --git a/templates/de/html/admin/admin_list_refs.tpl b/templates/de/html/admin/admin_list_refs.tpl index 7b614917cb..5b8266b552 100644 --- a/templates/de/html/admin/admin_list_refs.tpl +++ b/templates/de/html/admin/admin_list_refs.tpl @@ -1,21 +1,21 @@ - - - - - - - - - - - - - {!__REF_ROWS!} - - - +
{--ADMIN_LIST_REFERRALS_1--}{--_UID--}{--ADMIN_LIST_REFERRALS_2--} -
{--_UID--}{--REFS_COUNT--}{--SURNAME_FAMILY--}{--ADDY--}{--ACCOUNT_STATUS--}{--MEMBER_JOINED--}
+ + + + + + + + + + + +$content[rows] + + +
+ {--ADMIN_LIST_REFERRALS_1--}$content[uid]{--ADMIN_LIST_REFERRALS_2--} +
{--_UID--}{--REFS_COUNT--}{--SURNAME_FAMILY--}{--ADDY--}{--ACCOUNT_STATUS--}{--MEMBER_JOINED--}
diff --git a/templates/de/html/admin/admin_list_refs_level.tpl b/templates/de/html/admin/admin_list_refs_level.tpl new file mode 100644 index 0000000000..45cd439fe6 --- /dev/null +++ b/templates/de/html/admin/admin_list_refs_level.tpl @@ -0,0 +1,13 @@ + + + + +$content[rows] + + + +
+ {--ADMIN_LIST_REFERRALS_LEVEL_1--}$content[level]{--ADMIN_LIST_REFERRALS_LEVEL_2--} +
diff --git a/templates/de/html/admin/admin_list_refs_row.tpl b/templates/de/html/admin/admin_list_refs_row.tpl index 7ba25b37bb..fba5cfd256 100644 --- a/templates/de/html/admin/admin_list_refs_row.tpl +++ b/templates/de/html/admin/admin_list_refs_row.tpl @@ -1,9 +1,7 @@ - $content[u_link]   + $content[u_link]   $content[refs_link] -  $content[gender] - $content[surname] $content[family] +  $content[gender] $content[surname] $content[family]  $content[email]  $content[status]  $content[registered] diff --git a/templates/de/html/ext/ext_refback.tpl b/templates/de/html/ext/ext_refback.tpl new file mode 100644 index 0000000000..9302d8ed22 --- /dev/null +++ b/templates/de/html/ext/ext_refback.tpl @@ -0,0 +1,8 @@ +Ref-Back ist ein Prozentsatz, der von dem Referal-Guthaben Ihrer Mitglieder +abgezogen wird und dem geworbenen, der gerade {!POINTS!} erwirtschaftet, +gutgeschrieben. Sobald das Mitglied Ref-Back für seine Referals ändert, +erhält der Referal eine Mail zugesandt, wie diese jetzt eingestellt ist.
+
+Das Mitglied kann sehen, wo es welche Referal-Vergütungen +an seine Referals gegeben hat. Es ist in späteren Versionen eine Übersicht +für erhaltene Ref-Back-Gutschriften geplant. diff --git a/templates/de/html/member/member_refback_edit.tpl b/templates/de/html/member/member_refback_edit.tpl new file mode 100644 index 0000000000..d5264fb2b5 --- /dev/null +++ b/templates/de/html/member/member_refback_edit.tpl @@ -0,0 +1,27 @@ +
+ + + + + + + + + + + + + + +
+ {--MEMBER_REFBACK_EDIT_TITLE--}
+ {--MEMBER_REFBACK_REFID--}: $content[refid] +
 
+ {--MEMBER_REFBACK_PERCENTS--}: + + % +
 
+
diff --git a/templates/de/html/member/member_refback_list.tpl b/templates/de/html/member/member_refback_list.tpl new file mode 100644 index 0000000000..07835f7aaf --- /dev/null +++ b/templates/de/html/member/member_refback_list.tpl @@ -0,0 +1,14 @@ + + + + + +$content + + + +
+ {--MEMBER_REFBACK_TITLE--} +
 
diff --git a/templates/de/html/member/member_refback_list_level.tpl b/templates/de/html/member/member_refback_list_level.tpl new file mode 100644 index 0000000000..45e03f96fa --- /dev/null +++ b/templates/de/html/member/member_refback_list_level.tpl @@ -0,0 +1,35 @@ + + + + + + + + + + + + + +$content[rows] + + + +
+ {--MEMBER_REFBACK_LIST_TITLE_1--}$content[level]{--MEMBER_REFBACK_LIST_TITLE_2--}$content[percents]{--MEMBER_REFBACK_LIST_TITLE_3--} +
+ {--MEMBER_REFBACK_REFID--} + + {--MEMBER_REFBACK_STATUS--} + + {--MEMBER_REFBACK_PERCENTS--} + + {--MEMBER_REFBACK_POINTS--} + + {--MEMBER_REFBACK_EDIT--} +
+ + +  diff --git a/templates/de/html/member/member_refback_list_row.tpl b/templates/de/html/member/member_refback_list_row.tpl new file mode 100644 index 0000000000..64456ca669 --- /dev/null +++ b/templates/de/html/member/member_refback_list_row.tpl @@ -0,0 +1,20 @@ + + + $content[refid] ($content[nickname]) + + + $content[status] + + + $content[refback] % + + + $content[points] {!POINTS!} + + +
+ + +
+ + diff --git a/templates/de/html/member/member_refback_list_row_deleted.tpl b/templates/de/html/member/member_refback_list_row_deleted.tpl new file mode 100644 index 0000000000..257b0c0fb7 --- /dev/null +++ b/templates/de/html/member/member_refback_list_row_deleted.tpl @@ -0,0 +1,20 @@ + + + $content[refid] ($content[nickname]) + + + $content[status] + + + $content[refback] % + + + $content[points] {!POINTS!} + + +
+ +
+ + -- 2.30.2