]> git.mxchange.org Git - mailer.git/commitdiff
Extension 'ext-coupon' moved to branch, SQLs improved:
authorRoland Häder <roland@mxchange.org>
Fri, 10 Jun 2011 22:12:18 +0000 (22:12 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 10 Jun 2011 22:12:18 +0000 (22:12 +0000)
- All database columns should be surrounded with backticks (`) in all SQL
  statements
- Extension 'ext-coupon' resurrected from 'contrib'

17 files changed:
.gitattributes
inc/extensions/ext-coupon.php [new file with mode: 0644]
inc/libs/rallye_functions.php
inc/libs/task_functions.php
inc/modules/admin/what-list_bonus.php
inc/modules/admin/what-unlock_sponsor.php
inc/modules/guest/what-mediadata.php
inc/modules/guest/what-sponsor_login.php
inc/modules/guest/what-sponsor_reg.php
inc/modules/guest/what-top10.php
inc/modules/member/what-beg2.php
inc/modules/member/what-bonus.php
inc/modules/member/what-unconfirmed.php
inc/modules/sponsor/welcome.php
inc/monthly/monthly_beg.php
inc/monthly/monthly_bonus.php
templates/de/html/ext/ext_coupon.tpl [new file with mode: 0644]

index 26353d9e07519d6138f28a25cc22664426d5ed31..a88d175e0ff8d4d033820a09df1e6cef7533f01c 100644 (file)
@@ -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 (file)
index 0000000..091971a
--- /dev/null
@@ -0,0 +1,98 @@
+<?php
+/************************************************************************
+ * Mailer-Project 0.2.1-FINAL                         Start: 01/07/2005 *
+ * ==========================                   Last change: 01/07/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-coupon.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Coupon system                                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Coupon-System                                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} // END - if
+
+// Version number
+setThisExtensionVersion('0.0');
+
+// Version history array (add more with , '0.1' and so on)
+setExtensionVersionHistory(array('0.0'));
+
+switch (getExtensionMode()) {
+       case 'register': // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+               // SQL commands to run
+               addExtensionSql('');
+               break;
+
+       case 'remove': // Do stuff when removing extension
+               // SQL commands to run
+               addExtensionSql('');
+               break;
+
+       case 'activate': // Do stuff when admin activates this extension
+               // SQL commands to run
+               addExtensionSql('');
+               break;
+
+       case 'deactivate': // Do stuff when admin deactivates this extension
+               // SQL commands to run
+               addExtensionSql('');
+               break;
+
+       case 'update': // Update an extension
+               switch (getCurrentExtensionVersion()) {
+                       case '0.0.1': // SQL queries for v0.0.1
+                               addExtensionSql('');
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes('');
+                               break;
+               } // END - switch
+               break;
+
+       case 'modify': // When the extension got modified
+               break;
+
+       case 'test': // For testing purposes
+               break;
+
+       case 'init': // Do stuff when extension is initialized
+               break;
+
+       default: // Unknown extension mode
+               logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
+               break;
+} // END - switch
+
+// [EOF]
+?>
index b2fb6807a3a5abb1683c7fcfed959f5c7de7cf7b..4fbc604ad9172a2b642901f00183e75c12ef4b37 100644 (file)
@@ -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
index 6698aba4a0eeca1942afd6b02c48e6c4b0314b91..46dd7e1dd4406f5bd27a1c961f813f26fc739d43 100644 (file)
@@ -340,7 +340,7 @@ ORDER BY
                } // END - if
 
                addSql("SELECT
-       " . $USE . " AS points
+       " . $USE . " AS `points`
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
index 0667f2b89cb4a0df68c476d91a4cbc771f5ffd3c..06731189cccf177302244265ad27a9ed5bad26f6 100644 (file)
@@ -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
index 74bd7e8ce913676eee5cbe2d93cf4d3064d98e09..3a1852f82561ac98ef5512ffd68d79ce115d7d1a 100644 (file)
@@ -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`
index 25ef23425dfc6bf629b0949a8738e7fe4b9d16f9..a6f7d718077d903b38394d32a4431c1212028649 100644 (file)
@@ -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
index b86614b9b24d1670c99b9b893b05ffa91d648cef..7082a5cf0cf17c01ce88da9347fecea4c9da23b5 100644 (file)
@@ -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
index 3a8a20154a6fab27124f59e44cbfba569a87f65c..bc5bbdfcdea337564f92a30bd4a25b4f0a4e18e5 100644 (file)
@@ -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
index 0e1d4904ad2c1771102ca3af4304d9bb1e3165eb..a5ad5e61faac792850edddcf981b50a5fe52f9e2 100644 (file)
@@ -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
index 996c31ae3622b5b923854c42e70bb81abbe2c141..25b5bdce5577eb930160866f9f3bf756ceca9bb0 100644 (file)
@@ -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),
                );
 
index 8c8233c23de57fb393bb5ab819dd623041a0b406..2fc94b378ae610245231f27453fd96514b972215 100644 (file)
@@ -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
index 9f06817864c1db879a0345c6bebec93eb41712ff..2cad2b449d48c892b095099c379141d9795fa742 100644 (file)
@@ -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
index 1a37ea11186a84683ac025b6118208a66ee246e0..a740df393395ed9e9b1a7192442c7ec80e1820bc 100644 (file)
@@ -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
index b0478424df25c446550972be26a434278a6545e2..232bee7b0e91083fa2ee255dfd17b4c0f439a94b 100644 (file)
@@ -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
index 35d5b1e7d4c1ec1bd79cf45c575c26596c46b975..ca916cb6bc5cffa5d892d51261882d19732c1a93 100644 (file)
@@ -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 (file)
index 0000000..ca0c5b6
--- /dev/null
@@ -0,0 +1,11 @@
+<div class="para">
+       Stellen Sie Ihren neuen Mitgliedern Bonus-Coupons aus, mit denen sie an
+       Sonderaktionen, Bonus-Aktionen usw. dran teilnehmen lassen k&ouml;nnen! Es
+       k&ouml;nnen auch einfach nur Gutscheine versendet werden, die die Mitglieder
+       im Mitgliedsbereich einl&ouml;sen und daf&uuml;r {?POINTS?} erhalten.
+</div>
+
+<div class="para">
+       F&uuml;r alle Gutscheine kann eine Ablaufzeit eingestellt werden, nach der
+       der Gutschein wieder verf&auml;llt.
+</div>