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

Spruce up the search results page a bit. We need icons for talks, bugs,

cvs, pecl4win and whatever other top-level sites may pop up here.
This commit is contained in:
Rasmus Lerdorf
2006-02-28 21:59:20 +00:00
parent 56c9734579
commit 0f206e9ec4
3 changed files with 6 additions and 1 deletions

BIN
images/pear_item.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

BIN
images/pecl_item.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

View File

@@ -67,11 +67,16 @@ foreach($res['ResultSet']['Result'] as $i => $hit) {
// rewrite mirrors urls (\w\w\d? or www)
$real_url = preg_replace('!^http://\w{2,3}\.php\.net(.*)$!', '$1', $hit['Url']);
$displayurl = preg_replace('!^http://(?:\w{2,3}\.)?(.+[^/])/?$!', '$1', $hit['Url']);
$type = substr($displayurl,0,strpos($displayurl,'.'));
$display_title = str_replace('PHP:', '', $hit['Title']);
$types = array('pear'=>'<img src="http://static.php.net/www.php.net/images/pear_item.gif" height="19" width="17" style="float:left; margin-left:-30px;"/>',
'pecl'=>'<img src="http://static.php.net/www.php.net/images/pecl_item.gif" height="19" width="17" style="float:left; margin-left:-30px;"/>',
'php'=>'<img src="http://static.php.net/www.php.net/images/logos/php-icon-white.gif" height="32" width="32" style="float:left; margin-left:-40px;"/>'
);
echo <<<EOB
<li>
{$types[$type]}
<p class="result"><a href="{$real_url}">{$display_title}</a></p>
<p class="summary">{$hit['Summary']}</p>
<p class="meta">{$displayurl} - {$d}{$size}{$cachelink}</p>