2 /************************************************************************
3 * MXChange v0.2.1 Start: 09/08/2008 *
4 * ================ Last change: 09/08/2008 *
6 * -------------------------------------------------------------------- *
7 * File : what-surfbar_book.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Members can book new URLs here *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Mitglieder koennen URLs buchen *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if (!defined('__SECURITY')) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
38 } elseif (!IS_MEMBER()) {
40 LOAD_URL("modules.php?module=index");
41 } elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) {
42 addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "surfbar");
46 // Add description as navigation point
47 ADD_DESCR("member", __FILE__);
49 // Still allowed to book more URLs?
50 if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
51 // No more URLs allowed to book!
52 LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_SURFBAR_NO_MORE_ALLOWED'));
53 } elseif ((IS_FORM_SENT()) && (REQUEST_ISSET_POST(('limited')))) {
54 // Is limitation "no" and "limit" is > 0?
55 if ((REQUEST_POST('limited') == "N") && ((REQUEST_ISSET_POST(('limit'))) && (REQUEST_POST('limit') > 0)) || (!REQUEST_ISSET_POST(('limit')))) {
56 // Set it to unlimited
57 REQUEST_SET_POST('limit', 0);
60 // Register the new URL
61 $insertId = SURFBAR_MEMBER_ADD_URL(REQUEST_POST('url'), REQUEST_POST('limit'));
63 // By default something went wrong
64 $msg = getMessage('MEMBER_SURFBAR_URL_NOT_ADDED');
68 // URL added and waiting for unlock
69 $msg = getMessage('MEMBER_SURFBAR_URL_ADDED');
72 // Load message template
73 LOAD_TEMPLATE("admin_settings_saved", false, $msg);
75 // Prepare some content
77 'reward' => TRANSLATE_COMMA(SURFBAR_DETERMINE_REWARD(true)),
78 'costs' => TRANSLATE_COMMA(SURFBAR_DETERMINE_COSTS(true)),
79 'max_order' => getConfig('surfbar_max_order'),
80 'curr_order' => SURFBAR_GET_TOTAL_USER_URLS()
83 // Load surfbar order form
84 LOAD_TEMPLATE(sprintf("member_surfbar_book_%s", strtolower(getConfig('surfbar_pay_model'))), false, $content);