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 * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. March 2009) $ *
15 * $Tag:: 0.2.1-FINAL $ *
16 * $Author:: stelzi $ *
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 - 2008 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')) {
41 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
43 } elseif (!IS_MEMBER()) {
45 LOAD_URL("modules.php?module=index");
46 } elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) {
47 addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "surfbar");
51 // Add description as navigation point
52 ADD_DESCR("member", __FILE__);
54 // Still allowed to book more URLs?
55 if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
56 // No more URLs allowed to book!
57 LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_SURFBAR_NO_MORE_ALLOWED'));
58 } elseif ((IS_FORM_SENT()) && (REQUEST_ISSET_POST(('limited')))) {
59 // Is limitation "no" and "limit" is > 0?
60 if ((REQUEST_POST('limited') == "N") && ((REQUEST_ISSET_POST(('limit'))) && (REQUEST_POST('limit') > 0)) || (!REQUEST_ISSET_POST(('limit')))) {
61 // Set it to unlimited
62 REQUEST_SET_POST('limit', 0);
65 // Register the new URL
66 $insertId = SURFBAR_MEMBER_ADD_URL(REQUEST_POST('url'), REQUEST_POST('limit'));
68 // By default something went wrong
69 $msg = getMessage('MEMBER_SURFBAR_URL_NOT_ADDED');
73 // URL added and waiting for unlock
74 $msg = getMessage('MEMBER_SURFBAR_URL_ADDED');
77 // Load message template
78 LOAD_TEMPLATE("admin_settings_saved", false, $msg);
80 // Prepare some content
82 'reward' => TRANSLATE_COMMA(SURFBAR_DETERMINE_REWARD(true)),
83 'costs' => TRANSLATE_COMMA(SURFBAR_DETERMINE_COSTS(true)),
84 'max_order' => getConfig('surfbar_max_order'),
85 'curr_order' => SURFBAR_GET_TOTAL_USER_URLS()
88 // Load surfbar order form
89 LOAD_TEMPLATE(sprintf("member_surfbar_book_%s", strtolower(getConfig('surfbar_pay_model'))), false, $content);