From 391c98ab7233ff3e640d8b9fad8df92ce45e9b31 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 10 Jun 2011 22:12:18 +0000 Subject: [PATCH] Extension 'ext-coupon' moved to branch, SQLs improved: - All database columns should be surrounded with backticks (`) in all SQL statements - Extension 'ext-coupon' resurrected from 'contrib' --- .gitattributes | 2 + inc/extensions/ext-coupon.php | 98 +++++++++++++++++++++++ inc/libs/rallye_functions.php | 4 +- inc/libs/task_functions.php | 2 +- inc/modules/admin/what-list_bonus.php | 2 +- inc/modules/admin/what-unlock_sponsor.php | 2 +- inc/modules/guest/what-mediadata.php | 2 +- inc/modules/guest/what-sponsor_login.php | 2 +- inc/modules/guest/what-sponsor_reg.php | 2 +- inc/modules/guest/what-top10.php | 2 +- inc/modules/member/what-beg2.php | 5 +- inc/modules/member/what-bonus.php | 2 +- inc/modules/member/what-unconfirmed.php | 3 +- inc/modules/sponsor/welcome.php | 2 +- inc/monthly/monthly_beg.php | 2 +- inc/monthly/monthly_bonus.php | 2 +- templates/de/html/ext/ext_coupon.tpl | 11 +++ 17 files changed, 129 insertions(+), 16 deletions(-) create mode 100644 inc/extensions/ext-coupon.php create mode 100644 templates/de/html/ext/ext_coupon.tpl diff --git a/.gitattributes b/.gitattributes index 26353d9e07..a88d175e0f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -139,6 +139,7 @@ inc/extensions/ext-booking.php svneol=native#text/plain inc/extensions/ext-cache.php svneol=native#text/plain inc/extensions/ext-clickbanner.php svneol=native#text/plain inc/extensions/ext-country.php svneol=native#text/plain +inc/extensions/ext-coupon.php svneol=native#text/plain inc/extensions/ext-debug.php svneol=native#text/plain inc/extensions/ext-demo.php svneol=native#text/plain inc/extensions/ext-doubler.php svneol=native#text/plain @@ -1381,6 +1382,7 @@ templates/de/html/ext/ext_booking.tpl svneol=native#text/plain templates/de/html/ext/ext_cache.tpl svneol=native#text/plain templates/de/html/ext/ext_clickbanner.tpl svneol=native#text/plain templates/de/html/ext/ext_country.tpl svneol=native#text/plain +templates/de/html/ext/ext_coupon.tpl svneol=native#text/plain templates/de/html/ext/ext_debug.tpl svneol=native#text/plain templates/de/html/ext/ext_demo.tpl svneol=native#text/plain templates/de/html/ext/ext_doubler.tpl svneol=native#text/plain diff --git a/inc/extensions/ext-coupon.php b/inc/extensions/ext-coupon.php new file mode 100644 index 0000000000..091971adb3 --- /dev/null +++ b/inc/extensions/ext-coupon.php @@ -0,0 +1,98 @@ + diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index b2fb6807a3..4fbc604ad9 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -108,7 +108,7 @@ LIMIT 1", // Add userid and his ref count to table $result_ref = SQL_QUERY_ESC("SELECT - SUM(p.points) AS points + SUM(p.points) AS `points` FROM `{?_MYSQL_PREFIX?}_user_points` AS p LEFT JOIN @@ -645,7 +645,7 @@ function getArrayFromReferalRallyeUsers ($rallye) { // Points of ref's $result_ref = SQL_QUERY_ESC("SELECT - SUM(p.points) AS points + SUM(p.points) AS `points` FROM `{?_MYSQL_PREFIX?}_user_points` AS p LEFT JOIN diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 6698aba4a0..46dd7e1dd4 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -340,7 +340,7 @@ ORDER BY } // END - if addSql("SELECT - " . $USE . " AS points + " . $USE . " AS `points` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE diff --git a/inc/modules/admin/what-list_bonus.php b/inc/modules/admin/what-list_bonus.php index 0667f2b89c..06731189cc 100644 --- a/inc/modules/admin/what-list_bonus.php +++ b/inc/modules/admin/what-list_bonus.php @@ -76,7 +76,7 @@ if (isBonusRallyeActive()) { // Check if at least one is in the active rallye $result = SQL_QUERY_ESC("SELECT - `userid`, `email`, `gender`, `surname`, `family`, ".$USE." AS points, `last_online` + `userid`, `email`, `gender`, `surname`, `family`, ".$USE." AS `points`, `last_online` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE diff --git a/inc/modules/admin/what-unlock_sponsor.php b/inc/modules/admin/what-unlock_sponsor.php index 74bd7e8ce9..3a1852f825 100644 --- a/inc/modules/admin/what-unlock_sponsor.php +++ b/inc/modules/admin/what-unlock_sponsor.php @@ -159,7 +159,7 @@ LIMIT 1", // Load referal's data $result = SQL_QUERY_ESC("SELECT `id`, `gender`, `surname`, `family`, `email`, - (`points_amount` - `points_used`) AS points, + (`points_amount` - `points_used`) AS `points`, `receive_warnings`, `ref_count` AS refs FROM `{?_MYSQL_PREFIX?}_sponsor_data` diff --git a/inc/modules/guest/what-mediadata.php b/inc/modules/guest/what-mediadata.php index 25ef23425d..a6f7d71807 100644 --- a/inc/modules/guest/what-mediadata.php +++ b/inc/modules/guest/what-mediadata.php @@ -243,7 +243,7 @@ WHERE if (isExtensionActive('transfer')) { // Statistics for points transfers $result = SQL_QUERY("SELECT - COUNT(t.id) AS cnt, SUM(t.points) AS points + COUNT(t.id) AS cnt, SUM(t.points) AS `points` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` AS t LEFT JOIN diff --git a/inc/modules/guest/what-sponsor_login.php b/inc/modules/guest/what-sponsor_login.php index b86614b9b2..7082a5cf0c 100644 --- a/inc/modules/guest/what-sponsor_login.php +++ b/inc/modules/guest/what-sponsor_login.php @@ -67,7 +67,7 @@ if (isGetRequestParameterSet('hash')) { `id`, `status`, `gender`, `surname`, `family`, `company`, `position`, `tax_ident`, `street_nr1`, `street_nr2`, `country`, `zip`, `city`, `email`, `phone`, `fax`, `cell`, - `points_amount` AS points, `last_payment`, `last_currency` + `points_amount` AS `points`, `last_payment`, `last_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php index 3a8a20154a..bc5bbdfcde 100644 --- a/inc/modules/guest/what-sponsor_reg.php +++ b/inc/modules/guest/what-sponsor_reg.php @@ -206,7 +206,7 @@ if ((isFormSent()) && (count($formErrors) == 0)) { // Calulate points $result = SQL_QUERY_ESC("SELECT - (`pay_rate` * `pay_min_count`) AS points, `pay_min_count` AS pay, `pay_currency` AS curr + (`pay_rate` * `pay_min_count`) AS `points`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE diff --git a/inc/modules/guest/what-top10.php b/inc/modules/guest/what-top10.php index 0e1d4904ad..a5ad5e61fa 100644 --- a/inc/modules/guest/what-top10.php +++ b/inc/modules/guest/what-top10.php @@ -110,7 +110,7 @@ SQL_FREERESULT($result); //// TOP earners $result = SQL_QUERY("SELECT d.userid, - (SUM(p.points) - d.used_points) AS points, + (SUM(p.points) - d.used_points) AS `points`, d.last_online FROM `{?_MYSQL_PREFIX?}_user_data` AS d diff --git a/inc/modules/member/what-beg2.php b/inc/modules/member/what-beg2.php index 996c31ae36..25b5bdce55 100644 --- a/inc/modules/member/what-beg2.php +++ b/inc/modules/member/what-beg2.php @@ -61,7 +61,7 @@ if (isExtensionActive('autopurge')) { // Let's check if there are some points left we can pay... $result = SQL_QUERY_ESC("SELECT - `userid`, `beg_points` AS points, `last_online` + `userid`, `beg_points`, `last_online` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE @@ -84,10 +84,11 @@ if (!SQL_HASZERONUMS($result)) { $count = 1; while ($content = SQL_FETCHARRAY($result)) { // Prepare data for the template + // @TODO points->beg_points $content = array( 'cnt' => $count, 'userid' => $content['userid'], - 'points' => $content['points'], + 'points' => $content['beg_points'], 'last_online' => generateDateTime($content['last_online'], 2), ); diff --git a/inc/modules/member/what-bonus.php b/inc/modules/member/what-bonus.php index 8c8233c23d..2fc94b378a 100644 --- a/inc/modules/member/what-bonus.php +++ b/inc/modules/member/what-bonus.php @@ -74,7 +74,7 @@ if (isExtensionActive('autopurge')) { // Let's check if there are some points left we can 'pay'... $result = SQL_QUERY_ESC("SELECT - `userid`, ".$USE." AS points, `last_online` + `userid`, ".$USE." AS `points`, `last_online` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE diff --git a/inc/modules/member/what-unconfirmed.php b/inc/modules/member/what-unconfirmed.php index 9f06817864..2cad2b449d 100644 --- a/inc/modules/member/what-unconfirmed.php +++ b/inc/modules/member/what-unconfirmed.php @@ -81,7 +81,8 @@ LIMIT 1", } elseif (isGetRequestParameterSet('mailid')) { // Display regular member mail by loading its full data $result_data = SQL_QUERY_ESC("SELECT - s.id, s.subject, p.text, s.timestamp_ordered AS `timestamp`, s.cat_id, pay.price AS points, p.sender, pay.time, p.data_type + s.id, s.subject, p.text, s.timestamp_ordered AS `timestamp`, + s.cat_id, pay.price AS `points`, p.sender, pay.time, p.data_type FROM `{?_MYSQL_PREFIX?}_user_stats` AS s LEFT JOIN diff --git a/inc/modules/sponsor/welcome.php b/inc/modules/sponsor/welcome.php index 1a37ea1118..a740df3933 100644 --- a/inc/modules/sponsor/welcome.php +++ b/inc/modules/sponsor/welcome.php @@ -49,7 +49,7 @@ if (!defined('__SECURITY')) { // Load some data $result = SQL_QUERY_ESC("SELECT - `id`, `gender`, `surname`, `family`, (`points_amount` - `points_used`) AS points + `id`, `gender`, `surname`, `family`, (`points_amount` - `points_used`) AS `points` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE diff --git a/inc/monthly/monthly_beg.php b/inc/monthly/monthly_beg.php index b0478424df..232bee7b0e 100644 --- a/inc/monthly/monthly_beg.php +++ b/inc/monthly/monthly_beg.php @@ -71,7 +71,7 @@ if ((getBegRanks() > 0) && (!isCssOutputMode())) { // SQL string to check for accounts $result_main = SQL_QUERY("SELECT - `userid`, `email`, `gender`, `surname`, `family`, `beg_points` AS points + `userid`, `email`, `gender`, `surname`, `family`, `beg_points` AS `points` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE diff --git a/inc/monthly/monthly_bonus.php b/inc/monthly/monthly_bonus.php index 35d5b1e7d4..ca916cb6bc 100644 --- a/inc/monthly/monthly_bonus.php +++ b/inc/monthly/monthly_bonus.php @@ -78,7 +78,7 @@ if ((getConfig('bonus_ranks') > 0) && (!isCssOutputMode())) { // Run SQL string to check for accounts $result_main = SQL_QUERY('SELECT - `userid`, `email`, `gender`, `surname`, `family`, (0' . $add . ') AS points + `userid`, `email`, `gender`, `surname`, `family`, (0' . $add . ') AS `points` FROM `{?_MYSQL_PREFIX?}_user_data` ' . $whereStatement1 . ' diff --git a/templates/de/html/ext/ext_coupon.tpl b/templates/de/html/ext/ext_coupon.tpl new file mode 100644 index 0000000000..ca0c5b6990 --- /dev/null +++ b/templates/de/html/ext/ext_coupon.tpl @@ -0,0 +1,11 @@ +
+ Stellen Sie Ihren neuen Mitgliedern Bonus-Coupons aus, mit denen sie an + Sonderaktionen, Bonus-Aktionen usw. dran teilnehmen lassen können! Es + können auch einfach nur Gutscheine versendet werden, die die Mitglieder + im Mitgliedsbereich einlösen und dafür {?POINTS?} erhalten. +
+ +
+ Für alle Gutscheine kann eine Ablaufzeit eingestellt werden, nach der + der Gutschein wieder verfällt. +
-- 2.39.5