From: Roland Häder Date: Tue, 12 Jul 2011 22:44:50 +0000 (+0000) Subject: File renamed to naming convention, ext-repair continued: X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=0fada672e2066043b76ed5d57f852f451a49a3a3;ds=sidebyside File renamed to naming convention, ext-repair continued: - gen_refback.php renamed to fix_refsystem.php to make it more clear that this script is a) generic and b) is fixing the referal system - Extension ext-repair: The referal system can now be repaired - TODOs.txt updated --- diff --git a/.gitattributes b/.gitattributes index 3919121de9..24bca0646c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -226,6 +226,7 @@ inc/filter/user_filter.php svneol=native#text/plain inc/filters.php svneol=native#text/plain inc/fix_filters.php svneol=native#text/plain inc/fix_menu.php svneol=native#text/plain +inc/fix_refsystem.php svneol=native#text/plain inc/fix_user_points.php svneol=native#text/plain inc/footer.php svneol=native#text/plain inc/functions.php svneol=native#text/plain @@ -554,6 +555,7 @@ inc/modules/admin/what-repair_cats.php svneol=native#text/plain inc/modules/admin/what-repair_gmnu.php svneol=native#text/plain inc/modules/admin/what-repair_lang.php svneol=native#text/plain inc/modules/admin/what-repair_mmnu.php svneol=native#text/plain +inc/modules/admin/what-repair_refs.php svneol=native#text/plain inc/modules/admin/what-send_bonus.php svneol=native#text/plain inc/modules/admin/what-send_coupon.php svneol=native#text/plain inc/modules/admin/what-send_newsletter.php svneol=native#text/plain diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index c24b10110e..f2d72504b0 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -228,6 +228,7 @@ ./inc/autopurge/purge-tsks.php:2:// @DEPRECATED ./inc/autopurge/purge-unconfirmed.php:2:// @DEPRECATED ./inc/daily/daily_engine.php:2:// @DEPRECATED +./inc/gen_refback.php:2:// @DEPRECATED ./inc/loader/load_cache-admin.php:2:// @DEPRECATED ./inc/loader/load_cache-config.php:2:// @DEPRECATED ./inc/loader/load_cache-extension.php:2:// @DEPRECATED diff --git a/inc/extensions/ext-refback.php b/inc/extensions/ext-refback.php index 0d6b0c1741..1f46156fc3 100644 --- a/inc/extensions/ext-refback.php +++ b/inc/extensions/ext-refback.php @@ -52,7 +52,7 @@ switch (getExtensionMode()) { addMemberMenuSql('main', 'refback', 'Ref-Back einstellen', 4); // Execute this special file on registration - addIncludeToPool('extension', 'inc/gen_refback.php'); + addIncludeToPool('extension', 'inc/fix_refsystem.php'); break; case 'remove': // Do stuff when removing extension diff --git a/inc/extensions/ext-repair.php b/inc/extensions/ext-repair.php index 0bec21170c..5dd8206af3 100644 --- a/inc/extensions/ext-repair.php +++ b/inc/extensions/ext-repair.php @@ -41,10 +41,10 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.1.7'); +setThisExtensionVersion('0.1.8'); // Version history array (add more with , '0.0.1' and so on) -setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7')); +setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.8')); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running @@ -116,6 +116,13 @@ switch (getExtensionMode()) { case '0.1.7': // SQL queries for v0.1.7 addAdminMenuSql('repair','repair_lang','Sprachsystem', 'Findet nicht übersetzte Sprachelemente in allen Scripten. Dies kann eventuell sehr lange dauern. Haben Sie bitte solange Geduld.',5); + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Sprachdateien sind nun auch "reparierbar" - nicht durch das Script, das findet nur die nicht übersetzten Zeichenketten, sondern durch den Menschen."); + break; + + case '0.1.8': // SQL queries for v0.1.8 + addAdminMenuSql('repair','repair_refs','Referal-Tabelle', 'Setzt die Referal-Tabelle {?_MYSQL_PREFIX?}_user_refs zurück und baut diese neu auf. Dies sollten Sie nur tun, falls Ihre Mitglieder Ihnen Probleme mit Referals melden.',6); + // Update notes (these will be set as task text!) setExtensionUpdateNotes("Sprachdateien sind nun auch "reparierbar" - nicht durch das Script, das findet nur die nicht übersetzten Zeichenketten, sondern durch den Menschen."); break; diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index b34c6bdd89..4a65c5d0c9 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -472,7 +472,7 @@ INDEX (`refid`)", setExtensionUpdateNotes("Neues Tabellenlayout und verschoben von ext-refback."); // Load ext-refback's special include to regenerate the referal table - addIncludeToPool('extension', 'inc/gen_refback.php'); + addIncludeToPool('extension', 'inc/fix_refsystem.php'); break; } // END - switch break; diff --git a/inc/fix_refsystem.php b/inc/fix_refsystem.php new file mode 100644 index 0000000000..8608d51d73 --- /dev/null +++ b/inc/fix_refsystem.php @@ -0,0 +1,89 @@ + diff --git a/inc/gen_refback.php b/inc/gen_refback.php index fa4a874aca..f551ef47b7 100644 --- a/inc/gen_refback.php +++ b/inc/gen_refback.php @@ -1,89 +1,3 @@ diff --git a/inc/language/repair_de.php b/inc/language/repair_de.php index 78d3b109cb..426f03069f 100644 --- a/inc/language/repair_de.php +++ b/inc/language/repair_de.php @@ -47,6 +47,7 @@ addMessages(array( 'ADMIN_REPAIR_NOTHING_FIXED' => "Es wurden keine Einträge repariert.", 'ADMIN_REPAIR_LANGUAGE_TO_MUCH' => "Es sind mehr als 100 nicht existierende Elemente in der Zielsprachdatei gefunden worden.", 'ADMIN_REPAIR_LANGUAGE_TITLE' => "Analyse an den Sprachdateien", + 'ADMIN_REPAIR_REFERAL_SYSTEM_DONE' => "Das Referal-System wurde zurückgesetzt und neu aufgebaut.", )); // [EOF] diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 13ddfd2bb3..47d9f1cd55 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -274,7 +274,7 @@ ORDER BY if ((isExtensionInstalledAndNewer('sql_patches', '0.3.4')) && (isExtensionActive('user'))) { // Check for accounts without referal - addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `refid`=0 ORDER BY `userid` ASC"); + addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `refid`=0 OR `refid` IS NULL ORDER BY `userid` ASC"); $DESCRs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NOREF--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NOREFERAL_TITLE--}'; $WHATs[] = 'list_user&mode=norefs'; diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php index b330b66c25..0c86176452 100644 --- a/inc/modules/admin/what-list_user.php +++ b/inc/modules/admin/what-list_user.php @@ -188,20 +188,20 @@ LIMIT 1", case 'norefs': // Users w/o refs if (!empty($whereStatement)) { // Add AND statement - $whereStatement .= " AND `refid`=0"; + $whereStatement .= ' AND (`refid`=0 OR `refid` IS NULL)'; } else { // Add WHERE statement - $whereStatement = " WHERE `refid`=0"; + $whereStatement = ' WHERE (`refid`=0 OR `refid` IS NULL)'; } break; case 'random_refid': // Users available for random referal id if (!empty($whereStatement)) { // Add AND statement - $whereStatement .= " AND `rand_confirmed` >= {?user_min_confirmed?}"; + $whereStatement .= ' AND `rand_confirmed` >= {?user_min_confirmed?}'; } else { // Add WHERE statement - $whereStatement = " WHERE `rand_confirmed` >= {?user_min_confirmed?}"; + $whereStatement = ' WHERE `rand_confirmed` >= {?user_min_confirmed?}'; } break; diff --git a/inc/modules/admin/what-repair_refs.php b/inc/modules/admin/what-repair_refs.php new file mode 100644 index 0000000000..fd567dd7d1 --- /dev/null +++ b/inc/modules/admin/what-repair_refs.php @@ -0,0 +1,53 @@ +