cvs: phpweb /include layout.inc site.inc
| From: | Jim Winstead | Date: | Sat, 07 Jul 2001 03:23:34 +0000 |
| Subject: | cvs: phpweb /include layout.inc site.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-5254@lists.php.net to get a copy of this message | ||
jimw Fri Jul 6 23:23:34 2001 EDT
Modified files:
/phpweb/include layout.inc site.inc
Log:
move listing of mirrors in dropdown to function
Index: phpweb/include/layout.inc
diff -u phpweb/include/layout.inc:1.40 phpweb/include/layout.inc:1.41
--- phpweb/include/layout.inc:1.40 Fri Jul 6 21:17:38 2001
+++ phpweb/include/layout.inc Fri Jul 6 23:23:33 2001
@@ -1,5 +1,5 @@
<?php
-/* $Id: layout.inc,v 1.40 2001/07/07 01:17:38 jimw Exp $ */
+/* $Id: layout.inc,v 1.41 2001/07/07 03:23:33 jimw Exp $ */
# spacer()
@@ -173,7 +173,7 @@
#
function commonHeader($title="",$dont_enclose=0,$headers_gone=0) {
- global $MYSITE, $MIRRORS, $COUNTRIES, $enclosed;
+ global $MYSITE, $enclosed;
global $SIDEBAR_DATA, $prevsearch;
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
@@ -285,7 +285,7 @@
#
function commonFooter() {
- global $SCRIPT_NAME,$MIRRORS,$MYSITE,$COUNTRIES,$LAST_UPDATED,$enclosed;
+ global $SCRIPT_NAME,$MYSITE,$LAST_UPDATED,$enclosed;
if ($enclosed) {
echo "</td></tr></table></td></tr></table>\n";
}
@@ -321,17 +321,7 @@
}
print_link('/mirrors.php', 'mirror sites:', false,
'class="small"');
echo " <select class=\"small\" name=\"country\"
onchange=\"gotomirror(this.form)\">\n";
- foreach($MIRRORS as $url=>$mirror) {
- if ($mirror[4] == 1) { /* only list full mirrors here */
- if ($url==$MYSITE) {
- echo '<option value="' . $url . '" SELECTED>' .
$COUNTRIES[$mirror[0]] .
- ' (' . $mirror[1] . ") *\n";
- } else {
- echo '<option value="' . $url . '">' .
$COUNTRIES[$mirror[0]] .
- ' (' . $mirror[1] . ")\n";
- }
- }
- }
+ show_mirror_options($MYSITE);
echo "</select> ";
echo make_submit('small_submit.gif', 'go', 'bottom' );
?> <br>
Index: phpweb/include/site.inc
diff -u phpweb/include/site.inc:1.209 phpweb/include/site.inc:1.210
--- phpweb/include/site.inc:1.209 Fri Jul 6 21:17:38 2001
+++ phpweb/include/site.inc Fri Jul 6 23:23:33 2001
@@ -41,6 +41,21 @@
return $MIRRORS[$MYSITE][3];
}
+function show_mirror_options ($current) {
+ global $MIRRORS, $COUNTRIES;
+ foreach ($MIRRORS as $url=>$mirror) {
+ if ($mirror[4] == 1) { /* only list full mirrors here */
+ if ($url==$current) {
+ echo '<option value="' . $url . '" SELECTED>' .
$COUNTRIES[$mirror[0]] .
+ ' (' . $mirror[1] . ") *\n";
+ } else {
+ echo '<option value="' . $url . '">' .
$COUNTRIES[$mirror[0]] .
+ ' (' . $mirror[1] . ")\n";
+ }
+ }
+ }
+}
+
$COUNTRIES = array(
"au" => "Australia",
"at" => "Austria",