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 (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
38 } elseif (!IS_LOGGED_IN()) {
40 LOAD_URL(URL."/modules.php?module=index");
41 } elseif (!EXT_IS_ACTIVE("surfbar")) {
42 // Extension "surfbar" is not active
43 ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "surfbar");
47 // Add description as navigation point
48 ADD_DESCR("member", basename(__FILE__));
50 // Still allowed to book more URLs?
51 if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
52 // No more URLs allowed to book!
53 LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SURFBAR_NO_MORE_ALLOWED);
54 } elseif (isset($_POST['ok'])) {
55 // Register the new URL
56 $insertId = SURFBAR_MEMBER_ADD_URL($_POST['url']);
60 // URL added and waiting for unlock
61 $msg = MEMBER_SURFBAR_URL_ADDED;
63 // Something went wrong!
64 $msg = MEMBER_SURFBAR_URL_NOT_ADDED;
67 // Load message template
68 LOAD_TEMPLATE("admin_settings_saved", false, $msg);
70 // Prepare some content
72 'reward' => TRANSLATE_COMMA(SURFBAR_DETERMINE_REWARD()),
73 'costs' => TRANSLATE_COMMA(SURFBAR_DETERMINE_COSTS()),
74 'max_order' => $_CONFIG['surfbar_max_order'],
75 'curr_order' => SURFBAR_GET_TOTAL_USER_URLS()
78 // Load surfbar order form
79 LOAD_TEMPLATE(sprintf("member_surfbar_book_%s", strtolower($_CONFIG['surfbar_pay_model'])), false, $content);