PluginProbe
WP Directory Kit / 1.5.5
WP Directory Kit v1.5.5
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
wpdirectorykit / application / views / frontend / result_item_card.php

result_item_card.php in WP Directory Kit 1.5.5, at application/views/frontend/result_item_card.php

648 lines 41.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template for Result Item.
4 *
5 * This is the template that for result listing of listings preview
6 *
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12 ?>
13
14 <?php
15 $layout_type = 'grid';
16
17 if(isset($settings['layout_type'])) {
18 $layout_type = $settings['layout_type'];
19 }
20
21 $infobox = false;
22 if(isset($settings['infobox'])) {
23 $infobox = true;
24 }
25
26 $content_button_icon = '<i aria-hidden="true" class="fa fa-angle-right"></i>';
27 if(isset($settings['content_button_icon'])) {
28 $content_button_icon = $settings['content_button_icon'];
29 }
30
31 $url = '#';
32 if(wdk_is_listing_page_enabled()) {
33 $url = get_permalink($listing);
34 }
35
36 if(wdk_get_option('wdk_custom_listings_link_field')){
37 $custom_link = wdk_field_value(wdk_get_option('wdk_custom_listings_link_field'), $listing);
38 if(!empty($custom_link)) {
39 $url = $custom_link;
40 }
41 }
42
43 $title_part = wdk_resultitem_fields_section_value(1, 2, $listing);
44 $subtitle_part = wdk_resultitem_fields_section_value(1, 3, $listing);
45 $over_image_bottom = wdk_resultitem_fields_section_value(1, 1, $listing);
46 $over_image_top = wdk_resultitem_fields_section_value(1, 0, $listing);
47 $features_part = wdk_resultitem_fields_section_value(1, 4, $listing);
48 $price_part = wdk_resultitem_fields_section_value(1, 5, $listing);
49 $resul_item_config = wdk_resultitem();
50 /* true if thumbnail printed */
51 $thumbnail_printed = false;
52
53 $slides_count_limit = 5;
54
55 global $wdk_listing_result_id;
56 $wdk_listing_result_id = wmvc_show_data('post_id', $listing);
57
58 $parsed_url = parse_url($url);
59 $site_host = parse_url(home_url(), PHP_URL_HOST);
60 $url_host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
61
62 $is_external = $url_host && $url_host !== $site_host;
63 if(empty($url_host)) {
64 $is_external = true;
65 }
66
67
68 ?>
69 <div
70 data-listing_url ="<?php echo esc_url($url); ?>"
71 data-listing_id ="<?php echo esc_attr($wdk_listing_result_id); ?>"
72
73 class="wdk-listing-card <?php if( wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_popup')):?> wdk_listing_popup <?php endif;?> <?php echo esc_attr($layout_type);?> <?php if($layout_type == 'carousel'):?> grid <?php endif;?> <?php if(wdk_get_option('wdk_is_featured_enabled', FALSE) && wmvc_show_data('is_featured', $listing, '') == 1):?> is_featured <?php endif;?> <?php if(!$infobox && wmvc_show_data('is_multiline_enabled', $resul_item_config, '') == 1):?> is_multiline_enabled <?php endif;?>">
74 <div class="wdk-thumbnail">
75
76 <?php if(wdk_get_option('wdk_card_slider_enable') && !$infobox):?>
77 <?php
78 if(wmvc_show_data('thumbnail_image_size', $settings, false)) {
79 $image_size_generation_callback = function( $attachment_id, $size_name ) {
80 wdk_generate_missing_image_sizes($attachment_id, $size_name);
81 };
82
83 add_action('wdk/helpers/wdk_listing_images/get_attached/before', $image_size_generation_callback, 10, 2);
84 $images = wdk_listing_images ($listing, wmvc_show_data('thumbnail_image_size', $settings, 'full'));
85 remove_action('wdk/helpers/wdk_listing_images/get_attached/before', $image_size_generation_callback);
86
87 } else {
88 $images = wdk_listing_images_fast_access ($listing, 'full');
89 }
90 ?>
91 <?php if(!empty($images)):?>
92 <div class="wdk_js_gallery_slider_box">
93 <div class="wdk_js_gallery_slider">
94 <?php if(wdk_get_option('wdk_card_video_field')):?>
95 <?php $media = wdk_generate_media_field(wdk_field_value (wdk_get_option('wdk_card_video_field'), $listing));?>
96 <?php if($media):?>
97 <div class="wdk-image media">
98 <?php echo wp_kses_post($media);?>
99 </div>
100 <?php endif;?>
101 <?php endif;?>
102 <?php foreach ($images as $key=>$image_src):?>
103 <?php if($key >= $slides_count_limit) break;?>
104 <?php if(empty($image_src)) continue;?>
105 <div>
106 <img src="<?php echo esc_url($image_src);?>" alt="" class="wdk-image">
107 <a href="<?php echo esc_url($url);?>" class="wdk-thumbnail_link" title="<?php echo esc_attr(wmvc_show_data('post_title', $listing)) ;?>" <?php echo $is_external ? 'target="_blank" rel="noopener noreferrer"' : ''; ?>></a>
108 </div>
109 <?php endforeach;?>
110 </div>
111 <div class="wdk_js_gallery_slider-carousel_arrows">
112 <a href="#prev" class="wdk-slider-prev" title="<?php echo esc_attr__('prev slider', 'wpdirectorykit');?>">
113 <?php if(!empty($settings['thumbn_slider_arrow_left']['value'])):?>
114 <?php \Elementor\Icons_Manager::render_icon( $settings['thumbn_slider_arrow_left'], [ 'aria-hidden' => 'true' ] ); ?>
115 <?php else:?>
116 <span class="dashicons dashicons-arrow-left-alt2"></span>
117 <?php endif;?>
118 </a>
119 <a href="#next" class="wdk-slider-next" title="<?php echo esc_attr__('next slider', 'wpdirectorykit');?>">
120 <?php if(!empty($settings['thumbn_slider_arrow_right']['value'])):?>
121 <?php \Elementor\Icons_Manager::render_icon( $settings['thumbn_slider_arrow_right'], [ 'aria-hidden' => 'true' ] ); ?>
122 <?php else:?>
123 <span class="dashicons dashicons-arrow-right-alt2"></span>
124 <?php endif;?>
125 </a>
126 </div>
127 </div>
128 <?php $thumbnail_printed = true;?>
129 <?php else:?>
130 <?php if(wdk_get_option('wdk_card_video_field')):?>
131 <?php $media = wdk_generate_media_field(wdk_field_value (wdk_get_option('wdk_card_video_field'), $listing));?>
132 <?php if($media):?>
133 <div class="wdk-image media">
134 <?php echo wp_kses_post($media);?>
135 </div>
136 <?php $thumbnail_printed = true;?>
137 <?php endif;?>
138 <?php endif;?>
139 <?php endif;?>
140 <?php endif;?>
141
142 <?php if(!$thumbnail_printed && wdk_get_option('wdk_card_video_field') && !$infobox):?>
143 <?php $media = wdk_generate_media_field(wdk_field_value (wdk_get_option('wdk_card_video_field'), $listing));?>
144 <?php if($media):?>
145 <div class="wdk-image media">
146 <?php echo wp_kses_post($media);?>
147 </div>
148 <?php $thumbnail_printed = true;?>
149 <?php endif;?>
150 <?php endif;?>
151
152 <?php if(!$thumbnail_printed):?>
153 <?php if(wdk_get_option('wdk_card_video_enable')):?>
154 <?php
155 $image_src = wdk_listing_media_src($listing);
156 ?>
157 <?php if(wdk_file_extension_type($image_src) == 'video'):?>
158 <div class="wdk-image media">
159 <video controls src="<?php echo esc_url($image_src);?>" alt="<?php echo esc_attr(wmvc_show_data('post_title', $listing));?>"></video>
160 </div>
161 <?php elseif(wdk_file_extension_type($image_src) == 'image'):?>
162 <img src="<?php echo esc_url($image_src);?>" class="wdk-image" alt="<?php echo esc_attr(wmvc_show_data('post_title', $listing));?>">
163 <?php endif;?>
164 <?php else:?>
165 <img src="<?php echo esc_url(wdk_image_src($listing, 'full'));?>" alt="<?php echo esc_attr(wmvc_show_data('post_title', $listing)) ;?>" class="wdk-image">
166 <?php endif;?>
167 <?php endif;?>
168
169 <a href="<?php echo esc_url($url);?>" <?php echo $is_external ? 'target="_blank" rel="noopener noreferrer"' : ''; ?> class="wdk-thumbnail_link" title="<?php echo esc_attr(wmvc_show_data('post_title', $listing)) ;?>"></a>
170 <?php if(!empty($over_image_top)):?>
171 <div class="wdk-over-image-top">
172 <?php foreach ($over_image_top as $key => $field):?>
173 <?php if(in_array(wmvc_show_data('field_id', $field), array('agent_image','agent_email','agent_name'))):?>
174 <?php $user = wdk_get_user_data(wmvc_show_data('user_id_editor', $listing));?>
175 <?php if(!empty($user)): ?>
176 <span class="wdk-field-<?php echo esc_attr(wmvc_show_data('field_id', $field, ''));?>">
177 <?php if(!empty($user['profile_url']) && !empty($field['add_profile_link'])) :?>
178 <a href="<?php echo esc_url($user['profile_url']);?>" class="agent_logo_link">
179 <?php endif;?>
180 <?php
181 switch (wmvc_show_data('field_id', $field)) {
182 case 'agent_image':
183 ?>
184 <img class="agent_logo" src="<?php echo esc_url(wmvc_show_data('avatar', $user));?>" alt="<?php echo esc_attr(wmvc_show_data('display_name', $user['userdata']));?>">
185 <?php
186 break;
187 case 'agent_email':
188 ?>
189 <?php echo esc_html(wmvc_show_data('user_email', $user['userdata']));?>
190 <?php
191 break;
192 case 'agent_name':
193 ?>
194 <?php echo esc_html(wmvc_show_data('display_name', $user['userdata']));?>
195 <?php
196 break;
197 }
198 ?>
199
200 <?php if(!empty($user['profile_url']) && !empty($field['add_profile_link'])) :?>
201 </a>
202 <?php endif;?>
203 </span>
204 <?php endif;?>
205 <?php continue; endif;?>
206 <span class='wdk-field-<?php echo esc_attr(wmvc_show_data('field_id', $field, ''));?>'>
207 <?php
208 echo esc_html(apply_filters( 'wpdirectorykit/listing/field/prefix', wmvc_show_data('prefix', $field), wmvc_show_data('field_id', $field)));
209
210 if(wdk_field_option(wmvc_show_data('field_id', $field), 'is_price_format') && wdk_field_option(wmvc_show_data('field_id', $field), 'field_type') == 'NUMBER') {
211 $value = strip_tags(apply_filters( 'wpdirectorykit/listing/field/value', wdk_filter_decimal(wmvc_show_data('value', $field)), wmvc_show_data('field_id', $field), FALSE));
212 echo esc_html(wdk_number_format_i18n($value));
213 } else {
214 echo esc_html__(strip_tags(apply_filters( 'wpdirectorykit/listing/field/value', do_shortcode(wdk_filter_decimal(wmvc_show_data('value', $field))), wmvc_show_data('field_id', $field))), 'wpdirectorykit');
215 }
216
217 echo esc_html(apply_filters( 'wpdirectorykit/listing/field/suffix', wmvc_show_data('suffix', $field), wmvc_show_data('field_id', $field)));
218 ?>
219 </span>
220 <?php endforeach;?>
221 </div>
222 <?php endif;?>
223 <?php if(!empty($over_image_bottom) || function_exists('run_wdk_favorites')):?>
224 <div class="wdk-over-image-bottom">
225 <?php if(!empty($over_image_bottom)) foreach ($over_image_bottom as $key => $field):?>
226 <?php if(in_array(wmvc_show_data('field_id', $field), array('agent_image','agent_email','agent_name'))):?>
227 <?php $user = wdk_get_user_data(wmvc_show_data('user_id_editor', $listing));?>
228 <?php if(!empty($user)): ?>
229 <span class="wdk-field-<?php echo esc_attr(wmvc_show_data('field_id', $field, ''));?>">
230 <?php if(!empty($user['profile_url']) && !empty($field['add_profile_link'])) :?>
231 <a href="<?php echo esc_url($user['profile_url']);?>" class="agent_logo_link">
232 <?php endif;?>
233 <?php
234 switch (wmvc_show_data('field_id', $field)) {
235 case 'agent_image':
236 ?>
237 <img class="agent_logo" src="<?php echo esc_url(wmvc_show_data('avatar', $user));?>" alt="<?php echo esc_attr(wmvc_show_data('display_name', $user['userdata']));?>">
238 <?php
239 break;
240 case 'agent_email':
241 ?>
242 <?php echo esc_html(wmvc_show_data('user_email', $user['userdata']));?>
243 <?php
244 break;
245 case 'agent_name':
246 ?>
247 <?php echo esc_html(wmvc_show_data('display_name', $user['userdata']));?>
248 <?php
249 break;
250 }
251 ?>
252
253 <?php if(!empty($user['profile_url']) && !empty($field['add_profile_link'])) :?>
254 </a>
255 <?php endif;?>
256 </span>
257 <?php endif;?>
258 <?php continue; endif;?>
259 <span class='wdk-item wdk-field-<?php echo esc_attr(wmvc_show_data('field_id', $field, ''));?>'>
260 <?php
261 echo esc_html(apply_filters( 'wpdirectorykit/listing/field/prefix', wmvc_show_data('prefix', $field), wmvc_show_data('field_id', $field)));
262
263 if(wdk_field_option(wmvc_show_data('field_id', $field), 'is_price_format') && wdk_field_option(wmvc_show_data('field_id', $field), 'field_type') == 'NUMBER') {
264 $value = strip_tags(apply_filters( 'wpdirectorykit/listing/field/value', wdk_filter_decimal(wmvc_show_data('value', $field)), wmvc_show_data('field_id', $field), FALSE));
265 echo esc_html(wdk_number_format_i18n($value));
266 } else {
267 echo esc_html(strip_tags(apply_filters( 'wpdirectorykit/listing/field/value', do_shortcode(wdk_filter_decimal(wmvc_show_data('value', $field))), wmvc_show_data('field_id', $field))));
268 }
269
270 echo esc_html(apply_filters( 'wpdirectorykit/listing/field/suffix', wmvc_show_data('suffix', $field), wmvc_show_data('field_id', $field)));
271 ?>
272 </span>
273 <?php endforeach;?>
274
275
276 <?php if(function_exists('run_wdk_favorites')): ?>
277 <span class="wdk-favorites-actions">
278 <a title="<?php echo esc_attr__('Favorite', 'wpdirectorykit');?>" href="#" data-post_type="wdk-listing" data-post_id="<?php echo esc_attr(wmvc_show_data('post_id', $listing));?>" class="wdk-add-favorites-action <?php echo (esc_attr($favorite_added))?'wdk-hidden':''; ?>" data-ajax="<?php echo esc_url(admin_url( 'admin-ajax.php' )); ?>">
279 <i class="fa fa-heart-o"></i>
280 </a>
281 <a title="<?php echo esc_attr__('Favorite', 'wpdirectorykit');?>" href="#" data-post_type="wdk-listing" data-post_id="<?php echo esc_attr(wmvc_show_data('post_id', $listing));?>" class="wdk-remove-favorites-action <?php echo (!esc_attr($favorite_added))?'wdk-hidden':''; ?>" data-ajax="<?php echo esc_url(admin_url( 'admin-ajax.php' )); ?>">
282 <i class="fa fa-heart"></i>
283 </a>
284 <i class="fa fa-spinner fa-spin fa-custom-ajax-indicator"></i>
285 </span>
286 <?php endif; ?>
287
288 <?php if(shortcode_exists('wdk-compare-listing-button') && !get_option('wdk_compare_disable_on_result_items')):?>
289 <?php echo do_shortcode('[wdk-compare-listing-button wdk_listing_id="'.esc_attr(wmvc_show_data('post_id', $listing)).'" ]');?>
290 <?php endif;?>
291 </div>
292 <?php endif;?>
293 <div class="overlay"></div>
294 </div>
295 <?php if($layout_type == 'list'):?>
296 <div class="wdk-content">
297 <?php endif;?>
298 <?php if(!empty($title_part)):?>
299 <div class="wdk-title">
300 <h2 class="title">
301 <a href="<?php echo esc_url($url);?>" <?php echo $is_external ? 'target="_blank" rel="noopener noreferrer"' : ''; ?> title="<?php echo esc_attr(wmvc_show_data('post_title', $listing)) ;?>">
302 <?php foreach ($title_part as $key => $field):?>
303 <?php if(in_array(wmvc_show_data('field_id', $field), array('agent_image','agent_email','agent_name'))):?>
304 <?php $user = wdk_get_user_data(wmvc_show_data('user_id_editor', $listing));?>
305 <?php if(!empty($user)): ?>
306 <span class="wdk-field-<?php echo esc_attr(wmvc_show_data('field_id', $field, ''));?>">
307 <?php if(!empty($user['profile_url']) && !empty($field['add_profile_link'])) :?>
308 <a href="<?php echo esc_url($user['profile_url']);?>" class="agent_logo_link">
309 <?php endif;?>
310 <?php
311 switch (wmvc_show_data('field_id', $field)) {
312 case 'agent_image':
313 ?>
314 <img class="agent_logo" src="<?php echo esc_url(wmvc_show_data('avatar', $user));?>" alt="<?php echo esc_attr(wmvc_show_data('display_name', $user['userdata']));?>">
315 <?php
316 break;
317 case 'agent_email':
318 ?>
319 <?php echo esc_html(wmvc_show_data('user_email', $user['userdata']));?>
320 <?php
321 break;
322 case 'agent_name':
323 ?>
324 <?php echo esc_html(wmvc_show_data('display_name', $user['userdata']));?>
325 <?php
326 break;
327 }
328 ?>
329
330 <?php if(!empty($user['profile_url']) && !empty($field['add_profile_link'])) :?>
331 </a>
332 <?php endif;?>
333 </span>
334 <?php endif;?>
335 <?php continue; endif;?>
336 <span class='wdk-field-<?php echo esc_attr(wmvc_show_data('field_id', $field, ''));?>'>
337 <?php
338 echo esc_html(apply_filters( 'wpdirectorykit/listing/field/prefix', wmvc_show_data('prefix', $field), wmvc_show_data('field_id', $field)));
339
340 if(wdk_field_option(wmvc_show_data('field_id', $field), 'is_price_format') && wdk_field_option(wmvc_show_data('field_id', $field), 'field_type') == 'NUMBER') {
341 $value = strip_tags(apply_filters( 'wpdirectorykit/listing/field/value', wdk_filter_decimal(wmvc_show_data('value', $field)), wmvc_show_data('field_id', $field), FALSE));
342 echo esc_html(wdk_number_format_i18n($value));
343 } else {
344 echo esc_html(strip_tags(apply_filters( 'wpdirectorykit/listing/field/value', do_shortcode(wdk_filter_decimal(wmvc_show_data('value', $field))), wmvc_show_data('field_id', $field))));
345 }
346
347 echo esc_html(apply_filters( 'wpdirectorykit/listing/field/suffix', wmvc_show_data('suffix', $field), wmvc_show_data('field_id', $field)));
348 ?>
349 </span>
350 <?php endforeach;?>
351 </a>
352 </h2>
353 </div>
354 <?php endif;?>
355 <?php if(!empty($subtitle_part)):?>
356 <div class="wdk-subtitle-part">
357 <div class="wdk-stroke">
358 <?php foreach ($subtitle_part as $key => $field):?>
359 <?php if(in_array(wmvc_show_data('field_id', $field), array('agent_image','agent_email','agent_name'))):?>
360 <?php $user = wdk_get_user_data(wmvc_show_data('user_id_editor', $listing));?>
361 <?php if(!empty($user)): ?>
362 <span class="wdk-field-<?php echo esc_attr(wmvc_show_data('field_id', $field, ''));?>">
363 <?php if(!empty($user['profile_url']) && !empty($field['add_profile_link'])) :?>
364 <a href="<?php echo esc_url($user['profile_url']);?>" class="agent_logo_link">
365 <?php endif;?>
366 <?php
367 switch (wmvc_show_data('field_id', $field)) {
368 case 'agent_image':
369 ?>
370 <img class="agent_logo" src="<?php echo esc_url(wmvc_show_data('avatar', $user));?>" alt="<?php echo esc_attr(wmvc_show_data('display_name', $user['userdata']));?>">
371 <?php
372 break;
373 case 'agent_email':
374 ?>
375 <?php echo esc_html(wmvc_show_data('user_email', $user['userdata']));?>
376 <?php
377 break;
378 case 'agent_name':
379 ?>
380 <?php echo esc_html(wmvc_show_data('display_name', $user['userdata']));?>
381 <?php
382 break;
383 }
384 ?>
385
386 <?php if(!empty($user['profile_url']) && !empty($field['add_profile_link'])) :?>
387 </a>
388 <?php endif;?>
389 </span>
390 <?php endif;?>
391 <?php continue; endif;?>
392 <span class="wdk-field-<?php echo esc_attr(wmvc_show_data('field_id', $field, ''));?>">
393 <?php
394 echo esc_html(apply_filters( 'wpdirectorykit/listing/field/prefix', wmvc_show_data('prefix', $field), wmvc_show_data('field_id', $field)));
395
396 if(wdk_field_option(wmvc_show_data('field_id', $field), 'is_price_format') && wdk_field_option(wmvc_show_data('field_id', $field), 'field_type') == 'NUMBER') {
397 $value = strip_tags(apply_filters( 'wpdirectorykit/listing/field/value', wdk_filter_decimal(wmvc_show_data('value', $field)), wmvc_show_data('field_id', $field), FALSE));
398 echo esc_html(wdk_number_format_i18n($value));
399 } else {
400 echo esc_html(strip_tags(apply_filters( 'wpdirectorykit/listing/field/value', do_shortcode(wdk_filter_decimal(wmvc_show_data('value', $field))), wmvc_show_data('field_id', $field))));
401 }
402
403 echo esc_html(apply_filters( 'wpdirectorykit/listing/field/suffix', wmvc_show_data('suffix', $field), wmvc_show_data('field_id', $field)));
404 ?>
405 </span>
406 <?php endforeach;?>
407 </div>
408 </div>
409 <?php endif;?>
410 <?php if(wdk_get_option('wdk_sub_listings_enable') && isset($settings['related_fields_list'])): ?>
411 <div class="wdk-sublistings-part">
412 <?php if(!empty(wmvc_show_data('listing_related_ids', $listing))):?>
413 <ul>
414 <?php foreach (explode(',',wmvc_show_data('listing_related_ids', $listing, '')) as $key => $child_idlisting):?>
415 <?php if(!wdk_field_value('is_activated', $child_idlisting) || !wdk_field_value('is_approved', $child_idlisting)) continue; ?>
416 <li>
417 <?php foreach($settings['related_fields_list'] as $field):?>
418 <?php
419 if(strpos($field['field'],'__') !== FALSE){
420 $field['field'] = substr($field['field'], strpos($field['field'],'__')+2);
421 }
422 ?>
423
424 <?php if($field['is_link'] == 'yes'):?>
425 <a href="<?php echo get_permalink($child_idlisting); ?>" title="<?php echo esc_attr__('View','wpdirectorykit');?>" target="blank">
426 <?php else:?>
427 <span>
428 <?php endif;?>
429
430 <?php if($field['is_stars'] == 'yes'):?>
431 <?php $stars = round(floatval(wdk_field_value( $field['field'], $child_idlisting)),2);?>
432 <span class="stars-lst">
433 <?php for ($i = 1; $i <= 5; $i++): ?>
434 <?php if ($i <=$stars): ?>
435 <span><i class="fas fa-star star-active"></i></span>
436 <?php elseif( abs($stars - $i) < 1): ?>
437 <span><i class="fas fa-star-half-alt"></i></span>
438 <?php else: ?>
439 <span><i class="far fa-star innactive"></i></span>
440 <?php endif; ?>
441 <?php endfor; ?>
442 </span>
443 <?php else:?>
444 <?php echo esc_html(apply_filters( 'wpdirectorykit/listing/field/prefix', wdk_field_option($field['field'],'prefix'), $field['field']));?>
445 <?php echo esc_html(apply_filters( 'wpdirectorykit/listing/field/value', wdk_field_value_on_type($field['field'], $child_idlisting, '-'), $field['field']));?>
446 <?php echo esc_html(apply_filters( 'wpdirectorykit/listing/field/suffix', wdk_field_option($field['field'],'suffix'), $field['field']));?>
447 <?php endif;?>
448
449 <?php if($field['is_link'] == 'yes'):?>
450 </a>
451 <?php else:?>
452 </span>
453 <?php endif;?>
454
455 <?php endforeach;?>
456 </li>
457 <?php endforeach;?>
458 </ul>
459 <?php endif;?>
460 </div>
461 <?php endif;?>
462 <?php if(!empty($features_part)):?>
463 <div class="wdk-features-part">
464 <?php foreach ($features_part as $key => $field):?> <?php if(in_array(wmvc_show_data('field_id', $field), array('agent_image','agent_email','agent_name'))):?>
465 <?php $user = wdk_get_user_data(wmvc_show_data('user_id_editor', $listing));?>
466 <?php if(!empty($user)): ?>
467 <span class="wdk-field-<?php echo esc_attr(wmvc_show_data('field_id', $field, ''));?>">
468 <?php if(!empty($user['profile_url']) && !empty($field['add_profile_link'])) :?>
469 <a href="<?php echo esc_url($user['profile_url']);?>" class="agent_logo_link">
470 <?php endif;?>
471 <?php
472 switch (wmvc_show_data('field_id', $field)) {
473 case 'agent_image':
474 ?>
475 <img class="agent_logo" src="<?php echo esc_url(wmvc_show_data('avatar', $user));?>" alt="<?php echo esc_attr(wmvc_show_data('display_name', $user['userdata']));?>">
476 <?php
477 break;
478 case 'agent_email':
479 ?>
480 <?php echo esc_html(wmvc_show_data('user_email', $user['userdata']));?>
481 <?php
482 break;
483 case 'agent_name':
484 ?>
485 <?php echo esc_html(wmvc_show_data('display_name', $user['userdata']));?>
486 <?php
487 break;
488 }
489 ?>
490
491 <?php if(!empty($user['profile_url']) && !empty($field['add_profile_link'])) :?>
492 </a>
493 <?php endif;?>
494 </span>
495 <?php endif;?>
496 <?php continue; endif;?><?php if(wmvc_show_data('field_type', $field) == 'CHECKBOX'):?>
497 <span class="wdk-field-<?php echo esc_attr(wmvc_show_data('field_id', $field, ''));?>"><?php echo esc_html(esc_html(wmvc_show_data('field_label', $field, '')));?></span>
498 <?php else:?>
499 <?php if(!wdk_filter_decimal(wmvc_show_data('value', $field))) continue;?>
500 <span class="wdk-field-item wdk-field-<?php echo esc_attr(wmvc_show_data('field_id', $field, ''));?>">
501 <?php if(wmvc_show_data('icon_id', $field, false)):?>
502 <img src="<?php echo esc_url(wdk_image_src($field, 'full',NULL,'icon_id'));?>" alt="<?php echo esc_attr(esc_html__(wmvc_show_data('field_label', $field, ''),'wpdirectorykit'));?>" class="wdk-icon">
503 <?php elseif(wmvc_show_data('is_label_disable', $resul_item_config, false) == 1):?>
504 <?php echo '<span class="wdk-rc-field-label">'.esc_html__(wmvc_show_data('field_label', $field, ''),'wpdirectorykit').':</span>';?>
505 <?php endif;?>
506
507 <?php if(wmvc_show_data('is_label_disable', $resul_item_config, false) != 1):?>
508 <?php echo '<span class="wdk-rc-field-label">'.esc_html__(wmvc_show_data('field_label', $field, ''),'wpdirectorykit').':</span>';?>
509 <?php endif;?>
510
511 <?php
512 echo '<span class="wdk-rc-field-prefix">'.esc_html__(apply_filters( 'wpdirectorykit/listing/field/prefix', wmvc_show_data('prefix', $field), wmvc_show_data('field_id', $field)),'wpdirectorykit').'</span>';
513
514 if(wdk_field_option(wmvc_show_data('field_id', $field), 'is_price_format') && wdk_field_option(wmvc_show_data('field_id', $field), 'field_type') == 'NUMBER') {
515 $value = strip_tags(apply_filters( 'wpdirectorykit/listing/field/value', wdk_filter_decimal(wmvc_show_data('value', $field)), wmvc_show_data('field_id', $field), FALSE));
516 echo '<span class="wdk-rc-field-value">'.esc_html__(wdk_number_format_i18n($value),'wpdirectorykit').'</span>';
517 } else {
518 echo '<span class="wdk-rc-field-value">'.esc_html__(strip_tags(apply_filters( 'wpdirectorykit/listing/field/value', do_shortcode(wdk_filter_decimal(wmvc_show_data('value', $field))), wmvc_show_data('field_id', $field))),'wpdirectorykit').'</span>';
519 }
520
521 echo '<span class="wdk-rc-field-suffix">'.esc_html__(apply_filters( 'wpdirectorykit/listing/field/suffix', wmvc_show_data('suffix', $field), wmvc_show_data('field_id', $field)),'wpdirectorykit').'</span>';
522 ?>
523 </span>
524 <?php endif;?>
525 <?php endforeach;?>
526 </div>
527 <?php endif;?>
528 <div class="wdk-divider"></div>
529 <div class="wdk-footer">
530 <div class="wdk-left">
531 <div class="wdk-price">
532 <?php if(!empty($price_part)):?>
533 <?php foreach ($price_part as $key => $field):?>
534 <?php if(in_array(wmvc_show_data('field_id', $field), array('agent_image','agent_email','agent_name'))):?>
535 <?php $user = wdk_get_user_data(wmvc_show_data('user_id_editor', $listing));?>
536 <?php if(!empty($user)): ?>
537 <span class="wdk-field-<?php echo esc_attr(wmvc_show_data('field_id', $field, ''));?>">
538 <?php if(!empty($user['profile_url']) && !empty($field['add_profile_link'])) :?>
539 <a href="<?php echo esc_url($user['profile_url']);?>" class="agent_logo_link">
540 <?php endif;?>
541 <?php
542 switch (wmvc_show_data('field_id', $field)) {
543 case 'agent_image':
544 ?>
545 <img class="agent_logo" src="<?php echo esc_url(wmvc_show_data('avatar', $user));?>" alt="<?php echo esc_attr(wmvc_show_data('display_name', $user['userdata']));?>">
546 <?php
547 break;
548 case 'agent_email':
549 ?>
550 <?php echo esc_html(wmvc_show_data('user_email', $user['userdata']));?>
551 <?php
552 break;
553 case 'agent_name':
554 ?>
555 <?php echo esc_html(wmvc_show_data('display_name', $user['userdata']));?>
556 <?php
557 break;
558 }
559 ?>
560
561 <?php if(!empty($user['profile_url']) && !empty($field['add_profile_link'])) :?>
562 </a>
563 <?php endif;?>
564 </span>
565 <?php endif;?>
566 <?php continue; endif;?>
567 <span class="wdk-field-<?php echo esc_attr(wmvc_show_data('field_id', $field, ''));?>">
568 <?php echo esc_html(apply_filters( 'wpdirectorykit/listing/field/prefix', wmvc_show_data('prefix', $field), wmvc_show_data('field_id', $field)));?>
569 <?php if(function_exists('run_wdk_currency_conversion') && wdk_field_option(wmvc_show_data('field_id', $field), 'field_type') == 'NUMBER'):?>
570 <?php
571 $value = strip_tags(apply_filters( 'wpdirectorykit/listing/field/value', (wmvc_show_data('value', $field)), wmvc_show_data('field_id', $field), FALSE));
572 echo esc_html(wdk_filter_decimal(wdk_number_format_i18n($value)));
573 ?>
574 <?php else:?>
575 <?php if(wdk_field_option(wmvc_show_data('field_id', $field), 'is_price_format') && wdk_field_option(wmvc_show_data('field_id', $field), 'field_type') == 'NUMBER'):?>
576 <?php
577 $value = strip_tags(apply_filters( 'wpdirectorykit/listing/field/value', (wmvc_show_data('value', $field)), wmvc_show_data('field_id', $field), FALSE));
578 echo esc_html(wdk_filter_decimal(wdk_number_format_i18n($value)));
579 ?>
580 <?php else:?>
581 <?php echo esc_html(strip_tags(apply_filters( 'wpdirectorykit/listing/field/value', (do_shortcode(wdk_filter_decimal(wmvc_show_data('value', $field)))), wmvc_show_data('field_id', $field))));?>
582 <?php endif;?>
583 <?php endif;?>
584 <?php echo esc_html(apply_filters( 'wpdirectorykit/listing/field/suffix', wmvc_show_data('suffix', $field), wmvc_show_data('field_id', $field)));?>
585 </span>
586
587 <?php endforeach;?>
588 <?php endif;?>
589 </div>
590 </div>
591 <div class="wdk-right">
592 <a href="<?php echo esc_url($url);?>" <?php echo $is_external ? 'target="_blank" rel="noopener noreferrer"' : ''; ?> title="<?php esc_attr__('Open Listing', 'wpdirectorykit');?>" class="wdk-btn"><?php echo wmvc_show_data('content_button_text', $settings, '');?><?php wdk_viewe($content_button_icon); ?></a>
593 </div>
594 </div>
595 <?php if($layout_type == 'grid' && wmvc_show_data('is_show_agent_details', $resul_item_config, '')):?>
596
597 <?php if(wmvc_show_data('user_id_editor', $listing, false, TRUE, TRUE) && wdk_get_user_data(wmvc_show_data('user_id_editor', $listing, false, TRUE, TRUE))):?>
598 <div class="wdk-listing-item-agent wdk-subtitle-part">
599 <?php
600
601 $user_editor_data = array(
602 'display_name'=> wmvc_show_data('user_id_editor_display_name', $listing, false, TRUE, TRUE),
603 'user_login'=>wmvc_show_data('user_id_editor_user_login', $listing, false, TRUE, TRUE),
604 'wdk_slug'=>wmvc_show_data('user_id_editor_wdk_slug', $listing, false, TRUE, TRUE),
605 'avatar'=>wmvc_show_data('user_id_editor_avatar', $listing, false, TRUE, TRUE),
606 );
607
608 /* query user data */
609 if(empty($user_editor_data['display_name'])) {
610 $user_editor_data = array(
611 'display_name'=> wdk_get_user_field (wmvc_show_data('user_id_editor', $listing, false, TRUE, TRUE), 'display_name'),
612 'user_login'=>wdk_get_user_field (wmvc_show_data('user_id_editor', $listing, false, TRUE, TRUE), 'user_login'),
613 'wdk_slug'=>wdk_get_user_field (wmvc_show_data('user_id_editor', $listing, false, TRUE, TRUE), 'wdk_slug'),
614 'avatar'=>wdk_get_user_data(wmvc_show_data('user_id_editor', $listing, false, TRUE, TRUE))['avatar'],
615 );
616 }
617
618 $profile_url = wdk_generate_profile_permalink($user_editor_data);
619 ?>
620 <div class="agent-thumbnail">
621 <?php if(!empty($profile_url) && $profile_url !='#') :?>
622 <a href="<?php echo esc_url($profile_url);?>"><img src="<?php echo esc_url(wmvc_show_data('avatar', $user_editor_data, false, TRUE, TRUE));?>" alt="<?php echo esc_attr(wmvc_show_data('display_name', $user_editor_data, false, TRUE, TRUE));?>"></a>
623 <?php else:?>
624 <img src="<?php echo esc_url(wmvc_show_data('avatar', $user_editor_data, false, TRUE, TRUE));?>" alt="<?php echo esc_attr(wmvc_show_data('display_name', $user_editor_data, false, TRUE, TRUE));?>">
625 <?php endif;?>
626 </div>
627 <div class="agent-cont">
628 <span class="by"><?php echo esc_html__('Listing By', 'wpdirectorykit');?></span>
629 <h4 class="title">
630 <?php if(!empty($profile_url) && $profile_url !='#') :?>
631 <a href="<?php echo esc_url($profile_url);?>"><?php echo esc_html(wmvc_show_data('display_name', $user_editor_data, false, TRUE, TRUE));?></a>
632 <?php else:?>
633 <?php echo esc_html(wmvc_show_data('display_name', $user_editor_data, false, TRUE, TRUE));?>
634 <?php endif;?>
635 </h4>
636 </div>
637 </div>
638 <?php endif;?>
639 <?php endif;?>
640
641 <?php if($layout_type == 'list'):?>
642 </div>
643 <?php endif;?>
644 </div>
645
646 <?php
647 $wdk_listing_result_id = null;
648 ?>