cvs: phpweb / README.mirror index.php style.css /include layout.inc prepend.inc
| From: | James Cox | Date: | Tue, 13 Aug 2002 02:14:44 +0000 |
| Subject: | cvs: phpweb / README.mirror index.php style.css /include layout.inc prepend.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-11874@lists.php.net to get a copy of this message | ||
imajes Mon Aug 12 22:14:44 2002 EDT
Modified files:
/phpweb README.mirror index.php style.css
/phpweb/include layout.inc prepend.inc
Log:
Part of our getting the new server is that we allow the hosting provider to display a banner. We
would like to give other mirrors this opportunity too -- instructions in the readme.
also, some mirror redirection stuff ended up in here, but i felt it important to commit (with
commented out code) and start from there, as my code was getting quite stale.
Index: phpweb/README.mirror diff -u phpweb/README.mirror:1.49 phpweb/README.mirror:1.50 --- phpweb/README.mirror:1.49 Fri Aug 2 07:51:02 2002 +++ phpweb/README.mirror Mon Aug 12 22:14:44 2002 @@ -1,4 +1,4 @@ -MIRRORING OF THE PHP.NET WEBSITE + MIRRORING OF THE PHP.NET WEBSITE ------------------------------------------------------------------------ If you want to become an official PHP mirror, please be sure to @@ -7,8 +7,8 @@ yourself), and be prepared for some reasonably significant bandwidth usage (a reasonable estimate as of 2/2002 is 150MB/day). -Also, we are currently only accepting new official mirrors in -countries where we don't already have two active official mirrors. +** Also, we are currently only accepting new official mirrors in +countries where we don't already have two active official mirrors. ** The PHP website requires PHP 4. @@ -121,7 +121,24 @@ you can subscribe, by sending an empty message to: php-mirrors-subscribe@lists.php.net +We would like to thank you for providing php.net with a mirror, so +if you would like to display a logo on the site promoting your mirror, +you are able to do so by following these steps: + +- Create a logo button 120 x 60 pixels. +- copy it to your /local/path/to/phpweb/backend as "mirror.gif". +- go visit your mirror url. + +The PHP Group do reserve the right to refuse images based on content, but +most things should be fine. + +We have chosen mirror sizes that go along with the Internet Advertising Bureau +standards < http://www.iab.net/iab_banner_standards/bannersizes.html >. + And finally, don't forget to put a nice little PHP logo somewhere on your hosting company's site if possible. Grab one of the logos from the "Download PHP Logos and Icons" page on the PHP site, and link it to your mirror. + + +Thank you for being a mirror! Index: phpweb/index.php diff -u phpweb/index.php:1.272 phpweb/index.php:1.273 --- phpweb/index.php:1.272 Tue Aug 6 04:29:58 2002 +++ phpweb/index.php Mon Aug 12 22:14:44 2002 @@ -62,9 +62,10 @@ <h3>' . make_link("/thanks.php", "Thanks To") . '</h3> ' . make_link("http://www.easydns.com/?V=698570efeb62a6e2", "easyDNS") . '<br> ' . make_link("http://promote.pair.com/direct.pl?php.net", "pair Networks") . '<br> - ' . make_link("http://www.rackspace.com/?supbid=php.net", "Rackspace") . '<br> + ' . make_link("http://www.rackshack.net/", "RackShack") . ' <br> ' . make_link("http://www.synacor.com/", "Synacor") . '<br> - ' . make_link("http://vasoftware.com/", "VA Software Corporation") . '<br> + ' . make_link("http://vasoftware.com/", "VA Software Corporation") . '<br> + ' . make_link("http://www.rackspace.com/?supbid=php.net", "Rackspace") . '<br> <h3>Related sites</h3> ' . make_link("http://www.apache.org/", "Apache") . '<br> ' . make_link("http://www.mysql.com/", "MySQL") . '<br> @@ -82,6 +83,19 @@ make_link('http://bugs.php.net/', 'bug system') . '. </p> '; + +// do the mirror logo segment of the RSIDEBAR. +if(file_exists("backend/mirror.gif")) { + $RSIDEBAR_DATA .= "<center><h3>This mirror sponsored by:</h3>\n + <a href='" . $MIRRORS[$MYSITE]['3'] . "'>"; + if($MIRRORS[$MYSITE]['4'] === 2) { + $RSIDEBAR_DATA .= "<img src='backend/mirror.gif' width='125' height='125' alt='mirror sponsor' border='0' /></a></center><br />"; + } else { + $RSIDEBAR_DATA .= "<img src='backend/mirror.gif' width='120' height='60' alt='mirror sponsor' border='0' /></a></c\ +enter><br />"; + } + sprintf("%s", hdelim()); +} // Open events CVS file, and print out event title $fp = @fopen("backend/events.csv", "r"); Index: phpweb/style.css diff -u phpweb/style.css:1.29 phpweb/style.css:1.30 --- phpweb/style.css:1.29 Fri May 24 07:32:01 2002 +++ phpweb/style.css Mon Aug 12 22:14:44 2002 @@ -1,6 +1,6 @@ body, ul, td, th { font-family: verdana,arial,helvetica,sans-serif; - font-size: 90%; + font-size: 85%; } p { @@ -22,13 +22,14 @@ } .newsDate { - font-size: 85%; + font-size: 75%; font-style: italic; color: #6666cc; } .sidebar { - font-size: 85%; + font-size: 80%; + padding: 5px; } .sidebar p { @@ -37,12 +38,12 @@ code, pre, tt { font-family: Courier, "Courier New", monospace; - font-size: 90%; + font-size: 80%; } h1 { font-family: verdana,arial,helvetica,sans-serif; - font-size: 140%; + font-size: 130%; font-weight: bold; color: #000066; } @@ -160,4 +161,12 @@ .parameter:after { content: " "; -} \ No newline at end of file +} + +div.mirror { + border: 1px dashed #660000; + background: #fee; + color: #660000; + margin: 4px; + padding: 6px; +} \ No newline at end of file Index: phpweb/include/layout.inc diff -u phpweb/include/layout.inc:1.94 phpweb/include/layout.inc:1.95 --- phpweb/include/layout.inc:1.94 Sun Aug 11 13:43:29 2002 +++ phpweb/include/layout.inc Mon Aug 12 22:14:44 2002 @@ -1,5 +1,5 @@ <?php -/* $Id: layout.inc,v 1.94 2002/08/11 17:43:29 markonen Exp $ */ +/* $Id: layout.inc,v 1.95 2002/08/13 02:14:44 imajes Exp $ */ # spacer() # print a IMG tag for a sized spacer GIF @@ -201,7 +201,7 @@ <body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#ffffff" text="#000000" link="#000099" alink="#0000ff" vlink="#000099"> -<!--UdmComment--> + <table border="0" cellspacing="0" cellpadding="0" height="48" width="100%"> <tr bgcolor="#9999cc"> <td align="center" rowspan="2" width="120"><a href="/"><?php print_image('php_logo.gif', 'PHP'); ?></a></td> @@ -250,9 +250,8 @@ </font> </td> </tr> - <tr bgcolor="#333366"><td colspan="2"><?php spacer(1,1);?></td></tr> + <tr bgcolor="#333366"><td colspan="3"><?php spacer(1,1);?></td></tr> </table> -<!--/UdmComment--> <?php if (!$dont_enclose): @@ -270,11 +269,16 @@ <td bgcolor="#cccccc" background="/gifs/checkerboard.gif" width="1"><?php spacer(1,1);?></td> <?php endif; ?> <td> - <table cellpadding="10" cellspacing="0" width="620"> + <table cellpadding="10" cellspacing="0" width="100%"> <tr><td valign="top"> <?php endif; -} +/* don't show this yet ... ?> + <div class="mirror"> + You are using <?php echo $MYSITE; ?>. However, foo.php.net is closer. We would appreciate if you could use that mirror. + </div> + +<? */ } # commonfooter() @@ -283,9 +287,7 @@ function commonFooter() { global $SCRIPT_NAME,$MYSITE,$LAST_UPDATED,$PHP_SELF,$enclosed, $RSIDEBAR_DATA; - echo "<!--UdmComment-->"; if ($enclosed) { - spacer(620); echo "</td></tr></table></td>"; if(isset($RSIDEBAR_DATA)) {?> <td bgcolor="#cccccc" background="/gifs/checkerboard.gif" width="1"><?php spacer(1,1);?></td> @@ -329,11 +331,7 @@ print_link('/stats/', 'stats', false, 'class="small"'); echo delim(); } - print_link('/mirrors.php', 'mirror sites:', false, 'class="small"'); - echo " <select class=\"small\" name=\"country\" onchange=\"gotomirror(this.form)\">\n"; - show_mirror_options($MYSITE); - echo "</select> "; - echo make_submit('small_submit.gif', 'go', 'bottom' ); + print_link('/mirrors.php', 'mirror sites', false, 'class="small"'); ?> </form> </td> @@ -451,6 +449,19 @@ <tr bgcolor="#eeeeee"><td><?php echo preg_replace("/\r?\n\r?\n/","<br /><br />",trim($event['ldesc'])); if ($event['url']) {?><br /><br /><b>URL:</b> <?php echo '<a href="',htmlentities($event['url']),'">',htmlentities($event['url']),'</a>'; }?></td></tr> </table> <?php +} + +function calc_distance($from,$to) { + $lat1 = pi()/180 * $from['lat']; + $lat2 = pi()/180 * $to['lat']; + $lon1 = pi()/180 * $from['lon']; + $lon2 = pi()/180 * $to['lon']; + + $dlat = $lat2 - $lat1; + $dlon = $lon2 - $lon1; + + $t = pow(sin($dlat/2), 2) + cos($lat1)*cos($lat2)*pow(sin($dlon/2),2); + return atan2(sqrt($t),sqrt(1-$t)); } ?> Index: phpweb/include/prepend.inc diff -u phpweb/include/prepend.inc:1.6 phpweb/include/prepend.inc:1.7 --- phpweb/include/prepend.inc:1.6 Thu Aug 2 11:08:27 2001 +++ phpweb/include/prepend.inc Mon Aug 12 22:14:44 2002 @@ -3,6 +3,7 @@ unset($RSIDEBAR_DATA); require_once 'site.inc'; require_once 'layout.inc'; +require_once 'geoip.inc'; # this file is generated on rsync.php.net and propogated # from there it just defines $LAST_UPDATED.
Index: phpweb/README.mirror diff -u phpweb/README.mirror:1.49 phpweb/README.mirror:1.50 --- phpweb/README.mirror:1.49 Fri Aug 2 07:51:02 2002 +++ phpweb/README.mirror Mon Aug 12 22:14:44 2002 @@ -1,4 +1,4 @@ -MIRRORING OF THE PHP.NET WEBSITE + MIRRORING OF THE PHP.NET WEBSITE ------------------------------------------------------------------------ If you want to become an official PHP mirror, please be sure to @@ -7,8 +7,8 @@ yourself), and be prepared for some reasonably significant bandwidth usage (a reasonable estimate as of 2/2002 is 150MB/day). -Also, we are currently only accepting new official mirrors in -countries where we don't already have two active official mirrors. +** Also, we are currently only accepting new official mirrors in +countries where we don't already have two active official mirrors. ** The PHP website requires PHP 4. @@ -121,7 +121,24 @@ you can subscribe, by sending an empty message to: php-mirrors-subscribe@lists.php.net +We would like to thank you for providing php.net with a mirror, so +if you would like to display a logo on the site promoting your mirror, +you are able to do so by following these steps: + +- Create a logo button 120 x 60 pixels. +- copy it to your /local/path/to/phpweb/backend as "mirror.gif". +- go visit your mirror url. + +The PHP Group do reserve the right to refuse images based on content, but +most things should be fine. + +We have chosen mirror sizes that go along with the Internet Advertising Bureau +standards < http://www.iab.net/iab_banner_standards/bannersizes.html >. + And finally, don't forget to put a nice little PHP logo somewhere on your hosting company's site if possible. Grab one of the logos from the "Download PHP Logos and Icons" page on the PHP site, and link it to your mirror. + + +Thank you for being a mirror! Index: phpweb/index.php diff -u phpweb/index.php:1.272 phpweb/index.php:1.273 --- phpweb/index.php:1.272 Tue Aug 6 04:29:58 2002 +++ phpweb/index.php Mon Aug 12 22:14:44 2002 @@ -62,9 +62,10 @@ <h3>' . make_link("/thanks.php", "Thanks To") . '</h3> ' . make_link("http://www.easydns.com/?V=698570efeb62a6e2", "easyDNS") . '<br> ' . make_link("http://promote.pair.com/direct.pl?php.net", "pair Networks") . '<br> - ' . make_link("http://www.rackspace.com/?supbid=php.net", "Rackspace") . '<br> + ' . make_link("http://www.rackshack.net/", "RackShack") . ' <br> ' . make_link("http://www.synacor.com/", "Synacor") . '<br> - ' . make_link("http://vasoftware.com/", "VA Software Corporation") . '<br> + ' . make_link("http://vasoftware.com/", "VA Software Corporation") . '<br> + ' . make_link("http://www.rackspace.com/?supbid=php.net", "Rackspace") . '<br> <h3>Related sites</h3> ' . make_link("http://www.apache.org/", "Apache") . '<br> ' . make_link("http://www.mysql.com/", "MySQL") . '<br> @@ -82,6 +83,19 @@ make_link('http://bugs.php.net/', 'bug system') . '. </p> '; + +// do the mirror logo segment of the RSIDEBAR. +if(file_exists("backend/mirror.gif")) { + $RSIDEBAR_DATA .= "<center><h3>This mirror sponsored by:</h3>\n + <a href='" . $MIRRORS[$MYSITE]['3'] . "'>"; + if($MIRRORS[$MYSITE]['4'] === 2) { + $RSIDEBAR_DATA .= "<img src='backend/mirror.gif' width='125' height='125' alt='mirror sponsor' border='0' /></a></center><br />"; + } else { + $RSIDEBAR_DATA .= "<img src='backend/mirror.gif' width='120' height='60' alt='mirror sponsor' border='0' /></a></c\ +enter><br />"; + } + sprintf("%s", hdelim()); +} // Open events CVS file, and print out event title $fp = @fopen("backend/events.csv", "r"); Index: phpweb/style.css diff -u phpweb/style.css:1.29 phpweb/style.css:1.30 --- phpweb/style.css:1.29 Fri May 24 07:32:01 2002 +++ phpweb/style.css Mon Aug 12 22:14:44 2002 @@ -1,6 +1,6 @@ body, ul, td, th { font-family: verdana,arial,helvetica,sans-serif; - font-size: 90%; + font-size: 85%; } p { @@ -22,13 +22,14 @@ } .newsDate { - font-size: 85%; + font-size: 75%; font-style: italic; color: #6666cc; } .sidebar { - font-size: 85%; + font-size: 80%; + padding: 5px; } .sidebar p { @@ -37,12 +38,12 @@ code, pre, tt { font-family: Courier, "Courier New", monospace; - font-size: 90%; + font-size: 80%; } h1 { font-family: verdana,arial,helvetica,sans-serif; - font-size: 140%; + font-size: 130%; font-weight: bold; color: #000066; } @@ -160,4 +161,12 @@ .parameter:after { content: " "; -} \ No newline at end of file +} + +div.mirror { + border: 1px dashed #660000; + background: #fee; + color: #660000; + margin: 4px; + padding: 6px; +} \ No newline at end of file Index: phpweb/include/layout.inc diff -u phpweb/include/layout.inc:1.94 phpweb/include/layout.inc:1.95 --- phpweb/include/layout.inc:1.94 Sun Aug 11 13:43:29 2002 +++ phpweb/include/layout.inc Mon Aug 12 22:14:44 2002 @@ -1,5 +1,5 @@ <?php -/* $Id: layout.inc,v 1.94 2002/08/11 17:43:29 markonen Exp $ */ +/* $Id: layout.inc,v 1.95 2002/08/13 02:14:44 imajes Exp $ */ # spacer() # print a IMG tag for a sized spacer GIF @@ -201,7 +201,7 @@ <body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#ffffff" text="#000000" link="#000099" alink="#0000ff" vlink="#000099"> -<!--UdmComment--> + <table border="0" cellspacing="0" cellpadding="0" height="48" width="100%"> <tr bgcolor="#9999cc"> <td align="center" rowspan="2" width="120"><a href="/"><?php print_image('php_logo.gif', 'PHP'); ?></a></td> @@ -250,9 +250,8 @@ </font> </td> </tr> - <tr bgcolor="#333366"><td colspan="2"><?php spacer(1,1);?></td></tr> + <tr bgcolor="#333366"><td colspan="3"><?php spacer(1,1);?></td></tr> </table> -<!--/UdmComment--> <?php if (!$dont_enclose): @@ -270,11 +269,16 @@ <td bgcolor="#cccccc" background="/gifs/checkerboard.gif" width="1"><?php spacer(1,1);?></td> <?php endif; ?> <td> - <table cellpadding="10" cellspacing="0" width="620"> + <table cellpadding="10" cellspacing="0" width="100%"> <tr><td valign="top"> <?php endif; -} +/* don't show this yet ... ?> + <div class="mirror"> + You are using <?php echo $MYSITE; ?>. However, foo.php.net is closer. We would appreciate if you could use that mirror. + </div> + +<? */ } # commonfooter() @@ -283,9 +287,7 @@ function commonFooter() { global $SCRIPT_NAME,$MYSITE,$LAST_UPDATED,$PHP_SELF,$enclosed, $RSIDEBAR_DATA; - echo "<!--UdmComment-->"; if ($enclosed) { - spacer(620); echo "</td></tr></table></td>"; if(isset($RSIDEBAR_DATA)) {?> <td bgcolor="#cccccc" background="/gifs/checkerboard.gif" width="1"><?php spacer(1,1);?></td> @@ -329,11 +331,7 @@ print_link('/stats/', 'stats', false, 'class="small"'); echo delim(); } - print_link('/mirrors.php', 'mirror sites:', false, 'class="small"'); - echo " <select class=\"small\" name=\"country\" onchange=\"gotomirror(this.form)\">\n"; - show_mirror_options($MYSITE); - echo "</select> "; - echo make_submit('small_submit.gif', 'go', 'bottom' ); + print_link('/mirrors.php', 'mirror sites', false, 'class="small"'); ?> </form> </td> @@ -451,6 +449,19 @@ <tr bgcolor="#eeeeee"><td><?php echo preg_replace("/\r?\n\r?\n/","<br /><br />",trim($event['ldesc'])); if ($event['url']) {?><br /><br /><b>URL:</b> <?php echo '<a href="',htmlentities($event['url']),'">',htmlentities($event['url']),'</a>'; }?></td></tr> </table> <?php +} + +function calc_distance($from,$to) { + $lat1 = pi()/180 * $from['lat']; + $lat2 = pi()/180 * $to['lat']; + $lon1 = pi()/180 * $from['lon']; + $lon2 = pi()/180 * $to['lon']; + + $dlat = $lat2 - $lat1; + $dlon = $lon2 - $lon1; + + $t = pow(sin($dlat/2), 2) + cos($lat1)*cos($lat2)*pow(sin($dlon/2),2); + return atan2(sqrt($t),sqrt(1-$t)); } ?> Index: phpweb/include/prepend.inc diff -u phpweb/include/prepend.inc:1.6 phpweb/include/prepend.inc:1.7 --- phpweb/include/prepend.inc:1.6 Thu Aug 2 11:08:27 2001 +++ phpweb/include/prepend.inc Mon Aug 12 22:14:44 2002 @@ -3,6 +3,7 @@ unset($RSIDEBAR_DATA); require_once 'site.inc'; require_once 'layout.inc'; +require_once 'geoip.inc'; # this file is generated on rsync.php.net and propogated # from there it just defines $LAST_UPDATED.