From 8e38755040c6c2073f92f0ffb087da530d0e7a0a Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Mon, 12 Nov 2012 11:49:26 -0500
Subject: [PATCH] - Changed a German translation. - Extended SEO redirect check for subdomains/alias domains.

---
 server/conf/awstats_index.php.master |   73 +++++++++++++++++++-----------------
 1 files changed, 38 insertions(+), 35 deletions(-)

diff --git a/server/conf/awstats_index.php.master b/server/conf/awstats_index.php.master
index f6ced55..f7222c9 100644
--- a/server/conf/awstats_index.php.master
+++ b/server/conf/awstats_index.php.master
@@ -1,13 +1,7 @@
-<script>
-function load_content(url)
-{
-    var iframe = document.getElementById("content");
-    iframe.src = url;
-}
-</script>
 <?php
-$aw['aw_jump_text'] = 'Jump to previous stats: ';
-$aw['aw_renamed_index'] = 'awsindex.html';
+$yearmonth_text = "Jump to previous stats: ";
+$awstatsindex = 'awsindex.html';
+$script = "<script>function load_content(url){var iframe = document.getElementById(\"content\");iframe.src = url;}</script>\n";
 
 if ($handle = opendir('.'))
 {
@@ -15,46 +9,55 @@
         {
                 if (substr($file,0,1) != "." && is_dir($file))
                 {
-                        $awprev[] = $file;
+                        $orderkey = substr($file,0,4).substr($file,5,2);
+                        if (substr($file,5,2) < 10 )
+                        {
+                                $orderkey = substr($file,0,4)."0".substr($file,5,2);
+                        }
+                        $awprev[$orderkey] = $file;
                 }
         }
 
-        $month = date("m")+1-1;
-
+        $month = date("n");
+        $year = date("Y");
+		
         if (date("d") == 1)
         {
-                        $month = date("m")-1;
-        }
-
-        $year = date("Y");
-
-        if (date("m") == 1)
-        {
+                $month = date("m")-1;
+                if (date("m") == 1)
+                {
                         $year = date("Y")-1;
                         $month = "12";
+                }
         }
 
-        $awprev[] = $year."-".$month;
-        closedir($handle);
+        $current = $year.$month;
+		if ( $month < 10 ) {
+			$current = $year."0".$month;
+		}
+		$awprev[$current] = $year."-".$month;
+
+		closedir($handle);
 }
 
-echo '<div style="width: 97%; margin-left: 4px; height: 20px; background-color: #FFFFFF; position: fixed; padding: 7px; border: 2px solid #cccccc;><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica,  sans-serif">' .$aw["aw_jump_text"]. '</font </div>';
+arsort($awprev);
 
-echo "<select name='awdate' onchange=\"load_content(this.value)\">";
-rsort($awprev);
-
+$options = "";
 foreach ($awprev as $key => $value)
 {
-        if($key == 0)
-        {
-                echo "<option selected=\"selected\" value=\"".$aw['aw_renamed_index']."\"> $value</option>";
-        }
-        else
-        {
-                echo "<option value='$value/".$aw['aw_renamed_index']."'> $value</option>";
-        }
+	if($key == $current) $options .= "<option selected=\"selected\" value=\"{$awstatsindex}\">{$value}</option>\n";
+	else $options .= "<option value=\"{$value}/{$awstatsindex}\">{$value}</option>\n";
 }
 
-echo '</select></div><iframe src="'.$aw['aw_renamed_index'].'" frameborder="0" scrolling="Yes" width="100%" height="100%" style="margin-top:25px" id="content"></iframe>';
-
+$html = "<!DOCTYPE html>\n<html>\n<head>\n<title>Stats</title>\n";
+$html .= "<style>\nhtml,body {margin:0px;padding:0px;width:100%;height:100%;background-color: #ccc;}\n";
+$html .= "#header\n{\nwidth:100%;margin:0px auto;\nheight:20px;\nposition:fixed;\npadding:4px;\ntext-align:center;\n}\n";
+$html .= "iframe {width:100%;height:90%;margin:0px;margin-top:40px;border:0px;padding:0px;}\n</style>\n</head>\n<body>\n";
+$html .= $script;
+$html .= "<div id=\"header\">{$yearmonth_text}\n";
+$html .= "<select name=\"awdate\" onchange=\"load_content(this.value)\">\n";
+$html .= $options;
+$html .= "</select>\n</div>\n<iframe src=\"{$awstatsindex}\" id=\"content\"></iframe>\n";
+$html .= "</body></html>";
+echo $html;
 ?>
\ No newline at end of file

--
Gitblit v1.9.1