mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 02:21:55 -04:00
Add more type hints and work on some code formatting
This commit is contained in:
parent
06b82cdaaa
commit
c3c588cc1b
35 changed files with 343 additions and 167 deletions
|
@ -1,3 +1,11 @@
|
|||
<?
|
||||
use function Safe\filesize;
|
||||
use function Safe\preg_replace;
|
||||
|
||||
/**
|
||||
* @var Ebook $entry
|
||||
*/
|
||||
?>
|
||||
<item>
|
||||
<title><?= Formatter::EscapeXml($entry->Title) ?>, by <?= Formatter::EscapeXml(strip_tags($entry->AuthorsHtml)) ?></title>
|
||||
<link><?= SITE_URL . Formatter::EscapeXml($entry->Url) ?></link>
|
||||
|
@ -5,10 +13,10 @@
|
|||
<pubDate><?= $entry->EbookCreated->format('r') ?></pubDate>
|
||||
<guid><?= Formatter::EscapeXml(preg_replace('/^url:/ius', '', $entry->Identifier)) ?></guid>
|
||||
<? foreach($entry->Tags as $tag){ ?>
|
||||
<category domain="https://standardebooks.org/vocab/subjects"><?= Formatter::EscapeXml($tag->Name) ?></category>
|
||||
<category domain="https://standardebooks.org/vocab/subjects"><?= Formatter::EscapeXml($tag->Name) ?></category>
|
||||
<? } ?>
|
||||
<media:thumbnail url="<?= SITE_URL . $entry->Url ?>/downloads/cover-thumbnail.jpg" height="525" width="350"/>
|
||||
<? if($entry->EpubUrl !== null){ ?>
|
||||
<enclosure url="<?= SITE_URL . Formatter::EscapeXml($entry->EpubUrl) ?>" length="<?= filesize(WEB_ROOT . $entry->EpubUrl) ?>" type="application/epub+zip" /> <? /* Only one <enclosure> is allowed */ ?>
|
||||
<enclosure url="<?= SITE_URL . Formatter::EscapeXml($entry->EpubUrl) ?>" length="<?= filesize(WEB_ROOT . $entry->EpubUrl) ?>" type="application/epub+zip" /> <? /* Only one <enclosure> is allowed */ ?>
|
||||
<? } ?>
|
||||
</item>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue