]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-order.php
More EL used, this has fixed double calls of translateComma() in various places
[mailer.git] / inc / modules / member / what-order.php
index 1b1dd1984c29df084f31ad63e4dd97a93faa967c..f891d0609fa8f7d36799e234691f702d188df50f 100644 (file)
@@ -14,8 +14,6 @@
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
@@ -122,7 +120,7 @@ LIMIT 1",
                } // END - if
 
                // And shall I check that his URL is not in the black list?
-               if (getConfig('url_blacklist') == 'Y') {
+               if (isUrlBlaskEnabled()) {
                        // Ok, I do that for you know...
                        $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`timestamp`) AS tstamp FROM `{?_MYSQL_PREFIX?}_url_blacklist` WHERE `url`='%s' LIMIT 1",
                                array(postRequestParameter('url')), __FILE__, __LINE__);
@@ -173,7 +171,7 @@ LIMIT 1",
                } // END - if
        } elseif (!isAdmin()) {
                // He has already sent a mail within a specific time
-               $url = 'modules.php?module=login&what=order&code=' . getCode('URL_TLOCK') . '&id=' . $id;
+               $url = 'modules.php?module=login&what=order&code=' . getCode('URL_TIME_LOCK') . '&id=' . $id;
        }
 
        // Still no error?
@@ -203,12 +201,10 @@ WHERE
        d.receive_mails > 0
        ".$add."
 ORDER BY
-       d.%s %s",
+       d.{?order_select?} {?order_mode?}",
                        array(
                                bigintval(postRequestParameter('cat')),
-                               getMemberId(),
-                               getConfig('order_select'),
-                               getConfig('order_mode'),
+                               getMemberId()
                        ), __FILE__, __LINE__);
 
                // Do we enougth receivers left?
@@ -250,7 +246,10 @@ LIMIT 1",
 
                        // Update receiver list
                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `receive_mails`=`receive_mails`-1 WHERE `userid` IN (%s) LIMIT %s",
-                               array(convertReceivers($receiver), $content['target_send']), __FILE__, __LINE__);
+                               array(
+                                       convertReceivers($receiver),
+                                       $content['target_send']
+                               ), __FILE__, __LINE__);
 
                        // Is calculated max receivers larger than wanted receivers then reset it
                        if ($content['target_send'] > postRequestParameter('receiver')) $content['target_send'] = bigintval(postRequestParameter('receiver'));
@@ -388,11 +387,11 @@ LIMIT 1",
                                // No enougth points left!
                                $url = 'modules.php?module=login&what=order&code=' . getCode('MORE_POINTS');
                        }
-               } else  {
+               } else {
                        // Ordered more mails than he can send in this category
                        $url = 'modules.php?module=login&what=order&code=' . getCode('NO_RECS_LEFT');
                }
-       }
+       } // END - if
 } elseif (postRequestParameter('receiver') == '0') {
        // Not enougth receivers selected
        $url = 'modules.php?module=login&what=order&code=' . getCode('MORE_RECEIVERS1');
@@ -466,7 +465,7 @@ LIMIT 1",
                                                        array(bigintval($ucat)), __FILE__, __LINE__);
 
                                                // Fetch entry
-                                               list($cnt) = SQL_FETCHROW($result);
+                                               list($cnt) = SQL_FETCHROW($result_holiday);
 
                                                // Free memory
                                                SQL_FREERESULT($result_holiday);
@@ -527,7 +526,7 @@ LIMIT 1",
                                SQL_FREERESULT($result);
 
                                // Output user's points
-                               $content['total'] = translateComma($total);
+                               $content['total'] = $total;
 
                                // Check how many mail orders he has placed today and how many he's allowed to send
                                switch (getConfig('order_max_full')) {
@@ -580,7 +579,7 @@ LIMIT 1",
                                } else {
                                        // Default output for that your members don't forget it...
                                        $content['url']         = 'http://';
-                                       $content['target_send'] = getConfig('order_min');
+                                       $content['target_send'] = '{?order_min?}';
                                        $content['subject']     = '{--ORDER_DEFAULT_SUBJECT--}';
                                        $content['text']        = '{--ORDER_DEFAULT_TEXT--}';
                                }
@@ -600,12 +599,11 @@ LIMIT 1",
                                        // Mail type
                                        $content['type_selection'] = '';
                                        foreach ($types as $key => $value) {
-                                               $P = translateComma($types[$key][1]);
                                                if (is_array($value)) {
                                                        // Output option line
                                                        $content['type_selection'] .= '      <option value="' . $types[$key][0] . '"';
                                                        if (($OLD_ORDER) && ($content['payment_id'] == $types[$key][0])) $content['type_selection'] .= ' selected="selected"';
-                                                       $content['type_selection'] .= '>' . $P . ' {--PER_MAIL--} - ' . $types[$key][3] . ' - ' . round($types[$key][2]) . ' {--PAYMENT--}</option>';
+                                                       $content['type_selection'] .= '>{%pipe,translateComma=' . $types[$key][1] . '%} {--PER_MAIL--} - ' . $types[$key][3] . ' - ' . round($types[$key][2]) . ' {--PAYMENT--}</option>';
                                                } // END - if
                                        } // END - foreach
 
@@ -661,15 +659,15 @@ LIMIT 1",
                                }
                        } else {
                                // No mail types defined
-                               loadTemplate('admin_settings_saved', false, '<span class="member_failed">{--MEMBER_NO_PAYMENTS--}</span>');
+                               loadTemplate('admin_settings_saved', false, '<span class="notice">{--MEMBER_NO_PAYMENTS--}</span>');
                        }
                } else {
                        // No points left
-                       loadTemplate('admin_settings_saved', false, '<span class="member_failed">{--MEMBER_NO_POINTS--}</span>');
+                       loadTemplate('admin_settings_saved', false, '<span class="notice">{--MEMBER_NO_POINTS--}</span>');
                }
        } else {
                // No cateogries are defined yet
-               loadTemplate('admin_settings_saved', false, '<span class="member_failed">{--MEMBER_NO_CATEGORIES--}</span>');
+               loadTemplate('admin_settings_saved', false, '<span class="notice">{--MEMBER_NO_CATEGORIES--}</span>');
        }
 } else {
        // Please confirm some mails first