forked from concretecms/concrete5-legacy
/
blog_index_thumbnail.php
79 lines (71 loc) · 2.77 KB
/
blog_index_thumbnail.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$textHelper = Loader::helper("text");
$imgHelper = Loader::Helper('image');
$dateHelper = Loader::Helper('date');
/* @var $dateHelper DateHeler */
// now that we're in the specialized content file for this block type,
// we'll include this block type's class, and pass the block to it, and get
// the content
if (count($cArray) > 0) { ?>
<?php
for ($i = 0; $i < count($cArray); $i++ ) {
$cobj = $cArray[$i];
$target = $cobj->getAttribute('nav_target');
$title = $cobj->getCollectionName();
$date = $dateHelper->formatDate($cobj->getCollectionDatePublic(), true); ?>
<div class="grid_4 main-content-thumb">
<h4><?php echo "— " . $date; ?></h4>
<div class="image-link">
<a <?php if ($target != '') { ?> target="<?php echo $target?>" <?php } ?> href="<?php echo $nh->getLinkToCollection($cobj)?>">
<?php
$ts = $cobj->getBlocks('Thumbnail Image');
if (is_object($ts[0])) {
$tsb = $ts[0]->getInstance();
$thumb = $tsb->getFileObject();
if($thumb){
$imgHelper->outputThumbnail($thumb, 220, 220, $title);
}
}
?></a>
</div>
<h3><a <?php if ($target != '') { ?> target="<?php echo $target?>" <?php } ?> href="<?php echo $nh->getLinkToCollection($cobj)?>"><?php echo $title?></a></h3>
<!-- <h3><a <?php if ($target != '') { ?> target="<?php echo $target?>" <?php } ?> href="<?php echo $nh->getLinkToCollection($cobj)?>"><?php echo $textHelper->wordSafeShortText($title,$controller->truncateChars);?></a></h3> -->
<p>
<?php
if(!$controller->truncateSummaries){
echo $cobj->getCollectionDescription();
}else{
echo $textHelper->wordSafeShortText($cobj->getCollectionDescription(),$controller->truncateChars);
}
?>
</p>
</div>
<?php }
if(!$previewMode && $controller->rss) {
$btID = $b->getBlockTypeID();
$bt = BlockType::getByID($btID);
$uh = Loader::helper('concrete/urls');
$rssUrl = $controller->getRssUrl($b, 'blog_rss');
?>
<div class="ccm-page-list-rss-icon">
<a href="<?php echo $rssUrl?>" target="_blank"><img src="<?php echo $uh->getBlockTypeAssetsURL($bt, 'rss.png')?>" width="14" height="14" /></a>
</div>
<link href="<?php echo BASE_URL . $rssUrl?>" rel="alternate" type="application/rss+xml" title="<?php echo $controller->rssTitle?>" />
<?php
}
?>
<?php }
if ($paginate && $num > 0 && is_object($pl)): ?>
<div id="pagination">
<?php
$summary = $pl->getSummary();
if ($summary->pages > 1):
$paginator = $pl->getPagination();
?>
<span class="pagination-left">« <?php echo $paginator->getPrevious(t('Newer Posts')); ?></span>
<span class="pagination-right"><?php echo $paginator->getNext(t('Older Posts')); ?> »</span>
<?php echo $paginator->getPages(); ?>
<?php endif; ?>
</div>
<?php endif; ?>