Imported stats files from www.infodrom.org
authorJoey Schulze <joey@infodrom.org>
Thu, 14 Aug 2003 07:54:37 +0000 (07:54 +0000)
committerJoey Schulze <joey@infodrom.org>
Thu, 14 Aug 2003 07:54:37 +0000 (07:54 +0000)
src/stats/details.wml [new file with mode: 0644]
src/stats/frequency.wml [new file with mode: 0644]
src/stats/index.wml [new file with mode: 0644]
src/stats/stats.inc [new file with mode: 0644]
src/stats/submenu.inc [new file with mode: 0644]

diff --git a/src/stats/details.wml b/src/stats/details.wml
new file mode 100644 (file)
index 0000000..46e9c3e
--- /dev/null
@@ -0,0 +1,22 @@
+#include <infodrom.style>
+#include "stats.inc"
+
+<?
+    if (!strlen ($list)) {
+      header ("Location: index.php3");
+      exit (0);
+    }
+?>
+
+<page title="Infodrom Oldenburg" title="Lists Statistics">
+
+<display-list>
+
+<p>
+
+</page>
+
+# Local variables:
+# mode: indented-text
+# mode: auto-fill
+# end:
diff --git a/src/stats/frequency.wml b/src/stats/frequency.wml
new file mode 100644 (file)
index 0000000..55477e0
--- /dev/null
@@ -0,0 +1,17 @@
+#include <infodrom.style>
+#include "stats.inc"
+
+<page title="Infodrom Oldenburg" title="Lists Statistics">
+
+<h1>Lists Statistics</h1>
+
+<read-lists>
+
+<make-overview frac=latest-month href=details>
+
+</page>
+
+# Local variables:
+# mode: indented-text
+# mode: auto-fill
+# end:
diff --git a/src/stats/index.wml b/src/stats/index.wml
new file mode 100644 (file)
index 0000000..e9fc824
--- /dev/null
@@ -0,0 +1,17 @@
+#include <infodrom.style>
+#include "stats.inc"
+
+<page title="Infodrom Oldenburg" title="Lists Statistics">
+
+<h1>Lists Statistics</h1>
+
+<read-lists>
+
+<make-overview frac=distabs-month href=details>
+
+</page>
+
+# Local variables:
+# mode: indented-text
+# mode: auto-fill
+# end:
diff --git a/src/stats/stats.inc b/src/stats/stats.inc
new file mode 100644 (file)
index 0000000..9528ca4
--- /dev/null
@@ -0,0 +1,93 @@
+<define-tag listpath>/var/list/</define-tag>
+<define-tag listdescr>description</define-tag>
+
+<define-tag img_width>497</define-tag>
+<define-tag img_height>161</define-tag>
+
+# Sideeffect: fills $list and $description
+#             img_format img_format_href
+#
+<define-tag read-lists>
+<?
+    $img_format_href = '<p><div align="center">'
+                     .'<a href="%s">'
+                     .'<img src="%s" width=<img_width> height=<img_height> alt="%s" border=0>'
+                     .'</a>'
+                     .'</div>';
+
+    $img_format     = '<p><div align="center">'
+                     .'<img src="%s" width=<img_width> height=<img_height> alt="%s" border=0>'
+                     .'</div>';
+
+    $dir = dir (".");
+    $months = array ();
+
+    while ($dentry = $dir->read()) {
+      if ($dentry != "." && $dentry != "..") {
+       $list[] = $dentry;
+
+       if (is_file ("<listpath>/$dentry/<listdescr>")) {
+         if (($f = fopen ("<listpath>/$dentry/<listdescr>", "r"))) {
+           $description[$dentry] = fgets ($f, 255);
+           fclose ($f);
+         }
+       }
+      }
+    }
+    $dir->close();
+    sort ($list);
+?>
+</define-tag>
+
+# Make an overview about all similar files
+#
+<define-tag make-overview>
+<preserve frac href>
+<set-var %attributes>
+
+<?
+    $i=0;for ($i=0; $i <= count ($list); $i++) {
+      if (is_file ("$list[$i]/$list[$i]-<get-var frac>.png")) {
+
+       if (strlen ($description[$list[$i]])) {
+         printf ("<h3>%s - %s</h3>", $list[$i], $description[$list[$i]]);
+       } else {
+         printf ("<h3>%s</h3>", $list[$i]);
+       }
+
+       printf ($img_format_href, "<get-var href>.php3?list=$list[$i]", "$list[$i]/$list[$i]-<get-var frac>.png", $list[$i]);
+      }
+    }
+?>
+
+<p>
+<restore frac href>
+</define-tag>
+
+<define-tag display-list>
+<h1>Lists Statistics for list <? echo $list; ?></h1>
+
+<h3>Total Subscribers</h3>
+
+<p><center>\
+<?
+  printf ("<img src=\"%s/%s-distabs-month.png\" width=\"<img_width>\" height=\"<img_height>\" alt=\"[%s]\" border=\"0\">",
+    $list, $list, $list);
+?>
+</center>
+
+<h3>Posting Frequency</h3>
+
+<p><center>\
+<?
+  printf ("<img src=\"%s/%s-latest-month.png\" width=\"<img_width>\" height=\"<img_height>\" alt=\"[%s]\" border=\"0\">",
+    $list, $list, $list);
+?>
+</center>
+
+</define-tag>
+
+# Local variables:
+# mode: indented-text
+# mode: auto-fill
+# end:
diff --git a/src/stats/submenu.inc b/src/stats/submenu.inc
new file mode 100644 (file)
index 0000000..d5f7deb
--- /dev/null
@@ -0,0 +1,6 @@
+<p>
+
+<menu-item base=index text=Subscriber href=index.php3><br>
+<menu-item base=frequency text=Frequency href=frequency.php3><br>
+
+<a href="<root_prefix>Mail-Archive/">Mail Archive</a><br>