cvs: phpweb / sitewide.css /include get-download.inc mirrortable.inc

From: Date: Wed, 13 Aug 2003 14:35:12 +0000
Subject: cvs: phpweb / sitewide.css /include get-download.inc mirrortable.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-20215@lists.php.net to get a copy of this message
goba Wed Aug 13 10:35:12 2003 EDT Modified files: /phpweb sitewide.css /phpweb/include get-download.inc mirrortable.inc Log: Modify mirror listing tables to use classes instead of inline bgcolor and <small>, which makes the HTML standards compatible and much smaller. Also make the table look more like the other standard tables on PHP.net (spacing) Index: phpweb/sitewide.css diff -u phpweb/sitewide.css:1.11 phpweb/sitewide.css:1.12 --- phpweb/sitewide.css:1.11 Wed Aug 13 09:41:30 2003 +++ phpweb/sitewide.css Wed Aug 13 10:35:12 2003 @@ -226,3 +226,32 @@ text-align: right; vertical-align: top; } + +/* Mirror listing tables -------------------------------------------------- */ +table.mirrors td { + background-color: #eeeeee; + color: inherit; + font-size: smaller; +} +table.mirrors th { + background-color: #cccccc; + color: inherit; +} +table.mirrors th.ch { + text-align: left; +} +table.mirrors th img { + border: 1px solid #000000; +} +table.mirrors th.flag { + width: 45px; +} +table.mirrors tr.this td { + background-color: #ffffcc; + color: inherit; +} +table.mirrors td.caret { + text-align: right; + background-color: white !important; + color: inherit; +} Index: phpweb/include/get-download.inc diff -u phpweb/include/get-download.inc:1.1 phpweb/include/get-download.inc:1.2 --- phpweb/include/get-download.inc:1.1 Sat Aug 9 12:43:45 2003 +++ phpweb/include/get-download.inc Wed Aug 13 10:35:12 2003 @@ -1,5 +1,5 @@ <?php -// $Id: get-download.inc,v 1.1 2003/08/09 16:43:45 goba Exp $ +// $Id: get-download.inc,v 1.2 2003/08/13 14:35:12 goba Exp $ include_once $_SERVER['DOCUMENT_ROOT'] . '/include/mirrortable.inc'; // Try to make this page non-cached @@ -14,7 +14,7 @@ $local_file = $_SERVER['DOCUMENT_ROOT'] . '/distributions/' . $df; // Print out common header -commonHeader('Get Download'); +site_header('Get Download'); ?> <h1>Choose mirror site for download</h1> @@ -46,4 +46,4 @@ <?php mirror_list($df); -commonFooter(); +site_footer(); Index: phpweb/include/mirrortable.inc diff -u phpweb/include/mirrortable.inc:1.5 phpweb/include/mirrortable.inc:1.6 --- phpweb/include/mirrortable.inc:1.5 Wed Aug 13 09:30:17 2003 +++ phpweb/include/mirrortable.inc Wed Aug 13 10:35:12 2003 @@ -1,5 +1,5 @@ <?php -/* $Id: mirrortable.inc,v 1.5 2003/08/13 13:30:17 goba Exp $ */ +/* $Id: mirrortable.inc,v 1.6 2003/08/13 14:35:12 goba Exp $ */ /* This file includes functions to find close mirrors and list @@ -29,14 +29,14 @@ // Print out close mirrors' table $mnum = (($close > 1) ? "mirrors" : "mirror"); - echo "<p>We have automatically detected the following $mnum to be close\n" . - "to you. If you use a mirror close to you for downloads and\n" . - "your usual daily work, you will get better response times.</p>\n"; + echo "<p>\n We have automatically detected the following $mnum to be close\n" . + " to you. If you use a mirror close to you for downloads and\n" . + " your usual daily work, you will get better response times.\n</p>\n"; mirror_table($df, $COUNTRY); // Print out table of other mirror sites - echo "<p>Here is the list of all the other sites in case our detection\n" . - "did something wrong, or the local mirror sites are busy.\n"; + echo "<p>\n Here is the list of all the other sites in case our detection\n" . + " did something wrong, or the local mirror sites are busy.\n</p>\n"; mirror_table($df, '', $COUNTRY); } else { mirror_table($df); } } else { mirror_table($df); } @@ -51,23 +51,20 @@ // table or a usual mirror listing table if (!empty($df)) { $cnf = array( - 'width' => 500, 'virtual' => TRUE, 'datacols' => 2, 'download' => TRUE ); } else { $cnf = array( - 'width' => 560, 'virtual' => FALSE, 'datacols' => 2, 'download' => FALSE ); } - echo '<div class="center">' . "\n" . - '<table border="0" cellpadding="3" cellspacing="1" width="' . - $cnf['width'] . '">' . "\n"; + echo "<div class=\"center\">\n" . + " <table border=\"0\" cellpadding=\"3\" class=\"mirrors\">\n"; // Previous mirror country code $prevcc = 'aa'; @@ -89,30 +86,26 @@ // Print out a country header, if a new country is found if ($prevcc != $country && $country != "xx") { - echo '<tr><td colspan="' . ($cnf['datacols'] + 1) . '"></td></tr>' . "\n"; - echo '<tr bgcolor="#cccccc"><td width="40" align="center">'; + echo " <tr>\n <th class=\"flag\">"; print_image( 'flags/' . strtolower($country) . '.png', - $COUNTRIES[$country], - FALSE, - 'class="flag"' + $COUNTRIES[$country] ); - echo '<br /></td>'; - echo '<td colspan="' . $cnf['datacols'] . '"><b>' . - $COUNTRIES[$country] . '</b><br /></td>'; - echo '</tr>' . "\n"; + echo "</th>\n" . + ' <th class="ch" colspan="' . $cnf['datacols'] . '">' . + $COUNTRIES[$country] . "</th>\n </tr>\n"; } // We print out a row for the current mirror $thismirror = ($MYSITE == $murl); // Highlight this mirror if it is the current one - echo '<tr bgcolor="' . ($thismirror ? '#ffffcc' : '#e0e0e0') . '">' . "\n"; - + echo " <tr" . ($thismirror ? " class=\"this\"" : "") . ">\n"; + // Print out caret (in bold if current mirror) - echo '<td bgcolor="#ffffff" align="right">'; - print_image( ($thismirror ? 'caret-r.gif' : 'caret-rg.gif') ); - echo '<br /></td>' . "\n"; + echo ' <td class="caret">'; + print_image(($thismirror ? 'caret-r.gif' : 'caret-rg.gif')); + echo "</td>\n"; // Get short name of the mirror site $mirrorshort = substr($murl, strpos($murl, '//') + 2, -1); @@ -120,35 +113,30 @@ // If this is a download table print out download links if ($cnf['download']) { // Print out mirror site download link - echo '<td><small>'; + echo ' <td>'; $mirrorname = ($thismirror ? "this" : $mirrorshort); print_link("/get/$df/from/$mirrorname/mirror", $mirrorshort); - echo '</small><br /></td>' . "\n"; + echo "</td>\n"; // Print out mirror provider's name - echo '<td><small>'; - echo mirror_provider($murl); - echo '</small><br /></td>' . "\n"; + echo ' <td>' . htmlspecialchars(mirror_provider($murl)) . "</td>\n"; } // If this is a normal table, print out information else { - // Print out mirror site link - echo '<td><small>'; - print_link($murl, $mirrorshort); - echo '</small><br /></td>' . "\n"; - - // Print out mirror provider's link - echo '<td><small>'; - print_link(mirror_provider_url($murl), htmlspecialchars(mirror_provider($murl))); - echo '</small><br /></td>' . "\n"; + // Print out mirror site and provider link + echo " <td><a href=\"$murl\">$mirrorshort</a></td>\n" . + " <td><a href=\"" . + mirror_provider_url($murl) . "\">" . + htmlspecialchars(mirror_provider($murl)) . + "</a></td>\n"; } // End row for this mirror - echo "</tr>\n"; + echo " </tr>\n"; // Maintain previous country code $prevcc = $country; } - echo "</table>\n</div>"; + echo " </table>\n</div>"; }

« previous php.mirrors (#20215) next »