コード例 #1
0
ファイル: index.php プロジェクト: pipwilson/epubserver
$files = array_keys($files);
// add the files to the feed
foreach ($files as $file) {
    if (is_file($file)) {
        $ebook = new ebookRead($file);
        // entries
        $item = new FeedItem();
        $item->title = $ebook->getDcTitle();
        $item->linktype = "application/epub+zip";
        $item->link = $file;
        // <link rel="x-stanza-cover-image" type="image/jpeg" href="cover.php?filename=$file"/>
        $coverLink = new LinkItem();
        $coverLink->rel = "x-stanza-cover-image";
        $coverLink->type = "image/jpeg";
        $coverLink->href = "cover.php?filename={$file}";
        $item->addLink($coverLink);
        $thumbnailLink = new LinkItem();
        $thumbnailLink->rel = "x-stanza-cover-image-thumbnail";
        $thumbnailLink->type = "image/jpeg";
        $thumbnailLink->href = "cover.php?filename={$file}&amp;type=thumb";
        $item->addLink($thumbnailLink);
        // <link rel="x-stanza-cover-image" type="image/jpeg" href="/get/cover/3"/>
        // <link rel="x-stanza-cover-image-thumbnail" type="image/jpeg" href="/get/thumb/3"/>
        // if there is no description set it to be the same as the titke
        if ($ebook->getDcDescription() == "") {
            $item->description = $item->title;
        } else {
            $item->description = strip_tags($ebook->getDcDescription());
        }
        // sometimes DcCreator is an array, so make sure we display in both cases
        if (is_array($ebook->getDcCreator())) {