]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-order.php
Mailer used in many places, we still need a good 'selling' title
[mailer.git] / inc / modules / member / what-order.php
index da97a0a3d36b2930c7f4b968f82ad37379398680..a73cc895449baaa6c36b9a870278fdab428ec4db 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 10/19/2003 *
- * ===============                              Last change: 08/26/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 10/19/2003 *
+ * ===================                          Last change: 08/26/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-order.php                                   *
@@ -51,14 +51,14 @@ if ((!isExtensionActive('order')) && (!isAdmin())) {
        return;
 } // END - if
 
-$URL = ''; $id = 0;
+$URL = ''; $id = '0';
 $whereStatement = " WHERE `visible`='Y'";
 
 // Set undefined array elements
 if (isAdmin()) $whereStatement = '';
 
 // Count unconfirmed mails
-$links = countSumTotalData(getUserId(), 'user_links', 'id', 'userid', true);
+$links = countSumTotalData(getMemberId(), 'user_links', 'id', 'userid', true);
 
 // Do we have ext-holiday installed?
 $HOLIDAY = 'serid';
@@ -70,7 +70,7 @@ if ((isExtensionActive('holiday')) && (getExtensionVersion('holiday') >= '0.1.3'
 $result_mmails = SQL_QUERY_ESC("SELECT `userid`, `receive_mails`, `mail_orders`, `".$HOLIDAY."`
 FROM `{?_MYSQL_PREFIX?}_user_data`
 WHERE `userid`=%s AND `max_mails` > 0 LIMIT 1",
-       array(getUserId()), __FILE__, __LINE__);
+       array(getMemberId()), __FILE__, __LINE__);
 
 $mmails = SQL_NUMROWS($result_mmails);
 list($DMY, $MAXI, $ORDERS, $HOLIDAY) = SQL_FETCHROW($result_mmails);
@@ -85,7 +85,7 @@ $ALLOWED = $MAXI - $ORDERS;
 if (getConfig('order_max_full') == 'MAX') $ALLOWED = $MAXI;
 
 // Now check his points amount
-$total = countSumTotalData(getUserId(), 'user_points', 'points') - countSumTotalData(getUserId(), 'user_data', 'used_points');;
+$total = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points');;
 
 if (($HOLIDAY == 'Y') && (getExtensionVersion('holiday') >= '0.1.3')) {
        // Holiday is active!
@@ -103,12 +103,12 @@ WHERE
        `timestamp` > (UNIX_TIMESTAMP() - %s)
 LIMIT 1",
                array(
-                       getUserId(),
+                       getMemberId(),
                        postRequestElement('url'),
                        getConfig('url_tlock')
                ), __FILE__, __LINE__);
 
-       $type = 'TEMP'; $id = 0;
+       $type = 'TEMP'; $id = '0';
        if (SQL_NUMROWS($result) == 1) {
                // Load id and mail type
                list($id, $type) = SQL_FETCHROW($result);
@@ -221,7 +221,7 @@ ORDER BY
        d.%s %s",
                        array(
                                bigintval(postRequestElement('cat')),
-                               getUserId(),
+                               getMemberId(),
                                getConfig('order_select'),
                                getConfig('order_mode'),
                        ), __FILE__, __LINE__);
@@ -236,7 +236,7 @@ ORDER BY
                        } // END - if
 
                        // Load receivers from database
-                       $TEST = array(); $cnt = 0;
+                       $TEST = array(); $cnt = '0';
                        while ($holidayContent = SQL_FETCHARRAY($result)) {
                                if ($HOLIDAY) {
                                        // Check for his holiday status
@@ -248,7 +248,7 @@ WHERE
        `userid`=%s AND `holiday_start` < UNIX_TIMESTAMP() AND `holiday_end` > UNIX_TIMESTAMP()
 LIMIT 1",
                                                array($holidayContent['userid']), __FILE__, __LINE__);
-                                       if (SQL_NUMROWS($result_holiday) == 1) $holidayContent['userid'] = 0; // Exclude user who are in holiday
+                                       if (SQL_NUMROWS($result_holiday) == 1) $holidayContent['userid'] = '0'; // Exclude user who are in holiday
 
                                        // Free memory
                                        SQL_FREERESULT($result_holiday);
@@ -286,15 +286,15 @@ LIMIT 1",
                        // Check if he has enougth points for this order and selected more than 0 receivers
                        if (($USED > 0) && ($USED <= $total) && ($content['target_send'] > 0)) {
                                // Gettings points is okay, so we can add $USED later from
-                               if (($id == 0) || ($type != 'TEMP')) {
+                               if (($id == '0') || ($type != 'TEMP')) {
                                        // New order
-                                       $id = 0;
+                                       $id = '0';
                                        if (isExtensionActive('html_mail')) {
                                                // HTML extension is active
                                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_pool` (`sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `zip`, `html_msg`)
  VALUES ('%s','%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s','%s','%s','%s','%s')",
                                                        array(
-                                                               getUserId(),
+                                                               getMemberId(),
                                                                postRequestElement('subject'),
                                                                postRequestElement('text'),
                                                                $RECEIVER,
@@ -310,7 +310,7 @@ LIMIT 1",
                                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_pool` (`sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `zip`)
  VALUES ('%s','%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s','%s','%s','%s')",
                                                        array(
-                                                               getUserId(),
+                                                               getMemberId(),
                                                                postRequestElement('subject'),
                                                                postRequestElement('text'),
                                                                $RECEIVER,
@@ -384,12 +384,12 @@ LIMIT 1",
                                        }
                                }
 
-                               // Do we need to get the ID number?
-                               if ($id == 0) {
+                               // Do we need to get the id number?
+                               if ($id == '0') {
                                        // Order is placed as temporary. We need to get it's id for the frametester
                                        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `sender`=%s AND `subject`='%s' AND `payment_id`=%s AND `data_type`='TEMP' AND `timestamp`=UNIX_TIMESTAMP() LIMIT 1",
                                                array(
-                                                       getUserId(),
+                                                       getMemberId(),
                                                        postRequestElement('subject'),
                                                        bigintval(postRequestElement('type'))
                                                ), __FILE__, __LINE__);
@@ -401,9 +401,9 @@ LIMIT 1",
                                        SQL_FREERESULT($result);
                                } // END - if
 
-                               // ID is received so we can redirect the user, used points will be added when he send's out the mail
+                               // id is received so we can redirect the user, used points will be added when he send's out the mail
                                $URL = 'modules.php?module=frametester&amp;order=' . $id;
-                       } elseif ($content['target_send'] == 0) {
+                       } elseif ($content['target_send'] == '0') {
                                // Not enougth receivers found which can receive mails
                                $URL = 'modules.php?module=login&amp;what=order&amp;code=' . getCode('MORE_RECEIVERS2');
                        } else {
@@ -418,7 +418,7 @@ LIMIT 1",
 } elseif (postRequestElement('receiver') == '0') {
        // Not enougth receivers selected
        $URL = 'modules.php?module=login&amp;what=order&amp;code=' . getCode('MORE_RECEIVERS1');
-} elseif (($ALLOWED == 0) && (getConfig('order_max_full') == 'ORDER')) {
+} elseif (($ALLOWED == '0') && (getConfig('order_max_full') == 'ORDER')) {
        // No more mail orders allowed
        loadTemplate('admin_settings_saved', false, getMessage('MEMBER_ORDER_ALLOWED_EXHAUSTED'));
 } elseif (($links < getConfig('unconfirmed')) && ($mmails == 1)) {
@@ -455,9 +455,9 @@ ORDER BY
 
                                // Select users in current category
                                $result_userids = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `cat_id`=%s AND `userid` != '%s' ORDER BY `userid` ASC",
-                                       array(bigintval($categoriesContent['id']), getUserId()), __FILE__, __LINE__);
+                                       array(bigintval($categoriesContent['id']), getMemberId()), __FILE__, __LINE__);
 
-                               $userid_cnt = 0;
+                               $userid_cnt = '0';
                                while (list($ucat) = SQL_FETCHROW($result_userids)) {
                                        // Check for holiday system
                                        $HOL_ACTIVE = false;
@@ -521,7 +521,7 @@ LIMIT 1",
 
                        $types = array();
                        if (SQL_NUMROWS($result) > 0) {
-                               // Check for message ID in URL
+                               // Check for message id in URL
                                $message = getMessageFromErrorCode(getRequestElement('code'));
 
                                if (!empty($message)) {
@@ -574,7 +574,7 @@ WHERE
        `sender`=%s AND
        `data_type`='TEMP'
 LIMIT 1",
-                                       array(getUserId()), __FILE__, __LINE__);
+                                       array(getMemberId()), __FILE__, __LINE__);
 
                                if (SQL_NUMROWS($result) == 1) {
                                        // Old order found
@@ -685,7 +685,7 @@ LIMIT 1",
                // No cateogries are defined yet
                loadTemplate('admin_settings_saved', false, "<span class=\"member_failed\">{--MEMBER_NO_CATS--}</span>");
        }
-} elseif ($mmails == 0) {
+} elseif ($mmails == '0') {
        // Please set more than 0 mails per day
        loadTemplate('admin_settings_saved', false, getMessage('MEMBER_HAS_ZERO_MMAILS'));
 } else {