miniflux-legacy/app/helpers/favicon.php
Frederic Guillot 82df35a59b Change the database structure to have a single database
This is a major change for the next release of Miniflux.

- There is now only one database that can supports multiple users
- There is no automated schema migration for this release
- A migration procedure is available in the ChangeLog file
2016-12-26 09:51:38 -05:00

30 lines
631 B
PHP

<?php
namespace Miniflux\Helper;
function favicon_extension($type)
{
$types = array(
'image/png' => '.png',
'image/gif' => '.gif',
'image/x-icon' => '.ico',
'image/jpeg' => '.jpg',
'image/jpg' => '.jpg'
);
if (array_key_exists($type, $types)) {
return $types[$type];
} else {
return '.ico';
}
}
function favicon(array $favicons, $feed_id)
{
if (! empty($favicons[$feed_id])) {
return '<img src="'.FAVICON_URL_PATH.'/'.$favicons[$feed_id]['hash'].favicon_extension($favicons[$feed_id]['type']).'" class="favicon">';
}
return '';
}