static function jv_claim_columns_function($columns_name, $post_id)
    {
        switch ($columns_name) {
            case 'username':
                echo get_post_meta($post_id, 'user_login', true);
                break;
            case 'email':
                echo get_post_meta($post_id, 'email', true);
                break;
            case 'phone':
                echo get_post_meta($post_id, 'phone', true);
                break;
            case 'content':
                echo javo_str_cut(get_post($post_id)->post_content, 80);
                break;
            case 'status':
                echo get_post_meta($post_id, 'approve', true) != 'approved' ? sprintf('<a
					class="button button-primary javo-claim-app"
					data-post-id="%s"
					data-user-login="******"
					data-user-name="%s"
					data-user-email="%s"
					href="#">%s</a>', $post_id, get_post_meta($post_id, 'user_login', true), get_post_meta($post_id, 'user_name', true), get_post_meta($post_id, 'email', true), __('Approve', 'javo_fr')) : __('Approved', 'javo_fr');
                break;
            case 'item-name':
                $parent_post_id = get_post_meta($post_id, 'parent_post_id', true);
                printf('<a href="%s">%s</a>', get_permalink($parent_post_id), get_post($parent_post_id)->post_title);
                break;
        }
    }
 public function __excerpt($length = 120, $html = false)
 {
     $javo__excerpt = javo_str_cut(strip_tags($this->post->post_content), (int) $length);
     if ($html) {
         $javo__excerpt = sprintf('<a href="%s" target="_self">%s</a>', get_permalink($this->post->ID), $javo__excerpt);
     }
     return $javo__excerpt;
 }
Exemple #3
0
				<?php 
if (is_search()) {
    // Only display Excerpts for Search
    ?>
					<div class="entry-summary">
						<?php 
    the_excerpt();
    ?>
					</div><!-- .entry-summary -->
				<?php 
} else {
    ?>
					<div class="entry-content">
						<?php 
    if (is_category()) {
        printf('<a href="%s">%s</a>', get_permalink(), javo_str_cut(get_the_excerpt(), 300));
    } else {
        the_content(__('Continue reading <span class="meta-nav">&rarr;</span>', 'javo_fr'));
    }
    ?>

						<?php 
    wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'javo_fr'), 'after' => '</div>'));
    ?>
					</div><!-- .entry-content -->
				<?php 
}
?>
			</div><!-- 12 Columns Close -->
		</div><!-- Row Close -->
		<footer class="entry-meta">
// Queries Loop
$javo_this_posts = get_posts($javo_this_posts_args);
foreach ($javo_this_posts as $post) {
    setup_postdata($post);
    $javo_meta_query = new javo_get_meta($post->ID);
    $javo_latlng = @unserialize($javo_meta_query->_get('latlng', array()));
    $javo_latlng = new javo_ARRAY($javo_latlng);
    $javo_set_icon = '';
    $javo_marker_term_id = wp_get_post_terms($post->ID, 'item_category');
    if (!empty($javo_marker_term_id)) {
        $javo_set_icon = get_option('javo_item_category_' . $javo_marker_term_id[0]->term_id . '_marker', '');
        if ($javo_set_icon == '') {
            $javo_set_icon = $javo_tso->get('map_marker', '');
        }
    }
    $javo_this_return[$post->ID] = array('post_title' => $post->post_title, 'contents' => javo_str_cut($post->content, 300), 'thumbnail' => get_the_post_thumbnail($post->ID, array(50, 50)), 'permalink' => get_permalink($post->ID), 'category' => $javo_meta_query->cat('item_category', __('No Category', 'javo_fr')), 'location' => $javo_meta_query->cat('item_location', __('No Location', 'javo_fr')), 'lat' => $javo_latlng->get('lat'), 'lng' => $javo_latlng->get('lng'), 'icon' => $javo_set_icon, 'phone' => $javo_meta_query->get('phone'), 'address' => $javo_meta_query->get('address'), 'mobile' => $javo_meta_query->get('mobile'), 'website' => $javo_meta_query->get('website'), 'email' => $javo_meta_query->get('email'), 'rating' => $javo_meta_query->get_child_count('ratings'), 'review' => $javo_meta_query->get_child_count('review'));
}
wp_reset_postdata();
?>

<!-- Javo Map Options -->
<fieldset class="hidden">
	<input type="hidden" javo-map-distance-unit value="<?php 
echo $javo_tso_map->get('distance_unit', __('km', 'javo_fr'));
?>
">
	<input type="hidden" javo-map-distance-max value="<?php 
echo (double) $javo_tso_map->get('distance_max', '500');
?>
">
	<input type="hidden" javo-map-read-more value="<?php 
					<!-- ./pull-left -->
					<a href="<?php 
the_permalink();
?>
">
						<?php 
if (has_post_thumbnail()) {
    the_post_thumbnail('javo-tiny', array('class' => 'javo-rotate-back-image'));
} else {
    printf('<img src="%s" style="width:80px; height:80px;" class="javo-rotate-back-image">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
}
?>
						<div class="row javo-rotate-inner-content">
							<div class="col-md-12">
								<?php 
$javo_this_content = javo_str_cut(get_the_excerpt(), 195);
echo $javo_this_content != "" ? $javo_this_content : __('No Content', 'javo_fr');
?>
							</div>
							<!-- /.col-md-12 -->
						</div>
						<!-- /.row -->
					</a>
						<span class="javo-sns-wrap social-wrap">
							<i class="sns-facebook" data-title="<?php 
the_title();
?>
" data-url="<?php 
the_permalink();
?>
">
            }
            if ('' === ($javo_set_icon = get_option("javo_item_category_{$javo_this_terms[0]}_marker", ''))) {
                $javo_set_icon = $javo_tso->get('map_marker', '');
            }
            $javo_this_thumb = '';
            if ('' !== ($javo_this_thumb_id = get_post_thumbnail_id($post->ID))) {
                $javo_this_thumb_url = wp_get_attachment_image_src($javo_this_thumb_id, 'javo-map-thumbnail');
                if (isset($javo_this_thumb_url)) {
                    $javo_this_thumb = $javo_this_thumb_url[0];
                }
            }
            // If not found this post a thaumbnail
            if (empty($javo_this_thumb)) {
                $javo_this_thumb = $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png');
            }
            $javo_relative_items[] = array('lat' => get_post_meta($post->ID, 'jv_item_lat', true), 'lng' => get_post_meta($post->ID, 'jv_item_lng', true), 'icon' => $javo_set_icon, 'thumbnail' => $javo_this_thumb, 'post_title' => wp_trim_words($post->post_title, 30), 'permalink' => apply_filters('javo_wpml_link', $post->ID), 'address' => javo_str_cut(get_post_meta($post->ID, 'jv_item_address', true), 25), 'mobile' => javo_str_cut(get_post_meta($post->ID, 'jv_item_mobile', true), 25), 'website' => javo_str_cut(get_post_meta($post->ID, 'jv_item_website', true), 25), 'email' => javo_str_cut(get_post_meta($post->ID, 'jv_item_email', true), 25), 'category' => javo_str_cut(get_term($javo_this_terms[0], 'item_category')->name, 25), 'location' => $javo_this_location);
        }
        // End Foreach
        wp_reset_postdata();
    }
    // End If
    ?>
<fieldset>
	<input type="hidden" value="<?php 
    echo $javo_tso->get('javo_single_map_style');
    ?>
" data-javo-map-none-style>
	<input type="hidden" value="<?php 
    echo $javo_tso->get('single_map_marker', null);
    ?>
" data-javo-map-single-marker>
Exemple #7
0
function javo_map_get_favorite_lists_callback()
{
    ob_start();
    if (is_user_logged_in()) {
        $javo_this_current_user_favorites = get_user_meta(get_current_user_id(), 'favorites', true);
        ?>
		<div class="alert alert-rectangle alert-dark alert-no-padding">
			<h3 class="javo-sidebar-title text-center"><?php 
        _e('My Favorites', 'javo_fr');
        ?>
</h3>
		</div>

		<!-- Todo: Insert Sidebar content here. XD -->
		<ul class="list-group">
			<?php 
        if (!empty($javo_this_current_user_favorites)) {
            foreach ($javo_this_current_user_favorites as $favorite) {
                if (!empty($favorite['post_id'])) {
                    $javo_this_post = get_post($favorite['post_id']);
                    if ($javo_this_post == null) {
                        continue;
                    }
                    printf('<li class="list-group-item javo-hmap-marker-trigger text-center" data-id="mid_%s" data-post-id="%s"><span class="glyphicon glyphicon-heart-empty"></span>%s</li>', $javo_this_post->ID, $javo_this_post->ID, javo_str_cut($javo_this_post->post_title, 23));
                }
            }
            // End foreach
        }
        // End if
        ?>
		</ul>
		<?php 
    } else {
        ?>
		<div class="well well-default">
			<strong><?php 
        _e('Alert', 'javo_fr');
        ?>
</strong>
			<p><?php 
        _e('Please login', 'javo_fr');
        ?>
</p>
		</div>
		<?php 
    }
    $javo_this_output = ob_get_clean();
    echo json_encode(array('html' => $javo_this_output));
    exit;
}
Exemple #8
0
    public static function events_func($atts, $content = "")
    {
        global $javo_custom_item_label, $javo_tso;
        extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'title_text_color' => '#000', 'sub_title_text_color' => '#000', 'line_color' => '#fff', 'category' => '', 'page' => (int) 4, 'order' => 'DESC', 'type' => 'single', 'nopaging' => true), $atts));
        $javo_events_args = array('post_type' => 'jv_events', 'post_status' => 'publish', 'posts_per_page' => $page > 0 ? $page : -1, 'order' => $order, 'orderby' => 'post_date');
        if ($category != '') {
            $javo_events_args['tax_query'][] = array('taxonomy' => 'jv_events_category', 'field' => 'term_id', 'terms' => $category);
        }
        $javo_events = new WP_Query($javo_events_args);
        ob_start();
        echo apply_filters('javo_shortcode_title', $title, $sub_title, array('title' => 'color:' . $title_text_color . ';', 'subtitle' => 'color:' . $sub_title_text_color . ';', 'line' => 'border-color:' . $line_color . ';'));
        ?>
		<div class="sc-wrap" id="javo-sc-events-listing">
			<div class="sc-items sc-item-long-line-box">
				<div class='row'>
					<?php 
        switch ($type) {
            case 'single':
                ?>
							<div class="javo-event-item-slider single-event-col">
								<div class="row">
									<div class="col-md-offset-9 col-md-3">
										<!-- Controls -->
										<div class="controls pull-right hidden-xs">
											<a class="left fa fa-chevron-left btn btn-success btn-circle btn-white" href="#javo-event-item-slider-container" data-slide="prev"></a>
											<a class="right fa fa-chevron-right btn btn-success btn-circle btn-white" href="#javo-event-item-slider-container" data-slide="next"></a>
										</div>
									</div>
								</div>
								<div id="javo-event-item-slider-container" class="carousel slide" data-ride="carousel">
									<!-- Wrapper for slides -->
									<div class="carousel-inner">
										<?php 
                $javo_active = ' active';
                $javo_events = new WP_Query($javo_events_args);
                if ($javo_events->have_posts()) {
                    while ($javo_events->have_posts()) {
                        $javo_events->the_post();
                        $javo_get_parent_id = (int) get_post_meta(get_the_ID(), 'parent_post_id', true);
                        $javo_get_parent = get_post($javo_get_parent_id);
                        if ($javo_get_parent == '') {
                            continue;
                        }
                        $javo_get_parent_url = apply_filters('javo_wpml_link', $javo_get_parent->ID) . '#item-event';
                        ?>
												<div class="item<?php 
                        echo $javo_active;
                        ?>
">
													<div class="col-sm-12 pull-left">
														<div class="row">
															<div class="col-md-12 text-center">
																<div class="javo-shortcode-event-listing one-col-event">
																	<?php 
                        if (has_post_thumbnail()) {
                            the_post_thumbnail('javo-box', array('class' => 'img-responsive'));
                        } else {
                            printf('<img src="%s" class="img-circle" style="width:100%%; height:246px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
                        }
                        ?>
																	<div class="javo-event-one-col">
																		<a href="<?php 
                        echo $javo_get_parent_url;
                        ?>
">
																			<?php 
                        echo $javo_get_parent->post_title;
                        ?>
																			<div class="offer">
																				<?php 
                        the_title();
                        ?>
<br/>
																			</div>
																			<div class="javo-event-one-col-content">
																				<?php 
                        echo javo_str_cut(get_the_excerpt(), 400);
                        ?>
																			</div><!-- events-content-->
																		</a>
																	</div> <!-- javo-shop-name-->
																</div><!-- javo-shortcode-event-listing-->
															</div>
														</div><!-- /.row -->
													</div><!-- /.col-md-12 -->
												</div><!-- /.item -->
												<?php 
                        $javo_active = null;
                        // End While
                    }
                    // ENd If
                }
                wp_reset_query();
                ?>
									</div>
								</div>
							</div>
							<?php 
                break;
            default:
                // NORMAL TYPE
                if ($type == 'two-cols') {
                    $javo_event_columns_slice = 6;
                    $javo_event_columns = 2;
                } else {
                    if ($type == 'three-cols') {
                        $javo_event_columns_slice = 4;
                        $javo_event_columns = 3;
                    } else {
                        $javo_event_columns_slice = 3;
                        $javo_event_columns = 4;
                    }
                }
                ?>
							<div class="javo-event-item-slider">

								<div class="row">
									<div class="col-md-offset-9 col-md-3">
										<!-- Controls -->
										<div class="controls pull-right hidden-xs">
											<a class="left fa fa-chevron-left btn btn-success btn-circle btn-white" href="#javo-event-item-slider-container" data-slide="prev"></a>
											<a class="right fa fa-chevron-right btn btn-success btn-circle btn-white" href="#javo-event-item-slider-container" data-slide="next"></a>
										</div>
									</div>
								</div><!-- /.row -->

								<div id="javo-event-item-slider-container" class="carousel slide" data-ride="carousel">
									<!-- Wrapper for slides -->
									<div class="carousel-inner">
										<div class="item active">
											<div class="row">
												<?php 
                $javo_integer = 0;
                $javo_this_event_posts = new WP_Query($javo_events_args);
                if ($javo_this_event_posts->have_posts()) {
                    while ($javo_this_event_posts->have_posts()) {
                        $javo_this_event_posts->the_post();
                        $javo_get_parent_id = (int) get_post_meta(get_the_ID(), 'parent_post_id', true);
                        if (null !== ($javo_get_parent = get_post($javo_get_parent_id))) {
                            $javo_get_parent_url = apply_filters('javo_wpml_link', $javo_get_parent->ID) . '#item-events';
                            $javo_meta_query = new javo_GET_META($javo_get_parent_id);
                            ?>
															<div class="col-sm-<?php 
                            echo $javo_event_columns_slice;
                            ?>
 pull-left javo-second-event-wrap">

																<div class="row">
																	<div class="col-md-12 text-center">
																		<div class="javo-second-event-listing ">
																			<!-- <div class="javo-shortcode-event-listing"> -->
																			<div class="event-inner-overlay-bg">
																				<a href="<?php 
                            echo $javo_get_parent_url;
                            ?>
">
																					<div class="event-image-inner-top">
																						<div class="offer">
																							<?php 
                            the_title();
                            ?>
																						</div><!-- offer -->
																					</div><!-- event-image-inner-top -->
																					<div class="col-md-7 events-content">
																						<?php 
                            echo javo_str_cut(get_the_excerpt(), 70);
                            ?>
																					</div><!-- events-content-->
																				</a>
																			</div><!-- event-inner-overlay-bg -->
																			<?php 
                            if (has_post_thumbnail()) {
                                if ($javo_event_columns != 2) {
                                    the_post_thumbnail('javo-box', array('class' => 'img-responsive'));
                                } else {
                                    the_post_thumbnail('javo-box-v', array('class' => 'img-responsive'));
                                }
                            } else {
                                printf('<img src="%s" style="width:100%%; height:246px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
                            }
                            ?>

																			<div class="item-name">
																				<span class="top-small-post-title">
																					<?php 
                            if (strlen($javo_get_parent->post_title) > 30) {
                                echo substr($javo_get_parent->post_title, 0, 30) . '...';
                            } else {
                                echo $javo_get_parent->post_title;
                            }
                            ?>
																				</span>
																			</div> <!-- item-name -->
																		</div><!-- javo-shortcode-event-listing -->

																		<div class="javo-left-overlay bg-black">
																			<?php 
                            if (get_post_meta(get_the_ID(), 'brand', true) != "") {
                                ?>
																			<div class="javo-txt-meta-area admin-color-setting">
																				<?php 
                                echo get_post_meta(get_the_ID(), 'brand', true);
                                ?>
																			</div> <!-- javo-txt-meta-area -->
																			<div class="corner-wrap ">
																				<div class="corner admin-color-setting"></div>
																				<div class="corner-background admin-color-setting"></div>
																			</div> <!-- corner-wrap -->
																			<?php 
                            }
                            ?>
																		</div><!-- /.javo-left-overlay -->
																	</div><!-- /.col-md-12 -->
																</div><!-- /.row -->

															</div><!-- /.javo-second-event-wrap -->
															<?php 
                            $javo_integer++;
                        }
                        if ($javo_integer % $javo_event_columns == 0 && $javo_integer < $page) {
                            echo "</div></div><div class='item'><div class='row'>";
                        }
                    }
                    // Close While
                } else {
                    ?>
													<div class="col-md-12">
														<?php 
                    _e('No event posts found.', 'javo_fr');
                    ?>
													</div>
													<?php 
                }
                // Close if
                wp_reset_query();
                ?>
											</div><!-- /.row -->
										</div><!-- /.item.active -->
									</div><!-- Carousel Inner -->
								</div><!-- Slider Container -->
							</div>
					<?php 
                // End Default
                // End Switch
        }
        ?>
				</div><!-- row -->
			</div><!-- /.sc-item-long-line-box -->
		</div><!-- /#javo-sc-events-listing -->
		<?php 
        return ob_get_clean();
    }
Exemple #9
0
function rating_list_function($atts, $content = '')
{
    global $javo_tso;
    wp_enqueue_style('javo-rating-list-css', JAVO_THEME_DIR . '/library/shortcodes/rating-list/javo-rating-list.css', '1.0');
    extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'title_text_color' => '#000', 'sub_title_text_color' => '#000', 'line_color' => '#fff', 'count' => 5), $atts));
    $javo_this_ratings_args = array('post_type' => 'item', 'post_status' => 'publish', 'posts_per_page' => $count, 'orderby' => 'meta_value', 'meta_key' => 'rating_average');
    ob_start();
    echo apply_filters('javo_shortcode_title', $title, $sub_title, array('title' => 'color:' . $title_text_color . ';', 'subtitle' => 'color:' . $sub_title_text_color . ';', 'line' => 'border-color:' . $line_color . ';'));
    ?>
	<div class="javo-rating-list-wrap">
		<?php 
    $javo_this_ratings = new WP_Query($javo_this_ratings_args);
    if ($javo_this_ratings->have_posts()) {
        $i = 1;
        while ($javo_this_ratings->have_posts()) {
            $javo_this_ratings->the_post();
            $javo_this_score = (double) get_post_meta(get_the_ID(), 'rating_average', true);
            $javo_meta_query = new javo_GET_META(get_the_ID());
            $rating_raniking_num = $i++;
            ?>
				<div class="row rating_list top-ranker">
					<div class="col-md-3 top-ratings-thumb">
						<a href="<?php 
            the_permalink();
            ?>
.#item-ratings">
							<?php 
            if (has_post_thumbnail()) {
                the_post_thumbnail('thumbnail');
            } else {
                printf('<img src="%s" class="img-responsive wp-post-image img-circle" style="width:80px; height:80px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
            }
            ?>
						</a>
						<div class="top-ratings-num rating-num-<?php 
            echo $rating_raniking_num;
            ?>
"><?php 
            echo $rating_raniking_num;
            ?>
</div>
					</div>
					<div class="col-md-6 javo-p-t-20px">
						<a href="<?php 
            the_permalink();
            ?>
.#item-ratings">
							<h3><?php 
            echo javo_str_cut(get_the_title(), 20);
            ?>
</h3>
							<p><?php 
            printf('%s / %s', $javo_meta_query->cat('item_category', __('No category', 'javo_fr')), $javo_meta_query->cat('item_location', 'No Location'));
            ?>
</p>
						</a>
					</div>
					<div class="col-md-2 javo-p-t-20px">
						<div class="text-center">
							<?php 
            printf('<span class="rating_ave">%s</span> / <span class="rating_amount">%s</span>', $javo_this_score, $javo_meta_query->get_child_count('ratings', 'rating_parent_post_id'));
            ?>
						</div>
						<div class="javo-rating-registed-score" data-score="<?php 
            echo $javo_this_score;
            ?>
" title=<?php 
            _e("gorgeous", "javo_fr");
            ?>
></div>
					</div><!-- Col -->
				</div><!-- rating_list-imgs -->
				<?php 
        }
        // End While
    } else {
        _e('Not Items Found.', 'javo_fr');
    }
    // End If
    ?>
	</div>
	<?php 
    wp_reset_query();
    $content = ob_get_clean();
    return $content;
}
Exemple #10
0
										<div class="sub-cat-wraps-wrap">
											<div class="sub-cat-wraps">
												<a href="<?php 
                echo get_term_link($term);
                ?>
">
													<h4 class="category-title"><?php 
                echo $term->name;
                ?>
<br><small><?php 
                printf('%s %s', __('in', 'javo_fr'), strtoupper($javo_this_terms_object->name));
                ?>
</small></h3>
													<blockquote>
														<footer><?php 
                echo javo_str_cut($term->description, 130);
                ?>
</footer>
													</blockquote>
												</a>
											</div> <!-- sub-cat-wraps -->
										</div> <!-- sub-cat-wraps-wrap -->
									</div>
									<?php 
            }
        }
    } else {
        printf('<div class="col-md-12 no-found-sub-categories"><h4>%s</h4></div>', __("Sub Categories not found", 'javo_fr'));
    }
    // End if
    ?>
    public static function javo_events_gallery_function($atts = array(), $content = "")
    {
        global $javo_tso;
        self::$load_script = true;
        extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'title_text_color' => '#000', 'sub_title_text_color' => '#000', 'line_color' => '#fff', 'display_type' => 'parent'), $atts));
        $javo_this_gallery_args = array("post_type" => 'jv_events', "post_status" => 'publish', "posts_per_page" => -1);
        $javo_this_get_term_args = array();
        $javo_this_get_term_args['hide_empty'] = false;
        if ($display_type == 'parent' || $display_type == '') {
            $javo_this_get_term_args['parent'] = 0;
        }
        $javo_events_gallery_posts = new WP_Query($javo_this_gallery_args);
        $javo_events_gallery_terms = get_terms("jv_events_category", $javo_this_get_term_args);
        ob_start();
        echo apply_filters('javo_shortcode_title', $title, $sub_title, array('title' => 'color:' . $title_text_color . ';', 'subtitle' => 'color:' . $sub_title_text_color . ';', 'line' => 'border-color:' . $line_color . ';'));
        ?>
		<div id="javo-events-gall">
			<div class="javo-events-gallery-navi">
				<button class="javo-event-gallery-filter" data-filter="all"><?php 
        _e('ALL', 'javo_fr');
        ?>
</button>
				<?php 
        foreach ($javo_events_gallery_terms as $term) {
            printf('<button class="javo-event-gallery-filter gallery-terms-btn" data-filter=".javo-events-gallery-term-%s">%s</button>', $term->term_id, strtoupper($term->name));
        }
        ?>
			</div>
			<div class="javo-events-gallery row">
				<?php 
        if ($javo_events_gallery_posts->have_posts()) {
            while ($javo_events_gallery_posts->have_posts()) {
                $javo_events_gallery_posts->the_post();
                $javo_meta_query = new javo_GET_META(get_the_ID());
                $javo_this_parent_permalink = apply_filters('javo_wpml_link', get_post_meta(get_the_ID(), 'parent_post_id', true));
                $javo_this_parent_permalink .= "#item-events";
                $javo_this_include_terms = $javo_meta_query->cat('jv_events_category', false, false, true);
                $javo_this_terms = '';
                if ($javo_this_include_terms != false) {
                    foreach ($javo_this_include_terms as $terms) {
                        $javo_this_terms .= ' javo-events-gallery-term-' . $terms->term_id;
                    }
                } else {
                    $javo_this_terms = ' javo-events-gallery-term-all';
                }
                ?>
						<div class="col-md-3 javo-event-gallery-mix<?php 
                echo $javo_this_terms;
                ?>
">
							<a href="<?php 
                echo $javo_this_parent_permalink;
                ?>
">
								<?php 
                if (has_post_thumbnail()) {
                    echo get_the_post_thumbnail(get_the_ID(), 'javo-box');
                } else {
                    printf('<img src="%s" class="jv-events-gallery-no-image" style="width:100%%; height:266px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
                }
                ?>
							</a>
							<div class="javo-events-gallery-term-content-title"><span><?php 
                echo javo_str_cut(get_the_title(), 25);
                ?>
</span></div>

							<?php 
                if (get_post_meta(get_the_ID(), 'brand', true)) {
                    ?>
								<div class="event-tag custom-bg-color-setting admin-color-setting">
									<?php 
                    echo apply_filters('javo_offer_brand_tag', get_post_meta(get_the_ID(), 'brand', true));
                    ?>
								</div>
							<?php 
                }
                ?>
						</div>
						<?php 
            }
            // End While
        } else {
            _e('No Items Found.', 'javo_fr');
        }
        // End If
        wp_reset_query();
        ?>
				<div class="gap"></div>
				<div class="gap"></div>
			</div>
		</div>
		<script type="text/javascript">
		jQuery(function($){
			"use strict";
			$('.javo-events-gallery').mixItUp({
				selectors:{
					target		: '.javo-event-gallery-mix'
					, filter	: '.javo-event-gallery-filter'

				}

			});
		});
		</script>
	<?php 
        return ob_get_clean();
    }
 static function javo_map_callback()
 {
     // Get Theme Settings
     global $javo_tso, $javo_tso_map, $javo_favorite;
     // Get Parameter of Queries
     $javo_query = new javo_array($_POST);
     // Setup Agrumnets
     $javo_this_posts_args = array('post_status' => 'publish', 'post_type' => $javo_query->get('post_type', 'post'), 'posts_per_page' => $javo_query->get('ppp', 10), 'paged' => (int) $javo_query->get('current', 1), 'order' => $javo_query->get('order', 'DESC'));
     // WPML
     if ($javo_query->get('lang', null) != null) {
         global $sitepress;
         if (!empty($sitepress)) {
             $sitepress->switch_lang($javo_query->get('lang'), true);
         }
     }
     // Apply Filter
     if ($javo_query->get('filter', null) != null) {
         if (is_Array($javo_query->get('filter'))) {
             foreach ($javo_query->get('filter') as $taxonomy => $terms) {
                 if (!empty($terms)) {
                     $javo_this_posts_args['tax_query']['relation'] = 'AND';
                     $javo_this_posts_args['tax_query'][] = array('taxonomy' => $taxonomy, 'field' => 'term_id', 'terms' => $terms);
                 }
             }
         }
     }
     // Set Keyword
     if ($javo_query->get('keyword', null) != null) {
         $javo_this_posts_args['s'] = $javo_query->get('keyword');
     }
     switch ($javo_query->get('panel', 'list')) {
         case 'featured':
             $javo_this_posts_args['meta_query']['relation'] = 'AND';
             $javo_this_posts_args['meta_query'][] = array('key' => 'javo_this_featured_item', 'compare' => '=', 'value' => 'use');
             break;
         case 'favorite':
             $javo_this_posts_args = array('post_type' => $javo_query->get('post_type', 'post'));
             $javo_this_user_favorite = (array) get_user_meta(get_current_user_id(), 'favorites', true);
             $javo_this_user_favorite_posts = array('0');
             if (!empty($javo_this_user_favorite)) {
                 foreach ($javo_this_user_favorite as $favorite) {
                     if (!empty($favorite['post_id'])) {
                         $javo_this_user_favorite_posts[] = $favorite['post_id'];
                     }
                 }
                 // End foreach
             }
             // End if
             $javo_this_posts_args['post__in'] = (array) $javo_this_user_favorite_posts;
             break;
         case 'list':
         default:
     }
     // Set Read More
     if ($javo_query->get('offset', null) != null) {
         $javo_this_posts_args['offset'] = $javo_query->get('offset');
     }
     // Return Variables
     $javo_this_return = array();
     // Queries Loop
     $javo_this_posts = new WP_Query($javo_this_posts_args);
     if ($javo_this_posts->have_posts()) {
         while ($javo_this_posts->have_posts()) {
             $javo_this_posts->the_post();
             $javo_meta_query = new javo_get_meta(get_the_ID());
             $javo_rating = new javo_RATING(get_the_ID());
             $javo_latlng = @unserialize($javo_meta_query->_get('latlng', array()));
             $javo_latlng = new javo_ARRAY($javo_latlng);
             $javo_set_icon = '';
             $javo_marker_term_id = wp_get_post_terms(get_the_ID(), 'item_category');
             if (!empty($javo_marker_term_id)) {
                 $javo_set_icon = get_option('javo_item_category_' . $javo_marker_term_id[0]->term_id . '_marker', '');
                 if ($javo_set_icon == '') {
                     $javo_set_icon = $javo_tso->get('map_marker', '');
                 }
             }
             $javo_this_thumbnail = get_the_post_thumbnail(get_the_ID(), array(50, 50));
             $javo_this_thumbnail = $javo_this_thumbnail != '' ? $javo_this_thumbnail : sprintf('<img src="%s" class="img-responsive wp-post-image" style="width:50px; height:50px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
             $javo_this_thumbnail_large = get_the_post_thumbnail(get_the_ID(), 'javo-box-v', array('class' => 'group list-group-image item-thumbs'));
             $javo_this_thumbnail_large = $javo_this_thumbnail_large != '' ? $javo_this_thumbnail_large : sprintf('<img src="%s" style="width:100%%; height:219px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
             $javo_this_author_avatar_id = get_the_author_meta('avatar');
             $javo_this_author_avatar = wp_get_attachment_image($javo_this_author_avatar_id, 'javo-tiny', true, array('class' => 'img-circle', 'style' => 'width:50px; height:50px;'));
             $javo_this_return[get_the_ID()] = array('post_title' => get_the_title(), 'contents' => javo_str_cut(strip_shortcodes(get_the_excerpt()), 300), 'thumbnail' => $javo_this_thumbnail, 'thumbnail_large' => $javo_this_thumbnail_large, 'avatar' => $javo_this_author_avatar, 'author_name' => get_the_author_meta('display_name'), 'permalink' => get_permalink(), 'category' => $javo_meta_query->cat('item_category', __('No Category', 'javo_fr')), 'location' => $javo_meta_query->cat('item_location', __('No Location', 'javo_fr')), 'favorite' => $javo_favorite->on(get_the_ID(), ' saved'), 'lat' => $javo_latlng->get('lat'), 'lng' => $javo_latlng->get('lng'), 'icon' => $javo_set_icon, 'phone' => $javo_meta_query->get('phone'), 'mobile' => $javo_meta_query->get('mobile'), 'website' => $javo_meta_query->get('website'), 'email' => $javo_meta_query->get('email'), 'address' => $javo_meta_query->get('address'), 'rating' => $javo_rating->parent_rating_average, 'rating_count' => $javo_meta_query->get_child_count('ratings'), 'review_count' => $javo_meta_query->get_child_count('review'));
         }
     }
     wp_reset_query();
     $javo_this_pagination = '';
     if ($javo_query->get('pagination') == 'read_more') {
         $javo_this_pagination = sprintf('<a class="btn btn-primary btn-block javo-wide-map-read-more">%s</a>', __('Read More', 'javo_fr'));
     } else {
         $javo_this_pagination = sprintf('<div class="javo_pagination">%s</div>', paginate_links(array('base' => "%_%", 'format' => '?%#%', 'current' => (int) $javo_query->get('current', 1), 'total' => $javo_this_posts->max_num_pages)));
     }
     echo json_encode(array('state' => 'success', 'result' => $javo_this_return, 'pagination' => $javo_this_pagination));
     exit;
 }
    public function time_line_ajax()
    {
        $javo_query = new javo_array($_POST);
        $javo_ajax_timeline_args = array('post_type' => 'post', 'post_status' => 'publish', 'offset' => (int) $javo_query->get('offset'), 'posts_per_page' => (int) $javo_query->get('count'));
        $javo_item_timeline = new wp_query($javo_ajax_timeline_args);
        ob_start();
        if ($javo_item_timeline->have_posts()) {
            $i = 0;
            while ($javo_item_timeline->have_posts()) {
                $i++;
                $javo_item_timeline->the_post();
                switch ($i % 5) {
                    case 0:
                        $javo_badge = "warning";
                        break;
                    case 1:
                        $javo_badge = "danger";
                        break;
                    case 2:
                        $javo_badge = "primary";
                        break;
                    case 3:
                        $javo_badge = "info";
                        break;
                    case 4:
                        $javo_badge = "success";
                        break;
                    default:
                        $javo_badge = "";
                }
                ?>

				<li<?php 
                echo $i % 2 == 0 ? ' class="jv_timeline-inverted"' : '';
                ?>
>
					<div class="jv_timeline-badge <?php 
                echo $javo_badge;
                ?>
"><i class="glyphicon glyphicon-check"></i></div>
					<div class="jv_timeline-panel">
						<div class="jv_timeline-heading">
							<h4 class="jv_timeline-title"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h4>
							<p><small class="text-muted"><i class="glyphicon glyphicon-time"></i> <?php 
                echo get_the_date();
                ?>
</small></p>
						</div>
						<div class="jv_timeline-body">
							<div class="row">
								<a href="<?php 
                the_permalink();
                ?>
">
									<div class="col-md-6">
										<?php 
                if (has_post_thumbnail()) {
                    the_post_thumbnail('medium');
                }
                ?>
									</div>
									<div class="col-md-6">
										<?php 
                echo javo_str_cut(get_the_content(), 150);
                ?>
									</div>
								</a>
							</div><!-- Close Row -->
						</div><!-- Timeline Body-->
					</div>
				</li>
			<?php 
            }
            // End While
        }
        // End If
        $javo_timeline_content = ob_get_clean();
        wp_reset_query();
        echo json_encode(array('result' => 'hi', 'content' => $javo_timeline_content));
        exit;
    }
    function widget($args, $instance)
    {
        global $javo_tso;
        extract($args, EXTR_SKIP);
        $javo_query = new javo_ARRAY($instance);
        $javo_this_post_type = $javo_query->get('post_type', 'post');
        $javo_this_post_excerpt_limit = (int) $javo_query->get('excerpt_length', 20);
        $javo_this_widget_title = apply_filters('widget_title', $javo_query->get('title', null));
        $javo_this_posts_args = array('post_type' => $javo_this_post_type, 'posts_per_page' => (int) $javo_query->get('post_count', 3), 'post_status' => 'publish');
        $javo_this_posts = new WP_Query($javo_this_posts_args);
        ob_start();
        echo $before_widget;
        echo $before_title . $javo_this_widget_title . $after_title;
        ?>
		<div class="widget_posts_wrap">
			<?php 
        if ($javo_this_posts->have_posts()) {
            while ($javo_this_posts->have_posts()) {
                $javo_this_posts->the_post();
                switch ($javo_this_post_type) {
                    case 'jv_events':
                        $javo_this_permalink = javo_url(get_post_meta(get_the_ID(), 'parent_post_id', true)) . '#item-events';
                        break;
                    case 'review':
                        $javo_this_permalink = javo_url(get_post_meta(get_the_ID(), 'parent_post_id', true)) . '#item-reviews';
                        break;
                    default:
                        $javo_this_permalink = get_permalink();
                }
                ?>
					<div class="latest-posts posts row">
						<div class="col-md-12">
							<span class='thumb'>
								<a href="<?php 
                echo $javo_this_permalink;
                ?>
">
									<?php 
                if (has_post_thumbnail()) {
                    the_post_thumbnail('javo-tiny');
                } else {
                    printf('<img src="%s" class="wp-post-image" style="width:50px; height:50px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
                }
                ?>
								</a>
							</span>
							<?php 
                printf('<h3><a href="%s">%s</a></h3><a href="%s"><span>%s</span></a>', $javo_this_permalink, javo_str_cut(get_the_title(), 20), $javo_this_permalink, javo_str_cut(strip_tags(get_the_excerpt()), $javo_this_post_excerpt_limit));
                ?>
						</div><!-- /.col-md-12 -->
					</div><!-- /.row -->
					<?php 
            }
        } else {
            _e('Not Found Posts.', 'javo_fr');
        }
        ?>
		</div><!-- /.widget_posts_wrap -->
		<?php 
        wp_reset_query();
        echo $after_widget;
        ob_end_flush();
    }
Exemple #15
0

							</div><!-- /.col-md-4 -->
						</div><!-- /.row -->


						<div class="row">
							<div class="col-md-12 javo-archive-list-excerpt">
								<a href="<?php 
the_permalink();
?>
">
									<div class="javo-archive-list-inner-excerpt">
										<?php 
$javo_this_excerpt = get_the_excerpt() != "" ? get_the_excerpt() : __('No Content', 'javo_fr');
echo javo_str_cut($javo_this_excerpt, 550);
?>
									</div>
								</a>

							</div><!-- /.col-md-12 -->

						</div><!-- /.row -->

					</div><!-- /.media-body -->
				</div><!-- /.media	 -->
			</div><!-- /.col-md-12 -->
		</div><!-- /.row -->
		<div class="javo-archive-list-content-bottom">
			<div class="row">
				<div class="col-md-9 col-sm-10">
Exemple #16
0
    public function team_slider_callback($atts, $content = '')
    {
        global $javo_tso;
        extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'title_text_color' => '#000', 'sub_title_text_color' => '#000', 'line_color' => '#fff', 'column' => '3'), $atts));
        wp_enqueue_style('javo-team-slider-css', JAVO_THEME_DIR . '/library/shortcodes/team-slider/javo-team-slider.css', '1.0');
        $javo_team_slider_args = array('post_type' => 'jv_team', 'post_status' => 'publish', 'posts_per_page' => -1);
        $javo_item_team = new wp_query($javo_team_slider_args);
        $javo_team_columns = $column;
        if ($column == 4) {
            $javo_team_columns_slice = 3;
        } else {
            if ($column == 3) {
                $javo_team_columns_slice = 4;
            } else {
                $javo_team_columns_slice = 6;
            }
        }
        ob_start();
        ?>
		<?php 
        echo apply_filters('javo_shortcode_title', $title, $sub_title, array('title' => 'color:' . $title_text_color . ';', 'subtitle' => 'color:' . $sub_title_text_color . ';', 'line' => 'border-color:' . $line_color . ';'));
        ?>
		<div class="javo-team-item-slider">
			<div class="row">
				<div class="col-md-3 col-sm-3 col-xs-3 team-slide-arrow">
					<!-- Controls -->
					<div class="controls pull-right">
						<a class="left fa fa-chevron-left btn btn-success" href="#javo-team-item-slider-container" data-slide="prev"></a>
						<a class="right fa fa-chevron-right btn btn-success" href="#javo-team-item-slider-container" data-slide="next"></a>
					</div>
				</div>
			</div>


			<div id="javo-team-item-slider-container" class="carousel slide" data-ride="carousel">
				<!-- Wrapper for slides -->
				<div class="carousel-inner">
				<?php 
        for ($i = 0; $i < ceil($javo_item_team->post_count / (int) $javo_team_columns); $i++) {
            ?>
						<div class="item<?php 
            echo $i == 0 ? ' active' : '';
            ?>
">
							<div class="row">
							<?php 
            $javo_team_slider_args['offset'] = $i * $javo_team_columns;
            $javo_team_slider_args['posts_per_page'] = $javo_team_columns;
            $javo_this_team_posts = new WP_Query($javo_team_slider_args);
            if ($javo_this_team_posts->have_posts()) {
                while ($javo_this_team_posts->have_posts()) {
                    $javo_this_team_posts->the_post();
                    ?>
										<div class="col-sm-<?php 
                    echo $javo_team_columns_slice;
                    ?>
 col-xs-6 pull-left" id="grid-listing">
											<div class="row">
												<div class="col-md-12">
													<?php 
                    if (has_post_thumbnail()) {
                        the_post_thumbnail('javo-avatar', array('class' => 'img-responsive'));
                    } else {
                        printf('<img src="%s" class="img-responsive">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
                    }
                    ?>
												</div>
											</div>
											<div class="row margin-30-0">
												<div class="col-md-12">
													<big><?php 
                    the_title();
                    ?>
</big>
												</div>

											</div>
											<div class="row">
												<div class="col-md-12">
													<?php 
                    echo javo_str_cut(get_the_excerpt(), 130);
                    ?>
												</div>
											</div>
										</div>
									<?php 
                }
                // Close While
            } else {
                ?>
								<div class="col-md-12">
									<?php 
                _e('No team posts found.', 'javo_fr');
                ?>
								</div>
								<?php 
            }
            // Close if
            ?>
							</div>
						</div>
					<?php 
        }
        // Close For
        ?>
				</div><!-- Carousel Inner -->
			</div><!-- Slider Container -->
		</div><!-- Slider Shortcode Wrap -->


		<?php 
        wp_reset_query();
        $content = ob_get_clean();
        return $content;
    }
Exemple #17
0
 public static function javo_post_excerpt_callback($post_content, $length = -1)
 {
     $javo_return = strip_tags($post_content);
     $javo_return = strip_shortcodes($javo_return);
     $javo_return = esc_attr($javo_return);
     if ($length > 0) {
         $javo_return = javo_str_cut($javo_return, (int) $length);
     }
     return $javo_return;
 }
 public function excerpt($length = 150)
 {
     return javo_str_cut(strip_tags(self::$post->post_content), $length);
 }
function javo_post_list_callback()
{
    // Wordpress Queries
    global $wp_query, $javo_tso, $javo_favorite, $javo_custom_item_label, $javo_custom_item_tab;
    $video_media = array("youtube" => "//www.youtube.com/embed/", "vimeo" => "//player.vimeo.com/video/", "screenr" => "//www.youtube.com/embed/", "dailymotion" => "//www.youtube.com/embed/", "metacafe" => "//www.youtube.com/embed/");
    $javo_query = new javo_ARRAY($_POST);
    if ($javo_query->get('lang', null) != null) {
        global $sitepress;
        if (!empty($sitepress)) {
            $sitepress->switch_lang($javo_query->get('lang'), true);
        }
    }
    // List view tyope
    $mode = $javo_query->get('type', null);
    $post_type = $javo_query->get('post_type', 'item');
    $p = $javo_query->get('post_id', null);
    $ppp = $javo_query->get('ppp', 10);
    $page = $javo_query->get('page', 1);
    $tax = $javo_query->get('tax', 10);
    $term_meta = $javo_query->get('term_meta', 10);
    $meta = array();
    $args = array('post_type' => $post_type, 'post_status' => 'publish', 'posts_per_page' => $ppp, 'paged' => $page);
    if ((int) $p > 0) {
        $args['p'] = $p;
    }
    if ($tax != NULL && is_Array($tax)) {
        foreach ($tax as $key => $value) {
            if ($value != "") {
                $args['tax_query']['relation'] = "AND";
                $args['tax_query'][] = array("taxonomy" => $key, "field" => "term_id", "terms" => $value);
            }
        }
    }
    if ($term_meta != NULL && is_Array($term_meta)) {
        foreach ($term_meta as $key => $value) {
            if ($value != "") {
                $args['meta_query']['relation'] = "AND";
                $args['meta_query'][] = array("key" => $key, "value" => (int) $value, "compare" => ">=");
            }
        }
    }
    $args["s"] = $javo_query->get('keyword', null);
    // Not found image featured url
    $noimage = JAVO_IMG_DIR . "/no-image.png";
    ob_start();
    ?>
	<script type="text/javascript">
	if(typeof(window.jQuery) != "undefined")
	{
		jQuery(document).ready(function($)
		{
			"use strict";
			$(".javo_hover_body").css({
				"position":"absolute",
				"top":"0",
				"left":"0",
				"z-index":"2",
				"width":"100%",
				"height":"100%",
				"padding":"10px",
				"margin": "0px",
				"backgroundColor":"rgba(0, 0, 0, 0.4)",
				"display":"none"
			});
			$(".javo_img_hover")
				.css({
					"position":"relative", "overflow":"auto", "display":"inline-block"
				}).hover(function(){
					$(this).find(".javo_hover_body").fadeIn("fast");
				}, function(){
					$(this).find(".javo_hover_body").clearQueue().fadeOut("slow");
				});
		});
	};
	</script>
	<?php 
    switch ($mode) {
        case 2:
            $posts = new WP_Query($args);
            ?>
		<div class="row javo-item-grid-listing">
			<?php 
            $i = 0;
            ## Thumbnail Type ###################
            if ($posts->have_posts()) {
                while ($posts->have_posts()) {
                    $posts->the_post();
                    $javo_meta_query = new javo_GET_META(get_the_ID());
                    $meta = array('strong' => $javo_meta_query->cat('item_category', __('No Category', 'javo_fr')), "featured" => $javo_meta_query->cat('item_location', __('No Location', 'javo_fr')));
                    ?>
					<div class="col-md-4 col-sm-6 col-xs-6 pull-left">
						<div class="panel panel-default panel-relative">
							<?php 
                    $detail_images = (array) @unserialize(get_post_meta(get_the_ID(), "detail_images", true));
                    $detail_images[] = get_post_thumbnail_id(get_the_ID());
                    if (!empty($detail_images)) {
                        echo '<div class="javo_detail_slide">';
                        $javo_this_image_meta = wp_get_attachment_image_src($detail_images, 'large');
                        $javo_this_image = $javo_this_image_meta[0];
                        ?>

									<?php 
                        echo '<ul class="slides list list-unstyled">';
                        foreach ($detail_images as $index => $image) {
                            $javo_this_image_meta = wp_get_attachment_image_src($image, 'full');
                            $javo_this_image = $javo_this_image_meta[0];
                            ?>
										<li>
											<u href="<?php 
                            echo $javo_this_image;
                            ?>
" style="cursor:pointer;">
												<?php 
                            $javo_this = wp_get_attachment_image($image, "javo-box-v", false);
                            if ($javo_this) {
                                echo $javo_this;
                            } else {
                                printf('<img src="%s" class="img-responsive wp-post-image" style="width:100%%; height:201px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
                            }
                            ?>
											</u>
										</li>
										<?php 
                        }
                        echo '</ul>';
                        echo '</div>';
                    }
                    ?>
							<div class="panel-body">
								<div class="col-md-12">
									<a href="<?php 
                    the_permalink();
                    ?>
" class="javo-tooltip javo-igl-title"  title="<?php 
                    the_title();
                    ?>
">
										<div>
											<h2 class="panel-title text-center">
												<strong> <?php 
                    echo javo_str_cut(get_the_title(), 120);
                    ?>
 </strong>
											</h2>
											<div class="text-center"><?php 
                    echo $meta['strong'];
                    ?>
</div>
										</div>
									</a>
									<ul class="list list-unstyled">
										<li class="text-center text-excerpt javo-grid-listing-excerpt"><?php 
                    echo javo_str_cut(get_the_excerpt(), 150);
                    ?>
</li>
										<li class="text-center">
											<h2 class="javo-sns-wrap social-wrap">
												<i class="sns-facebook" data-title="<?php 
                    the_title();
                    ?>
" data-url="<?php 
                    the_permalink();
                    ?>
">
													<a class="facebook javo-tooltip" title="<?php 
                    _e('Share Facebook', 'javo_fr');
                    ?>
"></a>
												</i>
												<i class="sns-twitter" data-title="<?php 
                    the_title();
                    ?>
" data-url="<?php 
                    the_permalink();
                    ?>
">
													<a class="twitter javo-tooltip" title="<?php 
                    _e('Share Twitter', 'javo_fr');
                    ?>
"></a>
												</i>
												<i class="sns-heart">
													<a class="javo-tooltip favorite javo_favorite<?php 
                    echo $javo_favorite->on(get_the_ID(), ' saved');
                    ?>
"  data-post-id="<?php 
                    the_ID();
                    ?>
" title="<?php 
                    _e('Add My Favorite', 'javo_fr');
                    ?>
"></a>
												</i>
											</h2>
										</li>
									</ul><!-- List group -->
								</div>
							</div>
							<div class="javo-left-overlay">
								<div class="javo-txt-meta-area admin-color-setting">
									<?php 
                    echo $meta['featured'];
                    ?>
								</div> <!-- javo-txt-meta-area -->
								<div class="corner-wrap">
									<div class="corner admin-color-setting"></div>
									<div class="corner-background admin-color-setting"></div>
								</div> <!-- corner-wrap -->
							</div><!-- javo-left-overlay -->



						</div> <!-- /.panel -->
					</div><!-- /.col-sm-4 -->
					<?php 
                    $i++;
                    echo $i % 3 == 0 ? '<p style="clear:both;"></p>' : '';
                }
                // End While
            }
            // End If
            break;
        case 4:
            $posts = new WP_Query($args);
            if ($posts->have_posts()) {
                while ($posts->have_posts()) {
                    $posts->the_post();
                    $javo_meta_query = new javo_GET_META(get_the_ID());
                    $javo_rating = new javo_rating(get_the_ID());
                    $pd = strtotime(get_the_date());
                    $meta = array('column1' => $post_type == "item" ? $javo_meta_query->cat('item_category', __('No Category', 'javo_fr')) : get_the_author_meta('user_login'), 'column2' => $post_type == "item" ? $javo_meta_query->cat('item_location', __('No Location', 'javo_fr')) : get_the_author_meta('user_login'), 'column3' => $post_type == "item" ? (int) $javo_meta_query->get_child_count('jv_events') : get_the_author_meta('user_login'), 'column4' => $post_type == "item" ? (int) $javo_meta_query->get_child_count('review') : get_the_author_meta('user_login'), 'column5' => sprintf(' %s', $post_type == "item" ? $javo_meta_query->get('item_category', __('No Category', 'javo_fr')) : get_the_author_meta('user_login')), 'column6' => sprintf('<i class="%s"></i> %s', $post_type == "item" ? "icon-status" : "javo-con status", $post_type == "item" ? $javo_meta_query->get('item_category', __('No Category', 'javo_fr')) : get_the_author_meta('user_login')), 'features' => sprintf('<span class="%s"></span> %s', $post_type == "item" ? "glyphicon glyphicon-user" : "", $post_type == "item" ? $javo_meta_query->get('item_category', __('No Category', 'javo_fr')) : get_the_author_meta('user_login')), "month" => sprintf('%.1f', (double) $javo_meta_query->_get('rating_average', 0)), "day" => '/ ' . (int) $javo_meta_query->get_child_count('ratings', 'rating_parent_post_id'));
                    ?>
					<div class="row pretty_blogs" id="mini-album-listing">
						<div class="col-md-4 col-sm-5 col-xs-6 blog-thum-box">
							<?php 
                    $detail_images = (array) @unserialize(get_post_meta(get_the_ID(), "detail_images", true));
                    $detail_images[] = get_post_thumbnail_id(get_the_ID());
                    if (!empty($detail_images)) {
                        ?>
								<div class="javo_detail_slide">
									<ul class="slides list-unstyled">
										<?php 
                        foreach ($detail_images as $index => $image) {
                            $javo_this_image_meta = wp_get_attachment_image_src($image, 'full');
                            $javo_this = wp_get_attachment_image($image, "javo-box-v", false);
                            if (!$javo_this) {
                                $javo_this = sprintf('<img src="%s" class="img-responsive wp-post-image" style="width:100%%; height:219px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
                            }
                            $javo_this_image = $javo_this_image_meta[0];
                            printf('<li><u href="%s">%s</u></li>', $javo_this_image, $javo_this);
                        }
                        ?>
									</ul>
									<?php 
                        if ($javo_custom_item_tab->get('ratings', '') == '') {
                            ?>
										<div class="javo-mini-album-rating-area">
											<div class="javo-rating-registed-score" data-score="<?php 
                            echo $javo_rating->parent_rating_average;
                            ?>
"></div>
										</div>
									<?php 
                        }
                        ?>
								</div>
								<?php 
                    }
                    ?>
							<div class="">
								<span class="down-text"><?php 
                    //echo $meta['month'];
                    ?>
</span>
								<span class="up-text"><?php 
                    //echo $meta['day'];
                    ?>
</span>
							</div>

						</div> <!-- col-md-5 -->

						<div class="col-md-8 col-sm-7 col-xs-6 blog-meta-box">
							<div class="blog-meta-box-arrow"></div>
							<h2 class="title"><a href="<?php 
                    echo get_permalink(get_the_ID());
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>

							<div class="excerpt"><?php 
                    echo javo_str_cut(get_the_excerpt(), 240);
                    ?>
&nbsp;&nbsp;<a href="<?php 
                    the_permalink();
                    ?>
">[<?php 
                    _e('MORE', 'javo_fr');
                    ?>
]</a></div>

							<div class="row">
								<div class="col-md-12 javo-blog-meta-tags">
									<div class="pull-left javo-tooltip" title="<?php 
                    _e('Category', 'javo_fr');
                    ?>
">
										<ul class="pagination pagination-sm no-margin pagination-dark pagination-upper">
											<li class="active"><a href="#"><?php 
                    echo $meta['column1'];
                    ?>
</a></li>
										</ul>
									</div>
									<div class="pull-left javo-tooltip" title="<?php 
                    _e('Location', 'javo_fr');
                    ?>
">
										<ul class="pagination pagination-sm no-margin pagination-dark pagination-upper">
											<li class="active"><a href="#"><?php 
                    echo $meta['column2'];
                    ?>
</a></li>
										</ul>
									</div>
									<?php 
                    if ($javo_custom_item_tab->get('events', '') == '') {
                        ?>
										<div class="pull-left">
											<ul class="pagination pagination-sm no-margin pagination-dark">
												<li><a href="#" class="javo-accent bold-number"><?php 
                        echo $meta['column3'];
                        ?>
</a></li>
												<li class="active"><a href="#"><?php 
                        echo $javo_custom_item_label->get('events', __("Events", 'javo_fr')) . "(s)";
                        ?>
</a></li>
											</ul>
										</div>
									<?php 
                    }
                    ?>

									<?php 
                    if ($javo_custom_item_tab->get('reviews', '') == '') {
                        ?>
										<div class="pull-left">
											<ul class="pagination pagination-sm no-margin pagination-dark">
												<li><a href="#" class="javo-accent bold-number"><?php 
                        echo $meta['column4'];
                        ?>
</a></li>
												<li class="active"><a href="#"><?php 
                        echo $javo_custom_item_label->get('reviews', __("Reviews", 'javo_fr')) . "(s)";
                        ?>
</a></li>
											</ul>
										</div>
									<?php 
                    }
                    ?>
									<div class="pull-right">
										<span class="javo-sns-wrap social-wrap">
											<i class="sns-facebook" data-title="<?php 
                    the_title();
                    ?>
" data-url="<?php 
                    the_permalink();
                    ?>
">
												<a class="facebook javo-tooltip" title="<?php 
                    _e('Share Facebook', 'javo_fr');
                    ?>
"></a>
											</i>
											<i class="sns-twitter" data-title="<?php 
                    the_title();
                    ?>
" data-url="<?php 
                    the_permalink();
                    ?>
">
												<a class="twitter javo-tooltip" title="<?php 
                    _e('Share Twitter', 'javo_fr');
                    ?>
"></a>
											</i>
											<i class="sns-heart">
												<a class="javo-tooltip favorite javo_favorite<?php 
                    echo $javo_favorite->on(get_the_ID(), ' saved');
                    ?>
"  data-post-id="<?php 
                    the_ID();
                    ?>
" title="<?php 
                    _e('Add My Favorite', 'javo_fr');
                    ?>
"></a>
											</i>
										</span>
									</div>
								</div><!-- Col-md-12 -->
							</div> <!-- property-meta -->
						</div> <!-- col-md-7 -->
					</div> <!-- row -->
					<?php 
                }
                // End While
            }
            // End If
            break;
        case 11:
            $posts = new WP_Query($args);
            $javo_variable_integer = 0;
            ?>
			<div class="row" id="box-listing">
				<?php 
            if ($posts->have_posts()) {
                while ($posts->have_posts()) {
                    $posts->the_post();
                    $javo_meta_query = new javo_GET_META(get_the_ID());
                    $javo_meta_string = array('strong' => get_comments_number(get_the_ID()), 'featured' => $javo_meta_query->cat('category', __('No Category', 'javo_fr')), 'type' => sprintf('<span class="glyphicon glyphicon-user"></span> %s ( %s )', get_the_author_meta('display_name'), esc_attr(get_the_date(__('M d, Y', 'javo_fr')))));
                    ?>
						<div class="col-md-6 col-sm-6 col-xs-6 box-wraps">
							<div class="panel panel-default">
								<div class="panel-body">
									<div class="main-box item-wrap1">
										<div class="row blog-wrap-inner">
											<div class="col-md-5 col-sm-5 col-xs-5 img-wrap">
												<div class="javo_img_hover">
													<?php 
                    if (has_post_thumbnail()) {
                        the_post_thumbnail('javo-box', array('class' => 'img-responsive', 'style' => 'width:100%;'));
                    } else {
                        printf('<img src="%s" class="img-responsive wp-post-image">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
                    }
                    ?>
												</div> <!-- javo_img_hover -->
											</div> <!-- col-md-5 -->
											<div class="col-md-7 col-sm-7 col-xs-7">
												<div class="detail">
													<h3><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h3>
													<p class="expert"><?php 
                    echo javo_str_cut(get_the_excerpt(), 120);
                    ?>
</p>
												</div>
											</div> <!-- col-md-7 -->
										</div> <!-- row -->
									</div> <!-- main-box -->
								</div><!-- Panel Body -->

								<ul class="list-group">
									<li class="list-group-item">
										<div class="row">
											<div class="col-md-9 col-sm-9 col-xs-8 javo-box-listing-meta">
												<?php 
                    echo $javo_meta_string['type'];
                    ?>
											</div>
											<div class="col-md-3 col-sm-3 col-xs-4 text-right">
												<span class="javo-sns-wrap social-wrap">
													<i class="sns-facebook" data-title="<?php 
                    the_title();
                    ?>
" data-url="<?php 
                    the_permalink();
                    ?>
">
														<a class="facebook javo-tooltip" title="<?php 
                    _e('Share Facebook', 'javo_fr');
                    ?>
"></a>
													</i>
													<i class="sns-twitter" data-title="<?php 
                    the_title();
                    ?>
" data-url="<?php 
                    the_permalink();
                    ?>
">
														<a class="twitter javo-tooltip" title="<?php 
                    _e('Share Twitter', 'javo_fr');
                    ?>
"></a>
													</i>
												</span>
											</div> <!-- col-6-md -->
										</div><!-- row -->
									</li>
								  </ul>
								<div class="javo-left-overlay">
									<div class="javo-txt-meta-area admin-color-setting">
										<?php 
                    echo $javo_meta_string['featured'];
                    ?>
									</div> <!-- javo-txt-meta-area -->
									<div class="corner-wrap">
										<div class="corner"></div>
										<div class="corner-background"></div>
									</div> <!-- corner-wrap -->
								</div><!-- javo-left-overlay -->
							</div><!-- Panel Wrap -->
						</div> <!-- col-lg-6 -->
						<?php 
                    $javo_variable_integer++;
                    echo $javo_variable_integer % 2 == 0 ? '<p class="clearfix"></p>' : '';
                }
                // End While
            }
            // End IF
            ?>
			</div>
			<?php 
            break;
        case "listers":
            $posts = query_posts($args);
            ## Blog Calender Type #################
            foreach ($posts as $post) {
                setup_postdata($post);
                $javo_list_str = new get_char($post);
                $author = get_userdata($post->post_author);
                if (has_post_thumbnail($post->ID)) {
                    $thumbnail = get_the_post_thumbnail($post->ID, "javo-avatar");
                } else {
                    $thumbnail = $noimage;
                }
                ?>
			<!--<div class="row">-->
				<div class="col-md-3" id="listers-box-list">
				<div class="panel panel-default">
					  <div class="panel-heading">

					  <div class="lister-pic">
						<a href="<?php 
                echo get_permalink($post->ID);
                ?>
">
							<?php 
                $img_src = wp_get_attachment_image_src(get_user_meta($author->ID, "avatar", true), "javo-avatar");
                if ($img_src != "") {
                    printf("<img src='%s'>", $img_src[0]);
                }
                ?>
						</a>
							<div class="text-rb-meta">
							<?php 
                printf("%s %s", number_format($javo_list_str->get_author_item_count()), __("items", "javo_fr"));
                ?>
							</div>
						</div>

					  </div> <!-- panel-heading -->
					  <ul class="list-group">
  						<li class="list-group-item"><h3 class="panel-title"><span class="glyphicon glyphicon-user"></span>&nbsp;
								<?php 
                echo $author->first_name;
                ?>
&nbsp;<?php 
                echo $author->last_name;
                ?>
</h3></li>

						<li class="list-group-item"><?php 
                echo javo_str_cut($javo_list_str->a_meta('description'), 130);
                ?>
</li>
						<li class="list-group-item">
							<a href="http://facebook.com/<?php 
                echo $javo_list_str->a_meta('facebook');
                ?>
" target="_blank"><i class="fa fa-facebook"></i></a>
							<a href="http://twitter.com/<?php 
                echo $javo_list_str->a_meta('twitter');
                ?>
" target="_blank"><i class="fa fa-twitter"></i></a>
						</li>
					  </ul><!-- List group -->
					</div><!-- panel -->



				</div> <!-- col-md-3 -->
		<?php 
            }
            break;
        case "new_list":
            $posts = new WP_Query($args);
            ?>
			<div class="body-content">
				<div class="container">
					<div class="row">
						<div class="col-md-12">
							<!-- grid/list -->
							<div id="products" class="row list-group">
							<?php 
            if ($posts->have_posts()) {
                while ($posts->have_posts()) {
                    $posts->the_post();
                    $javo_this_author_avatar_id = get_the_author_meta('avatar');
                    $javo_rating = new javo_rating(get_the_ID());
                    ?>
									<div class="item col-md-4 javo-animation x1 javo-left-to-right-100">

									<div class="panel panel-default  item-list-box-listing">
										<div class="panel-body">
											<div class="main-box blog-wrap1">
												<div class="row blog-wrap-inner">
													<div class="col-md-12img-wrap">
														<div class="javo_img_hover" style="position: relative; display: inline-block;">
															<a href="<?php 
                    the_permalink();
                    ?>
">
																<?php 
                    if (has_post_thumbnail()) {
                        the_post_thumbnail('javo-box-v', array('class' => 'group list-group-image item-thumbs img-responsive'));
                    }
                    ?>
																<div class="img-on-ratings text-right">
																	<div class="javo-rating-registed-score" data-score="<?php 
                    echo $javo_rating->parent_rating_average;
                    ?>
"></div>
																</div>

																<div class="javo_hover_body" style="position: absolute; top: 0px; left: 0px; z-index: 2; width: 100%; height: 100%; padding: 10px; margin: 0px; display: none; opacity: 0.3151841979620183; background-color: rgba(0, 0, 0, 0.4);">
																	<div class="javo_hover_content" style="cursor: pointer; display: table; width: 100%; height: 100%;" data-href="<?php 
                    the_permalink();
                    ?>
">
																	<div class="javo_hover_content_link" style="display: table-cell; color: rgb(239, 239, 239); vertical-align: middle; font-size: 2em; text-align: center;"><i class="glyphicon glyphicon-plus"></i></div></div> <!-- javo_hover_content -->
																</div> <!-- javo_hover_body -->
															</a>
														</div> <!-- javo_img_hover -->
													</div> <!-- col-md-12 -->
												</div> <!-- row -->
											</div> <!-- main-box -->
										</div><!-- Panel Body -->


										<ul class="list-group">
											<li class="list-group-item">
												<div class="row">
													<div class="col-md-8">
														<?php 
                    echo javo_str_cut(get_the_title(), 20);
                    ?>


													</div>
													<div class="col-md-4 text-right">
														<div class="social-wrap javo-type-11-share">
															<span class="javo-sns-wrap">
																<i class="sns-facebook" data-title="<?php 
                    the_title();
                    ?>
" data-url="<?php 
                    the_permalink();
                    ?>
">
																	<a class="facebook"></a>
																</i>
																<i class="sns-twitter" data-title="<?php 
                    the_title();
                    ?>
" data-url="<?php 
                    the_permalink();
                    ?>
">
																	<a class="twitter"></a>
																</i>
																<i class="sns-heart">
																	<a class="favorite javo_favorite<?php 
                    echo $javo_favorite->on(get_the_ID(), ' saved');
                    ?>
"  data-post-id="<?php 
                    the_ID();
                    ?>
"></a>
																</i>
															</span>
														</div> <!-- sc-social-wrap -->
													</div> <!-- col-6-md -->
												</div><!-- row -->
											</li> <!-- list-group-item -->
										</ul> <!-- list-group -->

										<div class="panel-footer options-wrap">
											<div class="row">
												<ul class="options">
													<li class="col-md-6 col-sm-6 col-xs-6"><i class="javo-con category"></i>&nbsp;<?php 
                    echo javo_get_cat(get_the_ID(), 'item_category', __('No Category', 'javo_fr'));
                    ?>
</li>
													<li class="col-md-6 col-sm-6 col-xs-6 text-right"><i class="javo-con location"></i>&nbsp;<?php 
                    echo javo_get_cat(get_the_ID(), 'item_location', __('No Location', 'javo_fr'));
                    ?>
</li>
												</ul>
											</div>
										</div><!-- panel-footer -->
										<div class="javo-left-overlay">
											<div class="javo-txt-meta-area">
												<?php 
                    echo javo_get_cat(get_the_ID(), 'item_category', __('No Category', 'javo_fr'));
                    ?>
											</div> <!-- javo-txt-meta-area -->
											<div class="corner-wrap">
												<div class="corner"></div>
												<div class="corner-background"></div>
											</div> <!-- corner-wrap -->
										</div><!-- javo-left-overlay -->
									</div> <!-- panel -->
									</div> <!-- item col-md-4 -->
									<?php 
                }
                // Close while
            } else {
            }
            // Emd While
            ?>
							<!-- // grid/list -->


						</div>
					</div>
				</div>
			</div>
			<?php 
            break;
        default:
            _e('Error', 'javo_fr');
    }
    $big = 999999999;
    // need an unlikely integer
    wp_reset_query();
    echo "<div class='javo_pagination'>" . paginate_links(array('base' => "%_%", 'format' => '?paged=%#%', 'current' => $page, 'total' => $posts->max_num_pages)) . "</div>";
    $content = ob_get_clean();
    // Markers
    $javo_this_info_window_contents = new WP_Query($args);
    $markers = array();
    if ($javo_this_info_window_contents->have_posts()) {
        while ($javo_this_info_window_contents->have_posts()) {
            $javo_this_info_window_contents->the_post();
            $javo_meta_query = new javo_GET_META(get_the_ID());
            $javo_this_author_avatar_id = get_the_author_meta('avatar');
            $javo_this_author_name = sprintf('%s %s', get_the_author_meta('first_name'), get_the_author_meta('last_name'));
            ob_start();
            ?>
				<div class="javo_somw_info">
					<div class="row">
						<div class="col-md-6 col-sm-6 col-xs-12">
							<h4><?php 
            the_title();
            ?>
</h4>
							<ul class="list-unstyled">
								<li><div class="prp-meta"><?php 
            echo $javo_meta_query->get('phone');
            ?>
</div></li>
								<li><div class="prp-meta"><?php 
            echo $javo_meta_query->get('mobile');
            ?>
</div></li>
								<li><div class="prp-meta"><?php 
            echo $javo_meta_query->get('website');
            ?>
</div></li>
								<li><div class="prp-meta"><?php 
            echo $javo_meta_query->get('email');
            ?>
</div></li>
							</ul>
						</div><!-- /.col-md-8 -->
						<div class="col-md-6 col-sm-6 hidden-xs">
							<div class="thumb">
								<a href="<?php 
            the_permalink();
            ?>
" target="_blank">
									<?php 
            if (has_post_thumbnail()) {
                the_post_thumbnail('javo-map-thumbnail');
            } else {
                printf('<img src="%s" style="width:150px; height:165px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
            }
            ?>
								</a>
								<div class="img-in-text"><?php 
            echo $javo_meta_query->cat('item_category', __('No Category', 'javo_fr'));
            ?>
</div>
								<div class="javo-left-overlay">
									<div class="javo-txt-meta-area"><?php 
            echo $javo_meta_query->cat('item_location', __('No Location', 'javo_fr'));
            ?>
</div>
									<div class="corner-wrap">
										<div class="corner"></div>
										<div class="corner-background"></div>
									</div> <!-- corner-wrap -->
								</div> <!-- javo-left-overlay -->
							</div> <!-- thumb -->
						</div><!-- /.col-md-4 -->
					</div><!-- /.row -->



				</div> <!-- javo_somw_info -->
			<?php 
            $infoWindow = ob_get_clean();
            $latlng = array('lat' => get_post_meta(get_the_ID(), 'jv_item_lat', true), 'lng' => get_post_meta(get_the_ID(), 'jv_item_lng', true));
            $javo_set_icon = '';
            $javo_marker_term_id = wp_get_post_terms(get_the_ID(), 'item_category');
            if (!empty($javo_marker_term_id)) {
                $javo_set_icon = get_option('javo_item_category_' . $javo_marker_term_id[0]->term_id . '_marker', '');
                if ($javo_set_icon == '') {
                    $javo_set_icon = $javo_tso->get('map_marker', '');
                }
            }
            if (!empty($latlng['lat']) && !empty($latlng['lng'])) {
                $markers[] = array('id' => 'mid_' . get_the_ID(), 'lat' => $latlng['lat'], 'lng' => $latlng['lng'], 'info' => array('content' => $infoWindow, 'post_title' => get_the_title()), 'icon' => $javo_set_icon);
            }
        }
        // End While
    }
    // End If
    // Not found results
    ob_start();
    ?>
	<div class="row">
		<div class="col-md-12 text-center">
			<?php 
    _e('No result found. Please try again', 'javo_fr');
    ?>
		</div>

	</div>

	<?php 
    $blank_content = ob_get_clean();
    $result = array("result" => "success", "html" => $posts->found_posts > 0 ? $content : $blank_content, "markers" => $markers);
    echo json_encode($result);
    exit(0);
}
Exemple #20
0
        if (!empty($javo_marker_term_id)) {
            $javo_set_icon = get_option('javo_item_category_' . $javo_marker_term_id[0]->term_id . '_marker', '');
            if ($javo_set_icon == '') {
                $javo_set_icon = $javo_tso->get('map_marker', '');
            }
            $javo_this_posts_return[get_the_ID()]['icon'] = $javo_set_icon;
        }
        ?>
						<script type="text/template" id="javo_map_tmp_<?php 
        the_ID();
        ?>
">
							<div class="javo_somw_info panel">
								<div class="des">
									<h5><?php 
        echo javo_str_cut(get_the_title(), 30);
        ?>
</h5>
									<ul class="list-unstyled">
										<li><?php 
        echo $javo_meta_query->get('phone');
        ?>
</li>
										<li><?php 
        echo $javo_meta_query->get('mobile');
        ?>
</li>
										<li><?php 
        echo $javo_meta_query->get('website');
        ?>
</li>
										<span class="glyphicon glyphicon-link"></span>
									</a>
								</div>
						</div> <!-- javo_img_hover -->
					</div> <!-- col-md-5 -->
					<div class="col-md-7 col-sm-7 col-xs-7">
						<div class="detail">
							<h3><a href="<?php 
the_permalink();
?>
"><?php 
the_title();
?>
</a></h3>
							<p class="expert"><?php 
echo javo_str_cut(get_the_excerpt(), 120);
?>
</p>
						</div>
					</div> <!-- col-md-7 -->
				</div> <!-- row -->
			</div> <!-- main-box -->
		</div><!-- Panel Body -->
		<ul class="list-group">
			<li class="list-group-item">
				<div class="row">
					<div class="col-md-9 col-sm-9 col-xs-8 javo-box-listing-meta">
						<?php 
printf('<span class="glyphicon glyphicon-comment"></span> Reviews : %s / Events : %s ', $javo_meta_query->get_child_count('review'), $javo_meta_query->get_child_count('jv_events'));
?>
					</div>
Exemple #22
0
    public function ratings($all = FALSE, $count = -1, $view_type = 'normal', $length = 0)
    {
        global $javo_tso, $javo_custom_item_label;
        $javo_this_args = array("post_type" => "ratings", "post_status" => "publish", 'posts_per_page' => $count, "meta_query" => array(array("key" => "rating_parent_post_id", "compare" => "=", "type" => "NUMBERIC", "value" => $this->post->ID)));
        if ($all) {
            unset($javo_this_args['meta_query']);
        }
        $javo_rating_posts = new wp_query($javo_this_args);
        ob_start();
        ?>
		<div class="javo-rat-area row">
			<div class="col-md-12">
			<?php 
        if ($javo_rating_posts->have_posts()) {
            while ($javo_rating_posts->have_posts()) {
                $javo_rating_posts->the_post();
                $this->user_average_score = get_post_meta(get_the_ID(), 'rating_average', true);
                $this->parent_post_id = get_post_meta(get_the_ID(), 'rating_parent_post_id', true);
                $this->parent_post = get_post($this->parent_post_id);
                switch ($view_type) {
                    // Shortcode Display Type
                    case 'tab':
                        ?>
						<div class="row rating-wrap">
							<div class="col-md-12">
								<div class="row">
									<div class="col-md-5">
										<div class="rating-author pull-left">
											<?php 
                        if (get_the_author_meta('avatar')) {
                            echo wp_get_attachment_image(get_the_author_meta('avatar'), 'javo-tiny', 1, array('class' => 'img-circle'));
                        } else {
                            printf('<img src="%s" class="img-responsive wp-post-image img-circle" style="width:80px; height:80px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
                        }
                        ?>

											<div class="rating-total"><?php 
                        printf('%.1f', get_post_meta(get_the_ID(), 'rating_average', true));
                        ?>
</div> <!-- rating-total -->
										</div> <!-- rating-author -->

										<div class="rating-each-details pull-left">
											<?php 
                        echo apply_filters('javo_rating_score_display', get_the_ID(), false);
                        ?>
											<!-- javo-rating-registed-score -->
										</div> <!-- rating-each-details -->
									</div>
									<div class="rating-comments pull-left">
										<a href="<?php 
                        echo get_permalink($this->parent_post_id);
                        ?>
#item-ratings"><span><?php 
                        printf('%s %s', get_the_author_meta('first_name'), get_the_author_meta('last_name'));
                        ?>
 : </span>
											<?php 
                        if ((int) $length > 0) {
                            echo javo_str_cut(strip_tags(get_the_content()), $length);
                        } else {
                            echo strip_tags(get_the_content());
                        }
                        ?>
										</a>
									</div> <!-- rating-comments -->
								</div>
								<div class="clearfix"></div>

							</div> <!-- col-md-12 -->
						</div>

						<?php 
                        break;
                    case 'detail':
                        ?>
						<ul class="list-group">
							<li class="list-group-item">
								<div class="row">
									<div class="col-md-2 text-center">
										<div><?php 
                        echo wp_get_attachment_image(get_the_author_meta('avatar'), 'javo-tiny', 1, array('class' => 'img-circle'));
                        ?>
 </div>
									</div>
									<div class="col-md-5">
										<?php 
                        echo apply_filters('javo_rating_score_display', get_the_ID());
                        ?>
									</div>
									<div class="col-md-5">
										<a href="<?php 
                        echo get_permalink($this->parent_post->ID);
                        ?>
#item-ratings">
											<h3><?php 
                        echo $this->parent_post->post_title;
                        ?>
</h3>
											<p><?php 
                        the_content();
                        ?>
</p>
										</a>
									</div>
								</div><!-- Close Row -->
							</li><!-- Panel Body -->
						</ul><!-- Close Panel -->
						<?php 
                        break;
                        // Single Item Page Type
                    // Single Item Page Type
                    case 'normal':
                    default:
                        ?>
						<ul class="list-group">
							<li class="list-group-item">
								<div class="row">
									<div class="col-md-2 text-center">
										<div><?php 
                        echo wp_get_attachment_image(get_the_author_meta('avatar'), 'javo-tiny', 1, array('class' => 'img-circle'));
                        ?>
 </div>
									</div>
									<div class="col-md-2">
										<?php 
                        echo apply_filters('javo_rating_score_display', get_the_ID());
                        ?>
									</div>
									<div class="col-md-8">
										<span><?php 
                        the_content();
                        ?>
</span>
									</div>
								</div><!-- Close Row -->
							</li><!-- Panel Body -->
						</ul><!-- Close Panel -->
					<?php 
                }
                // End Switch
            }
            // End While;
        } else {
            _e('NO FOUND ' . $javo_custom_item_label->get('ratings', 'Ratings'), 'javo_fr');
        }
        // End If
        ?>
			</div><!-- 12 Columns Close -->
		</div><!-- Rating Area Clse -->
		<script type="text/javascript">
		jQuery(document).ready(function($){
			"use strict";
			$('.javo-rating-registed-score').each(function(k,v){
				$(this).raty({
					starOff: '<?php 
        echo JAVO_IMG_DIR;
        ?>
/star-off-s.png'
					, starOn: '<?php 
        echo JAVO_IMG_DIR;
        ?>
/star-on-s.png'
					, starHalf: '<?php 
        echo JAVO_IMG_DIR;
        ?>
/star-half-s.png'
					, half: true
					, readOnly: true
					, score: $(this).data('score')
				});
			});

		});
		</script>
		<?php 
        wp_reset_postdata();
        $javo_this_content = ob_get_clean();
        return $javo_this_content;
    }
Exemple #23
0
    $javo_header_buttons['data-javo-single-videoview'] = array('container_class' => '', 'viewport' => '.javo-single-item-tab-video-area', 'before_image' => JAVO_THEME_DIR . '/assets/images/icon/icon-btn-play.png', 'after_image' => JAVO_THEME_DIR . '/assets/images/icon/icon-btn-play-off.png');
}
$javo_relative_items = array();
if (false !== (bool) ($javo_this_terms = wp_get_post_terms($post_id, 'item_category', array('fields' => 'ids')))) {
    $javo_relative_posts_args = array('post_type' => 'item', 'post_status' => 'publish', 'posts_per_page' => 30, 'exclude' => array($post_id), 'tax_query' => array(array('taxonomy' => 'item_category', 'field' => 'term_id', 'terms' => $javo_this_terms[0])));
    $javo_relative_posts = get_posts($javo_relative_posts_args);
    foreach ($javo_relative_posts as $post) {
        setup_postdata($post);
        $javo_this_location = $jv_str['no_location'];
        if (false !== (bool) ($javo_this_locations = wp_get_post_terms($post->ID, 'item_location', array('fields' => 'names')))) {
            $javo_this_location = $javo_this_locations[0];
        }
        if ('' === ($javo_set_icon = get_option("javo_item_category_{$javo_this_terms[0]}_marker", ''))) {
            $javo_set_icon = $javo_tso->get('map_marker', '');
        }
        $javo_relative_items[] = array('post_id' => $post->ID, 'lat' => get_post_meta($post->ID, 'jv_item_lat', true), 'lng' => get_post_meta($post->ID, 'jv_item_lng', true), 'icon' => $javo_set_icon, 'category' => javo_str_cut(get_term($javo_this_terms[0], 'item_category')->name, 25), 'location' => $javo_this_location);
    }
    // End Foreach
    wp_reset_postdata();
}
// End If
?>


<fieldset>
	<!-- Current Item Information -->
	<input type="hidden" value="<?php 
echo $post_id;
?>
" data-javo-this-post-id>
	<!-- /.Current Item Information -->