예제 #1
0
				<div class="comments-main pad">
					<?php 
    if (function_exists('printCommentForm')) {
        printCommentForm();
    }
    ?>
				</div>
			</div>
		</div>
		<?php 
}
?>
		
		<?php 
if (function_exists('printRelatedItems')) {
    $result = getRelatedItems('albums', null);
    $resultcount = count($result);
    if ($resultcount != 0) {
        ?>
		<div id="related-items-gallery" class="wrap clearfix">
			<div class="inner pad">
				<div class="bold-header"><?php 
        echo gettext('Related Albums');
        ?>
</div>
				<div class="gallery-thumbs-large">
					<?php 
        $count = 0;
        if (is_numeric(getOption('libratus_related_maxnumber'))) {
            $number = getOption('libratus_related_maxnumber');
        } else {
예제 #2
0
파일: news.php 프로젝트: ckfreeman/libratus
					<?php 
            if (function_exists('printRating')) {
                ?>
					<div id="rating" class="block"><?php 
                printRating();
                ?>
</div>
					<?php 
            }
        }
        ?>
					<?php 
        if (function_exists('printRelatedItems')) {
            ?>
					<?php 
            if (getRelatedItems()) {
                ?>
<hr />
					<?php 
                printRelatedItems(5, 'news', null, null, true);
                ?>
					<?php 
            }
            ?>
					<?php 
        }
        ?>
					<?php 
        if ($_zp_zenpage->getAllCategories()) {
            ?>
					<hr /><h5><?php 
예제 #3
0
/**
 * Prints the x related articles based on a tag search
 *
 * @param int $number Number of items to get
 * @param string $type 'albums', 'images','news','pages', "all" for all combined.
 * @param string $specific If $type = 'albums' or 'images' name of album
 * @param bool $excerpt If a text excerpt (gallery items: description; Zenpage items: content) should be shown. NULL for none or number of length
 * @param bool $thumb For $type = 'albums' or 'images' if a thumb should be shown (default size as set on the options)
 */
function printRelatedItems($number = 5, $type = 'news', $specific = NULL, $excerpt = NULL, $thumb = false, $date = false)
{
    global $_zp_gallery, $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_page, $_zp_current_zenpage_news;
    $label = array('albums' => gettext('Albums'), 'images' => gettext('Images'), 'news' => gettext('News'), 'pages' => gettext('Pages'));
    $result = getRelatedItems($type, $specific);
    $resultcount = count($result);
    if ($resultcount != 0) {
        ?>
		<h3 class="relateditems">
			<?php 
        printf(gettext('Related %s'), $type);
        ?>
		</h3>
		<ul id="relateditems">
			<?php 
        $count = 0;
        foreach ($result as $item) {
            $count++;
            ?>
				<li class="<?php 
            echo $item['type'];
            ?>
">
					<?php 
            $category = '';
            switch ($item['type']) {
                case 'albums':
                    $obj = newAlbum($item['name']);
                    $url = $obj->getLink();
                    $text = $obj->getDesc();
                    $category = gettext('Album');
                    break;
                case 'images':
                    $alb = newAlbum($item['album']);
                    $obj = newImage($alb, $item['name']);
                    $url = $obj->getLink();
                    $text = $obj->getDesc();
                    $category = gettext('Image');
                    break;
                case 'news':
                    $obj = new ZenpageNews($item['name']);
                    $url = $obj->getLink();
                    $text = $obj->getContent();
                    $category = gettext('News');
                    break;
                case 'pages':
                    $obj = new ZenpagePage($item['name']);
                    $url = $obj->getLink();
                    $text = $obj->getContent();
                    $category = gettext('Page');
                    break;
            }
            ?>
					<?php 
            if ($thumb) {
                $thumburl = false;
                switch ($item['type']) {
                    case 'albums':
                        $thumburl = $obj->getThumb();
                        break;
                    case 'images':
                        $thumburl = $obj->getThumb();
                        break;
                }
                if ($thumburl) {
                    ?>
							<a href="<?php 
                    echo html_encode(pathurlencode($url));
                    ?>
" title="<?php 
                    echo html_encode($obj->getTitle());
                    ?>
" class="relateditems_thumb">
								<img src="<?php 
                    echo html_encode(pathurlencode($thumburl));
                    ?>
" alt="<?php 
                    echo html_encode($obj->getTitle());
                    ?>
" />
							</a>
							<?php 
                }
            }
            ?>
					<h4><a href="<?php 
            echo html_encode(pathurlencode($url));
            ?>
" title="<?php 
            echo html_encode($obj->getTitle());
            ?>
"><?php 
            echo html_encode($obj->getTitle());
            ?>
</a>
						<?php 
            if ($date) {
                switch ($item['type']) {
                    case 'albums':
                    case 'images':
                        $d = $obj->getDateTime();
                        break;
                    case 'news':
                    case 'pages':
                        $d = $obj->getDateTime();
                        break;
                }
                ?>
							<span class="relateditems_date">
								<?php 
                echo zpFormattedDate(DATE_FORMAT, strtotime($d));
                ?>
							</span>
							<?php 
            }
            ?>
						<?php 
            if ($type == 'all') {
                ?>
 (<small><?php 
                echo $category;
                ?>
</small>)<?php 
            }
            ?>

					</h4>
					<?php 
            if ($excerpt) {
                echo shortenContent($text, $excerpt, '...', true);
            }
            ?>
				</li>
				<?php 
            if ($count == $number) {
                break;
            }
        }
        // foreach
        if ($count) {
            ?>
			</ul>
			<?php 
        }
    }
}
예제 #4
0
    ?>
				</div>
				<div class="comments-main pad">
					<?php 
    printCommentForm();
    ?>
				</div>
			</div>
		</div>
		<?php 
}
?>

		<?php 
if (function_exists('printRelatedItems')) {
    $result = getRelatedItems('images', null);
    $resultcount = count($result);
    if ($resultcount != 0) {
        ?>
		<div id="related-items-gallery" class="wrap clearfix">
			<div class="inner pad">
				<div class="bold-header"><?php 
        echo gettext('Related Images');
        ?>
</div>
				<div class="gallery-thumbs">
					<?php 
        $count = 0;
        if (is_numeric(getOption('libratus_related_maxnumber'))) {
            $number = getOption('libratus_related_maxnumber');
        } else {