2 /************************************************************************
3 * MXChange v0.2.1 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 // Minimum mails / order
61 $content['min'] = getConfig('order_min');
63 // Count unconfirmed mails
64 $links = countSumTotalData(getUserId(), 'user_links', 'id', 'userid', true);
66 // Do we have ext-holiday installed?
68 if ((isExtensionActive('holiday')) && (getExtensionVersion('holiday') >= '0.1.3')) {
69 // Fetch also holiday activation data
70 $HOLIDAY = 'holiday_active';
73 $result_mmails = SQL_QUERY_ESC("SELECT `userid`, `receive_mails`, `mail_orders`, `".$HOLIDAY."`
74 FROM `{?_MYSQL_PREFIX?}_user_data`
75 WHERE `userid`=%s AND `max_mails` > 0 LIMIT 1",
76 array(getUserId()), __FILE__, __LINE__);
78 $mmails = SQL_NUMROWS($result_mmails);
79 list($DMY, $MAXI, $ORDERS, $HOLIDAY) = SQL_FETCHROW($result_mmails);
82 SQL_FREERESULT($result_mmails);
84 // Fix non-existent ext-holidy
85 if ($HOLIDAY == $DMY) $HOLIDAY = 'N';
87 $ALLOWED = $MAXI - $ORDERS;
88 if (getConfig('order_max_full') == 'MAX') $ALLOWED = $MAXI;
90 // Now check his points amount
91 $total = countSumTotalData(getUserId(), 'user_points', 'points') - countSumTotalData(getUserId(), 'user_data', 'used_points');;
93 if (($HOLIDAY == 'Y') && (getExtensionVersion('holiday') >= '0.1.3')) {
95 loadTemplate('admin_settings_saved', false, getMessage('HOLIDAY_ORDER_NOT_POSSIBLE'));
96 } elseif ((isPostRequestElementSet('frametester')) && ($ALLOWED > 0) && (postRequestElement('receiver') > 0)) {
97 // Continue with the frametester, we first need to store the data temporary in the pool
99 // First we would like to store the data and get it's pool position back...
100 $result = SQL_QUERY_ESC("SELECT `id`, `data_type`
102 `{?_MYSQL_PREFIX?}_pool`
106 `timestamp` > (UNIX_TIMESTAMP() - %s)
110 postRequestElement('url'),
111 getConfig('url_tlock')
112 ), __FILE__, __LINE__);
114 $type = 'TEMP'; $id = 0;
115 if (SQL_NUMROWS($result) == 1) {
116 // Load id and mail type
117 list($id, $type) = SQL_FETCHROW($result);
121 SQL_FREERESULT($result);
123 if ($type == 'TEMP') {
124 // No entry found, so we need to check out the stats table as well... :)
125 // We have to add that suff here, now we continue WITHOUT checking and check the text and subject against some filters
127 if (getConfig('test_text') == 'Y') {
128 // Test submitted text against some filters (length, URLs in text etc.)
129 if ((strpos(strtolower(postRequestElement('text')), "https://") > -1) || (strpos(strtolower(postRequestElement('text')), 'http://') > -1) || (strpos(strtolower(postRequestElement('text')), "www") > -1)) {
131 $URL = 'modules.php?module=login&what=order&code=' . getCode('URL_FOUND');
134 // Remove new-line and carriage-return characters
135 $TEST = str_replace("\n", '', str_replace("\r", '', postRequestElement('text')));
137 // Text length within allowed length?
138 if (strlen($TEST) > getConfig('max_tlength')) {
140 $URL = 'modules.php?module=login&what=order&code=' . getCode('OVERLENGTH');
144 // Shall I test the subject line against URLs?
145 if (getConfig('test_subj') == 'Y') {
146 // Check the subject line for issues
147 setRequestPostElement('subject', str_replace("\\", '[nl]', substr(postRequestElement('subject'), 0, 200)));
148 if ((strpos(strtolower(postRequestElement('subject')), 'http://') > -1) || (strpos(strtolower(postRequestElement('subject')), "www") > -1)) {
149 // URL in subject found
150 $URL = 'modules.php?module=login&what=order&code=' . getCode('SUBJ_URL');
154 // And shall I check that his URL is not in the black list?
155 if (getConfig('url_blacklist') == 'Y') {
156 // Ok, I do that for you know...
157 $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`timestamp`) AS tstamp FROM `{?_MYSQL_PREFIX?}_url_blacklist` WHERE `url`='%s' LIMIT 1",
158 array(postRequestElement('url')), __FILE__, __LINE__);
160 if (SQL_NUMROWS($result) == 1) {
161 // Jupp, we got one listed
162 list($blist) = SQL_FETCHROW($result);
164 // Create redirect-URL
165 $URL = 'modules.php?module=login&what=order&code=' . getCode('BLIST_URL') . '&blist=' . $blist;
169 SQL_FREERESULT($result);
172 // Enougth receivers entered?
173 if ((postRequestElement('receiver') < getConfig('order_min')) && (!isAdmin())) {
174 // Less than allowed receivers entered!
175 $URL = 'modules.php?module=login&what=order&code=' . getCode('MORE_RECEIVERS3');
179 if (!isUrlValid(postRequestElement('url'))) {
181 $URL = 'modules.php?module=login&what=order&code=' . getCode('INVALID_URL');
184 // Probe for HTML extension
185 if (isExtensionActive('html_mail')) {
186 // HTML or regular text mail?
187 if (postRequestElement('html') == 'Y') {
188 // Chek for valid HTML tags
189 setRequestPostElement('text', checkHtmlTags(postRequestElement('text')));
191 // Maybe invalid tags found?
192 if (!isPostRequestElementSet('text')) $URL = 'modules.php?module=login&what=order&code=' . getCode('INVALID_TAGS')."&id=".$id;
194 // Remove any HTML code
195 setRequestPostElement('text', str_replace('<', '{OPEN_HTML}', str_replace('>', '{CLOSE_HTML}', postRequestElement('text'))));
198 } elseif (!isAdmin()) {
199 // He has already sent a mail within a specific time
200 $URL = 'modules.php?module=login&what=order&code=' . getCode('URL_TLOCK') . '&id=' . $id;
205 // Check if category and number of receivers is okay
207 if ((getConfig('order_multi_page') == 'Y') && (isPostRequestElementSet('zip'))) {
208 // Choose recipients by ZIP code
209 $add = " AND d.zip LIKE '".bigintval(postRequestElement('zip'))."{PER}'";
213 $result = SQL_QUERY_ESC("SELECT
216 `{?_MYSQL_PREFIX?}_user_cats` AS c
218 `{?_MYSQL_PREFIX?}_user_data` AS d
222 c.cat_id=%s AND c.userid != '%s' AND d.`status`='CONFIRMED' AND d.receive_mails > 0".$add."
226 bigintval(postRequestElement('cat')),
228 getConfig('order_select'),
229 getConfig('order_mode'),
230 ), __FILE__, __LINE__);
232 // Do we enougth receivers left?
233 if (SQL_NUMROWS($result) >= postRequestElement('receiver')) {
234 // Check for holiday extensions
236 if (getExtensionVersion('holiday') >= '0.1.3') {
237 // Include checking for users in holiday
241 // Load receivers from database
242 $TEST = array(); $cnt = 0;
243 while ($holidayContent = SQL_FETCHARRAY($result)) {
245 // Check for his holiday status
246 $result_holiday = SQL_QUERY_ESC("SELECT
249 `{?_MYSQL_PREFIX?}_user_holidays`
251 `userid`=%s AND `holiday_start` < UNIX_TIMESTAMP() AND `holiday_end` > UNIX_TIMESTAMP()
253 array($holidayContent['userid']), __FILE__, __LINE__);
254 if (SQL_NUMROWS($result_holiday) == 1) $holidayContent['userid'] = 0; // Exclude user who are in holiday
257 SQL_FREERESULT($result_holiday);
260 if ($holidayContent['userid'] > 0) {
262 $TEST[] = $holidayContent['userid'];
268 SQL_FREERESULT($result);
270 // Implode array into string for the sending pool
271 $RECEIVER = implode($TEST, ';');
273 // Count array for maximum sent
274 $content['target_send'] = count($TEST);
276 // Update receiver list
277 SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `receive_mails`=`receive_mails`-1 WHERE `userid` IN (%s) LIMIT %s",
278 array(str_replace(';', ", ", $RECEIVER), $content['target_send']), __FILE__, __LINE__);
280 // Is calculated max receivers larger than wanted receivers then reset it
281 if ($content['target_send'] > postRequestElement('receiver')) $content['target_send'] = bigintval(postRequestElement('receiver'));
283 // Calculate used points
284 $USED = $content['target_send'] * getPaymentPoints(bigintval(postRequestElement('type')));
286 // Fix empty zip code
287 if (!isPostRequestElementSet('zip')) setRequestPostElement('zip', '0');
289 // Check if he has enougth points for this order and selected more than 0 receivers
290 if (($USED > 0) && ($USED <= $total) && ($content['target_send'] > 0)) {
291 // Gettings points is okay, so we can add $USED later from
292 if (($id == '0') || ($type != 'TEMP')) {
295 if (isExtensionActive('html_mail')) {
296 // HTML extension is active
297 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`)
298 VALUES ('%s','%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s','%s','%s','%s','%s')",
301 postRequestElement('subject'),
302 postRequestElement('text'),
304 bigintval(postRequestElement('type')),
305 postRequestElement('url'),
306 bigintval(postRequestElement('cat')),
307 $content['target_send'],
308 bigintval(postRequestElement('zip')),
309 postRequestElement('html')
310 ), __FILE__, __LINE__);
312 // No HTML extension is active
313 SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_pool` (`sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `zip`)
314 VALUES ('%s','%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s','%s','%s','%s')",
317 postRequestElement('subject'),
318 postRequestElement('text'),
320 bigintval(postRequestElement('type')),
321 postRequestElement('url'),
322 bigintval(postRequestElement('cat')),
323 $content['target_send'],
324 bigintval(postRequestElement('zip')),
325 ), __FILE__, __LINE__);
328 // Change current order
329 if (isExtensionActive('html_mail')) {
330 // HTML extension is active
331 SQL_QUERY_ESC("UPDATE
332 `{?_MYSQL_PREFIX?}_pool`
338 `timestamp`=UNIX_TIMESTAMP(),
348 postRequestElement('subject'),
349 postRequestElement('text'),
351 bigintval(postRequestElement('type')),
352 postRequestElement('url'),
353 bigintval(postRequestElement('cat')),
354 $content['target_send'],
355 bigintval(postRequestElement('zip')),
356 postRequestElement('html'),
358 ), __FILE__, __LINE__);
360 // No HTML extension is active
361 SQL_QUERY_ESC("UPDATE
362 `{?_MYSQL_PREFIX?}_pool`
368 `timestamp`=UNIX_TIMESTAMP(),
377 postRequestElement('subject'),
378 postRequestElement('text'),
380 bigintval(postRequestElement('type')),
381 postRequestElement('url'),
382 bigintval(postRequestElement('cat')),
383 $content['target_send'],
384 bigintval(postRequestElement('zip')),
386 ), __FILE__, __LINE__);
390 // Do we need to get the ID number?
392 // Order is placed as temporary. We need to get it's id for the frametester
393 $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",
396 postRequestElement('subject'),
397 bigintval(postRequestElement('type'))
398 ), __FILE__, __LINE__);
401 list($id) = SQL_FETCHROW($result);
404 SQL_FREERESULT($result);
407 // ID is received so we can redirect the user, used points will be added when he send's out the mail
408 $URL = 'modules.php?module=frametester&order=' . $id;
409 } elseif ($content['target_send'] == 0) {
410 // Not enougth receivers found which can receive mails
411 $URL = 'modules.php?module=login&what=order&code=' . getCode('MORE_RECEIVERS2');
413 // No enougth points left!
414 $URL = 'modules.php?module=login&what=order&code=' . getCode('MORE_POINTS');
417 // Ordered more mails than he can send in this category
418 $URL = 'modules.php?module=login&what=order&code=' . getCode('NO_RECS_LEFT');
421 } elseif (postRequestElement('receiver') == '0') {
422 // Not enougth receivers selected
423 $URL = 'modules.php?module=login&what=order&code=' . getCode('MORE_RECEIVERS1');
424 } elseif (($ALLOWED == 0) && (getConfig('order_max_full') == 'ORDER')) {
425 // No more mail orders allowed
426 loadTemplate('admin_settings_saved', false, getMessage('MEMBER_ORDER_ALLOWED_EXHAUSTED'));
427 } elseif (($links < getConfig('unconfirmed')) && ($mmails == '1')) {
428 // Display order form
429 $result_cats = SQL_QUERY("SELECT
432 `{?_MYSQL_PREFIX?}_cats`
435 `sort` ASC", __FILE__, __LINE__);
436 if (SQL_NUMROWS($result_cats) > 0) {
438 // Initialize array...
445 // Enable HTML checking
446 // @TODO Rewrite this to a filter
447 $HTML = ''; $HOLIDAY = false; $HOL_STRING = '';
448 if ((isExtensionActive('html_mail')) && (postRequestElement('html') == 'Y')) $HTML = " AND `html`='Y'";
449 if (getExtensionVersion('holiday') >= '0.1.3') {
450 // Extension's version is fine
451 $HOLIDAY = true; $HOL_STRING = " AND `holiday_active`='N'";
454 // ... and begin loading stuff
455 while ($categoriesContent = SQL_FETCHARRAY($result_cats)) {
456 $categories['id'][] = bigintval($categoriesContent['id']);
457 $categories['name'][] = $categoriesContent['cat'];
459 // Select users in current category
460 $result_userids = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `cat_id`=%s AND `userid` != '%s' ORDER BY `userid` ASC",
461 array(bigintval($categoriesContent['id']), getUserId()), __FILE__, __LINE__);
464 while (list($ucat) = SQL_FETCHROW($result_userids)) {
465 // Check for holiday system
468 // Check user's holiday status
469 $result_holiday = SQL_QUERY_ESC("SELECT
470 d.userid FROM `{?_MYSQL_PREFIX?}_user_data` AS d
472 `{?_MYSQL_PREFIX?}_user_holidays` AS h
476 d.userid=%s AND d.receive_mails > 0 AND d.`status`='CONFIRMED' AND d.`holiday_active`='Y' AND
477 h.holiday_start < UNIX_TIMESTAMP() AND h.holiday_end > UNIX_TIMESTAMP()
479 array(bigintval($ucat)), __FILE__, __LINE__);
481 // Is holiday is active?
482 $HOL_ACTIVE = (SQL_NUMROWS($result_holiday) == 1);
485 SQL_FREERESULT($result_holiday);
488 if ($HOL_ACTIVE === false) {
489 // Check if the user want's to receive mails?
490 $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",
491 array(bigintval($ucat)), __FILE__, __LINE__);
493 if ((SQL_NUMROWS($result_ver) == 1) && (isPostRequestElementSet('zip')) && (getConfig('order_multi_page') == 'Y')) {
495 list($zip) = SQL_FETCHROW($result_ver);
496 if (substr($zip, 0, strlen(postRequestElement('zip'))) == postRequestElement('zip')) {
497 // Ok, ZIP part is found
502 $userid_cnt += SQL_NUMROWS($result_ver);
506 SQL_FREERESULT($result_ver);
511 SQL_FREERESULT($result_userids);
512 $categories['userids'][] = $userid_cnt;
516 SQL_FREERESULT($result_cats);
518 // Now we need to load the mail types...
519 $result = SQL_QUERY("SELECT `id`, `price`, `payment`, `mail_title` FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `payment` ASC", __FILE__, __LINE__);
522 if (SQL_NUMROWS($result) > 0) {
523 // Check for message ID in URL
524 $message = getMessageFromErrorCode(getRequestElement('code'));
526 if (!empty($message)) {
527 // We got system message so we drop it out to the user
528 loadTemplate('admin_settings_saved', false, $message);
531 // Load all email types...
532 while ($types[] = SQL_FETCHROW($result)) {
533 // Nothing to do here... ;-)
537 SQL_FREERESULT($result);
539 // Output user's points
540 $content['total'] = translateComma($total);
542 // Check how many mail orders he has placed today and how many he's allowed to send
543 switch (getConfig('order_max_full')) {
544 case 'MAX': // He is allowed to send as much as possible
545 $content['order_max_full'] = getMessage('MEMBER_ORDER_ALLOWED_MAX');
548 case 'ORDER': // He is allowed to send as much as he setup the receiving value
549 $content['order_max_full'] = sprintf(getMessage('MEMBER_ORDER_ALLOWED_RECEIVE'), $ALLOWED, $MAXI);
552 default: // Unknown/invalid
553 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", getConfig('order_max_full')));
554 $content['order_max_full'] = sprintf(getMessage('MEMBER_ORDER_ALLOWED_UNKNOWN'), getConfig('order_max_full'));
558 // Load final template
559 loadTemplate('member_order_points', false, $content);
567 // Check if we already have an order placed and make it editable
568 $result = SQL_QUERY_ESC("SELECT
569 `subject`, `text`, `payment_id`, `timestamp`, `url`, `target_send`, `cat_id`, `zip`
571 `{?_MYSQL_PREFIX?}_pool`
576 array(getUserId()), __FILE__, __LINE__);
578 if (SQL_NUMROWS($result) == 1) {
580 $content = merge_array($content, SQL_FETCHARRAY($result));
582 // Fix max receivers when it is too much
583 if ((isset($categories['userids'][$content['cat_id']])) && ($content['target_send'] > $categories['userids'][$content['cat_id']])) {
585 $content['target_send'] = $categories['userids'][$content['cat_id']];
588 // Old order is grabbed
591 // Default output for that your members don't forget it...
592 $content['url'] = 'http://';
593 $content['target_send'] = $content['min'];
594 $content['subject'] = '{--ORDER_DEFAULT_SUBJECT--}';
595 $content['text'] = '{--ORDER_DEFAULT_TEXT--}';
599 SQL_FREERESULT($result);
601 if ((isPostRequestElementSet('data')) || ((getConfig('order_multi_page') != 'Y') && ((!isAdmin()) && (!isExtensionActive('html_mail'))))) {
602 // Pre-output categories
603 $content['category_selection'] = '';
604 foreach ($categories['id'] as $key => $value) {
605 $content['category_selection'] .= " <option value=\"".$value."\"";
606 if (($OLD_ORDER) && ($content['cat_id'] == $value)) $content['category_selection'] .= ' selected="selected"';
607 $content['category_selection'] .= ">".$categories['name'][$key]." (".$categories['userids'][$key]." {--USER_IN_CAT--})</option>\n";
611 $content['type_selection'] = '';
612 foreach ($types as $key => $value) {
613 $P = translateComma($types[$key][1]);
614 if (is_array($value)) {
615 // Output option line
616 $content['type_selection'] .= " <option value=\"".$types[$key][0]."\"";
617 if (($OLD_ORDER) && ($content['payment_id'] == $types[$key][0])) $content['type_selection'] .= ' selected="selected"';
618 $content['type_selection'] .= ">".$P." {--PER_MAIL--} - ".$types[$key][3]." - ".round($types[$key][2])." {--PAYMENT--}</option>\n";
622 if (isPostRequestElementSet('zip')) {
623 // Output entered ZIP code
624 $content['zip_content'] = loadTemplate('member_order-zip', true, postRequestElement('zip'));
626 $content['zip_content'] = "<tr><td colspan=\"5\" height=\"5\" class=\"seperator\"> </td></tr>";
630 if ((isExtensionActive('html_mail')) && (postRequestElement('html') == 'Y')) {
631 // Extension is active so output valid HTML tags
632 $content['html_extension'] = loadTemplate('member_order-html_ext', true, addValidHtmlTags());
634 // Extension not active and/or class not uploaded
635 $content['html_extension'] = "<tr><td colspan=\"5\"><input type=\"hidden\" name=\"html\" value=\"N\" /></td></tr>";
638 // Output form for page 2
639 loadTemplate('member_order_page2', false, $content);
641 // Remember maybe entered ZIP code in constant
643 if (isExtensionActive('html_mail')) {
644 // Add some content when html extension is active
645 if ((getConfig('order_multi_page') == 'Y') || (isAdmin())) $add = "<tr><td colspan=\"2\" class=\"seperator bottom2\" height=\"5\"> </td></tr>\n";
646 $content['html_extension'] = loadTemplate('member_order-html_intro', true);
648 // No HTML extension installed
649 $content['html_extension'] = "<tr><td colspan=\"2\"><input type=\"hidden\" name=\"html\" value=\"N\" /></td></tr>";
652 // Default is no ZIP code
653 $content['zip_content'] = '';
655 // Do we want ZIP code or not?
656 if ((getConfig('order_multi_page') == 'Y') || (isAdmin())) {
658 if (postRequestElement('zip') > 0) {
660 'zip' => bigintval(postRequestElement('zip')),
669 $content['zip_content'] = loadTemplate('member_order-zip1', true, $data);
672 // Output form for page 1 (ZIP code or HTML)
673 loadTemplate('member_order_page1', false, $content);
676 // No mail types defined
677 loadTemplate('admin_settings_saved', false, "<span class=\"member_failed\">{--MEMBER_NO_PAYMENTS--}</span>");
681 loadTemplate('admin_settings_saved', false, "<span class=\"member_failed\">{--MEMBER_NO_POINTS--}</span>");
684 // No cateogries are defined yet
685 loadTemplate('admin_settings_saved', false, "<span class=\"member_failed\">{--MEMBER_NO_CATS--}</span>");
687 } elseif ($mmails == '0') {
688 // Please set more than 0 mails per day
689 loadTemplate('admin_settings_saved', false, getMessage('MEMBER_HAS_ZERO_MMAILS'));
691 // Please confirm some mails first
692 loadTemplate('admin_settings_saved', false, sprintf(getMessage('MEMBER_LINKS_LEFT'), $links, getConfig('unconfirmed')));
696 // Redirect to requested URL