cvs: phpweb / index.php /include layout.inc

From: Date: Tue, 27 Jan 2004 08:33:48 +0000
Subject: cvs: phpweb / index.php /include layout.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-23200@lists.php.net to get a copy of this message
goba Tue Jan 27 03:33:48 2004 EDT Modified files: /phpweb index.php /phpweb/include layout.inc Log: Only allow official mirrors to have the sponsor image on the left of the homepage, plus provide a different footer text for not registered mirrors. http://cvs.php.net/diff.php/phpweb/index.php?r1=1.513&r2=1.514&ty=u Index: phpweb/index.php diff -u phpweb/index.php:1.513 phpweb/index.php:1.514 --- phpweb/index.php:1.513 Mon Jan 26 10:50:18 2004 +++ phpweb/index.php Tue Jan 27 03:33:46 2004 @@ -97,39 +97,43 @@ $MIRROR_IMAGE = ''; -// 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 align=\"center\"><h3>This mirror sponsored by:</h3>\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); - } +// Try to find a sponsor image in case this is an official mirror +if (is_official_mirror()) { - // End mirror specific part - $MIRROR_IMAGE .= '<a href="' . mirror_provider_url() . '">' . - $img . "</a></div><br /><hr />\n"; + // 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 align=\"center\"><h3>This mirror sponsored by:</h3>\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 href="' . mirror_provider_url() . '">' . + $img . "</a></div><br /><hr />\n"; - // We have found an image - break; + // We have found an image + break; + } } } http://cvs.php.net/diff.php/phpweb/include/layout.inc?r1=1.200&r2=1.201&ty=u Index: phpweb/include/layout.inc diff -u phpweb/include/layout.inc:1.200 phpweb/include/layout.inc:1.201 --- phpweb/include/layout.inc:1.200 Sat Jan 3 09:45:12 2004 +++ phpweb/include/layout.inc Tue Jan 27 03:33:48 2004 @@ -1,5 +1,5 @@ <?php -/* $Id: layout.inc,v 1.200 2004/01/03 14:45:12 goba Exp $ */ +/* $Id: layout.inc,v 1.201 2004/01/27 08:33:48 goba Exp $ */ // Set the static content root differently on php.net $_SERVER['STATIC_ROOT'] = ($MYSITE == 'http://www.php.net/') ? @@ -183,6 +183,9 @@ $stats = (have_stats() ? "\n <a href=\"/stats/\">stats</a> |" : ""); $provider_url = mirror_provider_url(); $provider_name = mirror_provider(); + $mirror_text = (is_official_mirror() ? + "<a href=\"/mirror.php\">This mirror</a> generously provided by:" : + "<a href=\"/mirror.php\">This unofficial mirror</a> is operated at:"); $last_updated = strftime("%c %Z", $LAST_UPDATED); $layout_helper = ($PAGE_COLUMNS > 2 ? "</div>" : ""); $functionsjs = (in_array("functionsjs", $config) ? "\n<script src=\"" . $_SERVER['STATIC_ROOT'] . '/functions.js" type="text/javascript"></script>' : ''); @@ -208,7 +211,7 @@ </div> <div id="thismirror"> - <a href="/mirror.php">This mirror</a> generously provided by: + {$mirror_text} <a href="{$provider_url}">{$provider_name}</a><br /> Last updated: {$last_updated} </div> @@ -573,7 +576,11 @@ <tr valign="top" bgcolor="#cccccc"> <td><small><?php echo make_link('/copyright.php', 'Copyright &copy; 2001-2004 The PHP Group'); ?><br />All rights reserved.</small></td> <td align="right"><small> - <a href="/mirror.php">This mirror</a> generously provided by: + <?php + echo (is_official_mirror() ? + "<a href=\"/mirror.php\">This mirror</a> generously provided by:" : + "<a href=\"/mirror.php\">This unofficial mirror</a> is operated at:"); + ?> <a href="<?php echo mirror_provider_url();?>"><?php echo mirror_provider();?></a><br /> Last updated: <?php echo strftime("%c %Z", $LAST_UPDATED); ?> </small>

« previous php.mirrors (#23200) next »