From 528cb262219d23d8023ec549cd168edb71ef409c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 21 Jul 2010 01:38:58 +0000 Subject: [PATCH] Naming convention applied (database columns, keys), Code cosmetics applied: - Naming convention applied on some old-lost database column names (ext-sponsor) - Notation of SQL queries improved - Other minor code improvements - TODOs.txt updated --- DOCS/TODOs.txt | 1 - inc/extensions/ext-admins.php | 2 +- inc/extensions/ext-bonus.php | 2 +- inc/extensions/ext-doubler.php | 4 +- inc/extensions/ext-holiday.php | 8 +-- inc/extensions/ext-mods.php | 2 +- inc/extensions/ext-payout.php | 2 +- inc/extensions/ext-sponsor.php | 66 +++++++++---------- inc/libs/sponsor_functions.php | 8 +-- inc/modules/admin/what-del_sponsor.php | 2 +- inc/modules/admin/what-list_sponsor.php | 2 +- inc/modules/admin/what-list_task.php | 2 +- inc/modules/admin/what-unlock_sponsor.php | 4 +- inc/modules/guest/what-sponsor_infos.php | 31 +++++---- inc/modules/guest/what-sponsor_login.php | 4 +- inc/modules/sponsor/account.php | 4 +- inc/modules/sponsor/settings.php | 4 +- inc/modules/sponsor/welcome.php | 2 +- .../de/html/guest/guest_sponsor_act_row.tpl | 10 +-- 19 files changed, 82 insertions(+), 78 deletions(-) diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 1afabe3353..5be000cebf 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -150,7 +150,6 @@ ./inc/modules/guest/what-mediadata.php:183:// @TODO Rewrite all these if-blocks to filters ./inc/modules/guest/what-mediadata.php:70: // @TODO Find a better formular than this one ./inc/modules/guest/what-rallyes.php:91: // @TODO Reactivate this: $content['admin'] = '' . $login . ''; -./inc/modules/guest/what-sponsor_infos.php:70: // @TODO Rewritings: conv->conv_rate,name->conv_name in template ./inc/modules/guest/what-sponsor_reg.php:290: // @TODO Swap this HTML code to templates ./inc/modules/guest/what-stats.php:116: // @TODO This can be somehow rewritten ./inc/modules/guest/what-stats.php:76:// @TODO This can be rewritten in a dynamic include diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index 93f877642b..1f9f64eba7 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -278,7 +278,7 @@ PRIMARY KEY (id) break; case '0.6.9': // SQL queries for v0.6.9 - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET title = 'Admin-Management' WHERE action = 'admins' AND (`what`='' OR `what` IS NULL) LIMIT 1"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Admin-Management' WHERE `action`='admins' AND (`what`='' OR `what` IS NULL) LIMIT 1"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Verwaltung nach Management umbenannt."); diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index 2e83eba753..a88acfd01c 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -70,7 +70,7 @@ switch (getExtensionMode()) { `mails_sent` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, KEY (`cat_id`), PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?} COMMENT='Bonus mails'"); +) TYPE={?_TABLE_TYPE?} COMMENT='Bonus mails'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` MODIFY `link_type` ENUM('NORMAL','BONUS') NOT NULL DEFAULT 'NORMAL'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` ADD `bonus_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` ADD INDEX (`bonus_id`)"); diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index 8181c9e06f..f569b33740 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -58,13 +58,13 @@ switch (getExtensionMode()) { `refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, `remote_ip` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0', -`timemark` VARCHAR(10) NOT NULL DEFAULT '', +`timemark` BIGINT(10) NOT NULL DEFAULT 0, `completed` ENUM('Y','N') NOT NULL DEFAULT 'N', `is_ref` ENUM('Y','N') NOT NULL DEFAULT 'N', KEY (`refid`), KEY (`userid`), PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?}"); +) TYPE={?_TABLE_TYPE?}"); // // --- SETTINGS --- diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index 07876b382a..e503ed5851 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -191,9 +191,9 @@ PRIMARY KEY (id) break; case '0.1.8': // SQL queries for v0.1.8 - addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (la_id, la_action, la_what) VALUES ('member', '', 'list_holiday')"); - addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (la_id, la_action, la_what) VALUES ('member', '', 'del_holiday')"); - addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (la_id, la_action, la_what) VALUES ('config', '', 'config_holiday')"); + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (`la_id`, `la_action`, `la_what`) VALUES ('member', '', 'list_holiday')"); + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (`la_id`, `la_action`, `la_what`) VALUES ('member', '', 'del_holiday')"); + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (`la_id`, `la_action`, `la_what`) VALUES ('config', '', 'config_holiday')"); // Depends on sql_patches (or you have to execute these both SQL statements by phpMyAdmin addExtensionUpdateDependency('sql_patches'); @@ -210,7 +210,7 @@ PRIMARY KEY (id) break; case '0.2.0': // SQL queries for v0.2.0 - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET title = 'Urlaubsmanagement' WHERE action = 'holiday' AND (`what`='' OR `what` IS NULL) LIMIT 1"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Urlaubsmanagement' WHERE `action`='holiday' AND (`what`='' OR `what` IS NULL) LIMIT 1"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut."); diff --git a/inc/extensions/ext-mods.php b/inc/extensions/ext-mods.php index 59a6ee591d..5c6fd30af2 100644 --- a/inc/extensions/ext-mods.php +++ b/inc/extensions/ext-mods.php @@ -105,7 +105,7 @@ switch (getExtensionMode()) { break; case '0.0.8': // SQL queries for v0.0.8 - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET title = 'Modul-Management' WHERE action = 'mods' AND (`what`='' OR `what` IS NULL) LIMIT 1"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Modul-Management' WHERE `action`='mods' AND (`what`='' OR `what` IS NULL) LIMIT 1"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Verwaltung auf Management umgestellt."); diff --git a/inc/extensions/ext-payout.php b/inc/extensions/ext-payout.php index 0e81799228..cf8fa78a63 100644 --- a/inc/extensions/ext-payout.php +++ b/inc/extensions/ext-payout.php @@ -226,7 +226,7 @@ PRIMARY KEY (id) break; case '0.3.7': // SQL queries for v0.3.7 - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET title = 'Auszahlungsmanagement' WHERE action = 'payouts' AND (`what`='' OR `what` IS NULL) LIMIT 1"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Auszahlungsmanagement' WHERE `action`='payouts' AND (`what`='' OR `what` IS NULL) LIMIT 1"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Verwaltung nach Management umgestellt."); diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index bdb4d60333..fb45c08693 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -93,34 +93,34 @@ switch (getExtensionMode()) { `points_used` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, `refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `ref_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -`hash` VARCHAR(32) NOT NULL DEFAULT '', -`last_pay` FLOAT(7,2) UNSIGNED NOT NULL DEFAULT '0.00', +`hash` VARCHAR(32) NULL DEFAULT NULL, +`last_pay` FLOAT(7,2) UNSIGNED NOT NULL DEFAULT 0.00, `last_curr` VARCHAR(255) NOT NULL DEFAULT '€', INDEX (`refid`), INDEX (`email`), UNIQUE KEY (`hash`), PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?}"); +) TYPE={?_TABLE_TYPE?}"); // // Sponsor orders // addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_orders`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_orders` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, -`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `regid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -`payid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `pay_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `pay_status` ENUM('PENDING','PAYED','UNPAYED','DELETED') NOT NULL DEFAULT 'PENDING', `pay_ordered` VARCHAR(10) NOT NULL DEFAULT 0, `pay_done` VARCHAR(10) NOT NULL DEFAULT 0, -INDEX (`payid`), +INDEX (`payment_id`), INDEX (`regid`), INDEX (`admin_id`), -INDEX (`sponsorid`), +INDEX (`sponsor_id`), PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?}"); +) TYPE={?_TABLE_TYPE?}"); // // Pay-types // @@ -132,7 +132,7 @@ PRIMARY KEY (`id`) `pay_min_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 1, `pay_currency` VARCHAR(255) NOT NULL DEFAULT '€', PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?}"); +) TYPE={?_TABLE_TYPE?}"); // // Points-to-action converting // @@ -144,7 +144,7 @@ PRIMARY KEY (`id`) `conv_name` VARCHAR(255) NOT NULL DEFAULT 'Mails', INDEX (`ext_name`), PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?}"); +) TYPE={?_TABLE_TYPE?}"); // // Sponsor menu system (default) // @@ -160,7 +160,7 @@ INDEX (`action`), UNIQUE KEY `action_what` (`action`,`what`), UNIQUE KEY (`what`), PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?}"); +) TYPE={?_TABLE_TYPE?}"); // // Registry for performable actions by your sponsors // @@ -174,44 +174,44 @@ PRIMARY KEY (`id`) INDEX (`ext_name`), INDEX (`admin_id`), PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?}"); +) TYPE={?_TABLE_TYPE?}"); // // URLs from the sponsors // addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_urls`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_urls` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, -`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `url` VARCHAR(255) NOT NULL DEFAULT 'http://', `title` VARCHAR(255) NOT NULL DEFAULT '', `clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `status` ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING', -INDEX (`sponsorid`), +INDEX (`sponsor_id`), PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?}"); +) TYPE={?_TABLE_TYPE?}"); // // Banners of any size from the sponsors // addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_banner`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_banner` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, -`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `url` VARCHAR(255) NOT NULL DEFAULT 'http://', `alternate` VARCHAR(255) NOT NULL DEFAULT '', `width` INT(7) UNSIGNED NOT NULL DEFAULT 468, `height` INT(7) UNSIGNED NOT NULL DEFAULT 60, `views` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `status` ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING', -INDEX (`sponsorid`), +INDEX (`sponsor_id`), PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?}"); +) TYPE={?_TABLE_TYPE?}"); // // Campaigns // addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaigns`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_campaigns` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, -`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `campaign_name` VARCHAR(255) NOT NULL DEFAULT '', `campaign_start` VARCHAR(10) NOT NULL DEFAULT 0, @@ -224,9 +224,9 @@ PRIMARY KEY (`id`) `locked_timestamp` VARCHAR(10) NOT NULL DEFAULT 0, `status` ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING', INDEX (`admin_id`), -INDEX (`sponsorid`), +INDEX (`sponsor_id`), PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?}"); +) TYPE={?_TABLE_TYPE?}"); // // Campaigns + URLs + Banner // @@ -242,7 +242,7 @@ INDEX (`bannerid`), INDEX (`urlid`), INDEX (`campaignid`), PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?}"); +) TYPE={?_TABLE_TYPE?}"); // // Allowed data to display (administrative) // @@ -252,19 +252,19 @@ PRIMARY KEY (`id`) `data_row` VARCHAR(255) NOT NULL DEFAULT '', `display` ENUM('Y','N') NOT NULL DEFAULT 'N', PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?}"); +) TYPE={?_TABLE_TYPE?}"); // // Allowed data to display (sponsor-side) // addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_display_data`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_display_data` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, -`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `data_row` VARCHAR(255) NOT NULL DEFAULT '', `display` ENUM('Y','N') NOT NULL DEFAULT 'N', -INDEX (`sponsorid`), +INDEX (`sponsor_id`), PRIMARY KEY (`id`) -)TYPE={?_TABLE_TYPE?}"); +) TYPE={?_TABLE_TYPE?}"); // // Default allowed data to display // @@ -321,9 +321,9 @@ PRIMARY KEY (`id`) addAdminMenuSql('sponsor','allow_sponsor_data','Datenverwaltung','Stellen Sie hier ein, welche Daten der Sponsor im Mitgliedsbereich über sicht anzeigen darf und welche nicht.', 7); addAdminMenuSql('sponsor','list_sponsor_pays','Bestellungen...','Bestellungen der Sponsoren auflisten / bearbeiten.', 8); addAdminMenuSql('sponsor','list_sponsor_menu','Sponsorenmenü','Das Sponsorenmenü kann hier geändert werden.', 9); - addAdminMenuSql('sponsor','list_sponsor_campaigns','Kampagnen...','Verwaltung aller von Ihren Sponsoren eingerichteten Kampagnen.', 10); - addAdminMenuSql('sponsor','list_sponsor_urls','URL-Verwaltung','Verwaltung (freischalten, sperren, löschen, testen, bearbeiten usw.) von gebuchten URLs.', 11); - addAdminMenuSql('sponsor','list_sponsor_banner','Banner-Verwaltung','Verwaltung (freischalten, sperren, löschen, testen, bearbeiten usw.) von gebuchten Bannern.', 12); + addAdminMenuSql('sponsor','list_sponsor_campaigns','Kampagnen...','Management aller von Ihren Sponsoren eingerichteten Kampagnen.', 10); + addAdminMenuSql('sponsor','list_sponsor_urls','URL-Management','Management (freischalten, sperren, löschen, testen, bearbeiten usw.) von gebuchten URLs.', 11); + addAdminMenuSql('sponsor','list_sponsor_banner','Banner-Management','Management (freischalten, sperren, löschen, testen, bearbeiten usw.) von gebuchten Bannern.', 12); addAdminMenuSql('sponsor','list_sponsor_reg','Sponsor-Aktionen','Alle Sponsor-Aktionen auflisten und verwalten.', 13); addAdminMenuSql('sponsor','list_sponsor_pay','Buchungspakete','Die Sponsoren können sich {OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Pakete kaufen. Hier können Sie diese verwalten.', 14); addAdminMenuSql('sponsor','list_sponsor_conv','{OPEN_CONFIG}POINTS{CLOSE_CONFIG} umwandeln...','Mit den vom Sponsor gekauften {OPEN_CONFIG}POINTS{CLOSE_CONFIG} kann er Aktionen buchen. Hier stellen Sie die Umrechnungsrate von {OPEN_CONFIG}POINTS{CLOSE_CONFIG} nach Sponsoraktionen um. Beispiel: 1 {OPEN_CONFIG}POINTS{CLOSE_CONFIG} = 10 Mails.', 15); @@ -354,8 +354,8 @@ PRIMARY KEY (`id`) addSponsorMenuSql('main','welcome','Willkommen','N', 1); addSponsorMenuSql('main','account','Ihr Account','N', 2); addSponsorMenuSql('main','campaigns','Kampagnen','N', 3); - addSponsorMenuSql('main','list_urls','URL-Verwaltung','N', 4); - addSponsorMenuSql('main','list_banner','Banner-Verwaltung','N', 5); + addSponsorMenuSql('main','list_urls','URL-Management','N', 4); + addSponsorMenuSql('main','list_banner','Banner-Management','N', 5); addSponsorMenuSql('main','settings','Einstellungen','N', 6); addSponsorMenuSql('main','fillup','Konto auffüllen','N', 7); addSponsorMenuSql('main','stats','Statistiken','N', 8); @@ -418,7 +418,7 @@ PRIMARY KEY (`id`) // Update notes (these will be set as task text!) setExtensionUpdateNotes(''); break; - } + } // END - switch break; case 'modify': // When the extension got modified @@ -433,7 +433,7 @@ PRIMARY KEY (`id`) default: // Unknown extension mode logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); break; -} +} // END - switch // [EOF] ?> diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index c6cd2e5b34..e1d3f99d83 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -243,7 +243,7 @@ function isSponsorRegisteredWithEmail ($email) { function isSponsor () { // Failed... $ret = false; - if ((isSessionVariableSet('sponsorid')) && (isSessionVariableSet('sponsorpass'))) { + if ((isSessionVariableSet('sponsor_id')) && (isSessionVariableSet('sponsorpass'))) { // Check cookies against database records... $result = SQL_QUERY_ESC("SELECT `id` @@ -253,7 +253,7 @@ WHERE `id`='%s' AND `password`='%s' AND `status`='CONFIRMED' LIMIT 1", array( - bigintval(getSession('sponsorid')), + bigintval(getSession('sponsor_id')), getSession('sponsorpass') ), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -377,7 +377,7 @@ function updateSponsorLogin () { SET `last_online`=UNIX_TIMESTAMP() WHERE `id`='%s' AND `password`='%s' LIMIT 1", array( - bigintval(getSession('sponsorid')), + bigintval(getSession('sponsor_id')), getSession('sponsorpass') ), __FUNCTION__, __LINE__); @@ -449,7 +449,7 @@ function saveSponsorData ($postData, $content) { // Add SQL tail data $sql .= " WHERE `id`=%s AND `password`='%s' LIMIT 1"; - $DATA[] = bigintval(getSession('sponsorid')); + $DATA[] = bigintval(getSession('sponsor_id')); $DATA[] = getSession('sponsorpass'); // Saving data was completed... ufff... diff --git a/inc/modules/admin/what-del_sponsor.php b/inc/modules/admin/what-del_sponsor.php index 98805ddfc9..633a7c79bc 100644 --- a/inc/modules/admin/what-del_sponsor.php +++ b/inc/modules/admin/what-del_sponsor.php @@ -68,7 +68,7 @@ if (isGetRequestParameterSet('id')) { array(bigintval(getRequestParameter('id'))), __FILE__, __LINE__); // Remove orders - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_orders` WHERE `sponsorid`='%s' LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_orders` WHERE `sponsor_id`='%s' LIMIT 1", array(bigintval(getRequestParameter('id'))), __FILE__, __LINE__); // Output message diff --git a/inc/modules/admin/what-list_sponsor.php b/inc/modules/admin/what-list_sponsor.php index b0f0cf593d..b840333adb 100644 --- a/inc/modules/admin/what-list_sponsor.php +++ b/inc/modules/admin/what-list_sponsor.php @@ -78,7 +78,7 @@ WHERE $content['last_online'] = generateDateTime($content['last_online'], 2); $content['last_change'] = generateDateTime($content['last_change'], 2); // Orders total - $content['orders'] = countSumTotalData(bigintval(getRequestParameter('id')), 'sponsor_orders', 'id', 'sponsorid', true); + $content['orders'] = countSumTotalData(bigintval(getRequestParameter('id')), 'sponsor_orders', 'id', 'sponsor_id', true); // Load template loadTemplate('admin_list_sponsor_details', false, $content); diff --git a/inc/modules/admin/what-list_task.php b/inc/modules/admin/what-list_task.php index dc82a683bd..23b8613289 100644 --- a/inc/modules/admin/what-list_task.php +++ b/inc/modules/admin/what-list_task.php @@ -55,7 +55,7 @@ if (!isGetRequestParameterSet('type')) setGetRequestParameter('type', 'your'); switch (getRequestParameter('type')) { case 'your': // List only your own open (new) tasks - $whereStatement = "`assigned_admin`='".getCurrentAdminId()."' AND `status`='NEW' AND `task_type` != 'EXTENSION_UPDATE'"; + $whereStatement = "`assigned_admin`=".getCurrentAdminId()." AND `status`='NEW' AND `task_type` != 'EXTENSION_UPDATE'"; break; case 'updates': // List only updates assigned to you diff --git a/inc/modules/admin/what-unlock_sponsor.php b/inc/modules/admin/what-unlock_sponsor.php index 5fde9c5571..55735a498b 100644 --- a/inc/modules/admin/what-unlock_sponsor.php +++ b/inc/modules/admin/what-unlock_sponsor.php @@ -81,9 +81,9 @@ FROM LEFT JOIN `{?_MYSQL_PREFIX?}_sponsor_paytypes` AS sp ON - sp.id=so.payid + sp.id=so.payment_id WHERE - so.sponsorid='%s' + so.sponsor_id=%s ORDER BY sp.pay_name ASC", array($content['id']), __FILE__, __LINE__); diff --git a/inc/modules/guest/what-sponsor_infos.php b/inc/modules/guest/what-sponsor_infos.php index ae57f8345b..d2060c5357 100644 --- a/inc/modules/guest/what-sponsor_infos.php +++ b/inc/modules/guest/what-sponsor_infos.php @@ -55,25 +55,28 @@ $result_act = false; $result_pay = false; // Load all sponsor actions -$result_act = SQL_QUERY("SELECT m.title, c.conv_rate, c.conv_name -FROM `{?_MYSQL_PREFIX?}_sponsor_menu` AS m -LEFT JOIN `{?_MYSQL_PREFIX?}_sponsor_action_convert` AS c ON m.what=c.ext_name -LEFT JOIN `{?_MYSQL_PREFIX?}_sponsor_registry` AS r ON m.what=r.ext_name -WHERE m.`action`='actions' AND r.is_active='Y' -ORDER BY m.sort ASC", __FILE__, __LINE__); +$result_act = SQL_QUERY("SELECT + m.title AS `conv_title`, c.conv_rate, c.conv_name +FROM + `{?_MYSQL_PREFIX?}_sponsor_menu` AS m +LEFT JOIN + `{?_MYSQL_PREFIX?}_sponsor_action_convert` AS c +ON + m.what=c.ext_name +LEFT JOIN + `{?_MYSQL_PREFIX?}_sponsor_registry` AS r +ON + m.what=r.ext_name +WHERE + m.`action`='actions' AND + r.is_active='Y' +ORDER BY + m.sort ASC", __FILE__, __LINE__); if (!SQL_HASZERONUMS($result_act)) { // Load all actions $OUT_ACT = ''; while ($content = SQL_FETCHARRAY($result_act)) { - // Prepare data for the row template - // @TODO Rewritings: conv->conv_rate,name->conv_name in template - $content = array( - 'title' => $content['title'], - 'conv' => round($content['conv_rate']), - 'name' => $content['conv_name'], - ); - // Load row template and switch color $OUT_ACT .= loadTemplate('guest_sponsor_act_row', true, $content); } // END - while diff --git a/inc/modules/guest/what-sponsor_login.php b/inc/modules/guest/what-sponsor_login.php index 89b66c180c..8bd46e44f8 100644 --- a/inc/modules/guest/what-sponsor_login.php +++ b/inc/modules/guest/what-sponsor_login.php @@ -242,14 +242,14 @@ LIMIT 1", // Check status and login data ... $result = SQL_QUERY_ESC("SELECT status FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `id`='%s' AND password='%s' LIMIT 1", - array(bigintval(postRequestParameter('sponsorid')), md5(postRequestParameter('pass'))), __FILE__, __LINE__); + array(bigintval(postRequestParameter('sponsor_id')), md5(postRequestParameter('pass'))), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Okay, first login data check passed, now has he/she an approved (CONFIRMED) account? list($status) = SQL_FETCHROW($result); if ($status == 'CONFIRMED') { // Is confirmed so both is fine and we can continue with login procedure - $login = ((setSession('sponsorid' , bigintval(postRequestParameter('sponsorid')))) && + $login = ((setSession('sponsor_id' , bigintval(postRequestParameter('sponsor_id')))) && (setSession('sponsorpass', md5(postRequestParameter('pass')) )) ); diff --git a/inc/modules/sponsor/account.php b/inc/modules/sponsor/account.php index fe9dec08e9..84204e4336 100644 --- a/inc/modules/sponsor/account.php +++ b/inc/modules/sponsor/account.php @@ -62,7 +62,7 @@ WHERE `password`='%s' LIMIT 1", array( - bigintval(getSession('sponsorid')), + bigintval(getSession('sponsor_id')), getSession('sponsorpass') ), __FILE__, __LINE__); @@ -144,7 +144,7 @@ if (SQL_NUMROWS($result) == 1) { } } else { // Sponsor account not found! - $OUT = loadTemplate('admin_settings_saved', true, getMaskedMessage('SPONSOR_ACCOUNT_404', getSession('sponsorid'))); + $OUT = loadTemplate('admin_settings_saved', true, getMaskedMessage('SPONSOR_ACCOUNT_404', getSession('sponsor_id'))); } // Free memory diff --git a/inc/modules/sponsor/settings.php b/inc/modules/sponsor/settings.php index d5d9b78ac5..76f73ac9f6 100644 --- a/inc/modules/sponsor/settings.php +++ b/inc/modules/sponsor/settings.php @@ -62,7 +62,7 @@ WHERE `password`='%s' LIMIT 1", array( - bigintval(getSession('sponsorid')), + bigintval(getSession('sponsor_id')), getSession('sponsorpass') ), __FILE__, __LINE__); @@ -122,7 +122,7 @@ if (SQL_NUMROWS($result) == 1) { } } else { // Sponsor account not found! - $OUT = loadTemplate('admin_settings_saved', true, getMaskedMessage('SPONSOR_ACCOUNT_404', getSession('sponsorid'))); + $OUT = loadTemplate('admin_settings_saved', true, getMaskedMessage('SPONSOR_ACCOUNT_404', getSession('sponsor_id'))); } // Free memory diff --git a/inc/modules/sponsor/welcome.php b/inc/modules/sponsor/welcome.php index 3748ee35cf..7aac1a7a27 100644 --- a/inc/modules/sponsor/welcome.php +++ b/inc/modules/sponsor/welcome.php @@ -59,7 +59,7 @@ WHERE `password`='%s' LIMIT 1", array( - bigintval(getSession('sponsorid')), + bigintval(getSession('sponsor_id')), getSession('sponsorpass') ), __FILE__, __LINE__); diff --git a/templates/de/html/guest/guest_sponsor_act_row.tpl b/templates/de/html/guest/guest_sponsor_act_row.tpl index 64394adfaf..f93df27dbe 100644 --- a/templates/de/html/guest/guest_sponsor_act_row.tpl +++ b/templates/de/html/guest/guest_sponsor_act_row.tpl @@ -1,6 +1,8 @@ - $content[title]:  - -
1 {?POINTS?} = $content[conv] $content[name]
- + $content[conv_title]: + +
+ 1 {?POINTS?} = $content[conv_rate] $content[conv_name] +
+ -- 2.39.5