script to create old historic static pages
[awstats-helper.git] / create-historic.php
diff --git a/create-historic.php b/create-historic.php
new file mode 100644 (file)
index 0000000..2977931
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Renders historic data for multiple sites
+ * Does not render static pages if they exist
+ * already.
+ */
+require_once 'functions.php';
+
+foreach (aws_sites() as $site) {
+    $dates = aws_historic($site);
+    foreach ($dates as $date) {
+        list($year, $month) = $date;
+       $dir = $GLOBALS['htmldir'] . '/' . $site . '/' . $year . '-' . $month . '/';
+       if (!is_dir($dir)) {
+           aws_createHtml($site, true, $year, $month);
+       }
+    }
+    aws_createIndex($site);
+}
+
+?>
\ No newline at end of file