]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-rewrite.php
Deprecation of ext-rewrite as of ext-seo prepared and ext-imprint/seo added (UNFINISHED)
[mailer.git] / inc / extensions / ext-rewrite.php
index b4de75958facce3482620a7bf7ed14adb04e3ae7..61f3ab1a18f9abe1b4dad6dab4bb46776a2c9ee6 100644 (file)
@@ -10,7 +10,7 @@
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Schreibt eigene Links um fuer Suchmaschinen      *
  * -------------------------------------------------------------------- *
- * $Revision:: 856                                                    $ *
+ * $Revision::                                                        $ *
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 }
 
 // Version number
-EXT_SET_VERSION("0.1.3");
+EXT_SET_VERSION('0.1.3');
 
-// Version history array (add more with , "0.1" and so on)
-EXT_SET_VER_HISTORY(array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3"));
+// Version history array (add more with , '0.1.0' and so on)
+EXT_SET_VER_HISTORY(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3'));
+
+// This extension is deprecated!
+// Only since 'seo' is ready! EXT_SET_DEPRECATED('Y');
 
 switch ($EXT_LOAD_MODE)
 {
-case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
-       // Check if mod_rewrite is loadeded
-       if (!IF_APACHE_MODULE_LOADED('mod_rewrite')){
-               EXT_SET_REPORTS_FAILURE(true);
-               addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
-       } // END - if
-
-       // SQL commands to run
-       ADD_SQL("");
-       break;
-
-case "remove": // Do stuff when removing extension
-       // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_rewrite' LIMIT 1");
-       break;
-
-case "activate": // Do stuff when admin activates this extension
-       // Check if mod_rewrite is loadeded
-       if (!IF_APACHE_MODULE_LOADED('mod_rewrite')) {
-               SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='N' WHERE ext_name='rewrite' LIMIT 1", __FILE__, __LINE__);
-               EXT_SET_REPORTS_FAILURE(true);
-               addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
-        } // END - if
-
-       // SQL commands to run
-       ADD_SQL("");
-       break;
-
-case "deactivate": // Do stuff when admin deactivates this extension
-       // SQL commands to run
-       ADD_SQL("");
-       break;
-
-case "update": // Update an extension
-       switch ($EXT_VER)
-       {
-       case "0.0.1": // SQL queries for v0.0.1
-               // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Folgende Linkvariablen werden nun auch ausgetauscht: bid, mid, url, page, offset");
-               break;
-
-       case "0.0.2": // SQL queries for v0.0.2
-               // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Folgende Linkvariablen werden nun auch ausgetauscht: type, do=search");
-
-       case "0.0.3": // SQL queries for v0.0.3
-               // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("URLs zu MXChange.org (".SERVER_URL.") sind nun auch wieder gültig.");
-               break;
-
-       case "0.0.4": // SQL queries for v0.0.4
-               // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Folgende Linkvariablen werden nun auch ausgetausch: sub, home");
-               break;
-
-       case "0.0.5": // SQL queries for v0.0.5
-               // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Links im Admin- und Mitgliedsbereich werden nicht mehr umgeschrieben. Entsprechend fällt die neue .htaccess-Datei kleiner aus. Bitte anpassen!");
-
-       case "0.0.6": // SQL queries for v0.0.6
-               // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Links im Frametester-Modul werden nicht mehr umgeschrieben.");
-               break;
+       case 'register': // Do stuff when installation is running (modules.php?module=admin&action=login is called)
+               // Check if mod_rewrite is loadeded
+               if (!isApacheModuleLoaded('mod_rewrite')){
+                       EXT_SET_REPORTS_FAILURE(true);
+                       addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
+               } // END - if
 
-       case "0.0.7": // SQL queries for v0.0.7
-               // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
+               // SQL commands to run
+               ADD_EXT_SQL('');
                break;
 
-       case "0.0.8": // SQL queries for v0.0.8
-               // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
+       case 'remove': // Do stuff when removing extension
+               // SQL commands to run
+               ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_rewrite'");
                break;
 
-       case "0.0.9": // SQL queries for v0.0.9
-               ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD rewrite_skip VARCHAR(255) NOT NULL DEFAULT 'login:admin:frametester:mailid'");
-               ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_rewrite','Rewrite-Engine','Stellen Sie hier ein, welche Module übersprungen werden sollen, in denen also kein Umschreiben des HTML-Codes stattfinden soll.', 8)");
+       case 'activate': // Do stuff when admin activates this extension
+               // Check if mod_rewrite is loadeded
+               if (!isApacheModuleLoaded('mod_rewrite')) {
+                       SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET `ext_active`='N' WHERE `ext_name`='rewrite' LIMIT 1", __FILE__, __LINE__);
+                       EXT_SET_REPORTS_FAILURE(true);
+                       addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
+        } // END - if
 
-               // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Zu überspringende Module können per Admin-Bereich eingestellt werden.");
-               break;
+        // SQL commands to run
+        ADD_EXT_SQL('');
+        break;
 
-       case "0.1.0": // SQL queries for v0.2.1
-               // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("W&ouml;rter <strong>Mailtausch</strong>, <strong>Mailtausches</strong> und <strong>Mailtauscher</strong> sind austauschbar.");
+       case 'deactivate': // Do stuff when admin deactivates this extension
+               // SQL commands to run
+               ADD_EXT_SQL('');
                break;
 
-       case "0.1.1": // SQL queries for v0.1.1
-               // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.");
+       case 'update': // Update an extension
+               switch ($EXT_VER)
+               {
+                       case '0.0.1': // SQL queries for v0.0.1
+                               // Update notes (these will be set as task text!)
+                               EXT_SET_UPDATE_NOTES("Folgende Linkvariablen werden nun auch ausgetauscht: bid, mid, url, page, offset");
+                               break;
+
+                       case '0.0.2': // SQL queries for v0.0.2
+                               // Update notes (these will be set as task text!)
+                               EXT_SET_UPDATE_NOTES("Folgende Linkvariablen werden nun auch ausgetauscht: type, do=search");
+
+                       case '0.0.3': // SQL queries for v0.0.3
+                               // Update notes (these will be set as task text!)
+                               EXT_SET_UPDATE_NOTES("URLs zu MXChange.org ({!SERVER_URL!}) sind nun auch wieder g&uuml;ltig.");
+                               break;
+
+                       case '0.0.4': // SQL queries for v0.0.4
+                               // Update notes (these will be set as task text!)
+                               EXT_SET_UPDATE_NOTES("Folgende Linkvariablen werden nun auch ausgetausch: sub, home");
+                               break;
+
+                       case '0.0.5': // SQL queries for v0.0.5
+                               // Update notes (these will be set as task text!)
+                               EXT_SET_UPDATE_NOTES("Links im Admin- und Mitgliedsbereich werden nicht mehr umgeschrieben. Entsprechend f&auml;llt die neue .htaccess-Datei kleiner aus. Bitte anpassen!");
+
+                       case '0.0.6': // SQL queries for v0.0.6
+                               // Update notes (these will be set as task text!)
+                               EXT_SET_UPDATE_NOTES("Links im Frametester-Modul werden nicht mehr umgeschrieben.");
+                               break;
+
+                       case '0.0.7': // SQL queries for v0.0.7
+                               // Update notes (these will be set as task text!)
+                               EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
+                               break;
+
+                       case '0.0.8': // SQL queries for v0.0.8
+                               // Update notes (these will be set as task text!)
+                               EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
+                               break;
+
+                       case '0.0.9': // SQL queries for v0.0.9
+                               ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD rewrite_skip VARCHAR(255) NOT NULL DEFAULT 'login:admin:frametester:mailid'");
+                               ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_rewrite','Rewrite-Engine','Stellen Sie hier ein, welche Module &uuml;bersprungen werden sollen, in denen also kein Umschreiben des HTML-Codes stattfinden soll.', 8)");
+
+                               // Update notes (these will be set as task text!)
+                               EXT_SET_UPDATE_NOTES("Zu &uuml;berspringende Module k&ouml;nnen per Admin-Bereich eingestellt werden.");
+                               break;
+
+                       case '0.1.0': // SQL queries for v0.2.1
+                               // Update notes (these will be set as task text!)
+                               EXT_SET_UPDATE_NOTES("W&ouml;rter <strong>Mailtausch</strong>, <strong>Mailtausches</strong> und <strong>Mailtauscher</strong> sind austauschbar.");
+                               break;
+
+                       case '0.1.1': // SQL queries for v0.1.1
+                               // Update notes (these will be set as task text!)
+                               EXT_SET_UPDATE_NOTES("HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.");
+                               break;
+
+                       case '0.1.2': // SQL queries for v0.1.2
+                               // Update notes (these will be set as task text!)
+                               EXT_SET_UPDATE_NOTES("Abspeichern von Einstellungen repariert.");
+                               break;
+                       case '0.1.3':
+                               // Check if mod_rewrite is loadeded
+                               if (!isApacheModuleLoaded('mod_rewrite')){
+                                       EXT_SET_REPORTS_FAILURE(true);
+                                       //addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
+                               } // END - if
+                               EXT_SET_UPDATE_NOTES("Es wird beim Registrieren und aktivieren gepr&uuml;ft, ob im Apache das Modul mod_rewrite geladen wurde. Wenn mod_rewrite nicht gefunden werden konnte, wird abgebrochen.");
+                               break;
+               }
                break;
 
-       case "0.1.2": // SQL queries for v0.1.2
-               // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Abspeichern von Einstellungen repariert.");
-               break;
-       case "0.1.3":
-               // Check if mod_rewrite is loadeded
-               if (!IF_APACHE_MODULE_LOADED('mod_rewrite')){
-                       EXT_SET_REPORTS_FAILURE(true);
-                       //addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
-               } // END - if
-               EXT_SET_UPDATE_NOTES("Es wird beim Registrieren und aktivieren gepr&uuml;ft, ob im Apache das Modul mod_rewrite geladen wurde. Wenn mod_rewrite nicht gefunden werden konnte, wird abgebrochen.");
-               break;
-       }
-       break;
-
-case "modify": // When the extension got modified
-       break;
+                       case 'modify': // When the extension got modified
+                               break;
 
-case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
-       break;
+                       case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+                               break;
 
-default: // Do stuff when extension is loaded
-       // Check if mod_rewrite is loadeded
-       if (!IF_APACHE_MODULE_LOADED('mod_rewrite')){
-               EXT_SET_REPORTS_FAILURE(true);
-               SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='N' WHERE ext_name='rewrite' LIMIT 1", __FILE__, __LINE__);
-               if (!IS_ADMIN()) addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
-        } // END - if
-       break;
+                       default: // Do stuff when extension is loaded
+                               // Check if mod_rewrite is loadeded
+                               if (!isApacheModuleLoaded('mod_rewrite')){
+                                       EXT_SET_REPORTS_FAILURE(true);
+                                       SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET `ext_active`='N' WHERE `ext_name`='rewrite' LIMIT 1", __FILE__, __LINE__);
+                                       if (!IS_ADMIN()) addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
+                               } // END - if
+                               break;
 }
 
 //