Created
April 9, 2012 11:45
-
-
Save katzueno/2343005 to your computer and use it in GitHub Desktop.
concrete5 RSS 表示ブロック、カスタマイズ (/blocks/rss_displayers/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('C5_EXECUTE') or die("Access Denied."); | |
// 設定一覧 | |
$NumChar = 64; // 説明文の文字数 | |
$Tail= '…'; // 省略した場合に付ける記号 | |
$AdvertisementKeyword='PR:'; // 広告だと思われるRSS記事に付いているキーワード | |
?> | |
<div id="rssSummaryList<?php echo intval($bID)?>" class="rssSummaryList"> | |
<?php if( strlen($title)>0 ){ ?> | |
<div class="rssSummaryListTitle" style="margin-bottom:8px"><?php echo $title?></div> | |
<?php } ?> | |
<?php | |
$rssObj=$controller; | |
$textHelper = Loader::helper("text"); | |
if (!$dateFormat) { | |
$dateFormat = t('F jS'); | |
} | |
if( strlen($errorMsg)>0 ){ | |
echo $errorMsg; | |
}else{ | |
foreach($posts as $itemNumber=>$item) { | |
if( intval($itemNumber) >= intval($rssObj->itemsToDisplay) ) break; | |
$TitleItem = $item->get_title(); | |
if (mb_strpos($TitleItem, $AdvertisementKeyword)=== FALSE) { | |
?> | |
<div class="rssItem"> | |
<div class="rssItemTitle"> | |
<a href="<?php echo $item->get_permalink(); ?>" <?php if($rssObj->launchInNewWindow) echo 'target="_blank"' ?> > | |
<?php echo $TitleItem; ?> | |
</a> | |
</div> | |
<div class="rssItemDate"><?php echo $item->get_date($dateFormat); ?></div> | |
<div class="rssItemSummary"> | |
<?php | |
if( $rssObj->showSummary ){ | |
echo $textHelper->shortText( strip_tags($item->get_description()), $NumChar, $Tail ); | |
} | |
?> | |
[ <a href="<?php echo $item->get_permalink(); ?>" <?php if($rssObj->launchInNewWindow) echo 'target="_blank"' ?> > | |
もっと読む</a> ] | |
</div> | |
</div> | |
<?php | |
} else { | |
} | |
} | |
} | |
?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment