summaryrefslogtreecommitdiff
path: root/archives/html/msgtop.php
diff options
context:
space:
mode:
authorAlvaro Herrera2009-03-07 23:01:31 +0000
committerAlvaro Herrera2009-03-07 23:01:31 +0000
commit27eb09171b9d1a1c8868bfe082a666430adde041 (patch)
tree668f1b342a335257326a97c135f80bcc7eee5ba2 /archives/html/msgtop.php
parent0e866609f8c27f44abceaecd9694dcfbc0623cdd (diff)
Move the message and thread/date index PHP pages out of the MHonarc resource
file and into its own PHP page, and improve it to display the left-hand menus from the JSON file instead of the old ugly hardcoded way. git-svn-id: file:///Users/dpage/pgweb/svn-repo/trunk@2423 8f5c7a92-453e-0410-a47f-ad33c8a6b003
Diffstat (limited to 'archives/html/msgtop.php')
-rw-r--r--archives/html/msgtop.php65
1 files changed, 65 insertions, 0 deletions
diff --git a/archives/html/msgtop.php b/archives/html/msgtop.php
new file mode 100644
index 00000000..b72c2f12
--- /dev/null
+++ b/archives/html/msgtop.php
@@ -0,0 +1,65 @@
+<?php
+ini_set('include_path', $_SERVER['DOCUMENT_ROOT']."/../pearlib");
+dl('json.so');
+
+require 'HTML/Template/Sigma.php';
+
+$tmpldir = $_SERVER['DOCUMENT_ROOT'] . "/../templates";
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" dir="ltr">
+<head>
+ <meta name="robots" content="all" />
+ <meta name="MSSmartTagsPreventParsing" content="TRUE" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta name="keywords" content="postgresql, hackers, general, sql, admin, novice, interfaces, odbc, jdbc" />
+ <meta name="rating" content="General" />
+ <meta name="distribution" content="Global" />
+ <meta name="revisit-after" content="7 days" />
+ <meta name="robots" content="follow, noindex, noarchive" />
+
+<?
+echo "<title>$title</title>\n";
+
+$tpl =& new HTML_Template_Sigma($tmpldir."/html");
+$tpl->loadTemplateFile('top_config.html');
+
+// extract the list name from the URL
+list($listname) = sscanf($_SERVER['PHP_SELF'], "/%[^/]s");
+
+/* fill the left-side menu with all the group names, expanding lists
+ * for the group this list belongs */
+$groups = json_decode(file_get_contents($tmpldir."/groups.json"), true);
+$lists = json_decode(file_get_contents($tmpldir."/lists.json"), true);
+ksort($groups);
+$mygroup = $lists[$listname]["group"];
+
+foreach ($groups as $group) {
+ $tpl->setCurrentBlock('top_listgroup');
+ $tpl->setVariable('top_groupname', $group["name"]);
+ $tpl->setVariable('top_group_firstlist', $group["lists"][0]);
+
+ /* When we detect the group that this list belongs to, expand the lists
+ * on the group */
+ if ($group["id"] == $mygroup) {
+ $tpl->setCurrentBlock('top_list');
+ foreach ($group["lists"] as $list) {
+ // use the shortdesc if it exists
+ if (isset($lists[$list]["shortdesc"]))
+ $desc = $lists[$list]["shortdesc"];
+ else
+ $desc = $list;
+ $tpl->setVariable('top_name', $list);
+ $tpl->setVariable('top_desc', $desc);
+ $tpl->parse('top_list');
+ }
+ }
+ $tpl->parse('top_listgroup');
+}
+
+$tpl->parse();
+$tpl->show();
+
+?>