diff options
| author | 2013-04-27 22:33:14 +0200 | |
|---|---|---|
| committer | 2013-04-27 22:33:14 +0200 | |
| commit | 21dc4ceace513a0d6cd934f5fc4bb9cc643bb570 (patch) | |
| tree | a22ce222550ee1a60266d6adea990402235df78b /app/models/Feed.php | |
| parent | 0e95494e29353a9ae31fb1196c6c9aaf556ae981 (diff) | |
Fix issue #64 : stockage des favicons en local
Diffstat (limited to 'app/models/Feed.php')
| -rw-r--r-- | app/models/Feed.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/Feed.php b/app/models/Feed.php index 08cf7425f..97cbe55d1 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -77,6 +77,16 @@ class Feed extends Model { $feedDAO = new FeedDAO (); return $feedDAO->countNotRead ($this->id ()); } + public function favicon () { + $file = '/data/favicons/' . $this->id () . '.ico'; + + $favicon_url = Url::display ($file); + if (!file_exists (PUBLIC_PATH . $file)) { + $favicon_url = dowload_favicon ($this->website (), $this->id ()); + } + + return $favicon_url; + } public function _id ($value) { $this->id = $value; |
