Author: dpage
Date: 2006-01-20 09:46:15 +0000 (Fri, 20 Jan 2006)
New Revision: 4940
Added:
trunk/www/include/archives.php
trunk/www/include/doc.php
Modified:
trunk/www/.htaccess
trunk/www/development/list.php
trunk/www/development/menu.php
trunk/www/include/page.php
trunk/www/support/list.php
trunk/www/support/menu.php
Log:
Integrate the list archives with the website
Modified: trunk/www/.htaccess
===================================================================
--- trunk/www/.htaccess 2006-01-20 09:28:34 UTC (rev 4939)
+++ trunk/www/.htaccess 2006-01-20 09:46:15 UTC (rev 4940)
@@ -34,4 +34,8 @@
RewriteRule ^docs/1\.4/(.*)\.png$ /svnrepo/pgadmin3-1\.4/docs/en_US/$1\.png [QSA,L]
# Requests like /docs/xx/yy need to be rewritten to /include/page.php?docset=xx&docpage=yy
-RewriteRule ^docs/(.[a-zA-Z0-9.]*)/(.*)$ /include/page.php?docset=$1&docpage=$2 [QSA,L]
+RewriteRule ^docs/(.[a-zA-Z0-9.]*)/(.*)$ /include/doc.php?docset=$1&docpage=$2 [QSA,L]
+
+# Similarly for the archives
+RewriteRule ^archives/(.[-a-zA-Z0-9.]*)/(.*)\.php$ /include/archives.php?list=$1&msg=$2\.php [QSA,L]
+
Modified: trunk/www/development/list.php
===================================================================
--- trunk/www/development/list.php 2006-01-20 09:28:34 UTC (rev 4939)
+++ trunk/www/development/list.php 2006-01-20 09:46:15 UTC (rev 4940)
@@ -9,7 +9,7 @@
<p>' . sprintf(_("The pgadmin-hackers mailing list is intended for developers who wish to contribute to pgAdmin
project.You are more than welcome to subscribe, but please remember to use <a href=\"%s\">pgadmin-support</a> list for
enduser support issues. To subscribe to the mailing list, send an email to <a href=\"%s\">%s</a> with the word
'subscribe',without quotes, as the body of message."), "../support/list.php",
"mailto:pgadmin-hackers-request@postgresql.org","pgadmin-hackers-request@postgresql.org") . '</p>
-<p>' . sprintf(_("Messages sent to the list are archived at <a href=\"%s\">PostgreSQL</a> and <a
href=\"%s\">mail-archive.com</a>."),"http://archives.postgresql.org/pgadmin-hackers/",
"http://www.mail-archive.com/pgadmin-hackers@postgresql.org"). '</p>
+<p>' . sprintf(_("Messages sent to the list may be browsed <a href=\"%s\">here</a> and are archived at <a
href=\"%s\">PostgreSQL</a>and <a href=\"%s\">mail-archive.com</a>."), "/archives/pgadmin-hackers/index.php",
"http://archives.postgresql.org/pgadmin-hackers/","http://www.mail-archive.com/pgadmin-hackers@postgresql.org") . '</p>
';
Modified: trunk/www/development/menu.php
===================================================================
--- trunk/www/development/menu.php 2006-01-20 09:28:34 UTC (rev 4939)
+++ trunk/www/development/menu.php 2006-01-20 09:46:15 UTC (rev 4940)
@@ -7,6 +7,7 @@
<div' . www_current_menu_page("svn.php") . '><a href="svn.php">› ' . _("SVN access") . '</a></div>
<div' . www_current_menu_page("http://svn.pgadmin.org/") . '><a href="http://svn.pgadmin.org/">› ' . _("SVN
browser"). '</a></div>
<div' . www_current_menu_page("list.php") . '><a href="list.php">› ' . _("Mailing list") . '</a></div>
+<div' . www_current_menu_page("/archives/pgadmin-hackers/index.php") . '><a
href="/archives/pgadmin-hackers/index.php">›' . _("List archives") . '</a></div>
<div' . www_current_menu_page("team.php") . '><a href="team.php">› ' . _("Team") . '</a></div>
<div' . www_current_menu_page("todo.php") . '><a href="todo.php">› ' . _("TODO list") . '</a></div>
<div' . www_current_menu_page("changelog.php") . '><a href="changelog.php">› ' . _("Change log") . '</a></div>
Added: trunk/www/include/archives.php
===================================================================
--- trunk/www/include/archives.php 2006-01-20 09:28:34 UTC (rev 4939)
+++ trunk/www/include/archives.php 2006-01-20 09:46:15 UTC (rev 4940)
@@ -0,0 +1,58 @@
+<?php
+
+require $GLOBALS["_SERVER"]["DOCUMENT_ROOT"] . "/include/page.php";
+
+if (isset($_GET['list']))
+{
+ if (!isset($_GET['msg']) || $_GET['msg'] == "")
+ $_GET['docpage'] = 'index.php';
+
+ switch ($_GET['list']) {
+ case "pgadmin-support":
+ $docroot = $_SERVER['DOCUMENT_ROOT'] . "/archives/pgadmin-support/";
+ break;
+
+ case "pgadmin-hackers":
+ $docroot = $_SERVER['DOCUMENT_ROOT'] . "/archives/pgadmin-hackers/";
+ break;
+
+ default:
+ header("HTTP/1.0 404 Not Found");
+ www_page(_("Document not found"), sprintf("<p>%s</p>", _("The document requested does not exist!")), false);
+ exit;
+ }
+
+ $docpage = $_GET['msg'];
+
+ $docfile = $docroot . "/" . $docpage;
+
+ if (file_exists($docfile))
+ {
+ $docrawcontent = file_get_contents($docfile);
+ }
+ else
+ {
+ header("HTTP/1.0 404 Not Found");
+ www_page(_("Document not found"), sprintf("<p>%s</p>", _("The document requested does not exist!")), false);
+ exit();
+ }
+
+ // Check the raw content for a charset. If there is one, convert from it to UTF-8
+ if (preg_match('/<meta.*charset=([^"]*)/is', $docrawcontent, $matches) > 0)
+ $dociconvcontent = iconv($matches[1], "UTF-8//TRANSLIT", $docrawcontent);
+ else
+ $dociconvcontent = $docrawcontent;
+
+ if (preg_match("/<title[^>]*>(.*)<\/title>/is", $dociconvcontent, $matches) > 0)
+ $doctitle = $matches[1];
+ else
+ $doctitle = _("pgAdmin: Archives - Couldn't find the archive title!");
+
+ if (preg_match("/\?>(.*)<\?/is", $dociconvcontent, $matches) > 0)
+ $doccontent = $matches[1];
+ else
+ $doccontent = sprintf("<p>%s</p>", _("Couldn't find the archive content!"));
+
+ www_page($doctitle, $doccontent, false);
+}
+
Added: trunk/www/include/doc.php
===================================================================
--- trunk/www/include/doc.php 2006-01-20 09:28:34 UTC (rev 4939)
+++ trunk/www/include/doc.php 2006-01-20 09:46:15 UTC (rev 4940)
@@ -0,0 +1,62 @@
+<?php
+
+require $GLOBALS["_SERVER"]["DOCUMENT_ROOT"] . "/include/page.php";
+
+// If this is a docpage, then generate our own content and title.
+if (isset($_GET['docset']))
+{
+ if (!isset($_GET['docpage']) || $_GET['docpage'] == "")
+ $_GET['docpage'] = 'index.html';
+
+ switch ($_GET['docset']) {
+ case "1.4":
+ $docroot = $_SERVER['DOCUMENT_ROOT'] . "/svnrepo/pgadmin3-1.4/docs/en_US";
+ $docheader = sprintf(_("pgAdmin %s online documentation"), "1.4");
+ break;
+
+ case "dev":
+ $docroot = $_SERVER['DOCUMENT_ROOT'] . "/svnrepo/pgadmin3/docs/en_US";
+ $docheader = sprintf(_("pgAdmin %s online documentation"), _("Development"));
+ break;
+
+ default:
+ header("HTTP/1.0 404 Not Found");
+ www_page(_("Document not found"), sprintf("<p>%s</p>", _("The document requested does not exist!")), false);
+ exit;
+ }
+
+ $docpage = $_GET['docpage'];
+
+ $docfile = $docroot . "/" . $docpage;
+ if (file_exists($docfile))
+ {
+ $docrawcontent = file_get_contents($docfile);
+ }
+ else
+ {
+ header("HTTP/1.0 404 Not Found");
+ www_page(_("Document not found"), sprintf("<p>%s</p>", _("The document requested does not exist!")), false);
+ exit();
+ }
+
+ // Check the raw content for a charset. If there is one, convert from it to UTF-8
+ if (preg_match('/<meta.*charset=([^"]*)/is', $docrawcontent, $matches) > 0)
+ $dociconvcontent = iconv($matches[1], "UTF-8//TRANSLIT", $docrawcontent);
+
+ if ($dociconvcontent == "")
+ $dociconvcontent = $docrawcontent;
+
+ if (preg_match("/<title[^>]*>(.*)<\/title>/is", $dociconvcontent, $matches) > 0)
+ $doctitle = $matches[1];
+ else
+ $doctitle = _("pgAdmin: Documentation - Couldn't find the document title!");
+
+ $doccontent = "<h1>" . $docheader . "</h1>";
+ if (preg_match("/<body[^>]*>(.*)<\/body>/is", $dociconvcontent, $matches) > 0)
+ $doccontent .= $matches[1];
+ else
+ $doccontent .= sprintf("<p>%s</p>", _("Couldn't find the document content!"));
+
+ www_page($doctitle, $doccontent, false);
+}
+
Modified: trunk/www/include/page.php
===================================================================
--- trunk/www/include/page.php 2006-01-20 09:28:34 UTC (rev 4939)
+++ trunk/www/include/page.php 2006-01-20 09:46:15 UTC (rev 4940)
@@ -3,66 +3,6 @@
// Startup the session and setup the gettext stuff
require $GLOBALS["_SERVER"]["DOCUMENT_ROOT"] . "/include/session.php";
-// If this is a docpage, then generate our own content and title.
-if (isset($_GET['docset']))
-{
- if (!isset($_GET['docpage']) || $_GET['docpage'] == "")
- $_GET['docpage'] = 'index.html';
-
- switch ($_GET['docset']) {
- case "1.4":
- $docroot = $_SERVER['DOCUMENT_ROOT'] . "/svnrepo/pgadmin3-1.4/docs/en_US";
- $docheader = sprintf(_("pgAdmin %s online documentation"), "1.4");
- break;
-
- case "dev":
- $docroot = $_SERVER['DOCUMENT_ROOT'] . "/svnrepo/pgadmin3/docs/en_US";
- $docheader = sprintf(_("pgAdmin %s online documentation"), _("Development"));
- break;
-
- default:
- header("HTTP/1.0 404 Not Found");
- www_page(_("Document not found"), sprintf("<p>%s</p>", _("The document requested does not exist!")), false);
- exit;
- }
-
- $docpage = $_GET['docpage'];
-
- $docfile = $docroot . "/" . $docpage;
- if (file_exists($docfile))
- {
- $docrawcontent = file_get_contents($docfile);
- }
- else
- {
- header("HTTP/1.0 404 Not Found");
- www_page(_("Document not found"), sprintf("<p>%s</p>", _("The document requested does not exist!")), false);
- exit();
- }
-
- // Check the raw content for a charset. If there is one, convert from it to UTF-8
- if (preg_match('/<meta.*charset=([^"]*)/is', $docrawcontent, $matches) > 0)
- $dociconvcontent = iconv($matches[1], "UTF-8//TRANSLIT", $docrawcontent);
-
- if ($dociconvcontent == "")
- $dociconvcontent = $docrawcontent;
-
- if (preg_match("/<title[^>]*>(.*)<\/title>/is", $dociconvcontent, $matches) > 0)
- $doctitle = $matches[1];
- else
- $doctitle = _("pgAdmin: Documentation - Couldn't find the document title!");
-
- $doccontent = "<h1>" . $docheader . "</h1>";
- if (preg_match("/<body[^>]*>(.*)<\/body>/is", $dociconvcontent, $matches) > 0)
- $doccontent .= $matches[1];
- else
- $doccontent .= sprintf("<p>%s</p>", _("Couldn't find the document content!"));
-
- www_page($doctitle, $doccontent, false);
-}
-
-
-
function www_current_menu_section($SECTION)
{
if (dirname($_SERVER['SCRIPT_NAME']) == $SECTION || dirname($_SERVER['SCRIPT_NAME']) . "/" == $SECTION)
Modified: trunk/www/support/list.php
===================================================================
--- trunk/www/support/list.php 2006-01-20 09:28:34 UTC (rev 4939)
+++ trunk/www/support/list.php 2006-01-20 09:46:15 UTC (rev 4940)
@@ -19,7 +19,7 @@
<li>' . _("Steps required to reproduce the problem. Please include a simple scheme with optional data if required.
Thismay be sent privately <b>upon request from a developer</b> if you are concerned about posting sample code or data
toa public mailing list.") . '<br /> </li>
</ul>
-<p>' . sprintf(_("Messages sent to the list are archived at <a href=\"%s\">PostgreSQL</a> and <a
href=\"%s\">mail-archive.com</a>."),"http://archives.postgresql.org/pgadmin-hackers/",
"http://www.mail-archive.com/pgadmin-hackers@postgresql.org"). '</p>
+<p>' . sprintf(_("Messages sent to the list may be browsed <a href=\"%s\">here</a> and are archived at <a
href=\"%s\">PostgreSQL</a>and <a href=\"%s\">mail-archive.com</a>."), "/archives/pgadmin-support/index.php",
"http://archives.postgresql.org/pgadmin-hackers/","http://www.mail-archive.com/pgadmin-hackers@postgresql.org") . '</p>
<p>' . _("Please <b>do not</b> send an email directly to one of the programmers; they might miss it, or even be the
wrongperson at all. Using the mailing list guarantees that your request isn't lost and will be answered in a timely
fashion."). '</p>
';
Modified: trunk/www/support/menu.php
===================================================================
--- trunk/www/support/menu.php 2006-01-20 09:28:34 UTC (rev 4939)
+++ trunk/www/support/menu.php 2006-01-20 09:46:15 UTC (rev 4940)
@@ -6,6 +6,7 @@
<div' . www_current_menu_page("index.php") . '><a href="index.php">› ' . _("Introduction") . '</a></div>
<div' . www_current_menu_page("faq.php") . '><a href="faq.php">› ' . _("FAQ") . '</a></div>
<div' . www_current_menu_page("list.php") . '><a href="list.php">› ' . _("Mailing list") . '</a></div>
+<div' . www_current_menu_page("/archives/pgadmin-support/index.php") . '><a
href="/archives/pgadmin-support/index.php">›' . _("List archives") . '</a></div>
<div' . www_current_menu_page("issues.php") . '><a href="issues.php">› ' . _("Known issues") . '</a></div>
';