Skip to content

Commit 02093c9

Browse files
committed
move mirror logo from homepage to mirror.php
Mirror.php is a much more appropriate place to be showing off our mirror providers' logos.
1 parent bf7b3ab commit 02093c9

File tree

3 files changed

+48
-49
lines changed

3 files changed

+48
-49
lines changed

index.php

-45
Original file line numberDiff line numberDiff line change
@@ -165,57 +165,12 @@
165165
$announcements = '';
166166
}
167167

168-
$MIRROR_IMAGE = '';
169-
170-
// Try to find a sponsor image in case this is an official mirror
171-
if (is_official_mirror()) {
172-
173-
// Iterate through possible mirror provider logo types in priority order
174-
$types = array("gif", "jpg", "png");
175-
while (list(,$ext) = each($types)) {
176-
177-
// Check if file exists for this type
178-
if (file_exists("backend/mirror." . $ext)) {
179-
180-
// Add text to rigth sidebar
181-
$MIRROR_IMAGE = "<div class='panel mirror-sponsor'>"
182-
. '<a href="' . mirror_provider_url() . '">'
183-
. "This mirror sponsored by</a><div class=\"body\">\n";
184-
185-
// Create image HTML code
186-
$img = make_image(
187-
'mirror.' . $ext,
188-
htmlspecialchars(mirror_provider()),
189-
FALSE,
190-
FALSE,
191-
'backend',
192-
0
193-
);
194-
195-
// Add size information depending on mirror type
196-
if (is_primary_site() || is_backup_primary()) {
197-
$img = resize_image($img, 125, 125);
198-
} else {
199-
$img = resize_image($img, 120, 60);
200-
}
201-
202-
// End mirror specific part
203-
$MIRROR_IMAGE .= '<a class="mirror-logo" href="' . mirror_provider_url() . '" title="'.htmlspecialchars(mirror_provider()).'">' .
204-
$img . "</a></div></div>\n";
205-
206-
// We have found an image
207-
break;
208-
}
209-
}
210-
}
211-
212168
$SIDEBAR = <<< SIDEBAR_DATA
213169
214170
<p class='panel'><a href='/migration55' title='Upgrading to PHP 5.5' class='headline'>Upgrading to PHP 5.5</a></p>
215171
$announcements
216172
<p class='panel'><a href='/cal.php'>User Group Events</a></p>
217173
<p class='panel'><a href='/thanks.php'>Special Thanks</a></p>
218-
$MIRROR_IMAGE
219174
<p class='panel social-media'>
220175
<a class='headline' href="https://twitter.com/official_php">
221176
<i class="icon-twitter"></i>

mirror.php

+47-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,41 @@
1616
mirroring page</a>.
1717
</p>
1818
';
19+
20+
$MIRROR_IMAGE = '';
21+
22+
// Try to find a sponsor image in case this is an official mirror
23+
if (is_official_mirror()) {
24+
25+
// Iterate through possible mirror provider logo types in priority order
26+
$types = array("gif", "jpg", "png");
27+
while (list(,$ext) = each($types)) {
28+
29+
// Check if file exists for this type
30+
if (file_exists("backend/mirror." . $ext)) {
31+
32+
// Create image HTML code
33+
$MIRROR_IMAGE = make_image(
34+
'mirror.' . $ext,
35+
htmlspecialchars(mirror_provider()),
36+
FALSE,
37+
FALSE,
38+
'backend',
39+
0
40+
);
41+
42+
// Add size information depending on mirror type
43+
if (is_primary_site() || is_backup_primary()) {
44+
$MIRROR_IMAGE = resize_image($MIRROR_IMAGE, 125, 125);
45+
} else {
46+
$MIRROR_IMAGE = resize_image($MIRROR_IMAGE, 120, 60);
47+
}
48+
49+
// We have found an image
50+
break;
51+
}
52+
}
53+
}
1954
site_header("Information About This PHP Mirror Site", array("current" => "community"));
2055
?>
2156

@@ -35,11 +70,20 @@
3570
<ul>
3671
<li>This site is <?php echo is_official_mirror() ? "" : "not"; ?> an official PHP.net mirror site</li>
3772
<li>The mirror site's address is <?php print_link($MYSITE); ?></li>
38-
<?php if (is_official_mirror()) { ?>
39-
<li>The provider of this mirror is <?php print_link(mirror_provider_url(), mirror_provider()); ?></li>
40-
<?php } ?>
4173
</ul>
4274

75+
<?php if (is_official_mirror()) { ?>
76+
<h2>Mirror Provider</h2>
77+
<ul>
78+
<li>
79+
<p>The provider of this mirror is <?php print_link(mirror_provider_url(), mirror_provider()); ?></p>
80+
<?php if ($MIRROR_IMAGE) { ?>
81+
<p><?php echo $MIRROR_IMAGE; ?></p>
82+
<?php } ?>
83+
</li>
84+
</ul>
85+
<?php } ?>
86+
4387
<h2>Mirror Services</h2>
4488

4589
<ul>

mirroring.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369
<ul>
370370
<li>Create a 120 x 60 pixel sized logo button.</li>
371371
<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>
372-
<li>Go visit your mirror URL and check if it is there.</li>
372+
<li>Go visit your mirror URL (e.g. http://foo.php.net/mirror.php) and check if it is there.</li>
373373
</ul>
374374

375375
<p>

0 commit comments

Comments
 (0)