Skip to content

Commit 2a958a7

Browse files
author
Marius Burkard
committed
Merge branch '6147-awstats-links' into 'develop'
Resolve "AWstats links" Closes #6147 See merge request ispconfig/ispconfig3!1470
2 parents 91ea854 + 5d143fe commit 2a958a7

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

server/conf/awstats_index.php.master

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,17 @@ if ($handle = opendir('.'))
4343
arsort($awprev);
4444

4545
$options = "";
46-
foreach ($awprev as $key => $value)
47-
{
48-
49-
if(file_exists($value.'/awsindex.html') && file_exists($value.'/goaindex.html')) {
50-
$awstatsindex = 'awsindex.html';
51-
} elseif(file_exists($value.'/awsindex.html') && !file_exists($value.'/goaindex.html')) {
52-
$awstatsindex = 'awsindex.html';
53-
} else {
54-
$awstatsindex = 'goaindex.html';
55-
}
56-
46+
foreach ($awprev as $key => $value) {
47+
// Define name for the index file
48+
$awstatsindex = 'awsindex.html';
49+
if(!file_exists($value.'/awsindex.html') && file_exists($value.'/goaindex.html')) {
50+
$awstatsindex = 'goaindex.html';
51+
}
52+
// Set name for first entry in month list
5753
if($key == $current) $options .= "<option selected=\"selected\" value=\"{$awstatsindex}\">{$value}</option>\n";
5854
else $options .= "<option value=\"{$value}/{$awstatsindex}\">{$value}</option>\n";
5955
}
6056

61-
$awstatsindex = 'awsindex.html';
62-
6357
$html = "<!DOCTYPE html>\n<html>\n<head>\n<title>Stats</title>\n";
6458
$html .= "<style>\nhtml,body {margin:0px;padding:0px;width:100%;height:100%;background-color: #ccc;}\n";
6559
$html .= "#header\n{\nwidth:100%;margin:0px auto;\nheight:20px;\nposition:fixed;\npadding:4px;\ntext-align:center;\n}\n";
@@ -68,7 +62,7 @@ $html .= $script;
6862
$html .= "<div id=\"header\">{$yearmonth_text}\n";
6963
$html .= "<select name=\"awdate\" onchange=\"load_content(this.value)\">\n";
7064
$html .= $options;
71-
$html .= "</select>\n</div>\n<iframe src=\"{$awstatsindex}\" id=\"content\"></iframe>\n";
65+
$html .= "</select>\n</div>\n<iframe src=\"awsindex.html\" id=\"content\"></iframe>\n";
7266
$html .= "</body></html>";
7367
echo $html;
7468
?>

0 commit comments

Comments
 (0)