]> git.mxchange.org Git - mailer.git/blob - inc/modules/member/what-surfbar_book.php
- Daily/weekly/monthly reset completely rewritten
[mailer.git] / inc / modules / member / what-surfbar_book.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 09/08/2008 *
4  * ================                             Last change: 09/08/2008 *
5  *                                                                      *
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  * -------------------------------------------------------------------- *
13  *                                                                      *
14  * -------------------------------------------------------------------- *
15  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
16  * For more information visit: http://www.mxchange.org                  *
17  *                                                                      *
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.                                  *
22  *                                                                      *
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.                         *
27  *                                                                      *
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,               *
31  * MA  02110-1301  USA                                                  *
32  ************************************************************************/
33
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";
37         require($INC);
38 } elseif (!IS_LOGGED_IN()) {
39         // Redirect
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");
44         return;
45 }
46
47 // Add description as navigation point
48 ADD_DESCR("member", basename(__FILE__));
49
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']);
57
58         // Was this fine?
59         if ($insertId > 0) {
60                 // URL added and waiting for unlock
61                 $msg = MEMBER_SURFBAR_URL_ADDED;
62         } else {
63                 // Something went wrong!
64                 $msg = MEMBER_SURFBAR_URL_NOT_ADDED;
65         }
66
67         // Load message template
68         LOAD_TEMPLATE("admin_settings_saved", false, $msg);
69 } else {
70         // Prepare some content
71         $content = array(
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()
76         );
77
78         // Load surfbar order form
79         LOAD_TEMPLATE(sprintf("member_surfbar_book_%s", strtolower($_CONFIG['surfbar_pay_model'])), false, $content);
80 }
81
82 //
83 ?>