2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 04/05/2005 *
4 * =================== Last change: 04/05/2005 *
6 * -------------------------------------------------------------------- *
7 * File : order_functions.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Functions for the guest's newsletter *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Funktionen fuer den Newsletter an die Gaeste *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2013 by Mailer Developer Team *
20 * For more information visit: http://mxchange.org *
22 * This program is free software; you can redistribute it and/or modify *
23 * it under the terms of the GNU General Public License as published by *
24 * the Free Software Foundation; either version 2 of the License, or *
25 * (at your option) any later version. *
27 * This program is distributed in the hope that it will be useful, *
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
30 * GNU General Public License for more details. *
32 * You should have received a copy of the GNU General Public License *
33 * along with this program; if not, write to the Free Software *
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
36 ************************************************************************/
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
43 // Generates a selection list for mail order
44 function addOrderSelectionOptions ($default) {
45 // Currenty the list is hardcoded...
46 // @TODO Move this array into a filter
47 $LIST = array('userid', 'zip', 'country', 'email', 'birth_year', 'last_online', 'ref_clicks', 'total_logins', 'mail_orders');
49 foreach ($LIST as $item) {
52 if ($item == $default) {
53 $selected = ' selected="selected"';
56 // 'ref_clicks' needs to be rewritten to 'referral_clicks'
57 if ($item == 'ref_clicks') {
58 $item = 'referral_clicks';
62 $OUT .= '<option value="' . $item . '"' . $selected . '>{--ADMIN_CONFIG_ORDER_SELECT_COLUMN_' . strtoupper($item) . '--}</option>';
69 //-----------------------------------------------------------------------------
70 // Wrapper functions for configuration entries
71 //-----------------------------------------------------------------------------
73 // Getter for 'order_multi_page' config entry
74 function getOrderMultiPage () {
76 if (!isset($GLOBALS[__FUNCTION__])) {
78 $GLOBALS[__FUNCTION__] = getConfig('order_multi_page');
82 return $GLOBALS[__FUNCTION__];
85 // Determines whether 'order_multi_page' is set to 'Y'
86 function isOrderMultiPageEnabled () {
88 if (!isset($GLOBALS[__FUNCTION__])) {
90 $GLOBALS[__FUNCTION__] = (getOrderMultiPage() == 'Y');
94 return $GLOBALS[__FUNCTION__];
97 // Getter for 'autosend_member_mails' config entry
98 function getAutosendMemberMails () {
100 if (!isset($GLOBALS[__FUNCTION__])) {
102 $GLOBALS[__FUNCTION__] = getConfig('autosend_member_mails');
106 return $GLOBALS[__FUNCTION__];
109 // Determines whether 'autosend_member_mails' is set to 'Y'
110 function isAutosendMemberMailsEnabled () {
112 if (!isset($GLOBALS[__FUNCTION__])) {
114 $GLOBALS[__FUNCTION__] = (getAutosendMemberMails() == 'Y');
118 return $GLOBALS[__FUNCTION__];
121 // Getter for 'order_max_full' config entry
122 function getOrderMaxFull () {
124 if (!isset($GLOBALS[__FUNCTION__])) {
126 $GLOBALS[__FUNCTION__] = getConfig('order_max_full');
130 return $GLOBALS[__FUNCTION__];
133 // Getter for 'order_mode' config entry
134 function getOrderMode () {
136 if (!isset($GLOBALS[__FUNCTION__])) {
138 $GLOBALS[__FUNCTION__] = getConfig('order_mode');
142 return $GLOBALS[__FUNCTION__];
145 // Getter for 'order_select' config entry
146 function getOrderSelect () {
148 if (!isset($GLOBALS[__FUNCTION__])) {
150 $GLOBALS[__FUNCTION__] = getConfig('order_select');
154 return $GLOBALS[__FUNCTION__];
157 // Getter for 'max_unconfirmed' config entry
158 function getMaxUnconfirmed () {
160 if (!isset($GLOBALS[__FUNCTION__])) {
162 $GLOBALS[__FUNCTION__] = getConfig('max_unconfirmed');
166 return $GLOBALS[__FUNCTION__];
169 // Getter for 'max_text_length' config entry
170 function getMaxTextLength () {
172 if (!isset($GLOBALS[__FUNCTION__])) {
174 $GLOBALS[__FUNCTION__] = getConfig('max_text_length');
178 return $GLOBALS[__FUNCTION__];
181 // Getter for 'order_min' config entry
182 function getOrderMin () {
184 if (!isset($GLOBALS[__FUNCTION__])) {
186 $GLOBALS[__FUNCTION__] = getConfig('order_min');
190 return $GLOBALS[__FUNCTION__];
193 // Getter for 'allow_url_in_text' config entry
194 function getAllowUrlInText () {
196 if (!isset($GLOBALS[__FUNCTION__])) {
198 $GLOBALS[__FUNCTION__] = getConfig('allow_url_in_text');
202 return $GLOBALS[__FUNCTION__];
205 // Determines whether 'allow_url_in_text' is set to 'Y'
206 function isAllowUrlInTextEnabled () {
208 if (!isset($GLOBALS[__FUNCTION__])) {
210 $GLOBALS[__FUNCTION__] = (getAllowUrlInText() == 'Y');
214 return $GLOBALS[__FUNCTION__];
217 // Getter for 'allow_url_in_subject' config entry
218 function getAllowUrlInSubject () {
220 if (!isset($GLOBALS[__FUNCTION__])) {
222 $GLOBALS[__FUNCTION__] = getConfig('allow_url_in_subject');
226 return $GLOBALS[__FUNCTION__];
229 // Determines whether 'allow_url_in_subject' is set to 'Y'
230 function isAllowUrlInSubjectEnabled () {
232 if (!isset($GLOBALS[__FUNCTION__])) {
234 $GLOBALS[__FUNCTION__] = (getAllowUrlInSubject() == 'Y');
238 return $GLOBALS[__FUNCTION__];