[28820] trunk/www

source_changes at macosforge.org source_changes at macosforge.org
Sun Sep 9 08:41:35 PDT 2007


Revision: 28820
          http://trac.macosforge.org/projects/macports/changeset/28820
Author:   sfiera at macports.org
Date:     2007-09-09 08:41:34 -0700 (Sun, 09 Sep 2007)

Log Message:
-----------
Decouple from the hard-coded /macports/ directory

Modified Paths:
--------------
    trunk/www/admin/add.php
    trunk/www/admin/edit.php
    trunk/www/admin/index.php
    trunk/www/admin/list.php
    trunk/www/admin/rss.php
    trunk/www/archives.php
    trunk/www/downloads.php
    trunk/www/emit_portfile.php
    trunk/www/getmp.php
    trunk/www/includes/common.inc
    trunk/www/includes/footer.inc
    trunk/www/includes/header.inc
    trunk/www/includes/news.inc
    trunk/www/index.php
    trunk/www/macports.css
    trunk/www/ports.php

Modified: trunk/www/admin/add.php
===================================================================
--- trunk/www/admin/add.php	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/admin/add.php	2007-09-09 15:41:34 UTC (rev 28820)
@@ -1,7 +1,7 @@
   <?php
-    $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
-    include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
-    include_once("$DOCUMENT_ROOT/macports/includes/news.inc");
+    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
+    include_once("$MPWEB/includes/common.inc");
+    include_once("$MPWEB/includes/news.inc");
     print_header('MacPorts | Add news', 'utf-8');
     /* $Id$ */
   ?>

Modified: trunk/www/admin/edit.php
===================================================================
--- trunk/www/admin/edit.php	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/admin/edit.php	2007-09-09 15:41:34 UTC (rev 28820)
@@ -1,7 +1,7 @@
   <?php
-    $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
-    include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
-    include_once("$DOCUMENT_ROOT/macports/includes/news.inc");
+    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
+    include_once("$MPWEB/includes/common.inc");
+    include_once("$MPWEB/includes/news.inc");
     print_header('MacPorts | Edit news', 'utf-8');
     /* $Id$ */
   ?>

Modified: trunk/www/admin/index.php
===================================================================
--- trunk/www/admin/index.php	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/admin/index.php	2007-09-09 15:41:34 UTC (rev 28820)
@@ -1,6 +1,6 @@
   <?php
-    $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
-    include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
+    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
+    include_once("$MPWEB/includes/common.inc");
     print_header('MacPorts Site Administration', 'utf-8');
     /* $Id$ */
   ?>

Modified: trunk/www/admin/list.php
===================================================================
--- trunk/www/admin/list.php	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/admin/list.php	2007-09-09 15:41:34 UTC (rev 28820)
@@ -1,7 +1,7 @@
   <?php
-    $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
-    include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
-    include_once("$DOCUMENT_ROOT/macports/includes/news.inc");
+    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
+    include_once("$MPWEB/includes/common.inc");
+    include_once("$MPWEB/includes/news.inc");
     print_header('MacPorts | List all news', 'utf-8');
     /* $Id$ */
   ?>

Modified: trunk/www/admin/rss.php
===================================================================
--- trunk/www/admin/rss.php	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/admin/rss.php	2007-09-09 15:41:34 UTC (rev 28820)
@@ -1,6 +1,6 @@
 <?php
-  $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
-  include_once("$DOCUMENT_ROOT/macports/includes/news.inc");
+  $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
+  include_once("$MPWEB/includes/news.inc");
   create_rss();
   /* $Id$ */
 ?>

Modified: trunk/www/archives.php
===================================================================
--- trunk/www/archives.php	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/archives.php	2007-09-09 15:41:34 UTC (rev 28820)
@@ -1,8 +1,8 @@
   <?php
     /* $Id$ */
-    $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
-    include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
-    include_once("$DOCUMENT_ROOT/macports/includes/news.inc");
+    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
+    include_once("$MPWEB/includes/common.inc");
+    include_once("$MPWEB/includes/news.inc");
     print_header('MacPorts -- News Archive', 'utf-8');
   ?>
 

Modified: trunk/www/downloads.php
===================================================================
--- trunk/www/downloads.php	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/downloads.php	2007-09-09 15:41:34 UTC (rev 28820)
@@ -1,7 +1,7 @@
   <?php
     /* $Id$ */
-    $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
-    include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
+    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
+    include_once("$MPWEB/includes/common.inc");
     print_header('MacPorts -- Downloads', 'utf-8');
   ?>
 

Modified: trunk/www/emit_portfile.php
===================================================================
--- trunk/www/emit_portfile.php	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/emit_portfile.php	2007-09-09 15:41:34 UTC (rev 28820)
@@ -1,7 +1,8 @@
 <?php
 /* $Id$ */
 $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
-include_once("$DOCUMENT_ROOT/macports/includes/email.inc");
+$MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
+include_once("$MPWEB/includes/email.inc");
 $portname = basename(dirname($_SERVER['PATH_INFO']));
 ?>
 

Modified: trunk/www/getmp.php
===================================================================
--- trunk/www/getmp.php	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/getmp.php	2007-09-09 15:41:34 UTC (rev 28820)
@@ -1,7 +1,7 @@
 <?php
   /* $Id$ */
-  $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
-  include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
+  $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
+  include_once("$MPWEB/includes/common.inc");
   print_header('MacPorts -- Download &amp; Installation', 'utf-8');
 ?>
     <h2 class="hdr">Get MacPorts</h2>

Modified: trunk/www/includes/common.inc
===================================================================
--- trunk/www/includes/common.inc	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/includes/common.inc	2007-09-09 15:41:34 UTC (rev 28820)
@@ -24,7 +24,7 @@
 
 # print the page header
 function print_header($title, $encoding) {
-  global $DOCUMENT_ROOT;
+  global $MPWEB;
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
                       "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
@@ -38,14 +38,14 @@
     <meta name="copyright" content="2003, OpenDarwin" />
     <meta name="copyright" content="2007, MacPorts Team" />
     <meta name="robots" content="all" />
-    <link rel="stylesheet" type="text/css" href="/macports/macports.css" />
-    <link rel="alternate" type="application/rss+xml" href="/macports/macports_news.xml" />
+    <link rel="stylesheet" type="text/css" href="macports.css" />
+    <link rel="alternate" type="application/rss+xml" href="macports_news.xml" />
     <script type="text/javascript" src="mootools.v1.11.js"></script>
     <script type="text/javascript" src="language.js"></script>
   </head>
   <body>
 <?php
-    include("$DOCUMENT_ROOT/macports/includes/header.inc");
+    include("$MPWEB/includes/header.inc");
     check_referer();
 }
 
@@ -53,9 +53,9 @@
 
 # print the page footer
 function print_footer() {
-  global $DOCUMENT_ROOT;
+  global $MPWEB;
 
-  include("$DOCUMENT_ROOT/macports/includes/footer.inc");
+  include("$MPWEB/includes/footer.inc");
 
   echo "  </body>\n";
   echo "</html>\n";

Modified: trunk/www/includes/footer.inc
===================================================================
--- trunk/www/includes/footer.inc	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/includes/footer.inc	2007-09-09 15:41:34 UTC (rev 28820)
@@ -5,7 +5,7 @@
     <div id="footer">
       <p>
       <a href="http://validator.w3.org/check?uri=referer"><img
-          src="/macports/img/valid-xhtml11-blue.png"
+          src="img/valid-xhtml11-blue.png"
           alt="Valid XHTML 1.1" height="31" width="88" /></a>
       </p>
       Copyright &copy; 2002&ndash;<?php print date("Y"); ?>,

Modified: trunk/www/includes/header.inc
===================================================================
--- trunk/www/includes/header.inc	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/includes/header.inc	2007-09-09 15:41:34 UTC (rev 28820)
@@ -2,7 +2,7 @@
   // $Id$
 ?>
     <h1>
-      <a href="/macports/" title="MacPorts">
+      <a href="http://www.macports.org/" title="MacPorts">
         <span class="accessibility">MacPorts</span>
       </a>
     </h1>
@@ -10,15 +10,15 @@
       <a href="#content">Skip to Content</a>
     </p>
     <div id="header">
-      <a id="download" href="/macports/getmp.php">
+      <a id="download" href="getmp.php">
         <span class="accessibility">Download MacPorts</span>
       </a>
       <span class="accessibility">View site in</span>
       <span>
-        <a href="#" id="language"><img src="/macports/img/en-enabled.png" alt="English" width="30" height="48" /></a>
+        <a href="#" id="language"><img src="img/en-enabled.png" alt="English" width="30" height="48" /></a>
       </span>
       <span id="languages">
-        <a href="#"><img src="/macports/img/fr-disabled.png" alt="Fran&ccedil;ais" width="30" height="48" /></a><a href="#"><img src="/macports/img/es-disabled.png" alt="Espa&ntilde;ol" width="30" height="48" /></a><a href="#"><img src="/macports/img/ru-disabled.png" alt="" width="30" height="48" /></a><a href="#"><img src="/macports/img/it-disabled.png" alt="Italiano" width="30" height="48" /></a>
+        <a href="#"><img src="img/fr-disabled.png" alt="Fran&ccedil;ais" width="30" height="48" /></a><a href="#"><img src="img/es-disabled.png" alt="Espa&ntilde;ol" width="30" height="48" /></a><a href="#"><img src="img/ru-disabled.png" alt="" width="30" height="48" /></a><a href="#"><img src="img/it-disabled.png" alt="Italiano" width="30" height="48" /></a>
       </span>
     </div>
     <div id="navigation">
@@ -29,9 +29,9 @@
 <?php
             $PHP_SELF = $_SERVER['PHP_SELF'];
             $pages = array (
-              'Home'            => '/macports/index.php',
-              'Get MacPorts'    => '/macports/getmp.php',
-              'Available Ports' => '/macports/ports.php',
+              'Home'            => 'index.php',
+              'Get MacPorts'    => 'getmp.php',
+              'Available Ports' => 'ports.php',
               'Documentation'   => 'http://geeklair.net/new_macports_guide',
               'Support &amp; Development'
                                 => 'http://trac.macports.org/',

Modified: trunk/www/includes/news.inc
===================================================================
--- trunk/www/includes/news.inc	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/includes/news.inc	2007-09-09 15:41:34 UTC (rev 28820)
@@ -6,7 +6,7 @@
 ######################################################################
 
 # variables and includes
-$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
+$DOCUMENT_ROOT = dirname($_SERVER['SCRIPT_NAME']);
 $PHP_SELF = $_SERVER['PHP_SELF'];
 /* include_once("$DOCUMENT_ROOT/macports/includes/db.inc"); */
 $newsdb = 'macports_news';

Modified: trunk/www/index.php
===================================================================
--- trunk/www/index.php	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/index.php	2007-09-09 15:41:34 UTC (rev 28820)
@@ -1,8 +1,8 @@
 <?php
   /* $Id$ */
-  $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
-  include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
-  include_once("$DOCUMENT_ROOT/macports/includes/news.inc");
+  $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
+  include_once("$MPWEB/includes/common.inc");
+  include_once("$MPWEB/includes/news.inc");
   print_header('MacPorts -- Home', 'utf-8');
 ?>
       <h2 class="hdr">Introduction to MacPorts</h2>

Modified: trunk/www/macports.css
===================================================================
--- trunk/www/macports.css	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/macports.css	2007-09-09 15:41:34 UTC (rev 28820)
@@ -4,7 +4,7 @@
 
 body {
     margin: 30px 40px;
-    background: url(/macports/img/top-backdrop.png) repeat-x #EDEDED;
+    background: url(img/top-backdrop.png) repeat-x #EDEDED;
     font: 12px Helvetica, Arial, sans-serif;
     line-height: 1.2em;
 }
@@ -35,7 +35,7 @@
     display: block;
     width: 183px;
     height: 70px;
-    background: url(/macports/img/macports-logo-top.png);
+    background: url(img/macports-logo-top.png);
 }
 h2, h3 {
     background: #8695B3;
@@ -52,13 +52,13 @@
     width: 183px;
     float: left;
     clear: left;
-    background: url(/macports/img/nav-header.png) top no-repeat #B1BACC;
+    background: url(img/nav-header.png) top no-repeat #B1BACC;
     line-height: 1.4em;
 }
 #navigation dl {
     padding: 16px;
     margin: 0;
-    background: url(/macports/img/nav-footer.png) bottom no-repeat;
+    background: url(img/nav-footer.png) bottom no-repeat;
 }
 #navigation dd, #navigation dt {
     margin: 0;
@@ -104,11 +104,11 @@
     float: right;
     width: 70px;
     height: 48px;
-    background: url(/macports/img/download.png);
+    background: url(img/download.png);
     margin-left: 5px;
 }
 a#download:hover {
-    background: url(/macports/img/download-highlight.png);
+    background: url(img/download-highlight.png);
 }
 #content {
     padding: 1px 0 40px 191px;

Modified: trunk/www/ports.php
===================================================================
--- trunk/www/ports.php	2007-09-09 15:30:44 UTC (rev 28819)
+++ trunk/www/ports.php	2007-09-09 15:41:34 UTC (rev 28820)
@@ -1,8 +1,8 @@
 <?php
         /* $Id$ */
-	$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
-	include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
-	include_once("$DOCUMENT_ROOT/macports/includes/email.inc");
+    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
+	include_once("$MPWEB/includes/common.inc");
+	include_once("$MPWEB/includes/email.inc");
 	print_header('MacPorts -- Available Ports', 'utf-8');
 	$by = isset($_GET['by']) ? $_GET['by'] : '';
 	$substr = isset($_GET['substr']) ? $_GET['substr'] : '';

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070909/74835d30/attachment.html


More information about the macports-changes mailing list