Commit: 02093c9cfcc2e3ace18068ecc45e702a31603e91 Author: Peter Cowburn <[email protected]> Wed, 20 Aug 2014 22:29:24 +0100 Parents: bf7b3ab6768d695d88289ec91a0240e30d4ddb86 Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=02093c9cfcc2e3ace18068ecc45e702a31603e91 Log: move mirror logo from homepage to mirror.php Mirror.php is a much more appropriate place to be showing off our mirror providers' logos. Changed paths: M index.php M mirror.php M mirroring.php Diff: diff --git a/index.php b/index.php index 80b0669..2a92f97 100644 --- a/index.php +++ b/index.php @@ -165,57 +165,12 @@ if (is_array($CONF_TEASER)) { $announcements = ''; } -$MIRROR_IMAGE = ''; - -// Try to find a sponsor image in case this is an official mirror -if (is_official_mirror()) { - - // Iterate through possible mirror provider logo types in priority order - $types = array("gif", "jpg", "png"); - while (list(,$ext) = each($types)) { - - // Check if file exists for this type - if (file_exists("backend/mirror." . $ext)) { - - // Add text to rigth sidebar - $MIRROR_IMAGE = "<div class='panel mirror-sponsor'>" - . '<a href="' . mirror_provider_url() . '">' - . "This mirror sponsored by</a><div class=\"body\">\n"; - - // Create image HTML code - $img = make_image( - 'mirror.' . $ext, - htmlspecialchars(mirror_provider()), - FALSE, - FALSE, - 'backend', - 0 - ); - - // Add size information depending on mirror type - if (is_primary_site() || is_backup_primary()) { - $img = resize_image($img, 125, 125); - } else { - $img = resize_image($img, 120, 60); - } - - // End mirror specific part - $MIRROR_IMAGE .= '<a class="mirror-logo" href="' . mirror_provider_url() . '" title="'.htmlspecialchars(mirror_provider()).'">' . - $img . "</a></div></div>\n"; - - // We have found an image - break; - } - } -} - $SIDEBAR = <<< SIDEBAR_DATA <p class='panel'><a href='/migration55' title='Upgrading to PHP 5.5' class='headline'>Upgrading to PHP 5.5</a></p> $announcements <p class='panel'><a href='/cal.php'>User Group Events</a></p> <p class='panel'><a href='/thanks.php'>Special Thanks</a></p> -$MIRROR_IMAGE <p class='panel social-media'> <a class='headline' href="https://twitter.com/official_php"> <i class="icon-twitter"></i> diff --git a/mirror.php b/mirror.php index 9c77962..a6b1b66 100644 --- a/mirror.php +++ b/mirror.php @@ -16,6 +16,41 @@ $SIDEBAR_DATA = ' mirroring page</a>. </p> '; + +$MIRROR_IMAGE = ''; + +// Try to find a sponsor image in case this is an official mirror +if (is_official_mirror()) { + + // Iterate through possible mirror provider logo types in priority order + $types = array("gif", "jpg", "png"); + while (list(,$ext) = each($types)) { + + // Check if file exists for this type + if (file_exists("backend/mirror." . $ext)) { + + // Create image HTML code + $MIRROR_IMAGE = make_image( + 'mirror.' . $ext, + htmlspecialchars(mirror_provider()), + FALSE, + FALSE, + 'backend', + 0 + ); + + // Add size information depending on mirror type + if (is_primary_site() || is_backup_primary()) { + $MIRROR_IMAGE = resize_image($MIRROR_IMAGE, 125, 125); + } else { + $MIRROR_IMAGE = resize_image($MIRROR_IMAGE, 120, 60); + } + + // We have found an image + break; + } + } +} site_header("Information About This PHP Mirror Site", array("current" => "community")); ?> @@ -35,11 +70,20 @@ site_header("Information About This PHP Mirror Site", array("current" => "commun <ul> <li>This site is <?php echo is_official_mirror() ? "" : "not"; ?> an official PHP.net mirror site</li> <li>The mirror site's address is <?php print_link($MYSITE); ?></li> - <?php if (is_official_mirror()) { ?> - <li>The provider of this mirror is <?php print_link(mirror_provider_url(), mirror_provider()); ?></li> - <?php } ?> </ul> +<?php if (is_official_mirror()) { ?> +<h2>Mirror Provider</h2> +<ul> + <li> + <p>The provider of this mirror is <?php print_link(mirror_provider_url(), mirror_provider()); ?></p> + <?php if ($MIRROR_IMAGE) { ?> + <p><?php echo $MIRROR_IMAGE; ?></p> + <?php } ?> + </li> +</ul> +<?php } ?> + <h2>Mirror Services</h2> <ul> diff --git a/mirroring.php b/mirroring.php index 63ef61f..bfa3742 100644 --- a/mirroring.php +++ b/mirroring.php @@ -369,7 +369,7 @@ site_header( <ul> <li>Create a 120 x 60 pixel sized logo button.</li> <li>Copy it to your <code>/www/htdocs/phpweb/backend</code> folder as <code>mirror.gif</code>, <code>mirror.jpg</code> or <code>mirror.png</code>.</li> - <li>Go visit your mirror URL and check if it is there.</li> + <li>Go visit your mirror URL (e.g. http://foo.php.net/mirror.php) and check if it is there.</li> </ul> <p> -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
