config_secure and config_points works only with ext-sql_patches -> moved
[mailer.git] / inc / extensions / ext-country.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 04/30/2005 *
4  * ================                             Last change: 04/30/2005 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : ext-country.php                                  *
8  * -------------------------------------------------------------------- *
9  * Short description : Country code management                          *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Laendercode-Management                           *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
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 - 2009 by Roland Haeder                           *
21  * For more information visit: http://www.mxchange.org                  *
22  *                                                                      *
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.                                  *
27  *                                                                      *
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.                         *
32  *                                                                      *
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,               *
36  * MA  02110-1301  USA                                                  *
37  ************************************************************************/
38
39 // Some security stuff...
40 if (!defined('__SECURITY')) {
41         die();
42 } // END - if
43
44 // Version number
45 setThisExtensionVersion('0.0.4');
46
47 // Version history array (add more with , '0.1.0' and so on)
48 setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4'));
49
50 // Keep this extension always active!
51 setExtensionAlwaysActive('Y');
52
53 switch (getExtensionMode()) {
54         case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
55                 // SQL commands to run
56                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`");
57                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_countries` (
58 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
59 code CHAR(2) NOT NULL DEFAULT 'DE',
60 descr VARCHAR(255) NOT NULL DEFAULT 'Deutschland',
61 is_active ENUM('Y','N') NOT NULL DEFAULT 'N',
62 KEY (code),
63 PRIMARY KEY (id)
64 ) TYPE={?_TABLE_TYPE?}");
65                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (code, descr, is_active) VALUES ('DE','Deutschland','Y')");
66
67                 // Admin menu
68                 addAdminMenuSql('country', NULL, 'L&auml;ndercodes verwalten','Stellen Sie hier L&auml;ndercodes ein, damit auch internationale Mitglieder sich zu Ihrem {?mt_word?} anmelden k&ouml;nnen.', 8);
69                 addAdminMenuSql('country','list_country','Verwalten','Hinzuf&uuml;gen, &Auml;ndern und L&ouml;schen von L&auml;ndercodes.', 1);
70
71                 // Add entry to user table
72                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD country_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 1");
73                 break;
74
75         case 'remove': // Do stuff when removing extension
76                 // SQL commands to run
77                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`");
78                 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='country'");
79                 break;
80
81         case 'activate': // Do stuff when admin activates this extension
82                 // SQL commands to run
83                 addExtensionSql('');
84                 break;
85
86         case 'deactivate': // Do stuff when admin deactivates this extension
87                 // SQL commands to run
88                 addExtensionSql('');
89                 break;
90
91         case 'update': // Update an extension
92                 switch (getCurrentExtensionVersion())
93                 {
94                         case '0.0.1': // SQL queries for v0.0.1
95                                 // Update notes (these will be set as task text!)
96                                 setExtensionUpdateNotes("SQL-Dateien hinzugef&uuml;gt, die Sie mit z.B. phpMyAdmin einspielen k&ouml;nnen. (DOCS/country/README.de lesen!)");
97                                 break;
98
99                         case '0.0.2': // SQL queries for v0.0.2
100                                 // Update notes (these will be set as task text!)
101                                 setExtensionUpdateNotes("Sicherheitsupdate: SQL-Anweisungen gesch&uuml;tzt.");
102                                 break;
103
104                         case '0.0.3': // SQL queries for v0.0.3
105                                 // Update notes (these will be set as task text!)
106                                 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
107                                 break;
108
109                         case '0.0.4': // SQL queries for v0.0.4
110                                 // Update notes (these will be set as task text!)
111                                 setExtensionUpdateNotes("Sicherheitsupdate f&uuml;r die Include-Befehle.");
112                                 break;
113                 }
114                 break;
115
116         case 'modify': // When the extension got modified
117                 break;
118
119         case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
120                 break;
121
122         case 'init': // Do stuff when extension is initialized
123                 break;
124
125         default: // Unknown extension mode
126                 DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
127                 break;
128 }
129
130 //
131 ?>