本文整理汇总了PHP中FeedItem::getRecentFeedItemsByCategory方法的典型用法代码示例。如果您正苦于以下问题:PHP FeedItem::getRecentFeedItemsByCategory方法的具体用法?PHP FeedItem::getRecentFeedItemsByCategory怎么用?PHP FeedItem::getRecentFeedItemsByCategory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FeedItem
的用法示例。
在下文中一共展示了FeedItem::getRecentFeedItemsByCategory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printCategoryFocusView
function printCategoryFocusView($categories, $index, $config) {
global $service, $event;
$pluginURL = $event->pluginURL;
if($index < 0 || $index >= count($categories)) {
return false;
}
$category = $categories[$index];
$result = '';
$entries = FeedItem::getRecentFeedItemsByCategory($category['id'], $config['categoryFeedCount']+1);
?>
<div class="title">
<h3><a href="<?php echo $service['path'];?>/category/<?php echo func::encode($category['name']);?>"><?php echo $category['name'];?></a></h3>
<div class="more">
<a href="<?php echo $service['path'];?>/category/<?php echo func::encode($category['name']);?>"><img src="<?php echo $pluginURL;?>/images/bt_more.gif" alt="<?php echo _t('더보기');?>" /></a>
</div>
<div class="clear"></div>
</div>
<ul>
<?php
if(count($entries)>0) {
$entry = $entries[0];
?>
<li class="detail">
<?php
$thumbnailFile = '';
if($media = Media::getMedia($entry['thumbnailId'])) {
$thumbnailFile = Media::getMediaFile($media['thumbnail']);
}
$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$entry['id'] : $service['path'].'/go/'.$entry['permalink'];
if(!empty($thumbnailFile)) {
?>
<div class="thumbnail">
<img src="<?php echo $thumbnailFile;?>" alt="<?php echo _t('미리보기 이미지');?>" />
</div>
<div class="data">
<h3><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($entry['title']),$config['categoryTitleLength']);?></a></h3>
<div class="desc">
<?php echo UTF8::lessenAsByte(func::stripHTML($entry['description']),$config['categoryDescLength']);?>
</div>
</div>
<?php
} else {
?>
<div class="data data_full">
<h3><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($entry['title']),$config['categoryTitleLength']);?></a></h3>
<div class="desc">
<?php echo UTF8::lessenAsByte(func::stripHTML($entry['description']),$config['categoryDescLength']);?>
</div>
</div>
<?php
}
?>
<div class="clear"></div>
</li>
<?php
}
for($i=1;$i<count($entries);$i++) {
$entry = $entries[$i];
$link_url = $config->addressType == 'id' ? $service['path'].'/go/'.$entry['id'] : $service['path'].'/go/'.$entry['permalink'];
?>
<li class="list"><a href="<?php echo $link_url;?>" target="_blank"><?php echo UTF8::lessenAsByte(func::stripHTML($entry['title']),$config['categoryTitleLength']);?></a></li>
<?php
}
?>
</ul>
<?php
return $result;
}