cvs: pearweb /include layout.php pear-format-html.php site.php /public_html index2.php /public_html/gifs black.gif blank.gif checkerboard.gif
onlypear.gif pear.gif pear_item.gif pearsmall.gif php-logo.gif small_submit_black.gif small_submit_white.gif
| From: | Colin Viebrock | Date: | Fri, 27 Apr 2001 17:58:31 +0000 |
| Subject: | cvs: pearweb /include layout.php pear-format-html.php site.php /public_html index2.php /public_html/gifs black.gif blank.gif checkerboard.gif onlypear.gif pear.gif pear_item.gif pearsmall.gif php-logo.gif small_submit_black.gif small_submit_white.gif |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-95@lists.php.net to get a copy of this message | ||
cmv Fri Apr 27 10:58:31 2001 EDT
Added files:
/pearweb/include layout.php site.php
/pearweb/public_html index2.php
/pearweb/public_html/gifs black.gif blank.gif checkerboard.gif
pear_item.gif php-logo.gif
small_submit_black.gif
small_submit_white.gif
Removed files:
/pearweb/public_html/gifs onlypear.gif
Modified files:
/pearweb/include pear-format-html.php
/pearweb/public_html/gifs pear.gif pearsmall.gif
Log:
Move to new look
... hopefully nothing broke :)
Index: pearweb/include/pear-format-html.php diff -u pearweb/include/pear-format-html.php:1.3 pearweb/include/pear-format-html.php:1.4 --- pearweb/include/pear-format-html.php:1.3 Wed Apr 18 17:59:05 2001 +++ pearweb/include/pear-format-html.php Fri Apr 27 10:58:30 2001 @@ -1,42 +1,23 @@ <?php -$pear_green = "#00b03b"; +require_once 'layout.php'; -function response_header($title = "PEAR: the PHP Extension and Application Repository", - $style = false) + + +function response_header($title = 'The PHP Extension and Application Repository', $style = false) { - global $_style, $pear_green, $PHP_AUTH_USER, $PHP_AUTH_PW; - global $_header_done; + global $_style, $_header_done; if ($_header_done) { return; } $_header_done = true; $_style = $style; - print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"; - print "<HTML><HEAD>\n"; - print " <TITLE>$title</TITLE>\n"; - print "</HEAD>\n"; - print "<BODY BGCOLOR=\"#ffffff\" TEXT=\"#000000\">\n"; - print "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=\"100%\">\n"; - print "<TR BGCOLOR=\"$pear_green\"><TD ALIGN=\"left\">"; - print "<IMG SRC=\"/gifs/pearsmall.gif\" WIDTH=96 HEIGHT=48 ALT=\"\">"; - print "</TD><TD ALIGN=\"left\" VALIGN=\"top\">"; - print "<FONT SIZE=\"-1\">"; - if ($PHP_AUTH_USER) { - print " <FONT COLOR=\"#ffffff\">user: <B>$PHP_AUTH_USER</B></FONT>". - '<BR> <A HREF="logout.php"><FONT COLOR="#ffffff">'; - print "logout</FONT></A><BR>\n"; - } else { - print ' <A HREF="login.php"><FONT COLOR="#ffffff">'; - print "login</FONT></A><BR>\n"; - } - print "</TD><TD ALIGN=\"center\" VALIGN=\"middle\" WIDTH=\"100%\">"; - print "<FONT COLOR=\"#ffffff\" SIZE=\"+1\"><B>"; - print $title; - print "</B></FONT></TD></TR></TABLE>\n"; - print "<BR><BR>\n"; + + commonHeader($title); } + + function response_footer($style = false) { static $called; @@ -47,11 +28,17 @@ if (!$style) { $style = $GLOBALS['_style']; } - print "</BODY></HTML>\n"; + + commonFooter(); + } function menu_link($text, $url) { - print "<H3><A HREF=\"$url\"><IMG ALIGN=\"left\" SRC=\"/gifs/onlypear.gif\" WIDTH=19 HEIGHT=24 BORDER=0>$text</A></H3>\n"; + echo "<P>\n"; + print_link($url, make_image('pear_item.gif', $text) ); + echo ' '; + print_link($url, '<B>' . $text . '</B>' ); + echo "</P>\n"; } function report_error($error) Index: pearweb/public_html/gifs/pear.gif Index: pearweb/public_html/gifs/pearsmall.gif Index: pearweb/include/layout.php +++ pearweb/include/layout.php <?php /* $Id: layout.php,v 1.1 2001/04/27 17:58:30 cmv Exp $ */ require_once 'site.php'; # spacer() # print a IMG tag for a sized spacer GIF # function spacer($width=1, $height=1, $align=false, $extras=false) { printf('<img src="/gifs/spacer.gif" width="%d" height="%d" border="0" alt="" %s%s>', $width, $height, ($align ? 'align="'.$align.'" ' : ''), ($extras ? $extras : '') ); } # resize_image() # tag the output of make_image() and resize it manually # function resize_image($img, $width=1, $height=1) { $str = preg_replace('/width=\"([0-9]+?)\"/i', '', $img ); $str = preg_replace('/height=\"([0-9]+?)\"/i', '', $str ); $str = substr($str,0,-1) . sprintf(' height="%s" width="%s">', $height, $width ); return $str; } # make_image() # return an IMG tag for a given file (relative to the images dir) # function make_image($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { global $HTTP_SERVER_VARS; if (!$dir) { $dir = '/gifs'; } if ($size = @getimagesize($HTTP_SERVER_VARS['DOCUMENT_ROOT'].$dir.'/'.$file)) { $image = sprintf('<img src="%s/%s" border="%d" %s ALT="%s" %s%s>', $dir, $file, $border, $size[3], ($alt ? $alt : ''), ($align ? ' align="'.$align.'"' : ''), ($extras ? ' '.$extras : '') ); } else { $image = sprintf('<img src="%s/%s" border="%d" ALT="%s" %s%s>', $dir, $file, $border, ($alt ? $alt : ''), ($align ? ' ALIGN="'.$align.'"' : ''), ($extras ? ' '.$extras : '') ); } return $image; } # print_image() # print an IMG tag for a given file # function print_image($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { print make_image($file, $alt, $align, $extras, $dir); } # make_submit() # - make a submit button image # function make_submit($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { if (!$dir) { $dir = '/gifs'; } $return = make_image($file, $alt, $align, $extras, $dir, $border); if ($return != "<img>") { $return = '<input type="image"'.substr($return,4); } else { $return = '<input type="submit">'; } return $return; } # delim() # print a pipe delimiter # function delim($color=false) { if (!$color) { return ' | '; } return sprintf('<font color="%s"> | </font>', $color ); } # hdelim() # print a horizontal delimiter (just a wide line); # function hdelim($color="#000000") { if (!$color) { return '<hr noshade size="1">'; } return sprintf('<hr noshade size="1" color="%s">', $color ); } # make_link() # return a hyperlink to something, within the site # function make_link ($url, $linktext=false, $target=false, $extras=false) { return sprintf("<a href=\"%s\"%s%s>%s</a>", $url, ($target ? ' target="'.$target.'"' : ''), ($extras ? ' '.$extras : ''), ($linktext ? $linktext : $url) ); } # print_link() # echo a hyperlink to something, within the site # function print_link($url, $linktext=false, $target=false, $extras=false) { echo make_link($url, $linktext, $target, $extras); } # commonheader() # # function commonHeader($title) { global $SIDEBAR_DATA; ?><html> <head> <title>PEAR: <?php echo $title; ?></title> <link rel="stylesheet" href="/style.css"> </head> <body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#ffffff" text="#000000" link="#003300" alink="#00ff99" vlink="#003300" ><a name="TOP"></a> <table border="0" cellspacing="0" cellpadding="0" height="48" width="100%"> <tr bgcolor="#009933"> <td align="left" rowspan="2" width="120"> <?php print_link('/', make_image('pearsmall.gif', 'PEAR', false, 'vspace="2" hspace="2"') ); ?><br> </td> <td align="right" valign="top"> <font color="#ffffff"><b> <?php echo strftime("%A, %B %d, %Y"); ?> </b> <br> </font> </td> </tr> <tr bgcolor="#009933"> <td align="right" valign="bottom"> <?php if ($HTTP_SERVER_VARS['PHP_AUTH_USER']) { print_link('/logout.php', 'logout', false, 'class="menuBlack"'); } else { print_link('/login.php', 'login', false, 'class="menuBlack"'); } echo delim(); print_link('/docs.php', 'documentation', false, 'class="menuBlack"'); ?> <br> <?php spacer(2,2); ?><br> </td> </tr> <tr bgcolor="#003300"><td colspan="2"><?php spacer(1,1);?><br></td></tr> <tr bgcolor="#006633"> <form method="POST" action="/search.php"> <td align="right" valign="top" colspan="2"><font color="#ffffff"> <small>search for</small> <INPUT CLASS="small" TYPE="text" NAME="pattern" VALUE="<? echo htmlspecialchars($prevsearch) ?>" SIZE="30"> <small>in the</small> <SELECT NAME="show" CLASS="small"> <OPTION VALUE="packages" SELECTED>packages <OPTION VALUE="nosource">whole site <OPTION VALUE="manual">online documentation <OPTION VALUE="bugdb">bug database <OPTION VALUE="maillist">general mailing list <OPTION VALUE="devlist">developer mailing list <OPTION VALUE="source">website source code </SELECT> <? echo make_submit('small_submit_white.gif', 'search', 'bottom'); ?> <br> </font></td> </form> </tr> <tr bgcolor="#003300"><td colspan="2"><?php spacer(1,1);?><br></td></tr> </table> <table cellpadding="0" cellspacing="0"> <tr valign="top"> <?php if (isset($SIDEBAR_DATA)):?> <td bgcolor="#f0f0f0"> <table width="149" cellpadding="4" cellspacing="0"> <tr valign="top"> <td class="sidebar"><?php echo $SIDEBAR_DATA?></td> </tr> </table> </td> <td bgcolor="#cccccc" background="/gifs/checkerboard.gif"><?php spacer(1,1);?><br></td> <?php endif; ?> <td> <table width="625" cellpadding="10" cellspacing="0"> <tr> <td valign="top"> <?php } # commonfooter() # # function commonFooter() { global $LAST_UPDATED, $MIRRORS, $MYSITE, $COUNTRIES; ?> <br> </td> </tr> </table> </td> </tr> </table> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr bgcolor="#003300"><td><?php spacer(1,1);?><br></td></tr> <tr bgcolor="#009933"> <form method="GET" action="/mirrors.php" onsubmit="return gotomirror(this);"> <td align="right" valign="bottom"> <script language="javascript"> <!-- function gotomirror(form) { url = form.country.options[form.country.selectedIndex].value; if (url != '<? echo $MYSITE; ?>') { window.location.href = url; } return false; } //--> </script> <input type="hidden" name="REDIRECT" value="1"> <?php # TODO: should send current url above, so we can redirect to # the same page on the mirror, and do the same in our javascript. print_link('/source.php?url='.$SCRIPT_NAME, 'show source', false, 'class="menuBlack"'); echo delim(); print_link('/credits.php', 'credits', false, 'class="menuBlack"'); echo delim(); print_link('/mirrors.php', 'mirror sites:', false, 'class="menuBlack"'); 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"; } } } echo "</select> "; echo make_submit('small_submit_black.gif', 'go', 'bottom' ); ?> <br> </td> </form> </tr> <tr bgcolor="#003300"><td><?php spacer(1,1); ?><br></td></tr> </table> <table border="0" cellspacing="0" cellpadding="6" width="100%"> <tr valign="top" bgcolor="#cccccc"> <td><small> <?php print_link('http://www.php.net/', make_image('php-logo.gif', 'PHP', 'left') ); ?> <?php print_link('/copyright.php', 'Copyright © 2001 The PHP Group'); ?><BR> All rights reserved.<BR> </small> </td> <td align="right"><small> This mirror generously provided by: <?php print_link($MIRRORS[$MYSITE][3], $MIRRORS[$MYSITE][1] ); ?><BR> Last updated: <?php echo strftime("%c %Z", $LAST_UPDATED); ?><BR> </small> </td> </tr> </table> </body> </html> <?php } Index: pearweb/include/site.php +++ pearweb/include/site.php <? /* Structure of MIRRORS array: 0 "country code", 1 "Mirror Name", 2 flag for whether local stats work (1) or not (0) on this mirror 3 "url for hosting company", 4 flag for whether site is a full mirror (1) or just a download site (0), or just a placeholder (2), 5 flag for whether search engine works (1) or not (0) on the site 6 default language code */ $MIRRORS = array( 'http://pear.php.net/' => array('us', 'VA Linux', 0, 'http://www.valinux.com/', 1, 0, 'en' ), 'http://pear.php.easydns.ca/' => array('ca', 'easyDNS Technologies', 0, 'http://www.easydns.com/', 1, 0, 'en' ) ); $COUNTRIES = array( 'au' => 'Australia', 'at' => 'Austria', 'be' => 'Belgium', 'bg' => 'Bulgaria', 'br' => 'Brazil', 'ca' => 'Canada', 'ch' => 'Switzerland', 'cl' => 'Chile', 'cn' => 'China', 'cz' => 'Czech Republic', 'de' => 'Germany', 'dk' => 'Denmark', 'ee' => 'Estonia', 'es' => 'Spain', 'fi' => 'Finland', 'fr' => 'France', 'gr' => 'Greece', 'hk' => 'China (Hong Kong)', 'hu' => 'Hungary', 'id' => 'Indonesia', 'ie' => 'Ireland', 'il' => 'Israel', 'it' => 'Italy', 'jp' => 'Japan', 'kr' => 'Korea', 'lv' => 'Latvia', 'mx' => 'Mexico', 'nl' => 'Netherlands', 'no' => 'Norway', 'nz' => 'New Zealand', 'ph' => 'Philippines', 'pl' => 'Poland', 'pt' => 'Portugal', 'ro' => 'Romania', 'ru' => 'Russian Federation', 'se' => 'Sweden', 'sk' => 'Slovakia', 'sg' => 'Singapore', 'th' => 'Thailand', 'tr' => 'Turkey', 'tw' => 'Taiwan', 'ua' => 'Ukraine', 'uk' => 'United Kingdom', 'us' => 'United States', 'za' => 'South Africa', 'xx' => 'Other' ); # http://www.unicode.org/unicode/onlinedat/languages.html $LANGUAGES = array( 'en' => 'English', 'pt_BR' => 'Brazilian Portuguese', 'bg' => 'Bulgarian', 'ca' => 'Catalan', 'zh' => 'Chinese', 'cs' => 'Czech', 'da' => 'Danish', 'nl' => 'Dutch', 'fi' => 'Finnish', 'fr' => 'French', 'de' => 'German', 'el' => 'Greek', 'hu' => 'Hungarian', 'it' => 'Italian', 'ja' => 'Japanese', 'kr' => 'Korean', # this should be 'ko'. its wrong in phpdoc. 'lv' => 'Latvian', 'no' => 'Norwegian', 'pl' => 'Polish', 'pt' => 'Portuguese', 'ro' => 'Romanian', 'ru' => 'Russian', 'sk' => 'Slovak', 'es' => 'Spanish', 'sv' => 'Swedish', 'th' => 'Thai', 'tr' => 'Turkish', 'uk' => 'Ukranian', ); $MYSITE = 'http://' . getenv('SERVER_NAME') . '/'; if (!isset($MIRRORS[$MYSITE])) { $MYSITE='http://' . preg_replace('/^www\./', '', $HTTP_HOST) . '/'; } if (!isset($MIRRORS[$MYSITE])) { $MIRRORS[$MYSITE] = array('xx', $MYSITE, 'none', $MYSITE, 2, 0, 'en'); } echo "<!-- $MYSITE -->"; ?> Index: pearweb/public_html/index2.php +++ pearweb/public_html/index2.php <?php response_header(); ?> <h1>Welcome to PEAR</h1> <P> Hello world. </P> <? response_footer(); ?>
Index: pearweb/include/pear-format-html.php diff -u pearweb/include/pear-format-html.php:1.3 pearweb/include/pear-format-html.php:1.4 --- pearweb/include/pear-format-html.php:1.3 Wed Apr 18 17:59:05 2001 +++ pearweb/include/pear-format-html.php Fri Apr 27 10:58:30 2001 @@ -1,42 +1,23 @@ <?php -$pear_green = "#00b03b"; +require_once 'layout.php'; -function response_header($title = "PEAR: the PHP Extension and Application Repository", - $style = false) + + +function response_header($title = 'The PHP Extension and Application Repository', $style = false) { - global $_style, $pear_green, $PHP_AUTH_USER, $PHP_AUTH_PW; - global $_header_done; + global $_style, $_header_done; if ($_header_done) { return; } $_header_done = true; $_style = $style; - print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"; - print "<HTML><HEAD>\n"; - print " <TITLE>$title</TITLE>\n"; - print "</HEAD>\n"; - print "<BODY BGCOLOR=\"#ffffff\" TEXT=\"#000000\">\n"; - print "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=\"100%\">\n"; - print "<TR BGCOLOR=\"$pear_green\"><TD ALIGN=\"left\">"; - print "<IMG SRC=\"/gifs/pearsmall.gif\" WIDTH=96 HEIGHT=48 ALT=\"\">"; - print "</TD><TD ALIGN=\"left\" VALIGN=\"top\">"; - print "<FONT SIZE=\"-1\">"; - if ($PHP_AUTH_USER) { - print " <FONT COLOR=\"#ffffff\">user: <B>$PHP_AUTH_USER</B></FONT>". - '<BR> <A HREF="logout.php"><FONT COLOR="#ffffff">'; - print "logout</FONT></A><BR>\n"; - } else { - print ' <A HREF="login.php"><FONT COLOR="#ffffff">'; - print "login</FONT></A><BR>\n"; - } - print "</TD><TD ALIGN=\"center\" VALIGN=\"middle\" WIDTH=\"100%\">"; - print "<FONT COLOR=\"#ffffff\" SIZE=\"+1\"><B>"; - print $title; - print "</B></FONT></TD></TR></TABLE>\n"; - print "<BR><BR>\n"; + + commonHeader($title); } + + function response_footer($style = false) { static $called; @@ -47,11 +28,17 @@ if (!$style) { $style = $GLOBALS['_style']; } - print "</BODY></HTML>\n"; + + commonFooter(); + } function menu_link($text, $url) { - print "<H3><A HREF=\"$url\"><IMG ALIGN=\"left\" SRC=\"/gifs/onlypear.gif\" WIDTH=19 HEIGHT=24 BORDER=0>$text</A></H3>\n"; + echo "<P>\n"; + print_link($url, make_image('pear_item.gif', $text) ); + echo ' '; + print_link($url, '<B>' . $text . '</B>' ); + echo "</P>\n"; } function report_error($error) Index: pearweb/public_html/gifs/pear.gif Index: pearweb/public_html/gifs/pearsmall.gif Index: pearweb/include/layout.php +++ pearweb/include/layout.php <?php /* $Id: layout.php,v 1.1 2001/04/27 17:58:30 cmv Exp $ */ require_once 'site.php'; # spacer() # print a IMG tag for a sized spacer GIF # function spacer($width=1, $height=1, $align=false, $extras=false) { printf('<img src="/gifs/spacer.gif" width="%d" height="%d" border="0" alt="" %s%s>', $width, $height, ($align ? 'align="'.$align.'" ' : ''), ($extras ? $extras : '') ); } # resize_image() # tag the output of make_image() and resize it manually # function resize_image($img, $width=1, $height=1) { $str = preg_replace('/width=\"([0-9]+?)\"/i', '', $img ); $str = preg_replace('/height=\"([0-9]+?)\"/i', '', $str ); $str = substr($str,0,-1) . sprintf(' height="%s" width="%s">', $height, $width ); return $str; } # make_image() # return an IMG tag for a given file (relative to the images dir) # function make_image($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { global $HTTP_SERVER_VARS; if (!$dir) { $dir = '/gifs'; } if ($size = @getimagesize($HTTP_SERVER_VARS['DOCUMENT_ROOT'].$dir.'/'.$file)) { $image = sprintf('<img src="%s/%s" border="%d" %s ALT="%s" %s%s>', $dir, $file, $border, $size[3], ($alt ? $alt : ''), ($align ? ' align="'.$align.'"' : ''), ($extras ? ' '.$extras : '') ); } else { $image = sprintf('<img src="%s/%s" border="%d" ALT="%s" %s%s>', $dir, $file, $border, ($alt ? $alt : ''), ($align ? ' ALIGN="'.$align.'"' : ''), ($extras ? ' '.$extras : '') ); } return $image; } # print_image() # print an IMG tag for a given file # function print_image($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { print make_image($file, $alt, $align, $extras, $dir); } # make_submit() # - make a submit button image # function make_submit($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { if (!$dir) { $dir = '/gifs'; } $return = make_image($file, $alt, $align, $extras, $dir, $border); if ($return != "<img>") { $return = '<input type="image"'.substr($return,4); } else { $return = '<input type="submit">'; } return $return; } # delim() # print a pipe delimiter # function delim($color=false) { if (!$color) { return ' | '; } return sprintf('<font color="%s"> | </font>', $color ); } # hdelim() # print a horizontal delimiter (just a wide line); # function hdelim($color="#000000") { if (!$color) { return '<hr noshade size="1">'; } return sprintf('<hr noshade size="1" color="%s">', $color ); } # make_link() # return a hyperlink to something, within the site # function make_link ($url, $linktext=false, $target=false, $extras=false) { return sprintf("<a href=\"%s\"%s%s>%s</a>", $url, ($target ? ' target="'.$target.'"' : ''), ($extras ? ' '.$extras : ''), ($linktext ? $linktext : $url) ); } # print_link() # echo a hyperlink to something, within the site # function print_link($url, $linktext=false, $target=false, $extras=false) { echo make_link($url, $linktext, $target, $extras); } # commonheader() # # function commonHeader($title) { global $SIDEBAR_DATA; ?><html> <head> <title>PEAR: <?php echo $title; ?></title> <link rel="stylesheet" href="/style.css"> </head> <body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#ffffff" text="#000000" link="#003300" alink="#00ff99" vlink="#003300" ><a name="TOP"></a> <table border="0" cellspacing="0" cellpadding="0" height="48" width="100%"> <tr bgcolor="#009933"> <td align="left" rowspan="2" width="120"> <?php print_link('/', make_image('pearsmall.gif', 'PEAR', false, 'vspace="2" hspace="2"') ); ?><br> </td> <td align="right" valign="top"> <font color="#ffffff"><b> <?php echo strftime("%A, %B %d, %Y"); ?> </b> <br> </font> </td> </tr> <tr bgcolor="#009933"> <td align="right" valign="bottom"> <?php if ($HTTP_SERVER_VARS['PHP_AUTH_USER']) { print_link('/logout.php', 'logout', false, 'class="menuBlack"'); } else { print_link('/login.php', 'login', false, 'class="menuBlack"'); } echo delim(); print_link('/docs.php', 'documentation', false, 'class="menuBlack"'); ?> <br> <?php spacer(2,2); ?><br> </td> </tr> <tr bgcolor="#003300"><td colspan="2"><?php spacer(1,1);?><br></td></tr> <tr bgcolor="#006633"> <form method="POST" action="/search.php"> <td align="right" valign="top" colspan="2"><font color="#ffffff"> <small>search for</small> <INPUT CLASS="small" TYPE="text" NAME="pattern" VALUE="<? echo htmlspecialchars($prevsearch) ?>" SIZE="30"> <small>in the</small> <SELECT NAME="show" CLASS="small"> <OPTION VALUE="packages" SELECTED>packages <OPTION VALUE="nosource">whole site <OPTION VALUE="manual">online documentation <OPTION VALUE="bugdb">bug database <OPTION VALUE="maillist">general mailing list <OPTION VALUE="devlist">developer mailing list <OPTION VALUE="source">website source code </SELECT> <? echo make_submit('small_submit_white.gif', 'search', 'bottom'); ?> <br> </font></td> </form> </tr> <tr bgcolor="#003300"><td colspan="2"><?php spacer(1,1);?><br></td></tr> </table> <table cellpadding="0" cellspacing="0"> <tr valign="top"> <?php if (isset($SIDEBAR_DATA)):?> <td bgcolor="#f0f0f0"> <table width="149" cellpadding="4" cellspacing="0"> <tr valign="top"> <td class="sidebar"><?php echo $SIDEBAR_DATA?></td> </tr> </table> </td> <td bgcolor="#cccccc" background="/gifs/checkerboard.gif"><?php spacer(1,1);?><br></td> <?php endif; ?> <td> <table width="625" cellpadding="10" cellspacing="0"> <tr> <td valign="top"> <?php } # commonfooter() # # function commonFooter() { global $LAST_UPDATED, $MIRRORS, $MYSITE, $COUNTRIES; ?> <br> </td> </tr> </table> </td> </tr> </table> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr bgcolor="#003300"><td><?php spacer(1,1);?><br></td></tr> <tr bgcolor="#009933"> <form method="GET" action="/mirrors.php" onsubmit="return gotomirror(this);"> <td align="right" valign="bottom"> <script language="javascript"> <!-- function gotomirror(form) { url = form.country.options[form.country.selectedIndex].value; if (url != '<? echo $MYSITE; ?>') { window.location.href = url; } return false; } //--> </script> <input type="hidden" name="REDIRECT" value="1"> <?php # TODO: should send current url above, so we can redirect to # the same page on the mirror, and do the same in our javascript. print_link('/source.php?url='.$SCRIPT_NAME, 'show source', false, 'class="menuBlack"'); echo delim(); print_link('/credits.php', 'credits', false, 'class="menuBlack"'); echo delim(); print_link('/mirrors.php', 'mirror sites:', false, 'class="menuBlack"'); 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"; } } } echo "</select> "; echo make_submit('small_submit_black.gif', 'go', 'bottom' ); ?> <br> </td> </form> </tr> <tr bgcolor="#003300"><td><?php spacer(1,1); ?><br></td></tr> </table> <table border="0" cellspacing="0" cellpadding="6" width="100%"> <tr valign="top" bgcolor="#cccccc"> <td><small> <?php print_link('http://www.php.net/', make_image('php-logo.gif', 'PHP', 'left') ); ?> <?php print_link('/copyright.php', 'Copyright © 2001 The PHP Group'); ?><BR> All rights reserved.<BR> </small> </td> <td align="right"><small> This mirror generously provided by: <?php print_link($MIRRORS[$MYSITE][3], $MIRRORS[$MYSITE][1] ); ?><BR> Last updated: <?php echo strftime("%c %Z", $LAST_UPDATED); ?><BR> </small> </td> </tr> </table> </body> </html> <?php } Index: pearweb/include/site.php +++ pearweb/include/site.php <? /* Structure of MIRRORS array: 0 "country code", 1 "Mirror Name", 2 flag for whether local stats work (1) or not (0) on this mirror 3 "url for hosting company", 4 flag for whether site is a full mirror (1) or just a download site (0), or just a placeholder (2), 5 flag for whether search engine works (1) or not (0) on the site 6 default language code */ $MIRRORS = array( 'http://pear.php.net/' => array('us', 'VA Linux', 0, 'http://www.valinux.com/', 1, 0, 'en' ), 'http://pear.php.easydns.ca/' => array('ca', 'easyDNS Technologies', 0, 'http://www.easydns.com/', 1, 0, 'en' ) ); $COUNTRIES = array( 'au' => 'Australia', 'at' => 'Austria', 'be' => 'Belgium', 'bg' => 'Bulgaria', 'br' => 'Brazil', 'ca' => 'Canada', 'ch' => 'Switzerland', 'cl' => 'Chile', 'cn' => 'China', 'cz' => 'Czech Republic', 'de' => 'Germany', 'dk' => 'Denmark', 'ee' => 'Estonia', 'es' => 'Spain', 'fi' => 'Finland', 'fr' => 'France', 'gr' => 'Greece', 'hk' => 'China (Hong Kong)', 'hu' => 'Hungary', 'id' => 'Indonesia', 'ie' => 'Ireland', 'il' => 'Israel', 'it' => 'Italy', 'jp' => 'Japan', 'kr' => 'Korea', 'lv' => 'Latvia', 'mx' => 'Mexico', 'nl' => 'Netherlands', 'no' => 'Norway', 'nz' => 'New Zealand', 'ph' => 'Philippines', 'pl' => 'Poland', 'pt' => 'Portugal', 'ro' => 'Romania', 'ru' => 'Russian Federation', 'se' => 'Sweden', 'sk' => 'Slovakia', 'sg' => 'Singapore', 'th' => 'Thailand', 'tr' => 'Turkey', 'tw' => 'Taiwan', 'ua' => 'Ukraine', 'uk' => 'United Kingdom', 'us' => 'United States', 'za' => 'South Africa', 'xx' => 'Other' ); # http://www.unicode.org/unicode/onlinedat/languages.html $LANGUAGES = array( 'en' => 'English', 'pt_BR' => 'Brazilian Portuguese', 'bg' => 'Bulgarian', 'ca' => 'Catalan', 'zh' => 'Chinese', 'cs' => 'Czech', 'da' => 'Danish', 'nl' => 'Dutch', 'fi' => 'Finnish', 'fr' => 'French', 'de' => 'German', 'el' => 'Greek', 'hu' => 'Hungarian', 'it' => 'Italian', 'ja' => 'Japanese', 'kr' => 'Korean', # this should be 'ko'. its wrong in phpdoc. 'lv' => 'Latvian', 'no' => 'Norwegian', 'pl' => 'Polish', 'pt' => 'Portuguese', 'ro' => 'Romanian', 'ru' => 'Russian', 'sk' => 'Slovak', 'es' => 'Spanish', 'sv' => 'Swedish', 'th' => 'Thai', 'tr' => 'Turkish', 'uk' => 'Ukranian', ); $MYSITE = 'http://' . getenv('SERVER_NAME') . '/'; if (!isset($MIRRORS[$MYSITE])) { $MYSITE='http://' . preg_replace('/^www\./', '', $HTTP_HOST) . '/'; } if (!isset($MIRRORS[$MYSITE])) { $MIRRORS[$MYSITE] = array('xx', $MYSITE, 'none', $MYSITE, 2, 0, 'en'); } echo "<!-- $MYSITE -->"; ?> Index: pearweb/public_html/index2.php +++ pearweb/public_html/index2.php <?php response_header(); ?> <h1>Welcome to PEAR</h1> <P> Hello world. </P> <? response_footer(); ?>