Heacy rewrite/cleanup:
[mailer.git] / inc / extensions / doubler / mode-setup.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 06/25/2013 *
4  * ===================                          Last change: 06/25/2013 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : mode-setup.php                                   *
8  * -------------------------------------------------------------------- *
9  * Short description : Double points                                    *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Punkte verdoppeln                                *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * -------------------------------------------------------------------- *
18  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
19  * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
20  * For more information visit: http://mxchange.org                      *
21  *                                                                      *
22  * This program is free software; you can redistribute it and/or modify *
23  * it under the terms of the GNU General Public License as published by *
24  * the Free Software Foundation; either version 2 of the License, or    *
25  * (at your option) any later version.                                  *
26  *                                                                      *
27  * This program is distributed in the hope that it will be useful,      *
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
30  * GNU General Public License for more details.                         *
31  *                                                                      *
32  * You should have received a copy of the GNU General Public License    *
33  * along with this program; if not, write to the Free Software          *
34  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
35  * MA  02110-1301  USA                                                  *
36  ************************************************************************/
37
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
40         die();
41 } // END - if
42
43 // @TODO Remove double tabs from all lines
44                 // Doubler table
45                 addDropTableSql('doubler');
46                 addCreateTableSql('doubler', "
47 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
48 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
49 `refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
50 `points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
51 `remote_ip` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
52 `timemark` BIGINT(10) NOT NULL DEFAULT 0,
53 `completed` ENUM('Y','N') NOT NULL DEFAULT 'N',
54 `is_ref` ENUM('Y','N') NOT NULL DEFAULT 'N',
55 PRIMARY KEY (`id`),
56 INDEX (`refid`),
57 INDEX (`userid`)",
58                         'User doubler data');
59
60                 //
61                 // --- SETTINGS ---
62                 //
63                 // Minimum points to double
64                 addConfigAddSql('doubler_min', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 100.00000');
65                 // Maximum points to double
66                 addConfigAddSql('doubler_max', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 10000.00000');
67                 // Points left on users account after doubling
68                 addConfigAddSql('doubler_left', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 1000');
69                 // Charge for doubling points which goes to the webmaster (shreddered in fact!)
70                 addConfigAddSql('doubler_charge', 'FLOAT(7,5) UNSIGNED NOT NULL DEFAULT 0.03000');
71                 // Referral percents
72                 addConfigAddSql('doubler_ref', 'FLOAT(7,5) UNSIGNED NOT NULL DEFAULT 0.02000');
73                 // Shall I use the jackpot to take points from? (Y/N, default=Y)
74                 addConfigAddSql('doubler_jackpot', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
75                 // A user account to take points from (default: 0->none)
76                 addConfigAddSql('doubler_userid', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
77                 // Total payed out points from your doublers
78                 addConfigAddSql('doubler_points', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
79                 // Sending mode of mails (immediately/daily reset)
80                 // --> This also means who fast the doubled points will be payed out!
81                 addConfigAddSql('doubler_send_mode', "ENUM('DIRECT','RESET') NOT NULL DEFAULT 'DIRECT'");
82                 // Timeout for entries to be purged (default: one week)
83                 addConfigAddSql('doubler_timeout', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 7));
84                 // Number of newest entries to display
85                 addConfigAddSql('doubler_display_new', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 10');
86                 // Number of entries which will be payed out soon
87                 addConfigAddSql('doubler_display_pay', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 10');
88                 // Number of entries which are already payed out
89                 addConfigAddSql('doubler_display_old', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 10');
90                 // Points used by every member
91                 addExtensionAddTableColumnSql('user_data', 'doubler_points', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
92                 // Counter for usage of the doubler
93                 addConfigAddSql('doubler_counter', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
94
95                 //
96                 // --- MENU SYSTEMS ---
97                 //
98                 // Admin menu
99                 addAdminMenuSql('doubler', NULL, '{OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Verdoppler','Einstellungen und Eintr&auml;ge auflisten.', 4);
100                 addAdminMenuSql('doubler','list_doubler','Auflisten','Eintr&auml;ge aus der Verdiensttabelle auflisten', 1);
101                 addAdminMenuSql('doubler','config_doubler','Einstellungen','Prozentuale Geb&uuml;hr usw. einstellen.', 2);
102
103                 // Guest menu (informations / default doubler link)
104                 addGuestMenuSql('main', 'doubler', 'Verdoppeln!', 3);
105
106                 // Member menu
107                 addMemberMenuSql('main', 'doubler', 'Verdoppeln!', 7);
108
109 // [EOF]
110 ?>