From e5b18980201acd32b160d0b74371844a00538cc9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 8 Nov 2010 02:22:39 +0000 Subject: [PATCH] HTML improved, several tables are now have NULL and some more UNSIGNED (is both better) --- inc/extensions/ext-user.php | 41 +++++++++++++++++++ inc/modules/member/what-nickname.php | 2 +- templates/de/html/member/member_bonus.tpl | 30 +++++++------- .../member/member_reflink_no_nickname.tpl | 8 +++- 4 files changed, 62 insertions(+), 19 deletions(-) diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index 7bab04d851..708f2fe1be 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -373,6 +373,47 @@ PRIMARY KEY (`id`) // Update notes (these will be set as task text!) setExtensionUpdateNotes("Der Sperrgrund wird nun mit abgespeichert und beim Löschen des Users mit ausgesendet."); break; + + case '0.3.7': // SQL queries for v0.3.7 + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` CHANGE `id` `id` BIGINT( 22 ) UNSIGNED NOT NULL AUTO_INCREMENT"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL,"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` CHANGE `cat_id` `cat_id` TINYINT( 3 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_del` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `stats_id` `stats_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `bonus_id` `bonus_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` CHANGE `userid` `userid` BIGINT( 22 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` CHANGE `ref_depth` `ref_depth` TINYINT( 3 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `level` `level` SMALLINT( 6 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `refid` `refid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `cat_id` `cat_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `payment_id` `payment_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `pool_id` `pool_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats_data` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + + // Cleanup SQLs + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `userid` IS NULL OR `cat_id` IS NULL"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_del` WHERE `userid` IS NULL"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_links` SET `stats_id`=NULL WHERE `stats_id`=0"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_links` SET `bonus_id`=NULL WHERE `bonus_id`=0"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `userid` IS NULL"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `ref_depth`=NULL WHERE `ref_depth`=0"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid` IS NULL"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid` IS NULL OR `refid` IS NULL OR `level` IS NULL"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `cat_id`=NULL WHERE `cat_id`=0"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `payment_id`=NULL WHERE `payment_id`=0"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `pool_id`=NULL WHERE `pool_id`=0"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `userid` IS NULL"); + + // This update depends on ext-bonus + addExtensionDependency('bonus'); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("NULL ist wichtiger als 0 und UNSIGNED auch."); + break; } // END - switch break; diff --git a/inc/modules/member/what-nickname.php b/inc/modules/member/what-nickname.php index cbb0937736..d84f555aff 100644 --- a/inc/modules/member/what-nickname.php +++ b/inc/modules/member/what-nickname.php @@ -65,7 +65,7 @@ if (isFormSent()) { if ($isValid === true) { // Look for nickname in database (we only need just one entry so don't worry about the "LIMIT 1" !) - $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `nickname`='%s' AND `userid` != '%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `nickname`='%s' AND `userid` != %s LIMIT 1", array(postRequestParameter('nickname'), getMemberId()), __FILE__, __LINE__); if (SQL_HASZERONUMS($result)) { // Nickname not in use, so set it now diff --git a/templates/de/html/member/member_bonus.tpl b/templates/de/html/member/member_bonus.tpl index f3c21ca232..d0dff414f0 100644 --- a/templates/de/html/member/member_bonus.tpl +++ b/templates/de/html/member/member_bonus.tpl @@ -1,10 +1,10 @@ -
- -
-{--MEMBER_BONUS_HERE_IS_THE_LIST--} +
+
+ {--MEMBER_BONUS_HERE_IS_THE_LIST--} +
-
+
@@ -15,23 +15,22 @@ $content[rows] - +
{--BONUS_RANK--}:
-
+
- - -
{--MEMBER_BONUS_RALLYE_CONDITIONS--}: + + {--MEMBER_BONUS_RALLYE_CONDITIONS--}:
+
  1. Es werden nur aktive und freigeschaltete Mitglieder berücksichtig.
  2. Der Login-Bonus wird bei der Auswertung nicht beachtet, aber dem Mitglied gutgeschrieben.
  3. @@ -42,9 +41,8 @@
diff --git a/templates/de/html/member/member_reflink_no_nickname.tpl b/templates/de/html/member/member_reflink_no_nickname.tpl index c13473b33e..11fbf600ea 100644 --- a/templates/de/html/member/member_reflink_no_nickname.tpl +++ b/templates/de/html/member/member_reflink_no_nickname.tpl @@ -1,4 +1,8 @@
- {--MEMBER_NO_NICKNAME_SET--} - {--MEMBER_PLEASE_CLICK_NICKNAME_FORM--} +
+ {--MEMBER_NO_NICKNAME_SET--} +
+
-- 2.39.5