Enclosure

This commit is contained in:
Fred Tempez 2020-11-20 19:52:44 +01:00
parent 44fd79e3b2
commit c0df60b319
4 changed files with 20 additions and 5 deletions

View File

@ -16,6 +16,7 @@
- Gestion des thèmes : - Gestion des thèmes :
- Bouton de réinitialisation avec confirmation - Bouton de réinitialisation avec confirmation
- Traduction automatique dans la langue du navigateur. - Traduction automatique dans la langue du navigateur.
- Amélioration de la structure du flux RSS.
## Version 10.3.07 ## Version 10.3.07
- Petites corrections - Petites corrections

View File

@ -44,7 +44,7 @@ class common {
const ACCESS_TIMER = 1800; const ACCESS_TIMER = 1800;
// Numéro de version // Numéro de version
const ZWII_VERSION = '10.4.00.003'; const ZWII_VERSION = '10.4.00.004';
const ZWII_UPDATE_CHANNEL = "v10"; const ZWII_UPDATE_CHANNEL = "v10";
public static $actions = []; public static $actions = [];

View File

@ -28,8 +28,7 @@ class blog extends common {
'delete' => self::GROUP_MODERATOR, 'delete' => self::GROUP_MODERATOR,
'edit' => self::GROUP_MODERATOR, 'edit' => self::GROUP_MODERATOR,
'index' => self::GROUP_VISITOR, 'index' => self::GROUP_VISITOR,
'rss' => self::GROUP_VISITOR, 'rss' => self::GROUP_VISITOR
'signature' => self::GROUP_VISITOR
]; ];
public static $articles = []; public static $articles = [];
@ -134,6 +133,12 @@ class blog extends common {
$newsArticle->setAuthor($author,'no@mail.com'); $newsArticle->setAuthor($author,'no@mail.com');
$newsArticle->setId(helper::baseUrl() .$this->getUrl(0) . '/' . $articleId); $newsArticle->setId(helper::baseUrl() .$this->getUrl(0) . '/' . $articleId);
$newsArticle->setDate(date('r', $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']))); $newsArticle->setDate(date('r', $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])));
if ($this->_mime_content_type(helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb) !== false) {
$newsArticle->addEnclosure( helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb,
getimagesize(helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb),
$this->_mime_content_type(helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb)
);
}
$feeds->addItem($newsArticle); $feeds->addItem($newsArticle);
} }
} }
@ -748,5 +753,15 @@ class blog extends common {
return $this->getData(['user', $userId, 'firstname']); return $this->getData(['user', $userId, 'firstname']);
} }
} }
private function _mime_content_type($filename) {
$result = new finfo();
if (is_resource($result) === true) {
return $result->file($filename, FILEINFO_MIME_TYPE);
}
return false;
}
} }

View File

@ -20,8 +20,7 @@ class news extends common {
'delete' => self::GROUP_MODERATOR, 'delete' => self::GROUP_MODERATOR,
'edit' => self::GROUP_MODERATOR, 'edit' => self::GROUP_MODERATOR,
'index' => self::GROUP_VISITOR, 'index' => self::GROUP_VISITOR,
'rss' => self::GROUP_VISITOR, 'rss' => self::GROUP_VISITOR
'signature' => self::GROUP_VISITOR
]; ];
public static $news = []; public static $news = [];