Changeset 28820


Ignore:
Timestamp:
Sep 9, 2007, 3:41:34 PM (13 years ago)
Author:
sfiera@…
Message:

Decouple from the hard-coded /macports/ directory

Location:
trunk/www
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/admin/add.php

    r28314 r28820  
    11  <?php
    2     $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
    3     include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
    4     include_once("$DOCUMENT_ROOT/macports/includes/news.inc");
     2    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
     3    include_once("$MPWEB/includes/common.inc");
     4    include_once("$MPWEB/includes/news.inc");
    55    print_header('MacPorts | Add news', 'utf-8');
    66    /* $Id$ */
  • trunk/www/admin/edit.php

    r28314 r28820  
    11  <?php
    2     $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
    3     include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
    4     include_once("$DOCUMENT_ROOT/macports/includes/news.inc");
     2    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
     3    include_once("$MPWEB/includes/common.inc");
     4    include_once("$MPWEB/includes/news.inc");
    55    print_header('MacPorts | Edit news', 'utf-8');
    66    /* $Id$ */
  • trunk/www/admin/index.php

    r28314 r28820  
    11  <?php
    2     $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
    3     include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
     2    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
     3    include_once("$MPWEB/includes/common.inc");
    44    print_header('MacPorts Site Administration', 'utf-8');
    55    /* $Id$ */
  • trunk/www/admin/list.php

    r28314 r28820  
    11  <?php
    2     $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
    3     include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
    4     include_once("$DOCUMENT_ROOT/macports/includes/news.inc");
     2    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
     3    include_once("$MPWEB/includes/common.inc");
     4    include_once("$MPWEB/includes/news.inc");
    55    print_header('MacPorts | List all news', 'utf-8');
    66    /* $Id$ */
  • trunk/www/admin/rss.php

    r28314 r28820  
    11<?php
    2   $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
    3   include_once("$DOCUMENT_ROOT/macports/includes/news.inc");
     2  $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
     3  include_once("$MPWEB/includes/news.inc");
    44  create_rss();
    55  /* $Id$ */
  • trunk/www/archives.php

    r28649 r28820  
    11  <?php
    22    /* $Id$ */
    3     $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
    4     include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
    5     include_once("$DOCUMENT_ROOT/macports/includes/news.inc");
     3    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
     4    include_once("$MPWEB/includes/common.inc");
     5    include_once("$MPWEB/includes/news.inc");
    66    print_header('MacPorts -- News Archive', 'utf-8');
    77  ?>
  • trunk/www/downloads.php

    r28649 r28820  
    11  <?php
    22    /* $Id$ */
    3     $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
    4     include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
     3    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
     4    include_once("$MPWEB/includes/common.inc");
    55    print_header('MacPorts -- Downloads', 'utf-8');
    66  ?>
  • trunk/www/emit_portfile.php

    r28322 r28820  
    22/* $Id$ */
    33$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
    4 include_once("$DOCUMENT_ROOT/macports/includes/email.inc");
     4$MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
     5include_once("$MPWEB/includes/email.inc");
    56$portname = basename(dirname($_SERVER['PATH_INFO']));
    67?>
  • trunk/www/getmp.php

    r28709 r28820  
    11<?php
    22  /* $Id$ */
    3   $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
    4   include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
     3  $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
     4  include_once("$MPWEB/includes/common.inc");
    55  print_header('MacPorts -- Download &amp; Installation', 'utf-8');
    66?>
  • trunk/www/includes/common.inc

    r28818 r28820  
    2525# print the page header
    2626function print_header($title, $encoding) {
    27   global $DOCUMENT_ROOT;
     27  global $MPWEB;
    2828?>
    2929<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
     
    3939    <meta name="copyright" content="2007, MacPorts Team" />
    4040    <meta name="robots" content="all" />
    41     <link rel="stylesheet" type="text/css" href="/macports/macports.css" />
    42     <link rel="alternate" type="application/rss+xml" href="/macports/macports_news.xml" />
     41    <link rel="stylesheet" type="text/css" href="macports.css" />
     42    <link rel="alternate" type="application/rss+xml" href="macports_news.xml" />
    4343    <script type="text/javascript" src="mootools.v1.11.js"></script>
    4444    <script type="text/javascript" src="language.js"></script>
     
    4646  <body>
    4747<?php
    48     include("$DOCUMENT_ROOT/macports/includes/header.inc");
     48    include("$MPWEB/includes/header.inc");
    4949    check_referer();
    5050}
     
    5454# print the page footer
    5555function print_footer() {
    56   global $DOCUMENT_ROOT;
     56  global $MPWEB;
    5757
    58   include("$DOCUMENT_ROOT/macports/includes/footer.inc");
     58  include("$MPWEB/includes/footer.inc");
    5959
    6060  echo "  </body>\n";
  • trunk/www/includes/footer.inc

    r28818 r28820  
    66      <p>
    77      <a href="http://validator.w3.org/check?uri=referer"><img
    8           src="/macports/img/valid-xhtml11-blue.png"
     8          src="img/valid-xhtml11-blue.png"
    99          alt="Valid XHTML 1.1" height="31" width="88" /></a>
    1010      </p>
  • trunk/www/includes/header.inc

    r28818 r28820  
    33?>
    44    <h1>
    5       <a href="/macports/" title="MacPorts">
     5      <a href="http://www.macports.org/" title="MacPorts">
    66        <span class="accessibility">MacPorts</span>
    77      </a>
     
    1111    </p>
    1212    <div id="header">
    13       <a id="download" href="/macports/getmp.php">
     13      <a id="download" href="getmp.php">
    1414        <span class="accessibility">Download MacPorts</span>
    1515      </a>
    1616      <span class="accessibility">View site in</span>
    1717      <span>
    18         <a href="#" id="language"><img src="/macports/img/en-enabled.png" alt="English" width="30" height="48" /></a>
     18        <a href="#" id="language"><img src="img/en-enabled.png" alt="English" width="30" height="48" /></a>
    1919      </span>
    2020      <span id="languages">
    21         <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>
     21        <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>
    2222      </span>
    2323    </div>
     
    3030            $PHP_SELF = $_SERVER['PHP_SELF'];
    3131            $pages = array (
    32               'Home'            => '/macports/index.php',
    33               'Get MacPorts'    => '/macports/getmp.php',
    34               'Available Ports' => '/macports/ports.php',
     32              'Home'            => 'index.php',
     33              'Get MacPorts'    => 'getmp.php',
     34              'Available Ports' => 'ports.php',
    3535              'Documentation'   => 'http://geeklair.net/new_macports_guide',
    3636              'Support &amp; Development'
  • trunk/www/includes/news.inc

    r28818 r28820  
    77
    88# variables and includes
    9 $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
     9$DOCUMENT_ROOT = dirname($_SERVER['SCRIPT_NAME']);
    1010$PHP_SELF = $_SERVER['PHP_SELF'];
    1111/* include_once("$DOCUMENT_ROOT/macports/includes/db.inc"); */
  • trunk/www/index.php

    r28818 r28820  
    11<?php
    22  /* $Id$ */
    3   $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
    4   include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
    5   include_once("$DOCUMENT_ROOT/macports/includes/news.inc");
     3  $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
     4  include_once("$MPWEB/includes/common.inc");
     5  include_once("$MPWEB/includes/news.inc");
    66  print_header('MacPorts -- Home', 'utf-8');
    77?>
  • trunk/www/macports.css

    r28650 r28820  
    55body {
    66    margin: 30px 40px;
    7     background: url(/macports/img/top-backdrop.png) repeat-x #EDEDED;
     7    background: url(img/top-backdrop.png) repeat-x #EDEDED;
    88    font: 12px Helvetica, Arial, sans-serif;
    99    line-height: 1.2em;
     
    3636    width: 183px;
    3737    height: 70px;
    38     background: url(/macports/img/macports-logo-top.png);
     38    background: url(img/macports-logo-top.png);
    3939}
    4040h2, h3 {
     
    5353    float: left;
    5454    clear: left;
    55     background: url(/macports/img/nav-header.png) top no-repeat #B1BACC;
     55    background: url(img/nav-header.png) top no-repeat #B1BACC;
    5656    line-height: 1.4em;
    5757}
     
    5959    padding: 16px;
    6060    margin: 0;
    61     background: url(/macports/img/nav-footer.png) bottom no-repeat;
     61    background: url(img/nav-footer.png) bottom no-repeat;
    6262}
    6363#navigation dd, #navigation dt {
     
    105105    width: 70px;
    106106    height: 48px;
    107     background: url(/macports/img/download.png);
     107    background: url(img/download.png);
    108108    margin-left: 5px;
    109109}
    110110a#download:hover {
    111     background: url(/macports/img/download-highlight.png);
     111    background: url(img/download-highlight.png);
    112112}
    113113#content {
  • trunk/www/ports.php

    r28649 r28820  
    11<?php
    22        /* $Id$ */
    3         $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
    4         include_once("$DOCUMENT_ROOT/macports/includes/common.inc");
    5         include_once("$DOCUMENT_ROOT/macports/includes/email.inc");
     3    $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
     4        include_once("$MPWEB/includes/common.inc");
     5        include_once("$MPWEB/includes/email.inc");
    66        print_header('MacPorts -- Available Ports', 'utf-8');
    77        $by = isset($_GET['by']) ? $_GET['by'] : '';
Note: See TracChangeset for help on using the changeset viewer.