1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

move mirror logo from homepage to mirror.php

Mirror.php is a much more appropriate place to be showing off our mirror
providers' logos.
This commit is contained in:
Peter Cowburn
2014-08-20 22:29:24 +01:00
parent bf7b3ab676
commit 02093c9cfc
3 changed files with 48 additions and 49 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>