2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 06/25/2013 *
4 * =================== Last change: 06/25/2013 *
6 * -------------------------------------------------------------------- *
7 * File : mode-setup.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Double points *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Punkte verdoppeln *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
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 *
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. *
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. *
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, *
36 ************************************************************************/
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
43 // @TODO Remove double tabs from all lines
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',
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');
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');
96 // --- MENU SYSTEMS ---
99 addAdminMenuSql('doubler', NULL, '{OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Verdoppler','Einstellungen und Einträge auflisten.', 4);
100 addAdminMenuSql('doubler','list_doubler','Auflisten','Einträge aus der Verdiensttabelle auflisten', 1);
101 addAdminMenuSql('doubler','config_doubler','Einstellungen','Prozentuale Gebühr usw. einstellen.', 2);
103 // Guest menu (informations / default doubler link)
104 addGuestMenuSql('main', 'doubler', 'Verdoppeln!', 3);
107 addMemberMenuSql('main', 'doubler', 'Verdoppeln!', 7);