function javo_get_single_review_callback() { $javo_this_result = array(); $javo_query = new javo_ARRAY($_POST); $javo_this_review_posts_args = array('post_type' => 'review', 'post_status' => 'publish', 'posts_per_page' => $javo_query->get('count'), 'offset' => $javo_query->get('offset'), 'meta_query' => array(array('key' => 'parent_post_id', 'type' => 'NUMBERIC', 'value' => $javo_query->get('post_id'), 'compare' => '='))); $javo_this_review_posts = new WP_Query($javo_this_review_posts_args); ob_start(); if ($javo_this_review_posts->have_posts()) { while ($javo_this_review_posts->have_posts()) { $javo_this_review_posts->the_post(); echo apply_filters('javo_single_review_filter', get_the_ID()); } // Emd While } else { } // End If wp_reset_postdata(); $javo_this_result['html'] = ob_get_clean(); echo json_encode($javo_this_result); exit; }
public function ajax_favorite_callback() { $javo_query = new javo_ARRAY($_POST); $this->favorites = (array) get_user_meta(get_current_user_id(), 'favorites', true); $result = array(); $post_id = $javo_query->get('post_id', 0); $reg = $javo_query->get('reg', false); if (0 < $post_id) { if ($reg) { if (!$this->on($post_id)) { $this->favorites[] = array('save_day' => date('Y-m-d h:i:s'), 'post_id' => $post_id); } } else { $this->del($post_id); } update_user_meta(get_current_user_id(), 'favorites', $this->favorites); $result = array('return' => 'success'); } else { $result = array('return' => 'fail'); } die(json_encode($result)); }
public static function javo_search_form_callback($atts, $content = '') { self::$load_script = true; $javo_query = new javo_ARRAY($_GET); extract(shortcode_atts(array('action' => '', 'hide_field' => array(), 'display_border' => ''), $atts)); $javo_redirect = home_url(); if ((int) $action > 0 && !is_archive() && !is_search()) { $javo_redirect = apply_filters('javo_wpml_link', $action); } $javo_hide_el = (array) @explode(',', $hide_field); $javo_hide_el = (object) Array_flip($javo_hide_el); $javo_display_border = $display_border === 'hide' || is_search() || is_archive() ? ' border-none' : null; ob_start(); ?> <div class="container search-type-a-wrap"> <form role="form" data-javo-search-form class="search-type-a-form" method="get"> <div class="search-type-a-inner<?php echo $javo_display_border; ?> "> <?php if (!isset($javo_hide_el->keyword)) { ?> <div class="search-box-inline"> <input type = "text" class = "search-a-items form-control" name = "s" placeholder = "<?php _e('Keyword', 'javo_fr'); ?> " value = "<?php echo $javo_query->get('keyword', null); ?> " > </div><!-- /.search-box-inline --> <?php } ?> <?php if (!isset($javo_hide_el->category)) { ?> <div class="search-box-inline"> <select name="filter[item_category]" class="form-control"> <option value=""><?php _e('Category', 'javo_fr'); ?> </option> <?php echo apply_filters('javo_get_selbox_child_term_lists', 'item_category', null, 'select', $javo_query->get('category', 0), 0, 0); ?> </select> </div><!-- /.search-box-inline --> <?php } ?> <?php if (!isset($javo_hide_el->location)) { ?> <div class="search-box-inline"> <select name="filter[item_location]" class="form-control"> <option value=""><?php _e('Location', 'javo_fr'); ?> </option> <?php echo apply_filters('javo_get_selbox_child_term_lists', 'item_location', null, 'select', $javo_query->get('location', 0), 0, 0); ?> </select> </div><!-- /.search-box-inline --> <?php } ?> <?php if (!isset($javo_hide_el->google) && !is_archive() && !is_search()) { ?> <div class="search-box-inline javo-search-form-geoloc"> <input type="text" name="geoloc" class="form-control jv-search-location-input" > <i class="fa fa-map-marker javo-geoloc-trigger"></i> </div><!-- /.col-md-2 --> <?php } ?> <div class="search-box-inline"> <button type="submit" class="jv-submit-button btn btn-primary admin-color-setting" > <i class="fa fa-search"></i> <?php _e('Search', 'javo_fr'); ?> </button> </div><!-- /.col-md-2 --> </div> <!-- search-type-a-inner --> <fieldset> <input type = "hidden" value = "<?php echo (int) $action > 0 ? apply_filters('javo_wpml_link', $action) : null; ?> " javo-search-target > </fieldset> </form> <form class = "hidden" role="search"> <input type="hidden" name="post_type" value="item"> <input type="hidden" name="category"> <input type="hidden" name="location"> <input type="hidden" name="keyword"> <input type="hidden" name="geolocation"> <input type="hidden" name="radius_key"> <input type="hidden" name="s"> </form> </div> <!-- container search-type-a-wrap --> <script type="text/javascript"> jQuery( function( $ ) { var javo_search_form_func = function() { this.elements = { origin : 'form[data-javo-search-form]' , result : '[data-javo-patch-form-for-result]' , template : '[data-javo-patch-form-for-template]' , type : '[data-javo-search-form-action-type]' , geo_trig : '.javo-geoloc-trigger' } if( ! window.__JSF__INSTANCE__ ) { window.__JSF__INSTANCE__ = true; this .init() .methods(); } } javo_search_form_func.prototype = { constructor: javo_search_form_func , init : function() { this.setAutoCompleteObject(); return this; } , setAutoCompleteObject : function() { var form = $( this.elements.origin ); var term_elements = form.find( "select[name^='filter']" ); var geo_elment = form.find( "[name='geoloc']" )[0]; term_elements.chosen({ search_contains: 1 }); if( geo_elment ) new google.maps.places.Autocomplete( geo_elment ); } , methods : function() { $( document ) .on( 'submit' , this.elements.origin, this.submit ) .on( 'click' , this.elements.geo_trig, this.trigger_geo ); return this; } , trigger_geo : function( e ) { e.preventDefault(); var _form = $( this ).closest( 'form' ); var form = _form.next(); _form .find( '*' ) .addClass( 'disabled' ) .attr( 'disabled', true ); $( this ).addClass( 'fa-spin' ); form.find( "[name='geolocation']" ).val(1); _form.submit(); } , submit : function( e ) { e.preventDefault(); var _form = $( this ); var form = _form.next(); var __TAR__ = _form.find( '[javo-search-target]' ).val(); if( __TAR__ ) { // Template form .prop({ action : __TAR__, method: 'post' }) .find( "[name='s'], [name='post_type']" ) .remove(); } else { // Search Result form.prop({ action : '', method : 'get' }); } ; form .find( "[name='category']") .val( _form.find( "select[name='filter[item_category]']" ).val() ) ; form .find( "[name='location']") .val( _form.find( "select[name='filter[item_location]']" ).val() ) ; form .find( "[name='s'], [name='keyword']") .val( _form.find( "input[name='s']" ).val() ) ; form .find( "[name='radius_key']") .val( _form.find( "input[name='geoloc']" ).val() ) form.submit(); } }; new javo_search_form_func; }); </script> <?php return ob_get_clean(); }
<input type="hidden" name="javo_google_map_poi" value="<?php echo $javo_tso_map->get('poi', 'on'); ?> "> <input type="hidden" name="javo_location_click_on_action" value="<?php echo $javo_tso->get('tab_location_click_trigger', ''); ?> "> <input type="hidden" name="javo-this-term-posts-latlng" value="<?php echo htmlspecialchars(json_encode($javo_relative_items)); ?> "> <!-- Street View --> <input type="hidden" value="<?php echo $javo_latlng_meta->get('street_visible', 1); ?> " data-street-visible> <input type="hidden" value="<?php echo $javo_latlng_meta->get('street_lat', null); ?> " data-street-lat> <input type="hidden" value="<?php echo $javo_latlng_meta->get('street_lng', null); ?> " data-street-lng> <input type="hidden" value="<?php echo $javo_latlng_meta->get('street_heading', 0); ?> " data-street-pov-heading> <input type="hidden" value="<?php
</div><!-- /.javo-archive-sub-category --> <hr> <?php } ?> <form class="form-horizontal archive-filter-bar" role="form" method="get"> <div class="row"> <?php if ($javo_tso_archive->get('types_enable', 'on') == 'on') { ?> <div class="col-md-2 col-sm-3 col-xs-3"> <div class="btn-group btn-group-md btn-group-justified" data-javo-archive-order-direction> <div class="btn btn-md archive-filter-btns<?php echo $javo_query->get('type', $javo_ts_default_primary_type) == 'class' ? ' active' : ''; ?> " title="<?php _e('Classic', 'javo_fr'); ?> " data-value="class" title="<?php _e('Classic', 'javo_fr'); ?> "> <span class="glyphicon glyphicon-th"></span> </div> <div class="btn btn-md archive-filter-btns<?php echo $javo_query->get('type', $javo_ts_default_primary_type) == 'grid' ? ' active' : ''; ?> " data-value="grid" title="<?php _e('Grid', 'javo_fr');
public static function item_publisher_callback() { global $wpdb, $current_user; $javo_query = new javo_ARRAY($_POST); $response = array(); $level_id = !empty($current_user->membership_level) ? $current_user->membership_level->ID : 0; $order = self::get_order_info($javo_query->get('code')); $level = self::get_level_info($level_id); // Price $javo_free = isset($level->initial_payment) && (double) $level->initial_payment > 0 ? false : true; // After Action $is_pending = !(isset($level->javo_after_action) && !$level->javo_after_action); // Set Featured $is_featured = $javo_query->get('featured', "false") == "true" ? true : false; // Checking for invalid order code. if ($javo_query->get('code', null) == null) { self::response_err(__("Can't get order code for available post.", 'javo_fr')); } // Checking for invalid target items. if ((int) $javo_query->get('post_id', 0) <= 0) { self::response_err(__('Failed to get item number.', 'javo_fr')); } // Checking for have an allow posts amount. if (!($javo_free || $level->javo_allow_post_unliimit)) { if ((int) $order->javo_allow_post <= 0) { self::response_err(__("Posts Remaining balance is now 0.", 'javo_fr')); } } // checking for amount of featured available if ($is_featured) { if (!$level->javo_featured_unliimit) { if ((int) $order->javo_cnt_featured <= 0) { self::response_err(__("Featured Item balance is now 0.", 'javo_fr')); } } } // Item Status Update Action $post_id = wp_update_post(array('ID' => (int) $javo_query->get('post_id'), 'post_status' => $is_pending ? 'pending' : 'publish')); if ((int) $post_id <= 0) { self::response_err($order->javo_allow_post); } else { if ($javo_free) { update_post_meta($post_id, 'javo_paid_state', 'free'); } else { // IF NOT UNLIMITED POST if (!$level->javo_allow_post_unliimit) { // Use available post $sql = $wpdb->prepare("\r\n\t\t\t\t\t\tUPDATE\r\n\t\t\t\t\t\t\t{$wpdb->pmpro_membership_orders}\r\n\t\t\t\t\t\tSET\r\n\t\t\t\t\t\t\tjavo_allow_post = javo_allow_post -1\r\n\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\tcode='%s'", $order->code); $wpdb->query($sql); // If after it work to count of allow posts is zero, initialize of current user level. $balance_ = $wpdb->get_var("\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\tjavo_allow_post\r\n\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t{$wpdb->pmpro_membership_orders}\r\n\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\tcode='{$order->code}'\r\n\t\t\t\t\t"); if ((int) $balance_ <= 0) { if (self::init_level(wp_get_current_user()->ID) === false) { self::response_err(__("Database Error", 'javo_fr')); } } } // IF NOT UNLIMITED FEATURED if ($is_featured && !$level->javo_featured_unliimit) { // Use available post $sql = $wpdb->prepare("\r\n\t\t\t\t\t\tUPDATE\r\n\t\t\t\t\t\t\t{$wpdb->pmpro_membership_orders}\r\n\t\t\t\t\t\tSET\r\n\t\t\t\t\t\t\tjavo_cnt_featured = javo_cnt_featured -1\r\n\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\tcode='%s'", $order->code); $wpdb->query($sql); } // IF NOT UNLIMITED EXPIRE if (!$level->javo_expire_unliimit) { $expire = date('YmdHis', strtotime($order->javo_expire_day . ' days')); } else { $expire = "unlimited"; } // IF SET FEATURED if ($is_featured) { update_post_meta($post_id, 'javo_this_featured_item', 'use'); } update_post_meta($post_id, 'javo_expire_day', $expire); update_post_meta($post_id, 'javo_paid_state', 'paid'); } $response['permalink'] = $is_pending ? home_url(JAVO_DEF_LANG . JAVO_MEMBER_SLUG . '/' . wp_get_current_user()->user_login . '/' . JAVO_ITEMS_SLUG) : get_permalink($post_id); $response['state'] = 'success'; } echo json_encode($response); die; }
public static function map_get_() { global $wpdb, $javo_tso, $sitepress; $javo_query = new javo_ARRAY($_POST); $javo_all_posts = array(); if ($javo_query->get('lang', null) != null) { if (!empty($sitepress)) { $sitepress->switch_lang($javo_query->get('lang'), true); } } $javo_this_posts_args = array('post_type' => 'item', 'suppress_filters' => false, 'post_status' => 'publish', 'posts_per_page' => -1); 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', 'item')); $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; } $javo_this_posts = get_posts($javo_this_posts_args); foreach ($javo_this_posts as $item) { // Google Map LatLng Values $latlng = @unserialize(get_post_meta($item->ID, "latlng", true)); $category = array(); $category_label = array(); foreach (array('item_category', 'item_location', 'post_tag') as $taxonomy) { $results = $wpdb->get_results($wpdb->prepare("\r\n\t\t\t\t\t\t\tSELECT t.term_id, t.name FROM {$wpdb->terms} AS t\r\n\t\t\t\t\t\t\tINNER JOIN {$wpdb->term_taxonomy} AS tt ON tt.term_id = t.term_id\r\n\t\t\t\t\t\t\tINNER JOIN {$wpdb->term_relationships} AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id\r\n\t\t\t\t\t\t\tWHERE tt.taxonomy IN (%s) AND tr.object_id IN ({$item->ID}) ORDER BY t.term_id ASC", $taxonomy)); //$category[ $taxonomy ] = $results; foreach ($results as $result) { $category[$taxonomy][] = $result->term_id; $category_label[$taxonomy][] = $result->name; } } $category_icon = isset($category['item_category'][0]) ? $category['item_category'][0] : null; if ('' === ($javo_set_icon = get_option("javo_item_category_{$category_icon}_marker", ''))) { $javo_set_icon = $javo_tso->get('map_marker', ''); } $javo_categories = new javo_ARRAY($category); $javo_categories_label = new javo_ARRAY($category_label); if (!empty($latlng['lat']) && !empty($latlng['lng'])) { $javo_all_posts[] = array('post_id' => $item->ID, 'lat' => $latlng['lat'], 'lng' => $latlng['lng'], 'rating' => get_post_meta($item->ID, 'rating_average', true), 'icon' => $javo_set_icon, 'cat_term' => $javo_categories->get('item_category'), 'loc_term' => $javo_categories->get('item_location'), 'tags' => $javo_categories_label->get('post_tag')); } } die(json_encode($javo_all_posts)); }
public function form($instance) { // WAQ : Widget Archive Queries. $javo_waq = new javo_ARRAY($instance); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title:', 'javo_fr'); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " type="text" value="<?php echo esc_attr($javo_waq->get('title')); ?> "> </p> <fieldset style="margin-bottom:10px;"> <input name="<?php echo $this->get_field_name('archive-wg-bg-color'); ?> " type="text" value="<?php echo esc_attr($javo_waq->get('archive-wg-bg-color')); ?> " class="wp_color_picker" data-default-color="#000"> <label style="position:relative; bottom:7px;"><?php _e('Background Color', 'javo_fr'); ?> </label> </fieldset> <fieldset style="margin-bottom:10px;"> <input name="<?php echo $this->get_field_name('archive-wg-text-color'); ?> " type="text" value="<?php echo esc_attr($javo_waq->get('archive-wg-text-color')); ?> " class="wp_color_picker" data-default-color="#fff"> <label style="position:relative; bottom:7px;"><?php _e('Text Color', 'javo_fr'); ?> </label> </fieldset> <script type="text/javascript"> jQuery(function($){ $(document).ajaxComplete(function(){ $('.wp_color_picker').wpColorPicker(); }); }); </script> <?php }
public function send_mail() { $javo_query = new javo_ARRAY($_POST); $javo_this_return = array(); $javo_this_return['result'] = false; $meta = array('to' => $javo_query->get('to', NULL), 'subject' => $javo_query->get('subject', __('Untitled Mail', 'javo_fr')) . ' : ' . get_bloginfo('name'), 'from' => sprintf("From: %s<%s>\r\n", get_bloginfo('name'), $javo_query->get('from', get_option('admin_email'))), 'content' => $javo_query->get('content', NULL)); if ($javo_query->get('to', NULL) != null && $javo_query->get('from', NULL) != null) { add_filter('wp_mail_content_type', array(__CLASS__, 'javo_send_mail_content_type_callback')); $mailer = wp_mail($meta['to'], $meta['subject'], $meta['content'], $meta['from']); $javo_this_return['result'] = $mailer; remove_filter('wp_mail_content_type', array(__CLASS__, 'javo_send_mail_content_type_callback')); } echo json_encode($javo_this_return); exit(0); }
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); ?> <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> <?php echo $author->first_name; ?> <?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> <?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> <?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); }
?> "> <input type="hidden" javo-alert-ok value="<?php _e("Done", 'javo_fr'); ?> "> <input type="hidden" javo-is-geoloc value="<?php echo $javo_current_pos; ?> "> <input type="hidden" javo-bad-location value="<?php _e("There is no such address", 'javo_fr'); ?> "> <input type="hidden" javo-cluster-onoff value="<?php echo $javo_mopt->get('cluster', null); ?> "> <input type="hidden" javo-cluster-level value="<?php echo $javo_mopt->get('cluster_level', null); ?> "> </fieldset> <script type="text/javascript"> jQuery( function( $ ){ var BTN_OK = $('[javo-alert-ok]').val(); window.javo_map_tab_func = {
public static function javo_post_meta_box_save($post_id) { if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return $post_id; } /* * Variables Initialize * *======================================================================================* */ $javo_query = new javo_ARRAY($_POST); $javo_itemlist_query = new javo_ARRAY($javo_query->get('javo_il', array())); if ($javo_query->get('javo_opt_header') != null) { update_post_meta($post_id, "javo_header_type", $javo_query->get('javo_opt_header')); } if ($javo_query->get('javo_opt_fancy') != null) { update_post_meta($post_id, "javo_header_fancy_type", $javo_query->get('javo_opt_fancy')); } if ($javo_query->get('javo_opt_sidebar') != null) { update_post_meta($post_id, "javo_sidebar_type", $javo_query->get('javo_opt_sidebar')); } if (false !== ($tmp = $javo_itemlist_query->get('type', false))) { update_post_meta($post_id, "javo_item_listing_type", $tmp); } if (false !== ($tmp = $javo_itemlist_query->get('list_position', false))) { update_post_meta($post_id, "javo_item_listing_position", $tmp); } if (false !== ($tmp = $javo_itemlist_query->get('content_position', false))) { update_post_meta($post_id, "javo_item_listing_content_position", $tmp); } if (false !== ($tmp = $javo_query->get('javo_hd', false))) { update_post_meta($post_id, "javo_hd_post", $tmp); } if (false !== ($tmp = $javo_query->get('javo_map_opts', false))) { update_post_meta($post_id, "javo_map_page_opt", $tmp); } // Slide AutoPlay if (false !== ($tmp = $javo_query->get('javo_detail_slide_autoplay', false))) { update_post_meta($post_id, "javo_detail_slide_autoplay", $tmp); } // Fancy options if ($javo_query->get('javo_fancy', null) != null) { update_post_meta($post_id, "javo_fancy_options", @serialize($javo_query->get('javo_fancy', null))); } if ($javo_query->get('javo_slide', null) != null) { update_post_meta($post_id, "javo_slider_options", @serialize($javo_query->get('javo_slide', null))); } $javo_controller_setup = !empty($_POST['javo_post_control']) ? @serialize($_POST['javo_post_control']) : ""; update_post_meta($post_id, "javo_control_options", $javo_controller_setup); /* * Set Page Template Default Values * *======================================================================================* */ update_post_meta($post_id, "javo_slider_type", $javo_query->get('javo_opt_slider')); update_post_meta($post_id, "javo_posts_per_page", $javo_query->get('javo_posts_per_page')); update_post_meta($post_id, "javo_item_tax", @serialize((array) $javo_query->get('javo_item_tax'))); update_post_meta($post_id, "javo_blog_tax", $javo_query->get('javo_blog_tax')); update_post_meta($post_id, "javo_item_terms", @serialize($javo_query->get('javo_item_terms', null))); update_post_meta($post_id, "javo_blog_terms", @serialize($javo_query->get('javo_blog_terms', null))); /* * Custom Post Types Meta Save * *======================================================================================* */ switch (get_post_type($post_id)) { case "item": $javo_item_query = new javo_ARRAY($javo_query->get('javo_item_attribute', array())); if ($javo_item_query->get('featured', null) != null) { update_post_meta($post_id, "javo_this_featured_item", $javo_item_query->get('featured', '')); } // item meta if (isset($_POST['javo_pt'])) { $ppt_meta = $_POST['javo_pt']; $javo_pt_query = new javo_array($ppt_meta); $ppt_images = !empty($_POST['javo_pt_detail']) ? $_POST['javo_pt_detail'] : null; $map_area_settings = !empty($ppt_meta['item_map_positon']) ? $ppt_meta['item_map_positon'] : array(); $map_area_settings = @serialize($map_area_settings); $map_type_settings = !empty($ppt_meta['item_map_type']) ? $ppt_meta['item_map_type'] : array(); $map_type_settings = @serialize($map_type_settings); // is Assign ? if ($javo_query->get('item_author') == 'other') { remove_action('save_post', array(__CLASS__, 'javo_post_meta_box_save')); $post_id = wp_update_post(array('ID' => $post_id, 'post_author' => $javo_query->get('item_author_id'))); add_action('save_post', array(__CLASS__, 'javo_post_meta_box_save')); } // Upload Video $javo_video_query = new javo_ARRAY($javo_query->get('javo_video', array())); $javo_video = null; if ($javo_video_query->get('portal', NULL) != NULL) { $protocal = is_ssl() ? "https" : "http"; switch ($javo_video_query->get('portal')) { case 'youtube': $javo_attachment_video = "{$protocal}://www.youtube-nocookie.com/embed/" . $javo_video_query->get('video_id', 0); break; case 'vimeo': $javo_attachment_video = "{$protocal}://player.vimeo.com/video/" . $javo_video_query->get('video_id', 0); break; case 'dailymotion': $javo_attachment_video = "{$protocal}://www.dailymotion.com/embed/video/" . $javo_video_query->get('video_id', 0); break; case 'yahoo': $javo_attachment_video = "{$protocal}://d.yimg.com/nl/vyc/site/player.html#vid=" . $javo_video_query->get('video_id', 0); break; case 'bliptv': $javo_attachment_video = "{$protocal}://a.blip.tv/scripts/shoggplayer.html#file=http://blip.tv/rss/flash/" . $javo_video_query->get('video_id', 0); break; case 'veoh': $javo_attachment_video = "{$protocal}://www.veoh.com/static/swf/veoh/SPL.swf?videoAutoPlay=0&permalinkId=" . $javo_video_query->get('video_id', 0); break; case 'viddler': $javo_attachment_video = "{$protocal}://www.viddler.com/simple/" . $javo_video_query->get('video_id', 0); break; } $javo_video = array('portal' => $javo_video_query->get('portal', null), 'video_id' => $javo_video_query->get('video_id', null), 'url' => $javo_attachment_video, 'html' => !empty($javo_attachment_video) ? sprintf('<iframe width="100%%" height="370" src="%s"></iframe>', $javo_attachment_video) : null, 'single_position' => $javo_video_query->get('single_position', null)); } // Default Meta if (false !== (bool) ($meta = $javo_pt_query->get('meta', false))) { foreach ($meta as $key => $value) { update_post_meta($post_id, $key, $value); } } // Default Meta if (false !== (bool) ($meta = $javo_pt_query->get('map', false))) { foreach ($meta as $key => $value) { update_post_meta($post_id, "jv_item_{$key}", $value); } } update_post_meta($post_id, "video", $javo_video); update_post_meta($post_id, "detail_images", @serialize($ppt_images)); update_post_meta($post_id, 'header_custom_frame', $javo_pt_query->get('header_frame', null)); update_post_meta($post_id, "item_map_positon", $map_area_settings); update_post_meta($post_id, "item_map_type", $map_type_settings); } break; case 'jv_events': $javo_event_query = new javo_ARRAY($javo_query->get('javo_event', array())); update_post_meta($post_id, "parent_post_id", $javo_event_query->get('parent_post_id', null)); update_post_meta($post_id, "brand", $javo_event_query->get('brand', null)); break; case 'review': $javo_event_query = new javo_ARRAY($javo_query->get('javo_event', array())); update_post_meta($post_id, "parent_post_id", $javo_event_query->get('parent_post_id', null)); update_post_meta($post_id, "brand", $javo_event_query->get('brand', null)); break; case 'jv_partners': $javo_partners_query = new javo_ARRAY($javo_query->get('javo_partners', array())); update_post_meta($post_id, 'javo_partner_website', $javo_partners_query->get('website', null)); break; } // End Switch }
/** * Widget setting */ function form($instance) { /* Set up some default widget settings. */ $defaults = array('btn_txt' => '', 'btn_txt_after' => '', 'btn_txt_color' => '', 'before_log_icon' => 'fa fa-lock', 'after_log_icon' => 'fa fa-unlock', 'btn_bg_color' => '', 'btn_border_color' => '', 'btn_radius' => '', 'btn_visible' => '', 'date' => true); $instance = wp_parse_args((array) $instance, $defaults); $javo_var = new javo_ARRAY($instance); $btn_txt = esc_attr($instance['btn_txt']); $btn_txt_after = esc_attr($instance['btn_txt_after']); $btn_txt_color = esc_attr($instance['btn_txt_color']); $btn_bg_color = esc_attr($instance['btn_bg_color']); $btn_border_color = esc_attr($instance['btn_border_color']); $btn_radius = esc_attr($instance['btn_radius']); $btn_visible = esc_attr($instance['btn_visible']); ?> <div class="javo-dtl-trigger" data-javo-dtl-el="[name='<?php echo esc_attr($this->get_field_name('button_style')); ?> ']" data-javo-dtl-val="set" data-javo-dtl-tar=".javo-button-login-detail-style"> <p> <label><?php _e("Show on mobile", 'javo_fr'); ?> </label> <label> <input name="<?php echo esc_attr($this->get_field_name('btn_visible')); ?> " type="radio" value="" <?php checked('' == $btn_visible); ?> > <?php _e("Enable", 'javo_fr'); ?> </label> <label> <input name="<?php echo esc_attr($this->get_field_name('btn_visible')); ?> " type="radio" value="hide" <?php checked('hide' == $btn_visible); ?> > <?php _e("Hide", 'javo_fr'); ?> </label> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('btn_txt')); ?> "><?php _e('Logged in Button Text:', 'javo_fr'); ?> </label> <input class="widefat" id="<?php echo esc_attr($this->get_field_id('btn_txt')); ?> " name="<?php echo esc_attr($this->get_field_name('btn_txt')); ?> " type="text" value="<?php echo $btn_txt; ?> " > </p> <p> <label for="<?php echo esc_attr($this->get_field_id('btn_txt_after')); ?> "><?php _e('Log out Button Text:', 'javo_fr'); ?> </label> <input class="widefat" id="<?php echo esc_attr($this->get_field_id('btn_txt_after')); ?> " name="<?php echo esc_attr($this->get_field_name('btn_txt_after')); ?> " type="text" value="<?php echo $btn_txt_after; ?> " > </p> <dl> <dt> <label><?php _e("Style Setting", 'javo_fr'); ?> </label> </dt> <dd> <label> <input name="<?php echo esc_attr($this->get_field_name('button_style')); ?> " type="radio" value="" <?php checked('' == $javo_var->get('button_style')); ?> > <?php _e("Same as navi menu color", 'javo_fr'); ?> </label> <br> <label> <input name="<?php echo esc_attr($this->get_field_name('button_style')); ?> " type="radio" value="set" <?php checked('set' == $javo_var->get('button_style')); ?> > <?php _e("Setup own custom color", 'javo_fr'); ?> </label> </dd> </dl> <div class="javo-button-login-detail-style"> <p class="no-margin"> <label for="<?php echo esc_attr($this->get_field_id('btn_txt_color')); ?> "><?php _e('Button text color:', 'javo_fr'); ?> </label> <input name="<?php echo esc_attr($this->get_field_name('btn_txt_color')); ?> " type="text" class="wp_color_picker" data-default-color="#ffffff" value="<?php echo $btn_txt_color; ?> " > </p> <p class="no-margin"> <label for="<?php echo esc_attr($this->get_field_id('btn_bg_color')); ?> "><?php _e('Button background color:', 'javo_fr'); ?> </label> <input name="<?php echo esc_attr($this->get_field_name('btn_bg_color')); ?> " type="text" class="wp_color_picker" data-default-color="#ffffff" value="<?php echo $btn_bg_color; ?> " > </p> <p class="no-margin"> <label for="<?php echo esc_attr($this->get_field_id('btn_border_color')); ?> "><?php _e('Button border color:', 'javo_fr'); ?> </label> <input name="<?php echo esc_attr($this->get_field_name('btn_border_color')); ?> " type="text" class="wp_color_picker" data-default-color="#ffffff" value="<?php echo $btn_border_color; ?> " > </p> <p class="no-margin"> <label for="<?php echo esc_attr($this->get_field_id('btn_radius')); ?> "><?php _e('Button radius (only number):', 'javo_fr'); ?> </label> <input name="<?php echo esc_attr($this->get_field_name('btn_radius')); ?> " name="<?php echo esc_attr($this->get_field_name('btn_radius')); ?> " type="text" value="<?php echo $btn_radius; ?> " > </p> </div><!-- /.javo-button-login-detail-style --> <p> <label for="<?php echo esc_attr($this->get_field_id('before_log_icon')); ?> "> <?php _e('Icon class before log-in (mobile)', 'javo_fr'); ?> </label> <input class = "widefat" id = "<?php echo esc_attr($this->get_field_id('before_log_icon')); ?> " name = "<?php echo esc_attr($this->get_field_name('before_log_icon')); ?> " type = "text" value="<?php echo $javo_var->get('before_log_icon'); ?> " > </p> <p class="no-margin"> <label for="<?php echo esc_attr($this->get_field_id('before_log_icon')); ?> "> <?php _e('Icon class after log-in (mobile)', 'javo_fr'); ?> </label> <input class = "widefat" id = "<?php echo esc_attr($this->get_field_id('after_log_icon')); ?> " name = "<?php echo esc_attr($this->get_field_name('after_log_icon')); ?> " type = "text" value="<?php echo $javo_var->get('after_log_icon'); ?> " > </p> </div><!-- /.javo-dtl-trigger --> <?php }
/** * Widget setting */ function form($instance) { /* Set up some default widget settings. */ $defaults = array('btn_txt' => '', 'btn_icon' => 'fa-folder', 'btn_txt_color' => '', 'btn_bg_color' => '', 'btn_border_color' => '', 'btn_radius' => '', 'date' => true); $instance = wp_parse_args((array) $instance, $defaults); $btn_txt = esc_attr($instance['btn_txt']); $btn_icon = esc_attr($instance['btn_icon']); $btn_txt_color = esc_attr($instance['btn_txt_color']); $btn_bg_color = esc_attr($instance['btn_bg_color']); $btn_border_color = esc_attr($instance['btn_border_color']); $btn_radius = esc_attr($instance['btn_radius']); $javo_var = new javo_ARRAY($instance); ?> <div class="javo-dtl-trigger" data-javo-dtl-el="[name='<?php echo esc_attr($this->get_field_name('button_style')); ?> ']" data-javo-dtl-val="set" data-javo-dtl-tar=".javo-full-cover-cat-detail-style"> <p> <label for="<?php echo esc_attr($this->get_field_id('btn_txt')); ?> "><?php _e('Label', 'javo_fr'); ?> : </label> <input class="widefat" id="<?php echo esc_attr($this->get_field_id('btn_txt')); ?> " name="<?php echo esc_attr($this->get_field_name('btn_txt')); ?> " type="text" value="<?php echo $btn_txt; ?> " > </p> <p> <label for="<?php echo esc_attr($this->get_field_id('btn_icon')); ?> "><?php _e('Font-Awsome Code', 'javo_fr'); ?> : </label> <input class="widefat" id="<?php echo esc_attr($this->get_field_id('btn_icon')); ?> " name="<?php echo esc_attr($this->get_field_name('btn_icon')); ?> " type="text" value="<?php echo $btn_icon; ?> " > </p> <dl> <dt> <label><?php _e("Display Sub Category", 'javo_fr'); ?> </label> </dt> <dd> <label> <input name="<?php echo esc_attr($this->get_field_name('sub_cate')); ?> " type="radio" value="" <?php checked('' == $javo_var->get('sub_cate')); ?> > <?php _e("Show", 'javo_fr'); ?> </label> <br> <label> <input name="<?php echo esc_attr($this->get_field_name('sub_cate')); ?> " type="radio" value="hide" <?php checked('hide' == $javo_var->get('sub_cate')); ?> > <?php _e("Hide", 'javo_fr'); ?> </label> </dd> </dl> <dl> <dt> <label><?php _e("Scroll enable (if you have long categories)", 'javo_fr'); ?> </label> </dt> <dd> <label> <input name="<?php echo esc_attr($this->get_field_name('use_scroll')); ?> " type="radio" value="hide" <?php checked('hide' == $javo_var->get('use_scroll')); ?> > <?php _e("Enable", 'javo_fr'); ?> </label> <br> <label> <input name="<?php echo esc_attr($this->get_field_name('use_scroll')); ?> " type="radio" value="" <?php checked('' == $javo_var->get('use_scroll')); ?> > <?php _e("Disabled", 'javo_fr'); ?> </label> </dd> </dl> <dl> <dt> <label><?php _e("Style Setting", 'javo_fr'); ?> </label> </dt> <dd> <label> <input name="<?php echo esc_attr($this->get_field_name('button_style')); ?> " type="radio" value="" <?php checked('' == $javo_var->get('button_style')); ?> > <?php _e("Same as navi menu color", 'javo_fr'); ?> </label> <br> <label> <input name="<?php echo esc_attr($this->get_field_name('button_style')); ?> " type="radio" value="set" <?php checked('set' == $javo_var->get('button_style')); ?> > <?php _e("Setup own custom color", 'javo_fr'); ?> </label> </dd> </dl> <div class="javo-full-cover-cat-detail-style"> <p class="no-margin"> <label for="<?php echo esc_attr($this->get_field_id('btn_txt_color')); ?> "><?php _e('Button text color', 'javo_fr'); ?> : </label> <input name="<?php echo esc_attr($this->get_field_name('btn_txt_color')); ?> " type="text" class="wp_color_picker" data-default-color="#ffffff" value="<?php echo $btn_txt_color; ?> " > </p> <p class="no-margin"> <label for="<?php echo esc_attr($this->get_field_id('btn_bg_color')); ?> "><?php _e('Button background color:', 'javo_fr'); ?> </label> <input name="<?php echo esc_attr($this->get_field_name('btn_bg_color')); ?> " type="text" class="wp_color_picker" data-default-color="#ffffff" value="<?php echo $btn_bg_color; ?> " > </p> <p class="no-margin"> <label for="<?php echo esc_attr($this->get_field_id('btn_border_color')); ?> "><?php _e('Button border color:', 'javo_fr'); ?> </label> <input name="<?php echo esc_attr($this->get_field_name('btn_border_color')); ?> " type="text" class="wp_color_picker" data-default-color="#ffffff" value="<?php echo $btn_border_color; ?> " > </p> <p class="no-margin"> <label for="<?php echo esc_attr($this->get_field_id('btn_radius')); ?> "><?php _e('Button radius (only number):', 'javo_fr'); ?> </label> <input name="<?php echo esc_attr($this->get_field_name('btn_radius')); ?> " name="<?php echo esc_attr($this->get_field_name('btn_radius')); ?> " type="text" value="<?php echo $btn_radius; ?> " > </p> </div><!-- /.javo-full-cover-cat-detail-style --> </div><!-- /.javo-dtl-trigger --> <?php }
public static function javo_auto_generator_callback($post_id, $is_remove = false) { global $wpdb, $javo_tso; $is_execusion = false; if ('item' === get_post_type($post_id)) { if ('publish' === get_post_status($post_id) || true === $is_remove) { $is_execusion = true; } } if (!$is_execusion) { return $post_id; } $upload_folder = wp_upload_dir(); $blog_id = get_current_blog_id(); $lang = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : ''; $json_file = "{$upload_folder['basedir']}/javo_all_items_{$blog_id}_{$lang}.json"; if (file_exists($json_file)) { $json_contents = file_get_contents($json_file); $javo_all_posts = json_decode($json_contents, true); } else { $javo_all_posts = array(); } // Google Map LatLng Values $latlng = array('lat' => get_post_meta($post_id, 'jv_item_lat', true), 'lng' => get_post_meta($post_id, 'jv_item_lng', true)); $category = array(); $category_label = array(); foreach (array('item_category', 'item_location', 'post_tag') as $taxonomy) { $results = $wpdb->get_results($wpdb->prepare("\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tt.term_id, t.name\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t{$wpdb->terms} AS t\n\t\t\t\t\t\tINNER JOIN\n\t\t\t\t\t\t\t{$wpdb->term_taxonomy} AS tt\n\t\t\t\t\t\tON\n\t\t\t\t\t\t\ttt.term_id = t.term_id\n\t\t\t\t\t\tINNER JOIN\n\t\t\t\t\t\t\t{$wpdb->term_relationships} AS tr\n\t\t\t\t\t\tON\n\t\t\t\t\t\t\ttr.term_taxonomy_id = tt.term_taxonomy_id\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\ttt.taxonomy IN (%s)\n\t\t\t\t\t\tAND\n\t\t\t\t\t\t\ttr.object_id IN ({$post_id})\n\t\t\t\t\t\tORDER\n\t\t\t\t\t\t\tBY t.name ASC", $taxonomy)); //$category[ $taxonomy ] = $results; foreach ($results as $result) { $category[$taxonomy][] = $result->term_id; $category_label[$taxonomy][] = $result->name; } } $category_icon = isset($category['item_category'][0]) ? $category['item_category'][0] : null; if ('' === ($javo_set_icon = get_option("javo_item_category_{$category_icon}_marker", ''))) { $javo_set_icon = $javo_tso->get('map_marker', ''); } $javo_categories = new javo_ARRAY($category); $javo_categories_label = new javo_ARRAY($category_label); $javo_result = array('post_id' => $post_id, 'post_title' => get_the_title($post_id), 'lat' => $latlng['lat'], 'lng' => $latlng['lng'], 'rating' => get_post_meta($post_id, 'rating_average', true), 'icon' => $javo_set_icon, 'cat_term' => $javo_categories->get('item_category'), 'loc_term' => $javo_categories->get('item_location'), 'tags' => $javo_categories_label->get('post_tag')); $javo_is_update = false; if (!empty($javo_all_posts)) { foreach ($javo_all_posts as $index => $post_object) { if ($post_object['post_id'] == $post_id) { if (!$is_remove) { // Added Items $javo_all_posts[$index] = $javo_result; } else { // Removed Items unset($javo_all_posts[$index]); } // Process? $javo_is_update = true; } } } if (!$javo_is_update && !$is_remove) { $javo_all_posts[] = $javo_result; } // Make JSON file $file_handler = @fopen($json_file, 'w'); @fwrite($file_handler, json_encode($javo_all_posts)); @fclose($file_handler); }
function form($instance) { $javo_query = new javo_ARRAY($instance); $post_types = apply_filters('javo_get_widget_post_type_filter', null); ob_start(); printf('<p><label for="%s">%s :</label><input type="text" class="widefat" id="%s" name="%s" value="%s"></p>', esc_attr($this->get_field_id('title')), __('Title', 'javo_fr'), esc_attr($this->get_field_id('title')), esc_attr($this->get_field_name('title')), $javo_query->get('title')); printf('<p><label for="%s">%s :</label><input type="text" class="widefat" id="%s" name="%s" value="%s"></p>', esc_attr($this->get_field_id('excerpt_length')), __('Excerpt Length', 'javo_fr'), esc_attr($this->get_field_id('excerpt_length')), esc_attr($this->get_field_name('excerpt_length')), $javo_query->get('excerpt_length', 20)); ?> <p> <label for="<?php echo esc_attr($this->get_field_id('post_count')); ?> "><?php _e('Limit:', 'javo_fr'); ?> </label> <select class="widefat" name="<?php echo $this->get_field_name('post_count'); ?> " id="<?php echo $this->get_field_id('post_count'); ?> "> <?php for ($i = 1; $i <= 20; $i++) { ?> <option <?php selected((int) $javo_query->get('post_count', 3), $i); ?> value="<?php echo $i; ?> "><?php echo $i; ?> </option> <?php } ?> </select> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('post_type')); ?> "><?php _e('Choose the Post Type: ', 'javo_fr'); ?> </label> <select class="widefat" id="<?php echo $this->get_field_id('post_type'); ?> " name="<?php echo $this->get_field_name('post_type'); ?> "> <?php foreach ($post_types as $post_type) { ?> <option value="<?php echo esc_attr($post_type->name); ?> " <?php selected($javo_query->get('post_type', 'post'), $post_type->name); ?> ><?php echo esc_html($post_type->labels->singular_name); ?> </option> <?php } ?> </select> </p> <?php ob_end_flush(); }
public static function javo_search_form_callback($atts, $content = '') { global $javo_tso, $javo_tso_map; self::$load_script = true; extract(shortcode_atts(array('action' => '', 'hide_field' => array()), $atts)); $errors = new wp_error(); $javo_query = new javo_ARRAY($_GET); $javo_redirect = home_url(); if ((int) $action > 0 && !is_archive() && !is_search()) { $javo_redirect = apply_filters('javo_wpml_link', $action); } $hide_field = @explode(',', $hide_field); if (!empty($hide_field)) { foreach ($hide_field as $idx => $item) { $hide_field[$item] = 'hide'; unset($hide_field[$idx]); } } $javo_setVisibleLocation = array(); $javo_this_onoff = new javo_ARRAY($hide_field); $javo_getCurrentPageArchive = is_archive() || is_search(); $javo_getVisibleLocationType = $javo_tso_map->get('tab_location_field', '') != 'select' ? 'gg_ac' : 'term'; if (!$javo_getCurrentPageArchive) { if ($javo_getVisibleLocationType == 'gg_ac') { $javo_setVisibleLocation['term'] = " hidden"; $javo_setVisibleLocation['gg_ac'] = ""; } else { $javo_setVisibleLocation['term'] = ""; $javo_setVisibleLocation['gg_ac'] = " hidden"; } } else { $javo_setVisibleLocation['term'] = ""; $javo_setVisibleLocation['gg_ac'] = " hidden"; } if ($javo_this_onoff->get('location', null) == 'hide') { $javo_setVisibleLocation['term'] = " hidden"; } if ($errors->get_error_code() != "") { ob_start(); echo "<div class='container'><div class='alert alert-warning' role='alert'>{$errors->get_error_message()}</div></div>"; return ob_get_clean(); } ob_start(); ?> <div class="container search-type-a-wrap"> <form role="form" data-javo-search-form> <div class="search-type-a-inner"> <div class="search-box-inline<?php echo $javo_this_onoff->get('keyword', null) == 'hide' ? ' hidden' : ''; ?> "> <input type="text" class="search-a-items form-control" name="s" placeholder="<?php _e('Keyword', 'javo_fr'); ?> " value="<?php echo $javo_query->get('s', null); ?> "> </div><!-- /.search-box-inline --> <div class="search-box-inline<?php echo $javo_this_onoff->get('category', null) == 'hide' ? ' hidden' : ''; ?> "> <select name="filter[item_category]" class="form-control"> <option value=""><?php _e('Category', 'javo_fr'); ?> </option> <?php echo apply_filters('javo_get_selbox_child_term_lists', 'item_category', null, 'select', $javo_query->get('category', 0), 0, 0); ?> </select> </div><!-- /.search-box-inline --> <div class="search-box-inline<?php echo $javo_setVisibleLocation['term']; ?> "> <select name="filter[item_location]" class="form-control"> <option value=""><?php _e('Location', 'javo_fr'); ?> </option> <?php echo apply_filters('javo_get_selbox_child_term_lists', 'item_location', null, 'select', $javo_query->get('location', 0), 0, 0); ?> </select> </div><!-- /.search-box-inline --> <div class="search-box-inline<?php echo $javo_setVisibleLocation['gg_ac']; ?> "> <input type="text" name="filter[location]" class="form-control"> </div><!-- /.col-md-2 --> <div class="search-box-inline"> <input type="submit" class="btn btn-block btn-primary admin-color-setting" value="<?php _e('Search', 'javo_fr'); ?> "> </div><!-- /.col-md-2 --> </div> <!-- search-type-a-inner --> </form> <fieldset> <input type="hidden" value="<?php echo (int) $action > 0 ? apply_filters('javo_wpml_link', $action) : null; ?> " data-javo-search-action-template-url> <input type="hidden" value="<?php echo (int) $action > 0 ? 'data-javo-patch-form-for-template' : 'data-javo-patch-form-for-result'; ?> " data-javo-search-form-action-type> </fieldset> <!-- Search Result Page --> <form action="<?php echo home_url('/'); ?> " method="get" data-javo-patch-form-for-result> <input type="hidden" name="post_type" value="item"> <input type="hidden" name="category" value="<?php echo $javo_query->get('category'); ?> " data-javo-sf-category> <input type="hidden" name="location" value="<?php echo $javo_query->get('location'); ?> " data-javo-sf-location> <input type="hidden" name="s" data-javo-sf-keyword> </form><!-- /data-javo-patch-form-for-result : Go to Archive Page --> <!-- Javo Map Template --> <form action="<?php echo $javo_redirect; ?> " method="post" data-javo-patch-form-for-template> <input type="hidden" name="category" value="<?php echo $javo_query->get('category'); ?> " data-javo-sf-category> <input type="hidden" name="location" value="<?php echo $javo_query->get('location'); ?> " data-javo-sf-location> <input type="hidden" name="radius_key"> <input type="hidden" name="keyword" data-javo-sf-keyword> </form><!-- /data-javo-patch-form-for-template : Go to Map --> </div> <!-- container search-type-a-wrap --> <script type="text/javascript"> jQuery(function($){ var javo_search_bar_script = { el:{ origin : '[data-javo-search-form]' , result : '[data-javo-patch-form-for-result]' , template : '[data-javo-patch-form-for-template]' , type : '[data-javo-search-form-action-type]' } , template_url: $('[data-javo-search-action-template-url]').val() , msg: function(str){ $.javo_msg({content:str, delay:10000}); } , init: function(){ var $cat = this.setAutoComplete('[name="filter[item_category]"]'); var $loc = this.setAutoComplete('[name="filter[item_location]"]'); var eloc = $( this.el.origin ).find( '[name="filter[location]"]' ); var javo_ac = new google.maps.places.Autocomplete( eloc[0] ); $(document) .on('submit', this.el.origin, this.submit) } , setAutoComplete: function(el){ $(this.el.origin).find(el).chosen(); return $(this.el.origin).find(el); } , submit: function(e){ e.preventDefault(); var o = javo_search_bar_script; var r = $( o.el.origin ); var t = $('[' + $(o.el.type).val() + ']'); t.find('[data-javo-sf-category]') .val( r.find('[name="filter[item_category]"]').val() ); t.find('[data-javo-sf-location]') .val( r.find('[name="filter[item_location]"]').val() ); t.find('[name="radius_key"]') .val( r.find('[name="filter[location]"]').val() ); t.find('[data-javo-sf-keyword]') .val( r.find('input[name="s"]').val() ); t.submit(); } } javo_search_bar_script.init(); }); </script> <?php return ob_get_clean(); }
?> </label> <?php $javo_get_my_posts = new WP_Query(array('post_type' => 'item', 'post_status' => 'publish', 'posts_per_page' => -1)); if ($javo_get_my_posts->have_posts()) { ?> <select name="txt_parent_post_id" class="form-control" data-autocomplete> <option value=""><?php _e('Select an item to review.', 'javo_fr'); ?> </option> <?php while ($javo_get_my_posts->have_posts()) { $javo_get_my_posts->the_post(); $javo_this_parent = !empty($edit) ? get_post_meta($edit->ID, 'parent_post_id', true) : null; printf('<option value="%s"%s>%s</option>', get_the_ID(), $javo_this_parent == get_the_ID() || (int) $javo_query->get('parent', 0) == get_the_ID() ? ' selected' : '', get_the_title()); } ?> </select> <?php } else { _e('No Items Found.', 'javo_fr'); } wp_reset_postdata(); ?> </div> <div class="form-group"> <label><?php _e('Featured Image', 'javo_fr'); ?> </label>
$javo_nav_logo_base = $javo_nav_logo; $javo_nav_logo_sticky = $javo_nav_logo; $javo_nav_logo_single = $javo_tso->get('single_item_logo', false); // ThemeSettings Logo $javo_hd_options = get_post_meta($post_id, 'javo_hd_post', true); $javo_post_skin = new javo_ARRAY($javo_hd_options); // Dark Logo ( User Default upload logo ) if (false === ($javo_nav_logo_dark = $javo_tso->get('logo_url', false))) { $javo_nav_logo_dark = $javo_nav_logo; } // Light Logo if (false === ($javo_nav_logo_light = $javo_tso->get('logo_light_url', false))) { $javo_nav_logo_light = $javo_nav_logo; } // Setup Default Logo switch ($javo_post_skin->get("header_skin", $javo_ts_hd->get('header_skin', false))) { case "light": $javo_nav_logo_base = $javo_nav_logo_light; break; case "dark": default: $javo_nav_logo_base = $javo_nav_logo_dark; } // Setup Sticky Default Logo switch ($javo_post_skin->get("sticky_header_skin", $javo_ts_hd->get('sticky_header_skin', false))) { case "light": $javo_nav_logo_sticky = $javo_nav_logo_light; break; case "dark": default: $javo_nav_logo_sticky = $javo_nav_logo_dark;
static function javo_custom_in_post_save_callback($post_id) { $javo_query = new javo_ARRAY($_POST); if (false !== (bool) ($fields = $javo_query->get('javo_custom_field', false))) { if (is_Array($fields)) { foreach ($fields as $key => $fields) { $javo_value = new javo_ARRAY($fields); update_post_meta($post_id, $key, $javo_value->get('value')); } } } }
public static function post_enqueue_scripts_callback() { global $post, $javo_ts_hd; if (empty($post)) { $post = new stdClass(); $post->ID = 0; } $javo_hd_options = get_post_meta($post->ID, 'javo_hd_post', true); $javo_query = new javo_ARRAY($javo_hd_options); $javo_css_one_row = array(); // Backgeound Color if (false !== ($css = $javo_query->get("page_bg", $javo_ts_hd->get('page_bg', false)))) { $javo_css_one_row[] = "html body{ background-color:{$css}; }"; $javo_css_one_row[] = "html body #page-style{ background-color:{$css}; }"; } // Navigation Background Color if (false !== ($hex = $javo_query->get("header_bg", $javo_ts_hd->get('header_bg', false)))) { if ($javo_query->get('header_opacity_as', '') != '') { // 'enable' => Page Setting if (false === ($opacity = (double) $javo_query->get('header_opacity', false))) { $opacity = (double) 1; } } else { // '' => Theme settings if (false === ($opacity = (double) $javo_ts_hd->get('header_opacity', false))) { $opacity = (double) 1; } } $javo_rgb = apply_filters('javo_rgb', substr($hex, 1)); $javo_css_one_row[] = "html header.main nav.navbar{ background-color:rgba( {$javo_rgb['r']}, {$javo_rgb['g']}, {$javo_rgb['b']}, {$opacity}); }"; } // Sticky Navigation Background Color if (false !== ($hex = $javo_query->get("sticky_header_bg", $javo_ts_hd->get('sticky_header_bg', false)))) { if ($javo_query->get('sticky_header_opacity_as', '') != '') { // 'enable' => Page Setting if (false === ($opacity = (double) $javo_query->get('sticky_header_opacity', false))) { $opacity = (double) 1; } } else { // '' => Theme settings if (false === ($opacity = (double) $javo_ts_hd->get('sticky_header_opacity', false))) { $opacity = (double) 1; } } $javo_rgb = apply_filters('javo_rgb', substr($hex, 1)); $javo_css_one_row[] = "html header.main nav.navbar.affix{ background-color:rgba( {$javo_rgb['r']}, {$javo_rgb['g']}, {$javo_rgb['b']}, {$opacity}); }"; } // Navigation Shadow if ("disabled" == $javo_query->get("header_shadow", $javo_ts_hd->get('header_shadow', false))) { $javo_css_one_row[] = "html header#header-one-line nav.navbar{ box-shadow:none; }"; $javo_css_one_row[] = "html header#header-one-line:after{ content:none; }"; } switch ($javo_query->get("header_skin", $javo_ts_hd->get('header_skin', false))) { case "light": $javo_css_one_row[] = "html body header#header-one-line ul.nav > li.menu-item > a{ color:#fff; }"; $javo_css_one_row[] = "html body header#header-one-line ul.widget_top_menu_wrap > li.widget_top_menu > a{ color:#fff; }"; $javo_css_one_row[] = "html body header#header-one-line ul.widget_top_menu_wrap > li.widget_top_menu button.btn{ color:#fff; }"; break; default: case "dark": $javo_css_one_row[] = "html body header#header-one-line ul.nav > li.menu-item > a{ color:#000; }"; $javo_css_one_row[] = "html body header#header-one-line ul.widget_top_menu_wrap > li.widget_top_menu > a{ color:#000; }"; $javo_css_one_row[] = "html body header#header-one-line ul.widget_top_menu_wrap > li.widget_top_menu button.btn{ color:#000; }"; break; } // Navigation Full-Width if ("full" == $javo_query->get("header_fullwidth", $javo_ts_hd->get('header_fullwidth', false))) { $javo_css_one_row[] = "html header#header-one-line .container{ width:100%; }"; $javo_css_one_row[] = "html header#header-one-line div#javo-navibar{ text-align:right; }"; $javo_css_one_row[] = "html header#header-one-line div#javo-navibar ul{ text-align:left; }"; $javo_css_one_row[] = "html header#header-one-line div#javo-navibar ul.navbar-left:not(.mobile){ float:none !important; display:inline-block; }"; $javo_css_one_row[] = "html header#header-one-line div#javo-navibar ul.navbar-right:not(.mobile){ float:none !important; display:inline-block; }"; } else { $javo_css_one_row[] = "html header#header-one-line div#javo-navibar ul.navbar-right .widget_top_menu_wrap{padding-top:16px; }"; } // Navigation Menu Transparent if (false !== ($css = $javo_query->get("header_relation", $javo_ts_hd->get('header_relation', false)))) { $javo_css_one_row[] = "html header#header-one-line.main{ position:{$css}; }"; if ($css == "absolute") { $javo_css_one_row[] = "html header#header-one-line.main{ left:0; right:0; }"; } } if ("disabled" == $javo_query->get("header_sticky", $javo_ts_hd->get('header_sticky', false))) { add_filter('body_class', array(__CLASS__, 'append_parametter')); } switch ($javo_query->get("sticky_header_skin", $javo_ts_hd->get('sticky_header_skin', false))) { case "light": $javo_css_one_row[] = "html body header#header-one-line .affix #javo-navibar ul.nav > li.menu-item > a{ color:#fff; }"; $javo_css_one_row[] = "html body header#header-one-line .affix ul.widget_top_menu_wrap > li.widget_top_menu > a{ color:#fff; }"; $javo_css_one_row[] = "html body header#header-one-line .affix ul.widget_top_menu_wrap > li.widget_top_menu button.btn{ color:#fff; }"; break; default: case "dark": $javo_css_one_row[] = "html body header#header-one-line .affix #javo-navibar ul.nav > li.menu-item > a{ color:#000; }"; $javo_css_one_row[] = "html body header#header-one-line .affix ul.widget_top_menu_wrap > li.widget_top_menu > a{ color:#000; }"; $javo_css_one_row[] = "html body header#header-one-line .affix ul.widget_top_menu_wrap > li.widget_top_menu button.btn{ color:#000; }"; break; } // Mobile Navigation if (false !== ($hex = $javo_query->get("mobile_header_bg", $javo_ts_hd->get('mobile_header_bg', false)))) { if ($javo_query->get('mobile_header_opacity_as', '') != '') { // 'enable' => Page Setting if (false === ($opacity = (double) $javo_query->get('mobile_header_opacity', false))) { $opacity = (double) 1; } } else { // '' => Theme settings if (false === ($opacity = (double) $javo_ts_hd->get('mobile_header_opacity', false))) { $opacity = (double) 1; } } $javo_rgb = apply_filters('javo_rgb', substr($hex, 1)); $javo_css_one_row[] = "html body.mobile header.main nav.navbar{ background-color:rgba( {$javo_rgb['r']}, {$javo_rgb['g']}, {$javo_rgb['b']}, {$opacity}); }"; } switch ($javo_query->get("mobile_header_skin", $javo_ts_hd->get('mobile_header_skin', false))) { case "light": $javo_css_one_row[] = "html body.mobile header#header-one-line ul.nav > li.menu-item > a{ color:#fff; }"; break; default: case "dark": $javo_css_one_row[] = "html body.mobile header#header-one-line #javo-navibar ul.nav > li.menu-item > a{ color:#000; }"; $javo_css_one_row[] = "html body.mobile header#header-one-line .navbar-header>button>span{ background-color:#000; }"; break; } $css = $javo_ts_hd->get('mobile_respon_menu_bg', '#454545'); $javo_css_one_row[] = "html body header#header-one-line #javo-doc-top-level-menu{ background-color:{$css}; }"; switch ($javo_ts_hd->get('mobile_respon_menu_skin', false)) { case "light": $javo_css_one_row[] = "html body header#header-one-line #javo-doc-top-level-menu{ color:#fff; }"; $javo_css_one_row[] = "html body header#header-one-line #javo-doc-top-level-menu a{ color:#fff; }"; break; default: case "dark": $javo_css_one_row[] = "html body header#header-one-line #javo-doc-top-level-menu{ color:#000; }"; $javo_css_one_row[] = "html body header#header-one-line #javo-doc-top-level-menu a{ color:#000; }"; } // Navigation Menu Transparent if (false !== ($css = $javo_query->get("single_header_relation", $javo_ts_hd->get('single_header_relation', false)))) { $javo_css_one_row[] = "html body.single header#header-one-line.main{ position:{$css}; }"; if ($css == "absolute") { $javo_css_one_row[] = "html body.single header#header-one-line.main{ left:0; right:0; }"; } } // Output Stylesheet ob_start(); foreach ($javo_css_one_row as $row) { echo "\t{$row}\n"; } $javo_post_hd_css = ob_get_clean(); echo "<style type=\"text/css\">\n{$javo_post_hd_css}</style>\n"; }
public static function javo_search_form_callback($atts, $content = "") { global $javo_tso, $javo_tso_map; self::$load_script = true; extract(shortcode_atts(array('action' => '', 'hide_field' => array(), 'input_field' => 'location', 'place_holder' => '', 'single_search_button_color' => ''), $atts)); $errors = new wp_error(); $javo_query = new javo_ARRAY($_GET); $javo_redirect = home_url(); $javo_all_tags = ""; if ($input_field == 'keyword') { foreach (get_tags(array('fields' => 'names')) as $tags) { $javo_all_tags .= "{$tags}|"; } $javo_all_tags = substr($javo_all_tags, 0, -1); } if ((int) $action > 0 && !is_archive() && !is_search()) { $javo_redirect = apply_filters('javo_wpml_link', $action); } // No setup result page if ($errors->get_error_code() != "") { ob_start(); echo "<div class='container'><div class='alert alert-warning' role='alert'>{$errors->get_error_message()}</div></div>"; return ob_get_clean(); } ob_start(); ?> <div class="container javo-single-search-form" id="javo-single-search-form"> <form role="form" data-javo-search-form class="search-form-type"> <div class="search-type-a-inner"> <div class="search-box-inline search-box-inline-position"> <input type="text" class="search-type-inner-position-text" placeholder="<?php echo $place_holder; ?> "> <div class="inner-marker"><i class="fa fa-map-marker javo-current-position"></i></div> <div class="search-box-inline search-box-inline-position-button"> <button type="submit" class="search-submit admin-color-setting" <?php if ($single_search_button_color != '') { echo 'style="background-color:' . $single_search_button_color . ';"'; } ?> > <i class="fa fa-search search-box-inline-icon"></i> <span class="search-submit-text"><?php _e("search", 'javo_fr'); ?> </span> </button> </div><!-- /.col-md-2 --> </div><!-- /.col-md-2 --> </div> <!-- search-type-inner --> </form><!--search-form-type--> <fieldset> <input type="hidden" value="<?php echo (int) $action > 0 ? apply_filters('javo_wpml_link', $action) : null; ?> " data-javo-search-action-template-url> <input type="hidden" value="<?php echo (int) $action > 0 ? 'data-javo-patch-form-for-template' : 'data-javo-patch-form-for-result'; ?> " data-javo-search-form-action-type> <input type="hidden" javo-map-all-tags value="<?php echo $javo_all_tags; ?> "> <input type="hidden" javo-input-field-type value="<?php echo $input_field; ?> "> </fieldset> <!-- Search Result Page --> <form action="<?php echo home_url('/'); ?> " method="get" data-javo-patch-form-for-result> <input type="hidden" name="post_type" value="item"> <input type="hidden" name="location" value="<?php echo $javo_query->get('location'); ?> " data-javo-sf-location> <input type="hidden" name="s" data-javo-sf-keyword> </form><!-- /data-javo-patch-form-for-result : Go to Archive Page --> <!-- Javo Map Template --> <form action="<?php echo $javo_redirect; ?> " method="post" data-javo-patch-form-for-template> <input type="hidden" name="location" data-javo-sf-location-keyword> <input type="hidden" name="radius_key" data-javo-sf-google-keyword> <input type="hidden" name="keyword" data-javo-sf-keyword> <input type="hidden" name="geolocation" data-javo-sf-geolocation> </form><!-- /data-javo-patch-form-for-template : Go to Map --> </div> <script type="text/javascript"> jQuery( function($){ window.javo_single_search_func = { init: function() { this.el_org = $( "[data-javo-search-form]" ); this.el = $( "[" + $("[data-javo-search-form-action-type]").val() + "]" ); this.type = this.el.closest( "#javo-single-search-form" ).find( "[javo-input-field-type]" ).val(); this.tags = $('[javo-map-all-tags]').val().toLowerCase().split( '|' ); this.el_keyword = $("#javo-single-search-form input.search-type-inner-position-text"); if( this.type == "keyword" ) { this.setKeywordAutoComplete(); }else{ var javo_ac = new google.maps.places.Autocomplete( this.el_keyword[0] ); } ;$( document ) .on( 'submit' , this.el_org.selector, this.submit ) .on( 'click' , '.javo-current-position', this.position ) } , setKeywordAutoComplete: function() { this.el_keyword.typeahead({ hint : false , highlight : true , minLength : 1 }, { name : 'tags' , displayKey : 'value' , source : this.keywordMatchesCallback( this.tags ) }); } , keywordMatchesCallback: function( tags ) { return function keywordFindMatches( q, cb ) { var matches, substrRegex; substrRegex = new RegExp( q, 'i'); matches = []; $.each( tags, function( i, tag ){ if( substrRegex.test( tag ) ){ matches.push({ value : tag }); } }); cb( matches ); } } , position: function( e ) { e.preventDefault(); var obj = javo_single_search_func; if( $( this ).hasClass( 'active' ) ) { obj.el.find( "[data-javo-sf-geolocation]" ).val( 0 ); $( this ).removeClass( 'active' ); }else{ obj.el.find( "[data-javo-sf-geolocation]" ).val( 1 ); $( this ).addClass( 'active' ).addClass( 'fa-spin' ); } obj.submit(e); } , submit: function( e ) { e.preventDefault(); var obj = javo_single_search_func; var el_org = obj.el_org; var el = obj.el; var type = obj.type; var input = el_org.find( "input.search-type-inner-position-text" ); if( type == "keyword" ) { // Keyword el.find( "[data-javo-sf-keyword]" ).val( input.val() ); }else{ // Locaiton el.find( "[data-javo-sf-google-keyword]" ).val( input.val() ); } el.submit(); } } window.javo_single_search_func.init(); }); </script> <?php return ob_get_clean(); }
function form($instance) { /* Set up some default widget settings. */ $defaults = array('btn_txt_color' => '', 'btn_visible' => ''); $instance = wp_parse_args($instance, $defaults); $javo_query = new javo_ARRAY($instance); ?> <div class="javo-dtl-trigger" data-javo-dtl-el="[name='<?php echo esc_attr($this->get_field_name('button_style')); ?> ']" data-javo-dtl-val="set" data-javo-dtl-tar=".javo-button-right-menu-detail-style"> <dl> <dt> <label><?php _e("Show on mobile", 'javo_fr'); ?> </label> </dt> <dd> <label> <input name="<?php echo esc_attr($this->get_field_name('btn_visible')); ?> " type="radio" value="" <?php checked('' == $javo_query->get('btn_visible')); ?> > <?php _e("Enable", 'javo_fr'); ?> </label> <label> <input name="<?php echo esc_attr($this->get_field_name('btn_visible')); ?> " type="radio" value="hide" <?php checked('hide' == $javo_query->get('btn_visible')); ?> > <?php _e("Hide", 'javo_fr'); ?> </label> </dd> </dl> <dl> <dt> <label><?php _e("Style Setting", 'javo_fr'); ?> </label> </dt> <dd> <label> <input name="<?php echo esc_attr($this->get_field_name('button_style')); ?> " type="radio" value="" <?php checked('' == $javo_query->get('button_style')); ?> > <?php _e("Same as navi menu color", 'javo_fr'); ?> </label> <br> <label> <input name="<?php echo esc_attr($this->get_field_name('button_style')); ?> " type="radio" value="set" <?php checked('set' == $javo_query->get('button_style')); ?> > <?php _e("Setup own custom color", 'javo_fr'); ?> </label> </dd> </dl> <div class="javo-button-right-menu-detail-style"> <dl class="no-margin"> <dt> <label> <?php _e('Button text color', 'javo_fr'); ?> : </label> </dt> <dd> <input type="text" name="<?php echo esc_attr($this->get_field_name('btn_txt_color')); ?> " class="wp_color_picker" data-default-color="#ffffff" value="<?php echo $javo_query->get('btn_txt_color', ''); ?> "> </dd> </dl> </div><!-- /.javo-button-right-menu-detail-style --> </div> <?php }
public static function item_unserial_callback() { global $javo_tso, $wpdb; $javo_query = new javo_ARRAY($_POST); $lang = $javo_query->get('lang', ''); $wpml_join = ""; $wpml_where = ""; if (defined('ICL_LANGUAGE_CODE') && $lang != '') { $wpml_join = "INNER JOIN {$wpdb->prefix}icl_translations as w ON p.ID = w.element_id"; $wpml_where = $wpdb->prepare("AND w.language_code=%s", $lang); } $javo_all_posts = array(); $javo_all_items = $wpdb->get_results($wpdb->prepare("SELECT ID, post_title FROM {$wpdb->posts} as p {$wpml_join} WHERE p.post_type=%s AND p.post_status=%s {$wpml_where} ORDER BY p.post_date ASC", 'item', 'publish'), OBJECT); foreach ($javo_all_items as $item) { // directory_meta if (false !== (bool) ($_meta = get_post_meta($item->ID, 'directory_meta', true))) { $_meta = @unserialize($_meta); if (!empty($_meta)) { foreach ($_meta as $key => $value) { update_post_meta($item->ID, "jv_item_{$key}", $value); } } } // Lat Lng if (false !== (bool) ($_meta = get_post_meta($item->ID, 'latlng', true))) { $_meta = @unserialize($_meta); if (!empty($_meta)) { foreach ($_meta as $key => $value) { update_post_meta($item->ID, "jv_item_{$key}", $value); } } } $javo_get_custom_field = $javo_tso->get('custom_field', null); $javo_get_custom_variables = get_post_meta($item->ID, 'custom_variables', true); if (!empty($javo_get_custom_field) && is_Array($javo_get_custom_field) && is_Array($javo_get_custom_variables)) { foreach ($javo_get_custom_field as $key => $field) { if (!empty($javo_get_custom_variables[$key]['value'])) { update_post_meta($item->ID, $key, $javo_get_custom_variables[$key]['value']); } } // End Foreach } // End IF // End Custom Fields } }
function javo_archive_apply_filter_callback($query) { global $javo_tso_archive; if ($query->is_main_query() && $query->is_archive) { $javo_query = new javo_ARRAY($_GET); if ((int) $javo_tso_archive->get('item_count', 20) > 0) { $query->set('posts_per_page', (int) $javo_tso_archive->get('item_count', 20)); } else { $query->set('posts_per_page', -1); } if (isset($_GET['view']) && $_GET['view'] != "") { $query->set('posts_per_page', $javo_query->get('view', 10)); } $query->set('order', $javo_query->get('order', null)); switch ($javo_query->get('sort', null)) { case 'post_date': $query->set('orderby', 'post_date'); break; case 'rating': $query->set('meta_key', 'rating_average'); $query->set('orderby', 'meta_value_num'); break; } } }
function javo_map_brief_callback() { global $javo_tso, $javo_custom_item_label, $javo_custom_item_tab; $javo_query = new javo_ARRAY($_POST); if ((int) $javo_query->get('post_id', 0) <= 0) { return false; } $javo_meta_query = new javo_GET_META($javo_query->get('post_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="row"> <div class="col-md-12 text-center"> <a href="<?php echo get_permalink($javo_query->get('post_id')); ?> "> <?php echo $javo_meta_query->image('thumbnail', array('class' => 'img-circle img-inner-shadow')); ?> </a> </div><!-- /.col-md-4 --> </div><!-- /.row --> <div class="row"> <div class="col-md-12 text-center"> <a href="<?php echo get_permalink($javo_query->get('post_id')); ?> "> <h1><?php echo $javo_meta_query->post_title; ?> </h1> </a> </div> </div><!-- /.row --> <div class="row"> <div class="col-md-6 text-right"> <ul class="list-unstyled"> <li><?php printf('%s : %s', __('Category', 'javo_fr'), $javo_meta_query->cat('item_category', __('No Category', 'javo_fr'))); ?> </li> <li><?php printf('%s : %s', __('Location', 'javo_fr'), $javo_meta_query->cat('item_location', __('No Location', 'javo_fr'))); ?> </li> <?php if ($javo_custom_item_tab->get('ratings', '') == '') { ?> <li><?php printf('%s : %.1f /%d', __($javo_custom_item_label->get('ratings', 'Ratings'), 'javo_fr'), (double) $javo_meta_query->_get('rating_average'), (int) $javo_meta_query->get_child_count('ratings', 'rating_parent_post_id', $javo_query->get('post_id'))); ?> </li> <?php } ?> <?php if ($javo_custom_item_tab->get('reviews', '') == '') { ?> <li><?php printf('%s : %d', __($javo_custom_item_label->get('reviews', 'Reviews'), 'javo_fr'), (int) $javo_meta_query->get_child_count('reviews', 'parent_post_id', $javo_query->get('post_id'))); ?> </li> <?php } ?> </ul> </div><!-- /.col-md-6 --> <div class="col-md-6"> <ul class="list-unstyled"> <li><?php printf('%s : %s', __('Phone', 'javo_fr'), $javo_meta_query->get('phone')); ?> </li> <li><?php printf('%s : %s', __('Email', 'javo_fr'), $javo_meta_query->get('email')); ?> </li> <li><?php printf('%s : %s', __('Website', 'javo_fr'), $javo_meta_query->get('website')); ?> </li> </ul> </div><!-- /.col-md-6 --> </div><!-- /.row --> <div class="row"> <div class="col-md-12 text-center alert alert-light-gray"> <?php echo $javo_meta_query->excerpt(400); ?> </div><!-- /.col-md-12 --> </div><!-- /.row --> <?php $javo_bf_output = ob_get_clean(); echo json_encode(array("html" => $javo_bf_output)); exit; }
</div><!-- 12 columns --> </div><!-- Row --> </div> </div> <!-- form-group --> <div class="line-title-bigdots"> <h2><span><?php _e("Video", "javo_fr"); ?> </span></h2> </div> <?php $javo_video_portals = array('youtube', 'vimeo', 'dailymotion', 'yahoo', 'bliptv', 'veoh', 'viddler'); $javo_get_video_meta = !empty($edit) ? get_post_meta($edit->ID, 'video', true) : array(); $javo_video_meta = new javo_ARRAY($javo_get_video_meta); $javo_get_video = array("portal" => $javo_video_meta->get('portal', NULL), "video_id" => $javo_video_meta->get('video_id', NULL)); ?> <div class="row"> <div class="col-md-4 col-sm-4 col-xs-4"> <select name="javo_video[portal]" class="form-control"> <option value=""><?php _e('None', 'javo_fr'); ?> </option> <?php foreach ($javo_video_portals as $portal) { printf('<option value="%s"%s>%s</option>', $portal, $portal == $javo_get_video['portal'] ? ' selected' : '', __($portal, 'javo_fr')); } ?> </select> </div><!-- /.col-md-4 -->
/** * Widget setting */ function form($instance) { global $javo_tso; $javo_var = new javo_ARRAY($instance); $javo_chimp_lists = apply_filters('javo_mail_chimp_get_lists', null); ob_start(); ?> <dl> <dt> <label><?php _e("Mail Chimp List", 'javo_fr'); ?> </label> </dt> <dd> <?php if (false !== $javo_tso->get('mailchimp_api', false)) { ?> <select name="<?php echo esc_attr($this->get_field_name('list_id')); ?> "> <?php if (!empty($javo_chimp_lists) && is_Array($javo_chimp_lists)) { foreach ($javo_chimp_lists as $label => $value) { $is_checked = selected($value == $javo_var->get('list_id'), true, false); echo "<option value='{$value}'{$is_checked}>{$label}</option>"; } } ?> </select> <?php } else { ?> <div class="notice notice-warning"> <?php _e("Theme Setting > General > Plugin > API KEY (Please add your API key)", 'javo_fr'); ?> </div> <input type="hidden" name="<?php echo esc_attr($this->get_field_name('list_id')); ?> "> <?php } ?> </dd> </dl> <?php ob_end_flush(); }
public function ajax_ratings_callback() { // Get Variables $javo_query = new javo_ARRAY($_POST); $javo_form_meta = new javo_ARRAY($_POST['javo_rating']); // Default Informations $javo_rating_meta = array('count' => count((array) $javo_query->get('javo_rats', array())), 'ratings' => @serialize($javo_query->get('javo_rats')), 'summary' => 0, 'parent_post' => $javo_query->get('parent_post_id'), 'user_ip' => $_SERVER['REMOTE_ADDR']); // Summary Ratings Scores if ($javo_query->get('javo_rats', null) != null) { foreach ($javo_query->get('javo_rats') as $index => $value) { $javo_rating_meta['summary'] += (double) $value['score']; } // End Foreach } // End if $javo_rating_meta_query = new javo_ARRAY($javo_rating_meta); $javo_rating_meta['average'] = (double) $javo_rating_meta_query->get('summary', 0) > 0 ? (double) ($javo_rating_meta_query->get('summary', 0) / $javo_rating_meta['count']) : 0; $javo_rating_meta['round'] = round((double) $javo_rating_meta['average']); // Create Rating Post $javo_create_rating_args = array('post_type' => 'ratings', 'post_title' => sprintf('[ %s: %d ][ %s: %.1f ] %s', __('Target ID', 'javo_fr'), (int) $javo_rating_meta['parent_post'], __('Rating', 'javo_fr'), (int) $javo_rating_meta['average'], $javo_form_meta->get('name', 'Noname')), 'post_author' => get_current_user_id(), 'post_content' => $javo_form_meta->get('content', 'None'), 'post_status' => 'publish'); $this->rating_id = wp_insert_post($javo_create_rating_args); if ((int) $this->rating_id > 0) { $this->insert('rating_scores', $javo_rating_meta['ratings']); $this->insert('rating_parent_post_id', $javo_rating_meta['parent_post']); $this->insert('rating_current_user_ip', $javo_rating_meta['user_ip']); $this->insert('rating_total', $javo_rating_meta['summary']); $this->insert('rating_average', $javo_rating_meta['average']); $this->insert('rating_round', $javo_rating_meta['round']); $javo_this_state = 1; // Update Score $this->update_score($javo_rating_meta['parent_post']); } else { $javo_this_state = 0; } echo json_encode(array('state' => $javo_this_state, 'count' => $javo_rating_meta['ratings'])); exit; }
public static function javo_timeline_callback() { global $javo_tso, $sitepress; check_ajax_referer('javo-timeline-call', 'nonce'); $javo_query = new javo_ARRAY($_POST); if (is_object($sitepress) && method_exists($sitepress, 'switch_lang') && $javo_query->get('lang', false) != false) { $sitepress->switch_lang($javo_query->get('lang'), true); } $javo_this_return = array(); $javo_this_offset = (int) $javo_query->get('offset', 0); $javo_this_posts = get_posts(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $javo_query->get('count', 4), 'offset' => $javo_this_offset)); if (!empty($javo_this_posts)) { foreach ($javo_this_posts as $post) { setup_postdata($post); $javo_this_regist = strtotime($post->post_date); $javo_this_author = new WP_User($post->post_author); $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-box-v'); 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_this_return['posts'][] = array('post_id' => $post->ID, 'post_title' => $post->post_title, 'post_content' => apply_filters('javo_post_excerpt', $post->post_content, 200), 'author' => $javo_this_author->display_name, 'thumbnail' => $javo_this_thumb, 'permalink' => apply_filters('javo_wpml_link', $post->ID), 'year' => date('Y', $javo_this_regist), 'month' => __(date('F', $javo_this_regist), 'javo_fr'), 'day' => __(date('d', $javo_this_regist), 'javo_fr'), 'week' => date('l', $javo_this_regist)); $javo_this_offset++; } } $javo_this_return['offset'] = $javo_this_offset; $javo_this_return['result'] = "OK"; die(json_encode($javo_this_return)); }