SVN Commit by dpage: r4940 - in trunk/www: . development include support
SVN Commit by dpage: r4940 - in trunk/www: . development include support
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 @@' . 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 pgadmin-support list for end user support issues. To subscribe to the mailing list, send an email to %s 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") . '
-' . sprintf(_("Messages sent to the list are archived at PostgreSQL and mail-archive.com."), "http://archives.postgresql.org/pgadmin-hackers/", "http://www.mail-archive.com/pgadmin-hackers@postgresql.org") . '
+' . sprintf(_("Messages sent to the list may be browsed here and are archived at PostgreSQL and mail-archive.com."), "/archives/pgadmin-hackers/index.php", "http://archives.postgresql.org/pgadmin-hackers/", "http://www.mail-archive.com/pgadmin-hackers@postgresql.org") . '
'; 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 @@ › ' . _("SVN access") . ' › ' . _("SVN browser") . ' › ' . _("Mailing list") . ' +› ' . _("List archives") . ' › ' . _("Team") . ' › ' . _("TODO list") . ' › ' . _("Change log") . ' 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 @@ +%s", _("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("%s
", _("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('/ 0) + $dociconvcontent = iconv($matches[1], "UTF-8//TRANSLIT", $docrawcontent); + else + $dociconvcontent = $docrawcontent; + + if (preg_match("/]*>(.*)<\/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("%s
", _("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 @@ +%s", _("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("%s
", _("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('/ 0) + $dociconvcontent = iconv($matches[1], "UTF-8//TRANSLIT", $docrawcontent); + + if ($dociconvcontent == "") + $dociconvcontent = $docrawcontent; + + if (preg_match("/]*>(.*)<\/title>/is", $dociconvcontent, $matches) > 0) + $doctitle = $matches[1]; + else + $doctitle = _("pgAdmin: Documentation - Couldn't find the document title!"); + + $doccontent = "" . $docheader . "
"; + if (preg_match("/]*>(.*)<\/body>/is", $dociconvcontent, $matches) > 0) + $doccontent .= $matches[1]; + else + $doccontent .= sprintf("%s
", _("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("%s
", _("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("%s
", _("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('/ 0) - $dociconvcontent = iconv($matches[1], "UTF-8//TRANSLIT", $docrawcontent); - - if ($dociconvcontent == "") - $dociconvcontent = $docrawcontent; - - if (preg_match("/]*>(.*)<\/title>/is", $dociconvcontent, $matches) > 0) - $doctitle = $matches[1]; - else - $doctitle = _("pgAdmin: Documentation - Couldn't find the document title!"); - - $doccontent = "" . $docheader . "
"; - if (preg_match("/]*>(.*)<\/body>/is", $dociconvcontent, $matches) > 0) - $doccontent .= $matches[1]; - else - $doccontent .= sprintf("%s
", _("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 @@
' . sprintf(_("Messages sent to the list are archived at PostgreSQL and mail-archive.com."), "http://archives.postgresql.org/pgadmin-hackers/", "http://www.mail-archive.com/pgadmin-hackers@postgresql.org") . '
+' . sprintf(_("Messages sent to the list may be browsed here and are archived at PostgreSQL and mail-archive.com."), "/archives/pgadmin-support/index.php", "http://archives.postgresql.org/pgadmin-hackers/", "http://www.mail-archive.com/pgadmin-hackers@postgresql.org") . '
' . _("Please do not send an email directly to one of the programmers; they might miss it, or even be the wrong person at all. Using the mailing list guarantees that your request isn't lost and will be answered in a timely fashion.") . '
'; 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 @@ › ' . _("Introduction") . ' › ' . _("FAQ") . ' › ' . _("Mailing list") . ' +› ' . _("List archives") . ' › ' . _("Known issues") . ' ';