<?php //netteCache[01]000574a:2:{s:4:"time";s:21:"0.26450400 1598841728";s:9:"callbacks";a:4:{i:0;a:3:{i:0;a:2:{i:0;s:6:"NCache";i:1;s:9:"checkFile";}i:1;s:88:"/home/bebiluck/public_html/buburbayi.id/wp-content/themes/cityguide/archive-ait-item.php";i:2;i:1525889615;}i:1;a:3:{i:0;a:2:{i:0;s:6:"NCache";i:1;s:10:"checkConst";}i:1;s:20:"NFramework::REVISION";i:2;s:22:"released on 2014-08-28";}i:2;a:3:{i:0;a:2:{i:0;s:6:"NCache";i:1;s:10:"checkConst";}i:1;s:15:"WPLATTE_VERSION";i:2;s:5:"2.9.2";}i:3;a:3:{i:0;a:2:{i:0;s:6:"NCache";i:1;s:10:"checkConst";}i:1;s:17:"AIT_THEME_VERSION";i:2;s:4:"3.20";}}}?><?php

// source file: /home/bebiluck/public_html/buburbayi.id/wp-content/themes/cityguide/archive-ait-item.php

?><?php
// prolog NCoreMacros
list($_l, $_g) = NCoreMacros::initRuntime($template, 'ptcxjve60o')
;
// prolog NUIMacros
//
// block content
//
if (!function_exists($_l->blocks['content'][] = '_lb7554245029_content')) { function _lb7554245029_content($_l, $_args) { foreach ($_args as $__k => $__v) $$__k = $__v
;$settings = $options->theme->items ;$noFeatured = $options->theme->item->noFeatured ?>

<?php $filterCounts = array(5, 10, 20) ?>
	<?php ob_start() ;echo NTemplateHelpers::escapeHtml(__('Date', 'wplatte'), ENT_NOQUOTES) ;$dateLabel = ob_get_clean() ?>

	<?php ob_start() ;echo NTemplateHelpers::escapeHtml(__('Title', 'wplatte'), ENT_NOQUOTES) ;$titleLabel = ob_get_clean() ?>


<?php $filterOrderBy = array( array("date", $dateLabel), array("title", $titleLabel)) ;if (defined('AIT_REVIEWS_ENABLED')) { ?>
		<?php ob_start() ;echo NTemplateHelpers::escapeHtml(__('Rating', 'wplatte'), ENT_NOQUOTES) ;$ratingLabel = ob_get_clean() ?>

<?php array_push($filterOrderBy, array("rating", $ratingLabel)) ;} ?>

<?php $filterCountsSelected = isset($_REQUEST['count']) && $_REQUEST['count'] != "" ? $_REQUEST['count'] : $settings->sortingDefaultCount ?>

<?php if (defined("AIT_ADVANCED_FILTERS_ENABLED")) { if (isset($_REQUEST['filters']) && $_REQUEST['filters'] != "") { $filterCountsSelected = -1 ;} } ?>

<?php $filterOrderBySelected = isset($_REQUEST['orderby']) && $_REQUEST['orderby'] != "" ? $_REQUEST['orderby'] : $settings->sortingDefaultOrderBy ;$filterOrderSelected = isset($_REQUEST['order']) && $_REQUEST['order'] != "" ? $_REQUEST['order'] : $settings->sortingDefaultOrder ?>

<?php $pagination = (get_query_var('paged')) ? get_query_var('paged') : 1 ;$itemQuery = array(
		'post_type' => 'ait-item',
		'posts_per_page' => $filterCountsSelected,
		'paged' => $pagination,
	) ?>

<?php if ($filterOrderBySelected == 'rating' && defined('AIT_REVIEWS_ENABLED')) { $itemQuery['orderby'] = 'meta_value_num' ;$itemQuery['meta_query'] = array(
			'relation' => 'OR',
			array(
				'key' => 'rating_mean',
				'compare' => 'NOT EXISTS',
				'value' => 0,
			),
			array(
				'key' => 'rating_mean',
			),
		) ;} else { $itemQuery['orderby'] = $filterOrderBySelected ;} $itemQuery['order'] = $filterOrderSelected ?>

<?php $query = WpLatteMacros::prepareCustomWpQuery(array($itemQuery)) ?>

<?php $allItems_filtered_query = $itemQuery ?>

<?php if (defined("AIT_ADVANCED_FILTERS_ENABLED")) { if (isset($_REQUEST['filters']) && $_REQUEST['filters'] != "") { $defined_filters = explode(";",$_REQUEST['filters']) ;$advanced_filter_query = $itemQuery ;$advanced_filter_query['posts_per_page'] = -1 ;$valid = array() ?>

<?php foreach ($iterator = new WpLatteLoopIterator($query) as $post): $meta = $post->meta('filters-options') ;if (isset($meta->filters) && is_array($meta->filters)) { $check = array_intersect($defined_filters, $meta->filters) ;if (is_array($check) && count($check) >= count($defined_filters)) { array_push($valid, $post->id) ;} } else { } endforeach; wp_reset_postdata() ?>

<?php $advanced_filter_query['post__in'] = array_unique($valid) ;$query = WpLatteMacros::prepareCustomWpQuery(array($advanced_filter_query)) ?>

<?php $allItems_filtered_query = $advanced_filter_query ;} } $allItems_filtered_query['posts_per_page'] = -1 ;$allItemsQuery = WpLatteMacros::prepareCustomWpQuery(array($allItems_filtered_query)) ?>

<?php $featured = array() ;$notFeatured = array() ;$newOrder = array() ;$iterations = 0; foreach ($query->posts as $post) { $dbFeatured = get_post_meta($post->ID, '_ait-item_item-featured', true) ;$isFeatured = $dbFeatured != "" ? filter_var($dbFeatured, FILTER_VALIDATE_BOOLEAN) : false ;if ($isFeatured) { array_push($featured, $post) ;} else { array_push($notFeatured, $post) ;} $iterations++; } $iterations = 0; foreach ($featured as $post) { array_push($newOrder, $post) ;$iterations++; } $iterations = 0; foreach ($notFeatured as $post) { array_push($newOrder, $post) ;$iterations++; } $query->posts = $newOrder ;$query->post_count = count($newOrder) ;$query->found_posts = count($newOrder) ;NCoreMacros::includeTemplate(WpLatteMacros::getTemplatePart("portal/parts/taxonomy-category-list", ""), array('taxonomy' => "ait-items") + get_defined_vars(), $_l->templates['ptcxjve60o'])->render() ?>

	<div class="items-container">
		<div class="content">

<?php if ($query->havePosts) { ?>

<?php NCoreMacros::includeTemplate(WpLatteMacros::getTemplatePart("portal/parts/search-filters", ""), array('taxonomy' => "ait-items", 'current' => $query->post_count, 'max' => $allItemsQuery->post_count) + get_defined_vars(), $_l->templates['ptcxjve60o'])->render() ?>

<?php if (defined("AIT_ADVANCED_FILTERS_ENABLED")) { NCoreMacros::includeTemplate(WpLatteMacros::getTemplatePart("portal/parts/advanced-filters", ""), array('query' => $allItemsQuery) + get_defined_vars(), $_l->templates['ptcxjve60o'])->render() ;} ?>

			<div class="ajax-container">
				<div class="content">

<?php foreach ($iterator = new WpLatteLoopIterator($query) as $post): $categories = get_the_terms($post->id, 'ait-items') ?>

<?php $meta = $post->meta('item-data') ?>

<?php $dbFeatured = get_post_meta($post->id, '_ait-item_item-featured', true) ;$isFeatured = $dbFeatured != "" ? filter_var($dbFeatured, FILTER_VALIDATE_BOOLEAN) : false ?>


						<div<?php if ($_l->tmp = array_filter(array('item-container', $isFeatured ? "item-featured":null, defined("AIT_REVIEWS_ENABLED") ? 'reviews-enabled':null))) echo ' class="' . NTemplateHelpers::escapeHtml(implode(" ", array_unique($_l->tmp)), ENT_COMPAT) . '"' ?>>
							<a href="<?php echo NTemplateHelpers::escapeHtml($post->permalink, ENT_COMPAT) ?>">
								<div class="content">

									<div class="item-image">
<?php if ($post->image) { ?>
										<img src="<?php echo aitResizeImage($post->imageUrl, array('width' => 640, 'height' => 384, 'crop' => 1)) ?>
" alt="<?php echo $post->title ?>" />
<?php } else { ?>
										<img src="<?php echo aitResizeImage($noFeatured, array('width' => 640, 'height' => 384, 'crop' => 1)) ?>
" alt="<?php echo $post->title ?>" />
<?php } ?>
									</div>
									<div class="item-data">
										<div class="item-header">
											<div class="item-title">
												<h3><?php echo $post->title ?></h3>
											</div>
<?php if (count($categories) > 0) { ?>
											<div class="item-categories">
<?php $iterations = 0; foreach ($categories as $category) { ?>
													<span class="item-category"><?php echo $category->name ?></span>
<?php $iterations++; } ?>
											</div>
<?php } ?>
										</div>
										<div class="item-body">
											<div class="entry-content">
												<p>
<?php if ($post->hasExcerpt) { ?>
														<?php echo $template->truncate($template->trim($template->striptags($post->excerpt)), 140) ?>

<?php } else { ?>
														<?php echo $template->truncate($template->trim($template->striptags($post->content)), 140) ?>

<?php } ?>
												</p>
											</div>
										</div>
										<div class="item-footer">
											<div class="item-address">
												<?php echo NTemplateHelpers::escapeHtml($meta->map['address'], ENT_NOQUOTES) ?>

											</div>
										</div>
									</div>
								</div>
							</a>
<?php if (defined('AIT_REVIEWS_ENABLED')) { NCoreMacros::includeTemplate(WpLatteMacros::getTemplatePart("portal/parts/carousel-reviews-stars", ""), array('item' => $post, 'showCount' => false) + get_defined_vars(), $_l->templates['ptcxjve60o'])->render() ;} ?>
						</div>


<?php endforeach; wp_reset_postdata() ?>

<?php NCoreMacros::includeTemplate(WpLatteMacros::getTemplatePart("parts/pagination", ""), array('location' => 'pagination-below', 'max' => $query->max_num_pages) + get_defined_vars(), $_l->templates['ptcxjve60o'])->render() ?>
				</div>
			</div>

<?php } else { NCoreMacros::includeTemplate(WpLatteMacros::getTemplatePart("parts/none", ""), array('message' => 'empty-site') + get_defined_vars(), $_l->templates['ptcxjve60o'])->render() ;} ?>
		</div>
	</div>
<?php
}}

//
// end of blocks
//

// template extending and snippets support

$_l->extends = empty($template->_extended) && isset($_control) && $_control instanceof NPresenter ? $_control->findLayoutTemplateFile() : NULL; $template->_extended = $_extended = TRUE;


if ($_l->extends) {
	ob_start();

} elseif (!empty($_control->snippetMode)) {
	return NUIMacros::renderSnippets($_control, $_l, get_defined_vars());
}

//
// main template
//
?>

<?php if ($_l->extends) { ob_end_clean(); return NCoreMacros::includeTemplate($_l->extends, get_defined_vars(), $template)->render(); }
call_user_func(reset($_l->blocks['content']), $_l, get_defined_vars()) ; 