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

Add mirror sponsor logo back to homepage sidebar

This commit is contained in:
Peter Cowburn
2014-08-18 21:35:28 +01:00
parent 635dbd4bb1
commit 0c461e0a6a
2 changed files with 50 additions and 0 deletions

View File

@@ -165,12 +165,57 @@ 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

@@ -122,6 +122,11 @@ p.archive {
}
}
/* Homepage mirror sponsor */
aside.tips .mirror-sponsor {
padding-top: 1.5rem;
}
/* Social media buttons. */
aside.tips .social-media {
padding-top: 2em;