]> git.mxchange.org Git - mailer.git/commitdiff
Again more fixes from bugtracker, thanks to profi-concept
authorRoland Häder <roland@mxchange.org>
Sat, 7 Feb 2009 03:49:48 +0000 (03:49 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 7 Feb 2009 03:49:48 +0000 (03:49 +0000)
.gitattributes
inc/databases.php
inc/extensions/ext-logs.php
inc/extensions/ext-usage.php [new file with mode: 0644]
inc/language/_de.php
inc/language/logs_de.php
inc/language/usage_de.php [new file with mode: 0644]
inc/modules/admin/what-logs.php
inc/modules/admin/what-usage.php
install/menu-de.sql
install/menu-en.sql

index a6a10877d2f0a03b043f512d4b5a0797438972b5..b0c1b1cf655e2c100cb2275256a6f724345d2d9c 100644 (file)
@@ -152,6 +152,7 @@ inc/extensions/ext-task.php -text
 inc/extensions/ext-theme.php -text
 inc/extensions/ext-top10.php -text
 inc/extensions/ext-transfer.php -text
+inc/extensions/ext-usage.php -text
 inc/extensions/ext-user.php -text
 inc/extensions/ext-wernis.php -text
 inc/extensions/ext-yoomedia.php -text
@@ -213,6 +214,7 @@ inc/language/task_de.php -text
 inc/language/theme_de.php -text
 inc/language/top10_de.php -text
 inc/language/transfer_de.php -text
+inc/language/usage_de.php -text
 inc/language/user_de.php -text
 inc/language/wernis_de.php -text
 inc/language/yoomedia_de.php -text
index 925c4954388cf31739578b71b998fbb2cd9dd62c..6fc682b4baa497cdd453734886c3e5583dceb0fe 100644 (file)
@@ -105,17 +105,11 @@ if ((strpos($COOKIES, "/") == "0") && (strpos(substr(URL, 8), "/") > 0)) {
 // Cookie-Path ( for lame servers... ;-) )
 define('COOKIE_PATH', $COOKIES);
 
-// Base directory for access logfiles
-define('LOGS_BASE', "logs");
-
-// Base directory for usage statistics
-define('USAGE_BASE', "usage");
-
 // Server-URL (DO NOT CHANGE THIS OR YOU CANNOT CHECK FOR UPDATES/EXTENSIONS!)
 define('SERVER_URL', "http://www.mxchange.org");
 
 // Current SVN revision
-define('CURR_SVN_REVISION', "711");
+define('CURR_SVN_REVISION', "712");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 0326ef7b1c5f0a06e53106dd5cdbfa82114a155a..385a5dd1c1bbc00b079cd9d52a0c7cf170bff95b 100644 (file)
@@ -51,6 +51,7 @@ switch ($EXT_LOAD_MODE)
 case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
        // SQL commands to run
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('stats','logs','Aufruflogb&uuml;cher','Verwalten Sie Ihre Aufruflogb&uuml;cher mit diesem Admin-Bereich! (Derzeit nur Download!)',8)";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `logs_base` VARCHAR(255) NOT NULL DEFAULT 'logs'";
        break;
 
 case "remove": // Do stuff when removing extension
diff --git a/inc/extensions/ext-usage.php b/inc/extensions/ext-usage.php
new file mode 100644 (file)
index 0000000..75d5e09
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/07/2009 *
+ * ================                             Last change: 02/07/2009 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-usage.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Helper extension for usage directory             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Helfer-Erweiterung fuer das "usage" Verzeichnis  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('stats','usage','Aufrufstatistik','Erkennt automatisch Ihre Aufrufstatisiken und bindet diese in das Admin-Interface ein. (Derzeit nur Webalizer!)',9)";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `usage_base` VARCHAR(255) NOT NULL DEFAULT 'usage'";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE what='usage' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "";
+               break;
+       }
+       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
+       break;
+}
+
+//
+?>
index f7a0f27a4af4ca67eb9f0af8746dea2b29b8ddd5..f30ca6935e1a39483c177cd2a0f0005afc270e39 100644 (file)
@@ -37,5 +37,7 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
+// Language definitions
+
 //
 ?>
index 72ef8c9c4a91357675acec110557d2ddf93aeb95..d1714ecd52b68996285713ca35907970ce66d37f 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 11/26/2008 *
- * ===============                              Last change: 11/26/2008 *
+ * MXChange v0.2.1                                    Start: 02/07/2009 *
+ * ===============                              Last change: 02/07/2009 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : _de.php                                          *
diff --git a/inc/language/usage_de.php b/inc/language/usage_de.php
new file mode 100644 (file)
index 0000000..74067e4
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/07/2009 *
+ * ===============                              Last change: 02/07/2009 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : usage_de.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ADMIN_USAGE_DIRECTORY_404', "Das Verzeichnis <u>%s</u> scheint auf Ihrem Server zu fehlen. Funktion nicht verf&uuml;gbar.");
+
+//
+?>
index 2496ac5035d199157fd77ffde7dffcf963995263..a5ce46945d6df2bd49cd4bc291a4646534fdf84e 100644 (file)
@@ -84,11 +84,11 @@ if (!empty($_GET['access'])) {
        }
 } else {
        // List access logfiles
-       $dir = PATH.LOGS_BASE."/";
+       $dir = PATH.getConfig('logs_base')."/";
        if (is_dir($dir)) {
                // logs directory does exist
                OUTPUT_HTML("<ol>");
-               $handle = opendir($dir) or mxchange_die("Cannot open directory ".LOGS_BASE."!");
+               $handle = opendir($dir) or mxchange_die("Cannot open directory ".getConfig('logs_base')."!");
                while ($file = readdir($handle)) {
                        // We currenly only like files with "access" as prefix, should be more flexible!
                        if (substr($file, 0, 6) == "access") {
@@ -100,7 +100,7 @@ if (!empty($_GET['access'])) {
                OUTPUT_HTML("</ol>");
        } else {
                // logs directory does not exist
-               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_LOGS_DIR_404_1.LOGS_BASE.ADMIN_LOGS_DIR_404_2);
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_LOGS_DIR_404_1.getConfig('logs_base').ADMIN_LOGS_DIR_404_2);
        }
 }
 
index 65b2810ca7c01836232fa6005609c9ce52696f74..fb3bd33282d10f34a546ba848698092971b72dea 100644 (file)
@@ -41,14 +41,19 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 ADD_DESCR("admin", __FILE__);
 
 // Base directory (should be moved to database)
-$usage = "usage/";
+$usage = getConfig('usage_base')."/";
 
 if (!empty($_GET['image'])) {
        if ($_GET['type'] == "usage") {
-               $file = sprintf("%s%susage.png", PATH, $usage);
+               $file = sprintf("%s%s/usage.png", PATH, getConfig('usage_base'));
        } else {
                if (strpos($_GET['image'], "\\") > 0) $_GET['image'] = substr($_GET['image'], 0, strpos($_GET['image'], "\\"));
-               $file = sprintf("%s%s%s_usage_%s.png", PATH, $usage, SQL_ESCAPE($_GET['type']), SQL_ESCAPE($_GET['image']));
+               $file = sprintf("%s%s/%s_usage_%s.png",
+                       PATH,
+                       getConfig('usage_base'),
+                       SQL_ESCAPE($_GET['type']),
+                       SQL_ESCAPE($_GET['image'])
+               );
        }
 
        if (FILE_READABLE($file)) {
@@ -59,44 +64,48 @@ if (!empty($_GET['image'])) {
        }
        exit();
 } elseif (empty($_GET['usage'])) {
-       $file = sprintf("%s%sindex.html", PATH, $usage);
+       $file = sprintf("%s%s/index.html", PATH, getConfig('usage_base'));
 } else {
-       $file = sprintf("%s%susage_%s.html",
+       $file = sprintf("%s%s/usage_%s.html",
                PATH,
-               $usage,
+               getConfig('usage_base'),
                SQL_ESCAPE($_GET['usage'])
        );
 }
 
-if (!empty($file)) {
-       if (FILE_READABLE($file)) {
-                       // @TODO This code is double, see functions.php, LOAD_TEMPLATE and LOAD_EMAIL_TEMPLATE
-                       $tmpl_file = READ_FILE($file);
-                       $tmpl_file = addslashes($tmpl_file);
-                       $tmpl_file = "\$content=\"".$tmpl_file."\";";
-                       eval($tmpl_file);
-                       // Double code until here
+if ((!empty($file)) && (FILE_READABLE($file) {
+       // @TODO This code is double, see LOAD_TEMPLATE and LOAD_EMAIL_TEMPLATE in functions.php
+       $tmpl_file = READ_FILE($file);
+       $tmpl_file = addslashes($tmpl_file);
+       $tmpl_file = "\$content=\"".$tmpl_file."\";";
+       eval($tmpl_file);
+       // Until here...
+
+       // Replace URLs
+       $content = str_replace("usage.png", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=usage&image=usage", $content);
+       $content = str_replace("daily_usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=daily&image=", $content);
+       $content = str_replace("hourly_usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=hourly&image=", $content);
+       $content = str_replace("ctry_usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=ctry&image=", $content);
+       $content = str_replace("usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&usage=", str_replace(".html", "", $content));
+
+       // Disabled due to too much trouble
+       //$content = str_replace("HREF=\"http://", "href=\"".URL."/modules.php?module=loader&amp;url=http://", $content);
+       $test = strtolower($content);
 
-                       // Replace URLs
-                       $content = str_replace("usage.png", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=usage&image=usage", $content);
-                       $content = str_replace("daily_usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=daily&image=", $content);
-                       $content = str_replace("hourly_usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=hourly&image=", $content);
-                       $content = str_replace("ctry_usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=ctry&image=", $content);
-                       $content = str_replace("usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&usage=", str_replace(".html", "", $content));
-                       // Disabled due to too much trouble
-                       //$content = str_replace("HREF=\"http://", "href=\"".URL."/modules.php?module=loader&amp;url=http://", $content);
-                       $test = strtolower($content);
-                       $body_start = strpos($test, "<body");
-                       $body_end   = strpos($test, "</body>");
-                       if (($body_start > 0) && ($body_end > 0))
-                       {
-                               $content = substr(substr($content, 0, $body_end), $body_start);
-                               $content = substr($content, strpos($content, ">") + 1);
-                               OUTPUT_HTML("<div align=\"left\">
+       // Do we need to strip out above and including <body> plus trailing </html> tag?
+       if ((strpos($test, "<body") > 0) && (strpos($test, "</body>") > 0)) {
+               // Okay, then do so.
+               $content = substr(substr($content, 0, $body_end), $body_start);
+               $content = substr($content, strpos($content, ">") + 1);
+       } // END - if
+
+       // Output code
+       OUTPUT_HTML("<div align=\"left\">
   ".$content."
 </div>");
-                       }
-       }
+} else {
+       // Nothing to load, then we have no directory "usage"
+       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_USAGE_DIRECTORY_404, getConfig('usage_base')));
 }
 
 //
index 0e38ada52f19aa09585a743e0cd6bf6ca508f2f0..19a284a0bc30d1cd5d808b3d28e87956349a1933 100644 (file)
@@ -90,7 +90,6 @@ INSERT INTO `mxchange_payments` VALUES (3,30,30.000,'Klick-Mail 30 Sek.',29.000)
 INSERT INTO `mxchange_payments` VALUES (4,40,40.000,'Klick-Mail 40 Sek.',39.000);\r
 INSERT INTO `mxchange_payments` VALUES (5,50,50.000,'Klick-Mail 50 Sek.',49.000);\r
 \r
-INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('stats','usage','Aufrufstatistik','Erkennt automatisch Ihre Aufrufstatisiken und bindet diese in das Admin-Interface ein. (Derzeit nur Webalizer!)',9);\r
 INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','email_archiv','E-Mail Archiv','Sehen Sie sich hier bereits gesendete Mails an.','6');\r
 INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','del_email','E-Mail l&ouml;schen','L&ouml;schen Sie hierr&uuml;ber E-Mails (sowohl Bonus- als auch Normal-Mails) aus Ihrem Mailtausch-System. <STRONG>Nur bei Normal-Mails:</STRONG> {!POINTS!} aus den unbest&auml;tigten Mails werden dem Werber wieder verg&uuml;tet.','7');\r
 INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','updates','Updates pr&uuml;fen','Pr&uuml;ft, ob eine neue Version oder ein Patch auf dem Server exisitiert. Sie m&uuml;ssen dann die Patches/Updates selber herunterladen und einspielen. Dabei werden keine Daten von Ihrer Installation an uns gesendet!','8');\r
index 0e38ada52f19aa09585a743e0cd6bf6ca508f2f0..19a284a0bc30d1cd5d808b3d28e87956349a1933 100644 (file)
@@ -90,7 +90,6 @@ INSERT INTO `mxchange_payments` VALUES (3,30,30.000,'Klick-Mail 30 Sek.',29.000)
 INSERT INTO `mxchange_payments` VALUES (4,40,40.000,'Klick-Mail 40 Sek.',39.000);\r
 INSERT INTO `mxchange_payments` VALUES (5,50,50.000,'Klick-Mail 50 Sek.',49.000);\r
 \r
-INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('stats','usage','Aufrufstatistik','Erkennt automatisch Ihre Aufrufstatisiken und bindet diese in das Admin-Interface ein. (Derzeit nur Webalizer!)',9);\r
 INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','email_archiv','E-Mail Archiv','Sehen Sie sich hier bereits gesendete Mails an.','6');\r
 INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','del_email','E-Mail l&ouml;schen','L&ouml;schen Sie hierr&uuml;ber E-Mails (sowohl Bonus- als auch Normal-Mails) aus Ihrem Mailtausch-System. <STRONG>Nur bei Normal-Mails:</STRONG> {!POINTS!} aus den unbest&auml;tigten Mails werden dem Werber wieder verg&uuml;tet.','7');\r
 INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','updates','Updates pr&uuml;fen','Pr&uuml;ft, ob eine neue Version oder ein Patch auf dem Server exisitiert. Sie m&uuml;ssen dann die Patches/Updates selber herunterladen und einspielen. Dabei werden keine Daten von Ihrer Installation an uns gesendet!','8');\r