Skip to content

Commit 81d93e4

Browse files
committed
added GoAccess index file compatiblity to awstats_index.php.master
1 parent 2ece9ca commit 81d93e4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

server/conf/awstats_index.php.master

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,21 @@ arsort($awprev);
4545
$options = "";
4646
foreach ($awprev as $key => $value)
4747
{
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+
4857
if($key == $current) $options .= "<option selected=\"selected\" value=\"{$awstatsindex}\">{$value}</option>\n";
4958
else $options .= "<option value=\"{$value}/{$awstatsindex}\">{$value}</option>\n";
5059
}
5160

61+
$awstatsindex = 'awsindex.html';
62+
5263
$html = "<!DOCTYPE html>\n<html>\n<head>\n<title>Stats</title>\n";
5364
$html .= "<style>\nhtml,body {margin:0px;padding:0px;width:100%;height:100%;background-color: #ccc;}\n";
5465
$html .= "#header\n{\nwidth:100%;margin:0px auto;\nheight:20px;\nposition:fixed;\npadding:4px;\ntext-align:center;\n}\n";
@@ -60,4 +71,4 @@ $html .= $options;
6071
$html .= "</select>\n</div>\n<iframe src=\"{$awstatsindex}\" id=\"content\"></iframe>\n";
6172
$html .= "</body></html>";
6273
echo $html;
63-
?>
74+
?>

0 commit comments

Comments
 (0)