]> git.mxchange.org Git - mailer.git/blobdiff - 0.2.1/inc/modules/admin/what-usage.php
win32 to unix line delimiters changed
[mailer.git] / 0.2.1 / inc / modules / admin / what-usage.php
index 169f0d042067d51d503549b5d724a45fa21ba71a..c235fc02eec3a3c867c41a85e980825539931597 100644 (file)
-<?php\r
-/************************************************************************\r
- * MXChange v0.2.1                                    Start: 11/15/2003 *\r
- * ===============                              Last change: 04/02/2004 *\r
- *                                                                      *\r
- * -------------------------------------------------------------------- *\r
- * File              : what-usage.php                                   *\r
- * -------------------------------------------------------------------- *\r
- * Short description : Auto-detection of usage statistics               *\r
- * -------------------------------------------------------------------- *\r
- * Kurzbeschreibung  : Automatische Erkennung der Aufrufstatistiken     *\r
- * -------------------------------------------------------------------- *\r
- *                                                                      *\r
- * -------------------------------------------------------------------- *\r
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *\r
- * For more information visit: http://www.mxchange.org                  *\r
- *                                                                      *\r
- * This program is free software; you can redistribute it and/or modify *\r
- * it under the terms of the GNU General Public License as published by *\r
- * the Free Software Foundation; either version 2 of the License, or    *\r
- * (at your option) any later version.                                  *\r
- *                                                                      *\r
- * This program is distributed in the hope that it will be useful,      *\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of       *\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *\r
- * GNU General Public License for more details.                         *\r
- *                                                                      *\r
- * You should have received a copy of the GNU General Public License    *\r
- * along with this program; if not, write to the Free Software          *\r
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *\r
- * MA  02110-1301  USA                                                  *\r
- ************************************************************************/\r
-\r
-// Some security stuff...\r
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))\r
-{\r
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";\r
-       require($INC);\r
-}\r
-// Add description as navigation point\r
-ADD_DESCR("admin", basename(__FILE__));\r
-\r
-OPEN_TABLE("100%", "admin_content admin_content_align", "");\r
-$usage = "usage/";\r
-if (!empty($_GET['image']))\r
-{\r
-       if ($_GET['type'] == "usage")\r
-       {\r
-               $file = PATH.$usage."usage.png";\r
-       }\r
-        else\r
-       {\r
-               if (strpos($_GET['image'], "\\") > 0) $_GET['image'] = substr($_GET['image'], 0, strpos($_GET['image'], "\\"));\r
-               $file = PATH.$usage.$_GET['type']."_usage_".$_GET['image'].".png";\r
-       }\r
-       if (file_exists($file))\r
-       {\r
-               $image = imagecreatefrompng($file);\r
-               header("Content-type: image/png");\r
-               imagepng($image);\r
-               imagedestroy($image);\r
-       }\r
-       exit();\r
-}\r
- elseif (empty($_GET['usage']))\r
-{\r
-       $file = PATH.$usage."index.html";\r
-}\r
- else\r
-{\r
-       $file = sprintf("%s%susage_%s.html",\r
-               PATH,\r
-               $usage,\r
-               SQL_ESCAPE($_GET['usage'])\r
-       );\r
-}\r
-if ($file !="")\r
-{\r
-       if (file_exists($file) && is_readable($file))\r
-       {\r
-                       $tmpl_file = implode("", file($file));\r
-                       $tmpl_file = addslashes($tmpl_file);\r
-                       $tmpl_file = "\$content=\"".$tmpl_file."\";";\r
-                       eval($tmpl_file);\r
-                       $content = str_replace("usage.png", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=usage&image=usage", $content);\r
-                       $content = str_replace("daily_usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=daily&image=", $content);\r
-                       $content = str_replace("hourly_usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=hourly&image=", $content);\r
-                       $content = str_replace("ctry_usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=ctry&image=", $content);\r
-                       $content = str_replace("usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&usage=", str_replace(".html", "", $content));\r
-                       // Disabled due to too much trouble\r
-                       //$content = str_replace("HREF=\"http://", "href=\"".URL."/modules.php?module=loader&amp;url=http://", $content);\r
-                       $test = strtolower($content);\r
-                       $body_start = strpos($test, "<body");\r
-                       $body_end   = strpos($test, "</body>");\r
-                       if (($body_start > 0) && ($body_end > 0))\r
-                       {\r
-                               $content = substr(substr($content, 0, $body_end), $body_start);\r
-                               $content = substr($content, strpos($content, ">") + 1);\r
-                               OUTPUT_HTML ("<DIV align=\"left\">\r
-  ".$content."\r
-</DIV>");\r
-                       }\r
-       }\r
-}\r
-CLOSE_TABLE();\r
-//\r
-?>\r
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/15/2003 *
+ * ===============                              Last change: 04/02/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-usage.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Auto-detection of usage statistics               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Automatische Erkennung der Aufrufstatistiken     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * 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 ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
+{
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+OPEN_TABLE("100%", "admin_content admin_content_align", "");
+$usage = "usage/";
+if (!empty($_GET['image']))
+{
+       if ($_GET['type'] == "usage")
+       {
+               $file = PATH.$usage."usage.png";
+       }
+        else
+       {
+               if (strpos($_GET['image'], "\\") > 0) $_GET['image'] = substr($_GET['image'], 0, strpos($_GET['image'], "\\"));
+               $file = PATH.$usage.$_GET['type']."_usage_".$_GET['image'].".png";
+       }
+       if (file_exists($file))
+       {
+               $image = imagecreatefrompng($file);
+               header("Content-type: image/png");
+               imagepng($image);
+               imagedestroy($image);
+       }
+       exit();
+}
+ elseif (empty($_GET['usage']))
+{
+       $file = PATH.$usage."index.html";
+}
+ else
+{
+       $file = sprintf("%s%susage_%s.html",
+               PATH,
+               $usage,
+               SQL_ESCAPE($_GET['usage'])
+       );
+}
+if ($file !="")
+{
+       if (file_exists($file) && is_readable($file))
+       {
+                       $tmpl_file = implode("", file($file));
+                       $tmpl_file = addslashes($tmpl_file);
+                       $tmpl_file = "\$content=\"".$tmpl_file."\";";
+                       eval($tmpl_file);
+                       $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\">
+  ".$content."
+</DIV>");
+                       }
+       }
+}
+CLOSE_TABLE();
+//
+?>