本文整理汇总了PHP中FeedItem::addLink方法的典型用法代码示例。如果您正苦于以下问题:PHP FeedItem::addLink方法的具体用法?PHP FeedItem::addLink怎么用?PHP FeedItem::addLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FeedItem
的用法示例。
在下文中一共展示了FeedItem::addLink方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ebookRead
$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}&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())) {