2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 10/19/2003 *
4 * =================== Last change: 08/26/2004 *
6 * -------------------------------------------------------------------- *
7 * File : what-order.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Order mails here *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Hier koennen Ihre Mitglieder Mails buchen *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * Needs to be in all Files and every File needs "svn propset *
18 * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
19 * -------------------------------------------------------------------- *
20 * Copyright (c) 2003 - 2009 by Roland Haeder *
21 * For more information visit: http://www.mxchange.org *
23 * This program is free software; you can redistribute it and/or modify *
24 * it under the terms of the GNU General Public License as published by *
25 * the Free Software Foundation; either version 2 of the License, or *
26 * (at your option) any later version. *
28 * This program is distributed in the hope that it will be useful, *
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
31 * GNU General Public License for more details. *
33 * You should have received a copy of the GNU General Public License *
34 * along with this program; if not, write to the Free Software *
35 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
37 ************************************************************************/
39 // Some security stuff...
40 if (!defined('__SECURITY')) {
42 } elseif (!isMember()) {
43 redirectToIndexMemberOnlyModule();
46 // Add description as navigation point
47 addMenuDescription('member', __FILE__);
49 if ((!isExtensionActive('order')) && (!isAdmin())) {
50 loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('order'));
55 $whereStatement = " WHERE `visible`='Y'";
57 // Set undefined array elements
58 if (isAdmin()) $whereStatement = '';
60 // Count unconfirmed mails
61 $links = countSumTotalData(getMemberId(), 'user_links', 'id', 'userid', true);
63 // Do we have ext-holiday installed?
64 // @TODO Rewrite this to a filter
66 if ((isExtensionActive('holiday')) && (getExtensionVersion('holiday') >= '0.1.3')) {
67 // Fetch also holiday activation data
68 $HOLIDAY = 'holiday_active';
71 $result_mmails = SQL_QUERY_ESC("SELECT
72 `userid`, `receive_mails`, `mail_orders`, `".$HOLIDAY."`
74 `{?_MYSQL_PREFIX?}_user_data`
79 array(getMemberId()), __FILE__, __LINE__);
81 $mmails = SQL_NUMROWS($result_mmails);
82 list($DMY, $MAXI, $ORDERS, $HOLIDAY) = SQL_FETCHROW($result_mmails);
85 SQL_FREERESULT($result_mmails);
87 // Fix non-existent ext-holidy
88 if ($HOLIDAY == $DMY) $HOLIDAY = 'N';
90 $ALLOWED = $MAXI - $ORDERS;
91 if (getConfig('order_max_full') == 'MAX') $ALLOWED = $MAXI;
93 // Now check his points amount
94 $total = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points');;
96 if (($HOLIDAY == 'Y') && (getExtensionVersion('holiday') >= '0.1.3')) {
98 loadTemplate('admin_settings_saved', false, getMessage('HOLIDAY_ORDER_NOT_POSSIBLE'));
99 } elseif ((isPostRequestElementSet('frametester')) && ($ALLOWED > 0) && (postRequestElement('receiver') > 0)) {
100 // Continue with the frametester, we first need to store the data temporary in the pool
102 // First we would like to store the data and get it's pool position back...
103 $result = SQL_QUERY_ESC("SELECT `id`, `data_type`
105 `{?_MYSQL_PREFIX?}_pool`
109 `timestamp` > (UNIX_TIMESTAMP() - %s)
113 postRequestElement('url'),
114 getConfig('url_tlock')
115 ), __FILE__, __LINE__);
117 $type = 'TEMP'; $id = '0';
118 if (SQL_NUMROWS($result) == 1) {
119 // Load id and mail type
120 list($id, $type) = SQL_FETCHROW($result);
124 SQL_FREERESULT($result);
126 if ($type == 'TEMP') {
127 // No entry found, so we need to check out the stats table as well... :)
128 // We have to add that suff here, now we continue WITHOUT checking and check the text and subject against some filters
130 if (getConfig('allow_url_in_text') == 'Y') {
131 // Test submitted text against some filters (length, URLs in text etc.)
132 if ((strpos(strtolower(postRequestElement('text')), 'https://') > -1) || (strpos(strtolower(postRequestElement('text')), 'http://') > -1) || (strpos(strtolower(postRequestElement('text')), "www") > -1)) {
134 $URL = 'modules.php?module=login&what=order&code=' . getCode('URL_FOUND');
137 // Remove new-line and carriage-return characters
138 $TEST = str_replace("\n", '', str_replace("\r", '', postRequestElement('text')));
140 // Text length within allowed length?
141 if (strlen($TEST) > getConfig('max_tlength')) {
143 $URL = 'modules.php?module=login&what=order&code=' . getCode('OVERLENGTH');
147 // Shall I test the subject line against URLs?
148 if (getConfig('allow_url_in_subject') == 'Y') {
149 // Check the subject line for issues
150 setPostRequestElement('subject', str_replace("\\", '[nl]', substr(postRequestElement('subject'), 0, 200)));
151 if ((strpos(strtolower(postRequestElement('subject')), 'http://') > -1) || (strpos(strtolower(postRequestElement('subject')), "www") > -1)) {
152 // URL in subject found
153 $URL = 'modules.php?module=login&what=order&code=' . getCode('SUBJ_URL');
157 // And shall I check that his URL is not in the black list?
158 if (getConfig('url_blacklist') == 'Y') {
159 // Ok, I do that for you know...
160 $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`timestamp`) AS tstamp FROM `{?_MYSQL_PREFIX?}_url_blacklist` WHERE `url`='%s' LIMIT 1",
161 array(postRequestElement('url')), __FILE__, __LINE__);
163 if (SQL_NUMROWS($result) == 1) {
164 // Jupp, we got one listed
165 list($blist) = SQL_FETCHROW($result);
167 // Create redirect-URL
168 $URL = 'modules.php?module=login&what=order&code=' . getCode('BLIST_URL') . '&blist=' . $blist;
172 SQL_FREERESULT($result);
175 // Enougth receivers entered?
176 if ((postRequestElement('receiver') < getConfig('order_min')) && (!isAdmin())) {
177 // Less than allowed receivers entered!
178 $URL = 'modules.php?module=login&what=order&code=' . getCode('MORE_RECEIVERS3');
182 if (!isUrlValid(postRequestElement('url'))) {
184 $URL = 'modules.php?module=login&what=order&code=' . getCode('INVALID_URL');
187 // Probe for HTML extension
188 if (isExtensionActive('html_mail')) {
189 // HTML or regular text mail?
190 if (postRequestElement('html') == 'Y') {
191 // Chek for valid HTML tags
192 setPostRequestElement('text', checkHtmlTags(postRequestElement('text')));
194 // Maybe invalid tags found?
195 if (!isPostRequestElementSet('text')) $URL = 'modules.php?module=login&what=order&code=' . getCode('INVALID_TAGS')."&id=".$id;
197 // Remove any HTML code
198 setPostRequestElement('text', str_replace('<', '{OPEN_HTML}', str_replace('>', '{CLOSE_HTML}', postRequestElement('text'))));
201 } elseif (!isAdmin()) {
202 // He has already sent a mail within a specific time
203 $URL = 'modules.php?module=login&what=order&code=' . getCode('URL_TLOCK') . '&id=' . $id;
208 // Check if category and number of receivers is okay
210 if ((getConfig('order_multi_page') == 'Y') && (isPostRequestElementSet('zip'))) {
211 // Choose recipients by ZIP code
212 $add = " AND d.zip LIKE '".bigintval(postRequestElement('zip'))."{PER}'";
216 $result = SQL_QUERY_ESC("SELECT
219 `{?_MYSQL_PREFIX?}_user_cats` AS c
221 `{?_MYSQL_PREFIX?}_user_data` AS d
225 c.cat_id=%s AND c.userid != '%s' AND d.`status`='CONFIRMED' AND d.receive_mails > 0".$add."
229 bigintval(postRequestElement('cat')),
231 getConfig('order_select'),
232 getConfig('order_mode'),
233 ), __FILE__, __LINE__);
235 // Do we enougth receivers left?
236 if (SQL_NUMROWS($result) >= postRequestElement('receiver')) {
237 // Check for holiday extensions
239 if (getExtensionVersion('holiday') >= '0.1.3') {
240 // Include checking for users in holiday
244 // Load receivers from database
245 $TEST = array(); $cnt = '0';
246 while ($holidayContent = SQL_FETCHARRAY($result)) {
248 // Check for his holiday status
249 $result_holiday = SQL_QUERY_ESC("SELECT
252 `{?_MYSQL_PREFIX?}_user_holidays`
254 `userid`=%s AND `holiday_start` < UNIX_TIMESTAMP() AND `holiday_end` > UNIX_TIMESTAMP()
256 array($holidayContent['userid']), __FILE__, __LINE__);
257 if (SQL_NUMROWS($result_holiday) == 1) $holidayContent['userid'] = '0'; // Exclude user who are in holiday
260 SQL_FREERESULT($result_holiday);
263 if ($holidayContent['userid'] > 0) {
265 $TEST[] = $holidayContent['userid'];
271 SQL_FREERESULT($result);
273 // Implode array into string for the sending pool
274 $receiver = implode($TEST, ';');
276 // Count array for maximum sent
277 $content['target_send'] = count($TEST);
279 // Update receiver list
280 SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `receive_mails`=`receive_mails`-1 WHERE `userid` IN (%s) LIMIT %s",
281 array(convertReceivers($receiver), $content['target_send']), __FILE__, __LINE__);
283 // Is calculated max receivers larger than wanted receivers then reset it
284 if ($content['target_send'] > postRequestElement('receiver')) $content['target_send'] = bigintval(postRequestElement('receiver'));
286 // Calculate used points
287 $USED = $content['target_send'] * getPaymentPoints(bigintval(postRequestElement('type')));
289 // Fix empty zip code
290 if (!isPostRequestElementSet('zip')) setPostRequestElement('zip', 0);
292 // Check if he has enougth points for this order and selected more than 0 receivers
293 if (($USED > 0) && ($USED <= $total) && ($content['target_send'] > 0)) {
294 // Gettings points is okay, so we can add $USED later from
295 if (($id == '0') || ($type != 'TEMP')) {
298 if (isExtensionActive('html_mail')) {
299 // HTML extension is active
300 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`)
301 VALUES ('%s','%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s','%s','%s','%s','%s')",
304 postRequestElement('subject'),
305 postRequestElement('text'),
307 bigintval(postRequestElement('type')),
308 postRequestElement('url'),
309 bigintval(postRequestElement('cat')),
310 $content['target_send'],
311 bigintval(postRequestElement('zip')),
312 postRequestElement('html')
313 ), __FILE__, __LINE__);
315 // No HTML extension is active
316 SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_pool` (`sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `zip`)
317 VALUES ('%s','%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s','%s','%s','%s')",
320 postRequestElement('subject'),
321 postRequestElement('text'),
323 bigintval(postRequestElement('type')),
324 postRequestElement('url'),
325 bigintval(postRequestElement('cat')),
326 $content['target_send'],
327 bigintval(postRequestElement('zip')),
328 ), __FILE__, __LINE__);
331 // Change current order
332 if (isExtensionActive('html_mail')) {
333 // HTML extension is active
334 SQL_QUERY_ESC("UPDATE
335 `{?_MYSQL_PREFIX?}_pool`
341 `timestamp`=UNIX_TIMESTAMP(),
351 postRequestElement('subject'),
352 postRequestElement('text'),
354 bigintval(postRequestElement('type')),
355 postRequestElement('url'),
356 bigintval(postRequestElement('cat')),
357 $content['target_send'],
358 bigintval(postRequestElement('zip')),
359 postRequestElement('html'),
361 ), __FILE__, __LINE__);
363 // No HTML extension is active
364 SQL_QUERY_ESC("UPDATE
365 `{?_MYSQL_PREFIX?}_pool`
371 `timestamp`=UNIX_TIMESTAMP(),
380 postRequestElement('subject'),
381 postRequestElement('text'),
383 bigintval(postRequestElement('type')),
384 postRequestElement('url'),
385 bigintval(postRequestElement('cat')),
386 $content['target_send'],
387 bigintval(postRequestElement('zip')),
389 ), __FILE__, __LINE__);
393 // Do we need to get the id number?
395 // Order is placed as temporary. We need to get it's id for the frametester
396 $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",
399 postRequestElement('subject'),
400 bigintval(postRequestElement('type'))
401 ), __FILE__, __LINE__);
404 list($id) = SQL_FETCHROW($result);
407 SQL_FREERESULT($result);
410 // id is received so we can redirect the user, used points will be added when he send's out the mail
411 $URL = 'modules.php?module=frametester&order=' . $id;
412 } elseif ($content['target_send'] == '0') {
413 // Not enougth receivers found which can receive mails
414 $URL = 'modules.php?module=login&what=order&code=' . getCode('MORE_RECEIVERS2');
416 // No enougth points left!
417 $URL = 'modules.php?module=login&what=order&code=' . getCode('MORE_POINTS');
420 // Ordered more mails than he can send in this category
421 $URL = 'modules.php?module=login&what=order&code=' . getCode('NO_RECS_LEFT');
424 } elseif (postRequestElement('receiver') == '0') {
425 // Not enougth receivers selected
426 $URL = 'modules.php?module=login&what=order&code=' . getCode('MORE_RECEIVERS1');
427 } elseif (($ALLOWED == '0') && (getConfig('order_max_full') == 'ORDER')) {
428 // No more mail orders allowed
429 loadTemplate('admin_settings_saved', false, getMessage('MEMBER_ORDER_ALLOWED_EXHAUSTED'));
430 } elseif (($links < getConfig('unconfirmed')) && ($mmails == 1)) {
431 // Display order form
432 $result_cats = SQL_QUERY("SELECT
435 `{?_MYSQL_PREFIX?}_cats`
438 `sort` ASC", __FILE__, __LINE__);
439 if (SQL_NUMROWS($result_cats) > 0) {
441 // Initialize array...
448 // Enable HTML checking
449 // @TODO Rewrite this to a filter
450 $HTML = ''; $HOLIDAY = false; $HOL_STRING = '';
451 if ((isExtensionActive('html_mail')) && (postRequestElement('html') == 'Y')) $HTML = " AND `html`='Y'";
452 if (getExtensionVersion('holiday') >= '0.1.3') {
453 // Extension's version is fine
454 $HOLIDAY = true; $HOL_STRING = " AND `holiday_active`='N'";
457 // ... and begin loading stuff
458 while ($categoriesContent = SQL_FETCHARRAY($result_cats)) {
459 $categories['id'][] = bigintval($categoriesContent['id']);
460 $categories['name'][] = $categoriesContent['cat'];
462 // Select users in current category
463 $result_userids = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `cat_id`=%s AND `userid` != '%s' ORDER BY `userid` ASC",
464 array(bigintval($categoriesContent['id']), getMemberId()), __FILE__, __LINE__);
467 while (list($ucat) = SQL_FETCHROW($result_userids)) {
468 // Check for holiday system
471 // Check user's holiday status
472 $result_holiday = SQL_QUERY_ESC("SELECT
473 d.userid FROM `{?_MYSQL_PREFIX?}_user_data` AS d
475 `{?_MYSQL_PREFIX?}_user_holidays` AS h
480 d.receive_mails > 0 AND
481 d.`status`='CONFIRMED' AND
482 d.`holiday_active`='Y' AND
483 h.holiday_start < UNIX_TIMESTAMP() AND
484 h.holiday_end > UNIX_TIMESTAMP()
486 array(bigintval($ucat)), __FILE__, __LINE__);
488 // Is holiday is active?
489 $HOL_ACTIVE = (SQL_NUMROWS($result_holiday) == 1);
492 SQL_FREERESULT($result_holiday);
495 if ($HOL_ACTIVE === false) {
496 // Check if the user want's to receive mails?
497 $result_ver = SQL_QUERY_ESC("SELECT `zip` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s".$HTML." AND `receive_mails` > 0 AND `status`='CONFIRMED' LIMIT 1",
498 array(bigintval($ucat)), __FILE__, __LINE__);
500 if ((SQL_NUMROWS($result_ver) == 1) && (isPostRequestElementSet('zip')) && (getConfig('order_multi_page') == 'Y')) {
502 list($zip) = SQL_FETCHROW($result_ver);
503 if (substr($zip, 0, strlen(postRequestElement('zip'))) == postRequestElement('zip')) {
504 // Ok, ZIP part is found
509 $userid_cnt += SQL_NUMROWS($result_ver);
513 SQL_FREERESULT($result_ver);
518 SQL_FREERESULT($result_userids);
519 $categories['userids'][] = $userid_cnt;
523 SQL_FREERESULT($result_cats);
525 // Now we need to load the mail types...
526 $result = SQL_QUERY("SELECT `id`, `price`, `payment`, `mail_title` FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `payment` ASC", __FILE__, __LINE__);
529 if (SQL_NUMROWS($result) > 0) {
530 // Check for message id in URL
531 $message = getMessageFromErrorCode(getRequestElement('code'));
533 if (!empty($message)) {
534 // We got system message so we drop it out to the user
535 loadTemplate('admin_settings_saved', false, $message);
538 // Load all email types...
539 while ($types[] = SQL_FETCHROW($result)) {
540 // Nothing to do here... ;-)
544 SQL_FREERESULT($result);
546 // Output user's points
547 $content['total'] = translateComma($total);
549 // Check how many mail orders he has placed today and how many he's allowed to send
550 switch (getConfig('order_max_full')) {
551 case 'MAX': // He is allowed to send as much as possible
552 $content['order_max_full'] = getMessage('MEMBER_ORDER_ALLOWED_MAX');
555 case 'ORDER': // He is allowed to send as much as he setup the receiving value
556 $content['order_max_full'] = sprintf(getMessage('MEMBER_ORDER_ALLOWED_RECEIVE'), $ALLOWED, $MAXI);
559 default: // Unknown/invalid
560 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", getConfig('order_max_full')));
561 $content['order_max_full'] = getMessage('MEMBER_ORDER_ALLOWED_UNKNOWN');
565 // Load final template
566 loadTemplate('member_order_points', false, $content);
574 // Check if we already have an order placed and make it editable
575 $result = SQL_QUERY_ESC("SELECT
576 `subject`, `text`, `payment_id`, `timestamp`, `url`, `target_send`, `cat_id`, `zip`
578 `{?_MYSQL_PREFIX?}_pool`
583 array(getMemberId()), __FILE__, __LINE__);
585 if (SQL_NUMROWS($result) == 1) {
587 $content = merge_array($content, SQL_FETCHARRAY($result));
589 // Fix max receivers when it is too much
590 if ((isset($categories['userids'][$content['cat_id']])) && ($content['target_send'] > $categories['userids'][$content['cat_id']])) {
592 $content['target_send'] = $categories['userids'][$content['cat_id']];
595 // Old order is grabbed
598 // Default output for that your members don't forget it...
599 $content['url'] = 'http://';
600 $content['target_send'] = getConfig('order_min');
601 $content['subject'] = '{--ORDER_DEFAULT_SUBJECT--}';
602 $content['text'] = '{--ORDER_DEFAULT_TEXT--}';
606 SQL_FREERESULT($result);
608 if ((isPostRequestElementSet('data')) || ((getConfig('order_multi_page') != 'Y') && ((!isAdmin()) && (!isExtensionActive('html_mail'))))) {
609 // Pre-output categories
610 $content['category_selection'] = '';
611 foreach ($categories['id'] as $key => $value) {
612 $content['category_selection'] .= " <option value=\"".$value."\"";
613 if (($OLD_ORDER) && ($content['cat_id'] == $value)) $content['category_selection'] .= ' selected="selected"';
614 $content['category_selection'] .= ">".$categories['name'][$key]." (".$categories['userids'][$key]." {--USER_IN_CAT--})</option>\n";
618 $content['type_selection'] = '';
619 foreach ($types as $key => $value) {
620 $P = translateComma($types[$key][1]);
621 if (is_array($value)) {
622 // Output option line
623 $content['type_selection'] .= " <option value=\"".$types[$key][0]."\"";
624 if (($OLD_ORDER) && ($content['payment_id'] == $types[$key][0])) $content['type_selection'] .= ' selected="selected"';
625 $content['type_selection'] .= ">".$P." {--PER_MAIL--} - ".$types[$key][3]." - ".round($types[$key][2])." {--PAYMENT--}</option>\n";
629 if (isPostRequestElementSet('zip')) {
630 // Output entered ZIP code
631 $content['zip_content'] = loadTemplate('member_order-zip', true, postRequestElement('zip'));
633 $content['zip_content'] = "<tr><td colspan=\"5\" height=\"5\" class=\"seperator\"> </td></tr>";
637 if ((isExtensionActive('html_mail')) && (postRequestElement('html') == 'Y')) {
638 // Extension is active so output valid HTML tags
639 $content['html_extension'] = loadTemplate('member_order-html_ext', true, addValidHtmlTags());
641 // Extension not active and/or class not uploaded
642 $content['html_extension'] = "<tr><td colspan=\"5\"><input type=\"hidden\" name=\"html\" value=\"N\" /></td></tr>";
645 // Output form for page 2
646 loadTemplate('member_order_page2', false, $content);
648 // Remember maybe entered ZIP code in constant
650 if (isExtensionActive('html_mail')) {
651 // Add some content when html extension is active
652 if ((getConfig('order_multi_page') == 'Y') || (isAdmin())) $add = "<tr><td colspan=\"2\" class=\"seperator bottom\" height=\"5\"> </td></tr>\n";
653 $content['html_extension'] = loadTemplate('member_order-html_intro', true);
655 // No HTML extension installed
656 $content['html_extension'] = "<tr><td colspan=\"2\"><input type=\"hidden\" name=\"html\" value=\"N\" /></td></tr>";
659 // Default is no ZIP code
660 $content['zip_content'] = '';
662 // Do we want ZIP code or not?
663 if ((getConfig('order_multi_page') == 'Y') || (isAdmin())) {
665 if (postRequestElement('zip') > 0) {
667 'zip' => bigintval(postRequestElement('zip')),
676 $content['zip_content'] = loadTemplate('member_order-zip1', true, $data);
679 // Output form for page 1 (ZIP code or HTML)
680 loadTemplate('member_order_page1', false, $content);
683 // No mail types defined
684 loadTemplate('admin_settings_saved', false, "<span class=\"member_failed\">{--MEMBER_NO_PAYMENTS--}</span>");
688 loadTemplate('admin_settings_saved', false, "<span class=\"member_failed\">{--MEMBER_NO_POINTS--}</span>");
691 // No cateogries are defined yet
692 loadTemplate('admin_settings_saved', false, "<span class=\"member_failed\">{--MEMBER_NO_CATS--}</span>");
694 } elseif ($mmails == '0') {
695 // Please set more than 0 mails per day
696 loadTemplate('admin_settings_saved', false, getMessage('MEMBER_HAS_ZERO_MMAILS'));
698 // Please confirm some mails first
699 loadTemplate('admin_settings_saved', false, getMaskedMessage('MEMBER_LINKS_LEFT'), $links);
703 // Redirect to requested URL