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 * Copyright (c) 2009, 2010 by Mailer Developer Team *
22 * For more information visit: http://www.mxchange.org *
24 * This program is free software; you can redistribute it and/or modify *
25 * it under the terms of the GNU General Public License as published by *
26 * the Free Software Foundation; either version 2 of the License, or *
27 * (at your option) any later version. *
29 * This program is distributed in the hope that it will be useful, *
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
32 * GNU General Public License for more details. *
34 * You should have received a copy of the GNU General Public License *
35 * along with this program; if not, write to the Free Software *
36 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
38 ************************************************************************/
40 // Some security stuff...
41 if (!defined('__SECURITY')) {
43 } elseif (!isMember()) {
44 redirectToIndexMemberOnlyModule();
47 // Add description as navigation point
48 addMenuDescription('member', __FILE__);
50 if ((!isExtensionActive('order')) && (!isAdmin())) {
51 loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('order'));
56 $whereStatement = " WHERE `visible`='Y'";
58 // Set undefined array elements
59 if (isAdmin()) $whereStatement = '';
61 // Count unconfirmed mails
62 $links = countSumTotalData(getMemberId(), 'user_links', 'id', 'userid', true);
64 // Do we have ext-holiday installed?
65 // @TODO Rewrite this to a filter
66 $extraColumn = 'userid';
67 if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
68 // Fetch also holiday activation data
69 $extraColumn = 'holiday_active';
72 $result_mmails = SQL_QUERY_ESC("SELECT
78 `{?_MYSQL_PREFIX?}_user_data`
83 array(getMemberId()), __FILE__, __LINE__);
85 $mmails = SQL_NUMROWS($result_mmails);
86 list($DMY, $MAXI, $ORDERS, $HOLIDAY) = SQL_FETCHROW($result_mmails);
89 SQL_FREERESULT($result_mmails);
91 // Fix non-existent ext-holidy
92 if ($HOLIDAY == $DMY) $HOLIDAY = 'N';
94 $ALLOWED = $MAXI - $ORDERS;
95 if (getConfig('order_max_full') == 'MAX') $ALLOWED = $MAXI;
97 // Now check his points amount
98 $total = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points');;
100 if (($HOLIDAY == 'Y') && (isExtensionInstalledAndNewer('holiday', '0.1.3'))) {
101 // Holiday is active!
102 loadTemplate('admin_settings_saved', false, getMessage('HOLIDAY_ORDER_NOT_POSSIBLE'));
103 } elseif ((isPostRequestParameterSet('frametester')) && ($ALLOWED > 0) && (postRequestParameter('receiver') > 0)) {
104 // Continue with the frametester, we first need to store the data temporary in the pool
106 // First we would like to store the data and get it's pool position back...
107 $result = SQL_QUERY_ESC("SELECT `id`, `data_type`
109 `{?_MYSQL_PREFIX?}_pool`
113 `timestamp` > (UNIX_TIMESTAMP() - %s)
117 postRequestParameter('url'),
118 getConfig('url_tlock')
119 ), __FILE__, __LINE__);
121 $type = 'TEMP'; $id = '0';
122 if (SQL_NUMROWS($result) == 1) {
123 // Load id and mail type
124 list($id, $type) = SQL_FETCHROW($result);
128 SQL_FREERESULT($result);
130 if ($type == 'TEMP') {
131 // No entry found, so we need to check out the stats table as well... :)
132 // We have to add that suff here, now we continue WITHOUT checking and check the text and subject against some filters
134 if (getConfig('allow_url_in_text') == 'Y') {
135 // Test submitted text against some filters (length, URLs in text etc.)
136 if ((strpos(strtolower(postRequestParameter('text')), 'https://') > -1) || (strpos(strtolower(postRequestParameter('text')), 'http://') > -1) || (strpos(strtolower(postRequestParameter('text')), "www") > -1)) {
138 $url = 'modules.php?module=login&what=order&code=' . getCode('URL_FOUND');
141 // Remove new-line and carriage-return characters
142 $TEST = str_replace("\n", '', str_replace("\r", '', postRequestParameter('text')));
144 // Text length within allowed length?
145 if (strlen($TEST) > getConfig('max_tlength')) {
147 $url = 'modules.php?module=login&what=order&code=' . getCode('OVERLENGTH');
151 // Shall I test the subject line against URLs?
152 if (getConfig('allow_url_in_subject') == 'Y') {
153 // Check the subject line for issues
154 setPostRequestParameter('subject', str_replace("\\", '[nl]', substr(postRequestParameter('subject'), 0, 200)));
155 if ((strpos(strtolower(postRequestParameter('subject')), 'http://') > -1) || (strpos(strtolower(postRequestParameter('subject')), "www") > -1)) {
156 // URL in subject found
157 $url = 'modules.php?module=login&what=order&code=' . getCode('SUBJ_URL');
161 // And shall I check that his URL is not in the black list?
162 if (getConfig('url_blacklist') == 'Y') {
163 // Ok, I do that for you know...
164 $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`timestamp`) AS tstamp FROM `{?_MYSQL_PREFIX?}_url_blacklist` WHERE `url`='%s' LIMIT 1",
165 array(postRequestParameter('url')), __FILE__, __LINE__);
167 if (SQL_NUMROWS($result) == 1) {
168 // Jupp, we got one listed
169 list($blist) = SQL_FETCHROW($result);
171 // Create redirect-URL
172 $url = 'modules.php?module=login&what=order&code=' . getCode('BLIST_URL') . '&blist=' . $blist;
176 SQL_FREERESULT($result);
179 // Enougth receivers entered?
180 if ((postRequestParameter('receiver') < getConfig('order_min')) && (!isAdmin())) {
181 // Less than allowed receivers entered!
182 $url = 'modules.php?module=login&what=order&code=' . getCode('MORE_RECEIVERS3');
186 if (!isUrlValid(postRequestParameter('url'))) {
188 $url = 'modules.php?module=login&what=order&code=' . getCode('INVALID_URL');
191 // Probe for HTML extension
192 if (isExtensionActive('html_mail')) {
193 // HTML or regular text mail?
194 if (postRequestParameter('html') == 'Y') {
195 // Chek for valid HTML tags
196 setPostRequestParameter('text', checkHtmlTags(postRequestParameter('text')));
198 // Maybe invalid tags found?
199 if (!isPostRequestParameterSet('text')) $url = 'modules.php?module=login&what=order&code=' . getCode('INVALID_TAGS')."&id=".$id;
201 // Remove any HTML code
202 setPostRequestParameter('text', str_replace('<', '{OPEN_HTML}', str_replace('>', '{CLOSE_HTML}', postRequestParameter('text'))));
207 if ((!isPostRequestParameterSet('mail_type')) || (postRequestParameter('mail_type') < 1)) {
209 $url = 'modules.php?module=login&what=order&code=' . getCode('NO_MAIL_TYPE');
211 } elseif (!isAdmin()) {
212 // He has already sent a mail within a specific time
213 $url = 'modules.php?module=login&what=order&code=' . getCode('URL_TLOCK') . '&id=' . $id;
218 // Check if category and number of receivers is okay
220 if ((getConfig('order_multi_page') == 'Y') && (isPostRequestParameterSet('zip')) && (postRequestParameter('zip') != '')) {
221 // Choose recipients by ZIP code
222 $add = sprintf(" AND d.zip LIKE '%s%%'",
223 bigintval(postRequestParameter('zip'))
228 $result = SQL_QUERY_ESC("SELECT
231 `{?_MYSQL_PREFIX?}_user_cats` AS c
233 `{?_MYSQL_PREFIX?}_user_data` AS d
239 d.`status`='CONFIRMED' AND
245 bigintval(postRequestParameter('cat')),
247 getConfig('order_select'),
248 getConfig('order_mode'),
249 ), __FILE__, __LINE__);
251 // Do we enougth receivers left?
252 if (SQL_NUMROWS($result) >= postRequestParameter('receiver')) {
253 // Load receivers from database
254 $TEST = array(); $cnt = '0';
255 while ($holidayContent = SQL_FETCHARRAY($result)) {
256 if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
257 // Check for his holiday status
258 $result_holiday = SQL_QUERY_ESC("SELECT
261 `{?_MYSQL_PREFIX?}_user_holidays`
263 `userid`=%s AND `holiday_start` < UNIX_TIMESTAMP() AND `holiday_end` > UNIX_TIMESTAMP()
265 array($holidayContent['userid']), __FILE__, __LINE__);
266 if (SQL_NUMROWS($result_holiday) == 1) $holidayContent['userid'] = '0'; // Exclude user who are in holiday
269 SQL_FREERESULT($result_holiday);
272 if ($holidayContent['userid'] > 0) {
274 $TEST[] = $holidayContent['userid'];
280 SQL_FREERESULT($result);
282 // Implode array into string for the sending pool
283 $receiver = implode($TEST, ';');
285 // Count array for maximum sent
286 $content['target_send'] = count($TEST);
288 // Update receiver list
289 SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `receive_mails`=`receive_mails`-1 WHERE `userid` IN (%s) LIMIT %s",
290 array(convertReceivers($receiver), $content['target_send']), __FILE__, __LINE__);
292 // Is calculated max receivers larger than wanted receivers then reset it
293 if ($content['target_send'] > postRequestParameter('receiver')) $content['target_send'] = bigintval(postRequestParameter('receiver'));
295 // Calculate used points
296 $USED = $content['target_send'] * getPaymentPoints(bigintval(postRequestParameter('mail_type')));
298 // Fix empty zip code
299 if (!isPostRequestParameterSet('zip')) setPostRequestParameter('zip', 0);
301 // Check if he has enougth points for this order and selected more than 0 receivers
302 if (($USED > 0) && ($USED <= $total) && ($content['target_send'] > 0)) {
303 // Gettings points is okay, so we can add $USED later from
304 if (($id == '0') || ($type != 'TEMP')) {
307 if (isExtensionActive('html_mail')) {
308 // HTML extension is active
309 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`)
310 VALUES (%s,'%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s',%s,%s,%s,'%s')",
313 postRequestParameter('subject'),
314 postRequestParameter('text'),
316 bigintval(postRequestParameter('mail_type')),
317 postRequestParameter('url'),
318 bigintval(postRequestParameter('cat')),
319 $content['target_send'],
320 bigintval(postRequestParameter('zip'), true, false),
321 postRequestParameter('html')
322 ), __FILE__, __LINE__);
324 // No HTML extension is active
325 SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_pool` (`sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `zip`)
326 VALUES (%s,'%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s',%s,%s,%s)",
329 postRequestParameter('subject'),
330 postRequestParameter('text'),
332 bigintval(postRequestParameter('mail_type')),
333 postRequestParameter('url'),
334 bigintval(postRequestParameter('cat')),
335 $content['target_send'],
336 bigintval(postRequestParameter('zip'), true, false),
337 ), __FILE__, __LINE__);
340 // Change current order
341 if (isExtensionActive('html_mail')) {
342 // HTML extension is active
343 SQL_QUERY_ESC("UPDATE
344 `{?_MYSQL_PREFIX?}_pool`
350 `timestamp`=UNIX_TIMESTAMP(),
360 postRequestParameter('subject'),
361 postRequestParameter('text'),
363 bigintval(postRequestParameter('mail_type')),
364 postRequestParameter('url'),
365 bigintval(postRequestParameter('cat')),
366 $content['target_send'],
367 bigintval(postRequestParameter('zip')),
368 postRequestParameter('html'),
370 ), __FILE__, __LINE__);
372 // No HTML extension is active
373 SQL_QUERY_ESC("UPDATE
374 `{?_MYSQL_PREFIX?}_pool`
380 `timestamp`=UNIX_TIMESTAMP(),
389 postRequestParameter('subject'),
390 postRequestParameter('text'),
392 bigintval(postRequestParameter('mail_type')),
393 postRequestParameter('url'),
394 bigintval(postRequestParameter('cat')),
395 $content['target_send'],
396 bigintval(postRequestParameter('zip')),
398 ), __FILE__, __LINE__);
402 // Do we need to get the id number?
404 // Order is placed as temporary. We need to get it's id for the frametester
405 $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",
408 postRequestParameter('subject'),
409 bigintval(postRequestParameter('mail_type'))
410 ), __FILE__, __LINE__);
413 list($id) = SQL_FETCHROW($result);
416 SQL_FREERESULT($result);
419 // id is received so we can redirect the user, used points will be added when he send's out the mail
420 $url = 'modules.php?module=frametester&order=' . $id;
421 } elseif ($content['target_send'] == '0') {
422 // Not enougth receivers found which can receive mails
423 $url = 'modules.php?module=login&what=order&code=' . getCode('MORE_RECEIVERS2');
425 // No enougth points left!
426 $url = 'modules.php?module=login&what=order&code=' . getCode('MORE_POINTS');
429 // Ordered more mails than he can send in this category
430 $url = 'modules.php?module=login&what=order&code=' . getCode('NO_RECS_LEFT');
433 } elseif (postRequestParameter('receiver') == '0') {
434 // Not enougth receivers selected
435 $url = 'modules.php?module=login&what=order&code=' . getCode('MORE_RECEIVERS1');
436 } elseif (($ALLOWED == '0') && (getConfig('order_max_full') == 'ORDER')) {
437 // No more mail orders allowed
438 loadTemplate('admin_settings_saved', false, getMessage('MEMBER_ORDER_ALLOWED_EXHAUSTED'));
439 } elseif (($links < getConfig('unconfirmed')) && ($mmails == 1)) {
440 // Display order form
441 $result_cats = SQL_QUERY("SELECT
444 `{?_MYSQL_PREFIX?}_cats`
447 `sort` ASC", __FILE__, __LINE__);
448 if (SQL_NUMROWS($result_cats) > 0) {
450 // Initialize array...
457 // Enable HTML checking
458 // @TODO Rewrite this to a filter
459 $HTML = ''; $HOL_STRING = '';
460 if ((isExtensionActive('html_mail')) && (postRequestParameter('html') == 'Y')) $HTML = " AND `html`='Y'";
461 if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
462 // Extension's version is fine
463 $HOL_STRING = " AND `holiday_active`='N'";
466 // ... and begin loading stuff
467 while ($categoriesContent = SQL_FETCHARRAY($result_cats)) {
468 $categories['id'][] = bigintval($categoriesContent['id']);
469 $categories['name'][] = $categoriesContent['cat'];
471 // Select users in current category
472 $result_userids = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `cat_id`=%s AND `userid` != '%s' ORDER BY `userid` ASC",
473 array(bigintval($categoriesContent['id']), getMemberId()), __FILE__, __LINE__);
476 while (list($ucat) = SQL_FETCHROW($result_userids)) {
477 // Check for holiday system
479 if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
480 // Check user's holiday status
481 $result_holiday = SQL_QUERY_ESC("SELECT
482 d.userid FROM `{?_MYSQL_PREFIX?}_user_data` AS d
484 `{?_MYSQL_PREFIX?}_user_holidays` AS h
489 d.receive_mails > 0 AND
490 d.`status`='CONFIRMED' AND
491 d.`holiday_active`='Y' AND
492 h.holiday_start < UNIX_TIMESTAMP() AND
493 h.holiday_end > UNIX_TIMESTAMP()
495 array(bigintval($ucat)), __FILE__, __LINE__);
497 // Is holiday is active?
498 $HOL_ACTIVE = (SQL_NUMROWS($result_holiday) == 1);
501 SQL_FREERESULT($result_holiday);
504 if ($HOL_ACTIVE === false) {
505 // Check if the user want's to receive mails?
506 $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",
507 array(bigintval($ucat)), __FILE__, __LINE__);
509 if ((SQL_NUMROWS($result_ver) == 1) && (isPostRequestParameterSet('zip')) && (getConfig('order_multi_page') == 'Y')) {
511 list($zip) = SQL_FETCHROW($result_ver);
512 if (substr($zip, 0, strlen(postRequestParameter('zip'))) == postRequestParameter('zip')) {
513 // Ok, ZIP part is found
518 $userid_cnt += SQL_NUMROWS($result_ver);
522 SQL_FREERESULT($result_ver);
527 SQL_FREERESULT($result_userids);
528 $categories['userids'][] = $userid_cnt;
532 SQL_FREERESULT($result_cats);
534 // Now we need to load the mail types...
535 $result = SQL_QUERY("SELECT `id`, `price`, `payment`, `mail_title` FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `payment` ASC", __FILE__, __LINE__);
538 if (SQL_NUMROWS($result) > 0) {
539 // Check for message id in URL
540 $message = getMessageFromErrorCode(getRequestParameter('code'));
542 if (!empty($message)) {
543 // We got system message so we drop it out to the user
544 loadTemplate('admin_settings_saved', false, $message);
547 // Load all email types...
548 while ($types[] = SQL_FETCHROW($result)) {
549 // Nothing to do here... ;-)
553 SQL_FREERESULT($result);
555 // Output user's points
556 $content['total'] = translateComma($total);
558 // Check how many mail orders he has placed today and how many he's allowed to send
559 switch (getConfig('order_max_full')) {
560 case 'MAX': // He is allowed to send as much as possible
561 $content['order_max_full'] = getMessage('MEMBER_ORDER_ALLOWED_MAX');
564 case 'ORDER': // He is allowed to send as much as he setup the receiving value
565 $content['order_max_full'] = sprintf(getMessage('MEMBER_ORDER_ALLOWED_RECEIVE'), $ALLOWED, $MAXI);
568 default: // Unknown/invalid
569 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", getConfig('order_max_full')));
570 $content['order_max_full'] = getMessage('MEMBER_ORDER_ALLOWED_UNKNOWN');
574 // Load final template
575 loadTemplate('member_order_points', false, $content);
583 // Check if we already have an order placed and make it editable
584 $result = SQL_QUERY_ESC("SELECT
585 `subject`, `text`, `payment_id`, `timestamp`, `url`, `target_send`, `cat_id`, `zip`
587 `{?_MYSQL_PREFIX?}_pool`
592 array(getMemberId()), __FILE__, __LINE__);
594 if (SQL_NUMROWS($result) == 1) {
596 $content = merge_array($content, SQL_FETCHARRAY($result));
598 // Fix max receivers when it is too much
599 if ((isset($categories['userids'][$content['cat_id']])) && ($content['target_send'] > $categories['userids'][$content['cat_id']])) {
601 $content['target_send'] = $categories['userids'][$content['cat_id']];
604 // Old order is grabbed
607 // Default output for that your members don't forget it...
608 $content['url'] = 'http://';
609 $content['target_send'] = getConfig('order_min');
610 $content['subject'] = '{--ORDER_DEFAULT_SUBJECT--}';
611 $content['text'] = '{--ORDER_DEFAULT_TEXT--}';
615 SQL_FREERESULT($result);
617 if ((isPostRequestParameterSet('data')) || ((getConfig('order_multi_page') != 'Y') && ((!isAdmin()) && (!isExtensionActive('html_mail'))))) {
618 // Pre-output categories
619 $content['category_selection'] = '';
620 foreach ($categories['id'] as $key => $value) {
621 $content['category_selection'] .= " <option value=\"".$value."\"";
622 if (($OLD_ORDER) && ($content['cat_id'] == $value)) $content['category_selection'] .= ' selected="selected"';
623 $content['category_selection'] .= ">".$categories['name'][$key]." (".$categories['userids'][$key]." {--USER_IN_CAT--})</option>\n";
627 $content['type_selection'] = '';
628 foreach ($types as $key => $value) {
629 $P = translateComma($types[$key][1]);
630 if (is_array($value)) {
631 // Output option line
632 $content['type_selection'] .= " <option value=\"".$types[$key][0]."\"";
633 if (($OLD_ORDER) && ($content['payment_id'] == $types[$key][0])) $content['type_selection'] .= ' selected="selected"';
634 $content['type_selection'] .= ">".$P." {--PER_MAIL--} - ".$types[$key][3]." - ".round($types[$key][2])." {--PAYMENT--}</option>\n";
638 // No content is default
639 $content['zip_content'] = '';
641 if (isPostRequestParameterSet('zip')) {
642 // Output entered ZIP code
643 $content['zip_content'] = loadTemplate('member_order-zip2', true, postRequestParameter('zip'));
647 if ((isExtensionActive('html_mail')) && (postRequestParameter('html') == 'Y')) {
648 // Extension is active so output valid HTML tags
649 $content['html_extension'] = loadTemplate('member_order-html_ext', true, addValidHtmlTags());
651 // Extension not active and/or class not uploaded
652 $content['html_extension'] = '<tr><td colspan="3"><input type="hidden" name="html" value="N" /></td></tr>';
655 // Output form for page 2
656 loadTemplate('member_order_page2', false, $content);
658 // Remember maybe entered ZIP code in constant
659 if (isExtensionActive('html_mail')) {
660 // Add some content when html extension is active
661 $content['html_extension'] = loadTemplate('member_order-html_intro', true);
663 // No HTML extension installed
664 $content['html_extension'] = '<tr><td colspan="3"><input type="hidden" name="html" value="N" /></td></tr>';
667 // Default is no ZIP code
668 $content['zip_content'] = '';
670 // Do we want ZIP code or not?
671 if ((getConfig('order_multi_page') == 'Y') || (isAdmin())) {
673 if (postRequestParameter('zip') > 0) {
675 'zip' => bigintval(postRequestParameter('zip'))
682 $content['zip_content'] = loadTemplate('member_order-zip1', true, $data);
685 // Output form for page 1 (ZIP code or HTML)
686 loadTemplate('member_order_page1', false, $content);
689 // No mail types defined
690 loadTemplate('admin_settings_saved', false, '<span class="member_failed">{--MEMBER_NO_PAYMENTS--}</span>');
694 loadTemplate('admin_settings_saved', false, '<span class="member_failed">{--MEMBER_NO_POINTS--}</span>');
697 // No cateogries are defined yet
698 loadTemplate('admin_settings_saved', false, '<span class="member_failed">{--MEMBER_NO_CATS--}</span>');
700 } elseif ($mmails == '0') {
701 // Please set more than 0 mails per day
702 loadTemplate('admin_settings_saved', false, getMessage('MEMBER_HAS_ZERO_MMAILS'));
704 // Please confirm some mails first
705 loadTemplate('admin_settings_saved', false, getMaskedMessage('MEMBER_LINKS_LEFT'), $links);
709 // Redirect to requested URL