]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/order_functions.php
Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / libs / order_functions.php
index 63283118a674e1467d6e0e004a47384b5dd5ca5e..019b84029c2fe3b18eb20c20d4f223c9ad0c07dc 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 04/05/2005 *
- * ===============                              Last change: 04/05/2005 *
+ * Mailer v0.2.1-FINAL                                Start: 04/05/2005 *
+ * ===================                          Last change: 04/05/2005 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : order_functions.php                               *
  * $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 - 2008 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
+ * For more information visit: http://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 *
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
-       require($INC);
-}
+       die();
+} // END - if
 
-function ORDER_SELECT_OPTION_LIST($default) {
+// Generates a selection list for mail order
+function addOrderSelectionOptions ($default) {
        // Currenty the list is hardcoded...
-       $LIST = array('userid', "zip", 'country', 'email', "birth_year", "last_online", "ref_clicks", "total_logins", "mail_orders");
+       // @TODO Move this array into a filter
+       $LIST = array('userid', 'zip', 'country', 'email', 'birth_year', 'last_online', 'ref_clicks', 'total_logins', 'mail_orders');
        $OUT = '';
        foreach ($LIST as $item) {
+               // Defaul selection
                $selected = '';
-               if ($item == $default) $selected = " selected=\"selected\"";
-               $OUT .= "<option value=\"".$item."\"".$selected.">{--ORDER_SELECT_COLUMN_".strtoupper($item)."--}</option>\n";
-       }
+               if ($item == $default) {
+                       $selected = ' selected="selected"';
+               } // END - if
+
+               // 'ref_clicks' needs to be rewritten to 'referral_clicks'
+               if ($item == 'ref_clicks') {
+                       $item = 'referral_clicks';
+               } // END - if
+
+               // Add option line
+               $OUT .= '<option value="' . $item . '"' . $selected . '>{--ADMIN_CONFIG_ORDER_SELECT_COLUMN_' . strtoupper($item) . '--}</option>';
+       } // END - foreach
 
        // Return the output
        return $OUT;
 }
 
-//
+//-----------------------------------------------------------------------------
+//                Wrapper functions for configuration entries
+//-----------------------------------------------------------------------------
+
+// Getter for 'order_multi_page' config entry
+function getOrderMultiPage () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('order_multi_page');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Determines whether 'order_multi_page' is set to 'Y'
+function isOrderMultiPageEnabled () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getOrderMultiPage() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'autosend_member_mails' config entry
+function getAutosendMemberMails () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('autosend_member_mails');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Determines whether 'autosend_member_mails' is set to 'Y'
+function isAutosendMemberMailsEnabled () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getAutosendMemberMails() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'order_max_full' config entry
+function getOrderMaxFull () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('order_max_full');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'order_mode' config entry
+function getOrderMode () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('order_mode');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'order_select' config entry
+function getOrderSelect () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('order_select');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'max_unconfirmed' config entry
+function getMaxUnconfirmed () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('max_unconfirmed');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'max_text_length' config entry
+function getMaxTextLength () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('max_text_length');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'order_min' config entry
+function getOrderMin () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('order_min');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'allow_url_in_text' config entry
+function getAllowUrlInText () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('allow_url_in_text');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Determines whether 'allow_url_in_text' is set to 'Y'
+function isAllowUrlInTextEnabled () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getAllowUrlInText() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'allow_url_in_subject' config entry
+function getAllowUrlInSubject () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('allow_url_in_subject');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Determines whether 'allow_url_in_subject' is set to 'Y'
+function isAllowUrlInSubjectEnabled () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getAllowUrlInSubject() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// [EOF]
 ?>