Login – Google My Business

We're Giving Away An Amazing FREE Money Making Offer. Would You Jump For Joy If You Can Download 12 FREE Websites In 2021? They Come Preloaded With Content And Ads. Click The Link Below To Register

https://demosites.onlinebizopps.info/share-demosites/?c1Le

alert offer.png

Clickbank Marketing Tools


Login – Google My Business -1; } /* Disable tracking if the opt-out cookie exists. */ if ( __gaTrackerIsOptedOut() ) { window[disableStr] = true; } /* Opt-out function */ function __gaTrackerOptout() { document.cookie = disableStr + ‘=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/’; window[disableStr] = true; } if ( ‘undefined’ === typeof gaOptout ) { function gaOptout() { __gaTrackerOptout(); } } if ( em_track_user ) { (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’__gaTracker’); window.ga = __gaTracker; __gaTracker(‘create’, ‘UA-114912898-1’, ‘auto’); __gaTracker(‘set’, ‘forceSSL’, true); __gaTracker(‘send’,’pageview’); __gaTracker( function() { window.ga = __gaTracker; } ); } else { console.log( “” ); (function() { /* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */ var noopfn = function() { return null; }; var noopnullfn = function() { return null; }; var Tracker = function() { return null; }; var p = Tracker.prototype; p.get = noopfn; p.set = noopfn; p.send = noopfn; var __gaTracker = function() { var len = arguments.length; if ( len === 0 ) { return; } var f = arguments[len-1]; if ( typeof f !== ‘object’ || f === null || typeof f.hitCallback !== ‘function’ ) { console.log( ‘Not running function __gaTracker(‘ + arguments[0] + ” ….) because you are not being tracked. ” + em_no_track_reason ); return; } try { f.hitCallback(); } catch (ex) { } }; __gaTracker.create = function() { return new Tracker(); }; __gaTracker.getByName = noopnullfn; __gaTracker.getAll = function() { return []; }; __gaTracker.remove = noopfn; window[‘__gaTracker’] = __gaTracker; window.ga = __gaTracker; })(); } ]]><![CDATA[ window._wpemojiSettings = {"baseUrl":"https://s.w.org/images/core/emoji/12.0.0-1/72×72/","ext":".png","svgUrl":"https://s.w.org/images/core/emoji/12.0.0-1/svg/","svgExt":".svg","source":{"concatemoji":"https://googlemybusiness.co.za/wp-includes/js/wp-emoji-release.min.js?ver=5.2.9"}}; !function(a,b,c){function d(a,b){var c=String.fromCharCode;l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,a),0,0);var d=k.toDataURL();l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,b),0,0);var e=k.toDataURL();return d===e}function e(a){var b;if(!l||!l.fillText)return!1;switch(l.textBaseline="top",l.font="600 32px Arial",a){case"flag":return!(b=d([55356,56826,55356,56819],[55356,56826,8203,55356,56819]))&&(b=d([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]),!b);case"emoji":return b=d([55357,56424,55356,57342,8205,55358,56605,8205,55357,56424,55356,57340],[55357,56424,55356,57342,8203,55358,56605,8203,55357,56424,55356,57340]),!b}return!1}function f(a){var c=b.createElement("script");c.src=a,c.defer=c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var g,h,i,j,k=b.createElement("canvas"),l=k.getContext&&k.getContext("2d");for(j=Array("flag","emoji"),c.supports={everything:!0,everythingExceptFlag:!0},i=0;i 0 || (jQuery(‘select[name=”sort_by”]’).val() == ‘nearest’ || jQuery(‘select[name=”sort_by”]’, $form).val() == ‘farthest’) || (jQuery(“.snear”, $form).val() != ” && jQuery(“.snear”, $form).val() != ‘Near’ && !jQuery(‘.geodir-location-search-type’, $form).val() ) ) { // OSM can’t handel post code with no space so we test for it and add one if needed if(window.gdMaps === ‘osm’){ var $near_val = jQuery(“.snear”, $form).val(); var $is_post_code = $near_val.match(“^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]??[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$”); if($is_post_code){ $near_val = $near_val.replace(/.{3}$/,’ $&’); jQuery(“.snear”, $form).val($near_val); } } geodir_setsearch($form); } else { jQuery(“.snear”, $form).val(”); jQuery($form).submit(); } }); } jQuery(document).ready(function() { geodir_setup_submit_search(); //setup advanced search form on form ajax load jQuery(“body”).on(“geodir_setup_search_form”, function($form){ geodir_setup_submit_search($form); }); }); function geodir_setsearch($form) { if ((dist > 0 || (jQuery(‘select[name=”sort_by”]’, $form).val() == ‘nearest’ || jQuery(‘select[name=”sort_by”]’, $form).val() == ‘farthest’)) && (jQuery(“.snear”, $form).val() == ” || jQuery(“.snear”, $form).val() == ‘Near’)) jQuery(“.snear”, $form).val(default_location); geocodeAddress($form); } function updateSearchPosition(latLng, $form) { if (window.gdMaps === ‘google’) { jQuery(‘.sgeo_lat’).val(latLng.lat()); jQuery(‘.sgeo_lon’).val(latLng.lng()); } else if (window.gdMaps === ‘osm’) { jQuery(‘.sgeo_lat’).val(latLng.lat); jQuery(‘.sgeo_lon’).val(latLng.lon); } jQuery($form).submit(); // submit form after insering the lat long positions } function geocodeAddress($form) { // Call the geocode function Sgeocoder = window.gdMaps == ‘google’ ? new google.maps.Geocoder() : null; if (jQuery(‘.snear’, $form).val() == ” || ( jQuery(‘.sgeo_lat’).val() != ” && jQuery(‘.sgeo_lon’).val() != ” ) || jQuery(‘.snear’, $form).val().match(“^In:”)) { if (jQuery(‘.snear’, $form).val().match(“^In:”)) { jQuery(“.snear”, $form).val(”); } jQuery($form).submit(); } else { var address = jQuery(“.snear”, $form).val(); if (jQuery(‘.snear’, $form).val() == ‘Near’) { initialise2(); } else { var search_address = address; if (window.gdMaps === ‘google’) { Sgeocoder.geocode({‘address’: search_address}, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { updateSearchPosition(results[0].geometry.location, $form); } else { alert(“Search was not successful for the following reason :” + status); } }); } else if (window.gdMaps === ‘osm’) { geocodePositionOSM(false, search_address, false, false, function(geo) { if (typeof geo !== ‘undefined’ && geo.lat && geo.lon) { updateSearchPosition(geo, $form); } else { alert(“Search was not successful for the requested address.”); } }); } else { jQuery($form).submit(); } } } } function initialise2() { if (!window.gdMaps) { return; } if (window.gdMaps === ‘google’) { var latlng = new google.maps.LatLng(56.494343, -4.205446); var myOptions = { zoom: 4, mapTypeId: google.maps.MapTypeId.TERRAIN, disableDefaultUI: true } } else if (window.gdMaps === ‘osm’) { var latlng = new L.LatLng(56.494343, -4.205446); var myOptions = { zoom: 4, mapTypeId: ‘TERRAIN’, disableDefaultUI: true } } try { prepareGeolocation(); } catch (e) {} doGeolocation(); } function doGeolocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(positionSuccess, positionError); } else { positionError(-1); } } function positionError(err) { var msg; switch (err.code) { case err.UNKNOWN_ERROR: msg = “Unable to find your location”; break; case err.PERMISSION_DENINED: msg = “Permission denied in finding your location”; break; case err.POSITION_UNAVAILABLE: msg = “Your location is currently unknown”; break; case err.BREAK: msg = “Attempt to find location took too long”; break; default: msg = “Location detection not supported in browser”; } jQuery(‘#info’).html(msg); } function positionSuccess(position) { var coords = position.coords || position.coordinate || position; jQuery(‘.sgeo_lat’).val(coords.latitude); jQuery(‘.sgeo_lon’).val(coords.longitude); jQuery(‘.geodir-listing-search’).submit(); } /** * On unload page do some cleaning so back button cache does not these values. */ window.onunload = function(){ if(jQuery(‘.sgeo_lat’).length ){ jQuery(‘.sgeo_lat’).val(”); jQuery(‘.sgeo_lon’).val(”); } }; ]]><![CDATA[ /* Location suggestion schema var = { type: "city", name: "Belfast" } */ var gdasac_selected = ''; var gdasac_li_type = ''; var gdasac_categories = []; var gdasac_listings = []; var gdasac_do_not_close = false; var gdasac_doing_search = 0; var gdasac_is_search = false; var gdasac_keyup_timeout = null; jQuery(function() { // init gdas_ac_init('.gd_search_text'); // on CPT change jQuery("body").on("geodir_setup_search_form", function(){ gdas_ac_init('.gd_search_text'); }); }); function gdas_ac_init($field){ jQuery($field).focusin( function(){ gdasac_selected = this; gdas_ac_focus_in(this); }).focusout( function(){ gdasac_selected = ''; gdas_ac_focus_out(this); }); // window resize tasks jQuery(window).resize(function(){ gdas_ac_resize_suggestions(); }); } function gdas_ac_focus_in($input){ if(jQuery($input).parent().find(".gdas-search-suggestions").length){ jQuery($input).parent().find(".gdas-search-suggestions").show(); }else{ jQuery($input).after("" + "

    ” + “
    ” + “”); gdas_ac_init_suggestions($input); gdas_ac_categories(); } // resize gdas_ac_resize_suggestions(); // set if is search near if(jQuery(‘.gdlm-location-suggestions:visible’).prev().hasClass(‘snear’)){ gdasac_is_search = true; }else{ gdasac_is_search = false; } } function gdas_ac_focus_out($input){ setTimeout(function() { if (!gdasac_do_not_close) { jQuery($input).parent().find(“.gdas-search-suggestions”).hide(); } },200); } /** * Get the current post_type categories as suggestions. * */ function gdas_ac_categories(){ $input = jQuery(gdasac_selected); var post_type = jQuery($input).parent().parent().find(“input[name=’stype’]”).val(); var post_type_slug = jQuery($input).parent().parent().find(“input[name=’stype’]”).data(“slug”); if(!post_type_slug) { post_type_slug = jQuery($input).parent().parent().find(“.search_by_post”).find(‘:selected’).data(“slug”); } var search = jQuery($input).val(); jQuery.ajax({ type: “GET”, url: geodir_params.api_url + “” + post_type_slug+”/categories/?orderby=count&search=”+search+”&per_page=”+geodir_search_params.autocompleter_max_results, success: function (data) { console.log(data); gdasac_categories = data;gdasac_doing_search–; html = ”; gdasac_li_type = ‘category’; jQuery.each(gdasac_categories, function (index, value) { // console.log(value); html = html + gdas_ac_create_li(‘category’, value); }); jQuery(gdasac_selected).parent().find(“ul.gdasac-category”).empty().append(html); }, error: function (xhr, textStatus, errorThrown) { console.log(errorThrown); } }); } /** * Get the current post_type categories as suggestions. * */ function gdas_ac_listings(){ $input = jQuery(gdasac_selected); var post_type = jQuery($input).parent().parent().find(“input[name=’stype’]”).val(); var post_type_slug = jQuery($input).parent().parent().find(“input[name=’stype’]”).data(“slug”); if(!post_type_slug) { post_type_slug = jQuery($input).parent().parent().find(“.search_by_post”).find(‘:selected’).data(“slug”); } var search = jQuery($input).val(); if(search && search.length >= geodir_search_params.autocomplete_min_chars){ jQuery.ajax({ type: “GET”, url: geodir_params.api_url + “” + post_type_slug+”/?search=”+search+”&per_page=”+geodir_search_params.autocompleter_max_results, success: function (data) { gdasac_listings = data;gdasac_doing_search–; html = ”; gdasac_li_type = ‘listing’; jQuery.each(gdasac_listings, function (index, value) { // console.log(value); html = html + gdas_ac_create_li(‘listing’, value); }); jQuery(gdasac_selected).parent().find(“ul.gdasac-listing”).empty().append(html); }, error: function (xhr, textStatus, errorThrown) { console.log(errorThrown); } }); }else{ jQuery(gdasac_selected).parent().find(“ul.gdasac-listing”).empty(); } } /** * set the max height for the suggestion div so to never scroll past the bottom of the page. */ function gdas_ac_resize_suggestions(){ setTimeout(function(){ if(jQuery(‘.gd-suggestions-dropdown:visible’).length){ var offset = jQuery(‘.gd-suggestions-dropdown:visible’).offset().top; var windowHeight = jQuery( window ).height(); var maxHeight = windowHeight – ( offset – jQuery(window).scrollTop() ); if(jQuery(‘.gd-suggestions-dropdown:visible’).prev().hasClass(‘gd_search_text’)){ jQuery(‘.gd-suggestions-dropdown:visible’).css(‘max-height’,windowHeight – 40); }else{ jQuery(‘.gd-suggestions-dropdown:visible’).css(‘max-height’,maxHeight); } } }, 50); } function gdas_ac_init_suggestions($input){ setTimeout(function(){ gdas_ac_resize_suggestions(); }, 250); jQuery($input).keyup(function ($input) { gdasac_doing_search = 3;// city, region, country if(gdasac_keyup_timeout != null) clearTimeout(gdasac_keyup_timeout); gdasac_keyup_timeout = setTimeout(gdas_ac_maybe_fire_suggestions,500); }); } function gdas_ac_maybe_fire_suggestions(){ gdasac_keyup_timeout = null; gdas_ac_listings(); gdas_ac_categories(); } function gdas_ac_create_li($type,$data){ var output = ”; var history = ”; var $delete = ”; if(gdasac_li_type != ”){ if($type==’category’){ output += ‘

  • Categories’; }else if($type==’listing’){ output += ‘
  • Listings’; }else{ output += ‘
  • ‘+$type.charAt(0).toUpperCase() + $type.slice(1)+”; } } gdasac_li_type = ”; if($data.history){ history = ‘ ‘; $delete = ‘ ‘; }else if($type == ‘category’ && $data.fa_icon){ var icon_color = $data.fa_icon_color ? ‘#fff’ : ”; history = ‘ ‘; }else if($type == ‘category’){ history = ‘ ‘; }else if($type == ‘listing’ && $data.featured_image.thumbnail){ history = ‘ ‘; }else{ history = ‘ ‘; } console.log($data); if($type==’category’){ if($data.area){$data.city = $data.area;} output += ‘
  • ‘+history+’‘+ $data.name + ”+$delete+”; }else if($type==’listing’){ if($data.area){$data.region = $data.area;} output += ‘
  • ‘+history+’‘+ $data.title.rendered + ”+$delete+”; } return output; } function gdasac_click_action($type,$url){ if($type==’category’){ // add location if(geodir_search_params.autocompleter_filter_location) { var current_location = geodir_params.location_url; $location_string = current_location.replace(geodir_params.location_base_url, “”); $url += $url.endsWith(“/”) ? “” : “/”; $url += $location_string; } window.location = $url }else if($type==’listing’){ window.location = $url } } ]]>

Change Location

To find awesome listings near you!

<![CDATA[ /* Location suggestion schema var = { type: "city", name: "Belfast" } */ var gdlmls_selected = ''; var gdlmls_nearest = []; var gdlmls_country = []; var gdlmls_region = []; var gdlmls_city = []; var gdlmls_neighbourhood = []; var gdlmls_google_sessionToken = '';// google session token var gdlmls_google_service = '';// google service var gdlmls_do_not_close = false; var gdlmls_doing_search = 0; var gdlmls_is_search = false; var gdlmls_keyup_timeout = null; jQuery(function() { // init gdlm_ls_init('.geodir-location-search'); gdlm_ls_init('.snear'); gdlm_is_search_input_location(); // on CPT change jQuery("body").on("geodir_setup_search_form", function(){ gdlm_ls_init('.geodir-location-search'); gdlm_ls_init('.snear'); gdlm_is_search_input_location(); }); }); function gdlm_is_search_input_location(){ // check for on change jQuery(".snear").change(function(){ setTimeout(function(){ var $type = jQuery('.geodir-location-search-type').attr('name'); if($type ){ jQuery('.gd-search-field-near').removeClass('in-location in-neighbourhood in-city in-region in-country').addClass('in-location in-'+$type); }else{ jQuery('.gd-search-field-near').removeClass('in-location in-neighbourhood in-city in-region in-country'); } }, 100); //alert('change'); }).keyup(function () { jQuery('.gd-search-field-near').removeClass('in-location in-neighbourhood in-city in-region in-country'); jQuery('.geodir-location-search-type').val('').attr('name',''); jQuery('.sgeo_lat').val(''); jQuery('.sgeo_lon').val(''); }); } function gdlm_ls_init($field){ jQuery($field).focusin( function(){ gdlmls_selected = this; gdlm_ls_focus_in(this); }).focusout( function(){ gdlmls_selected = ''; gdlm_ls_focus_out(this); }); // window resize tasks jQuery(window).resize(function(){ gdls_ls_resize_suggestions(); }); } function gdlm_ls_focus_in($input){ if(jQuery($input).parent().find(".gdlm-location-suggestions").length){ jQuery($input).parent().find(".gdlm-location-suggestions").show(); gdlm_ls_current_location_suggestion($input); }else{ jQuery($input).after("" + "

    ” + “
    ” + “
    ” + “
    ” + “
    ” + “
    ” + “”); gdlm_ls_init_suggestions($input); gdlm_ls_current_location_suggestion($input); } // resize gdls_ls_resize_suggestions(); // set if is search near if(jQuery(‘.gdlm-location-suggestions:visible’).prev().hasClass(‘snear’)){ gdlmls_is_search = true; }else{ gdlmls_is_search = false; } } function gdlm_ls_focus_out($input){ setTimeout(function() { if (!gdlmls_do_not_close) { jQuery($input).parent().find(“.gdlm-location-suggestions”).hide(); } },200); } /** * set the max height for the suggestion div so to never scroll past the bottom of the page. */ function gdls_ls_resize_suggestions(){ setTimeout(function(){ if(jQuery(‘.gdlm-location-suggestions:visible’).length){ var offset = jQuery(‘.gdlm-location-suggestions:visible’).offset().top; var windowHeight = jQuery( window ).height(); var maxHeight = windowHeight – ( offset – jQuery(window).scrollTop() ); if(jQuery(‘.gdlm-location-suggestions:visible’).prev().hasClass(‘snear’)){ jQuery(‘.gdlm-location-suggestions:visible’).css(‘max-height’,windowHeight – 40); }else{ jQuery(‘.gdlm-location-suggestions:visible’).css(‘max-height’,maxHeight); } } }, 50); } function gdlm_ls_init_suggestions($input){ setTimeout(function(){ gdls_ls_resize_suggestions(); }, 250); jQuery($input).keyup(function ($input) { gdlmls_doing_search = 3;// city, region, country if(gdlmls_keyup_timeout != null) clearTimeout(gdlmls_keyup_timeout); gdlmls_keyup_timeout = setTimeout(gdlm_ls_maybe_fire_suggestions,500); }); } function gdlm_ls_maybe_fire_suggestions(){ // reset timer gdlmls_keyup_timeout = null; // do suggestions gdlm_ls_current_location_suggestion(); gdlm_ls_city_suggestion(); gdlm_ls_region_suggestion(); gdlm_ls_country_suggestion(); } function gdlm_ls_maybe_suggest_more(){ if( gdlmls_doing_search==0 && gdlmls_country.length == 0 && gdlmls_region.length == 0 && gdlmls_city.length == 0 && gdlmls_neighbourhood.length == 0 ){ $input = jQuery(gdlmls_selected).val(); if($input){ gdlm_ls_google_suggestions($input); }else{ jQuery(gdlmls_selected).parent().find(“ul.gdlmls-more”).empty(); } } } function gdlm_ls_neighbourhood_suggestion(){ var $search = jQuery(gdlmls_selected).val(); if($search) { jQuery.ajax({ type: “GET”, url: geodir_params.api_url + “locations/neighbourhoods/?search=” + $search, success: function (data) { gdlmls_neighbourhood = data;gdlmls_doing_search–;gdlm_ls_maybe_suggest_more(); html = ”; jQuery.each(gdlmls_neighbourhood, function (index, value) { // console.log(value); html = html + gdlm_ls_create_li(‘neighbourhood’, value); }); jQuery(gdlmls_selected).parent().find(“ul.gdlmls-neighbourhood”).empty().append(html); }, error: function (xhr, textStatus, errorThrown) { console.log(errorThrown); } }); }else{ gdlmls_neighbourhood = [];gdlmls_doing_search–;gdlm_ls_maybe_suggest_more(); jQuery(gdlmls_selected).parent().find(“ul.gdlmls-city”).empty(); } } function gdlm_ls_city_suggestion(){ var $search = jQuery(gdlmls_selected).val(); if($search) { jQuery.ajax({ type: “GET”, url: geodir_params.api_url + “locations/cities/?search=” + $search, success: function (data) { gdlmls_city = data;gdlmls_doing_search–;gdlm_ls_maybe_suggest_more(); html = ”; jQuery.each(gdlmls_city, function (index, value) { // console.log(value); html = html + gdlm_ls_create_li(‘city’, value); }); jQuery(gdlmls_selected).parent().find(“ul.gdlmls-city”).empty().append(html); }, error: function (xhr, textStatus, errorThrown) { console.log(errorThrown); } }); }else{ gdlmls_city = [];gdlmls_doing_search–;gdlm_ls_maybe_suggest_more(); jQuery(gdlmls_selected).parent().find(“ul.gdlmls-city”).empty(); } } function gdlm_ls_region_suggestion(){ var $search = jQuery(gdlmls_selected).val(); if($search) { jQuery.ajax({ type: “GET”, url: geodir_params.api_url + “locations/regions/?search=” + $search, success: function (data) { gdlmls_region = data;gdlmls_doing_search–;gdlm_ls_maybe_suggest_more(); html = ”; jQuery.each(gdlmls_region, function (index, value) { // console.log(value); html = html + gdlm_ls_create_li(‘region’, value); }); jQuery(gdlmls_selected).parent().find(“ul.gdlmls-region”).empty().append(html); }, error: function (xhr, textStatus, errorThrown) { console.log(errorThrown); } }); }else{ gdlmls_region = [];gdlmls_doing_search–;gdlm_ls_maybe_suggest_more(); jQuery(gdlmls_selected).parent().find(“ul.gdlmls-region”).empty(); } } function gdlm_ls_country_suggestion(){ var $search = jQuery(gdlmls_selected).val(); if($search){ jQuery.ajax({ type: “GET”, url: geodir_params.api_url+”locations/countries/?search=”+$search, success: function(data) { gdlmls_country = data;gdlmls_doing_search–;gdlm_ls_maybe_suggest_more(); html = ”; jQuery.each(gdlmls_country, function(index, value) { // console.log(value); html = html + gdlm_ls_create_li(‘country’,value); }); jQuery(gdlmls_selected).parent().find(“ul.gdlmls-country”).empty().append(html); }, error: function(xhr, textStatus, errorThrown) { console.log(errorThrown); } }); }else{ gdlmls_country = [];gdlmls_doing_search–;gdlm_ls_maybe_suggest_more(); jQuery(gdlmls_selected).parent().find(“ul.gdlmls-country”).empty(); } } function gdlm_ls_current_location_suggestion(){ jQuery(gdlmls_selected).parent().find(“ul.gdlmls-near”).empty(); // near me jQuery(gdlmls_selected).parent().find(“ul.gdlmls-near”).empty().append(gdlm_ls_create_li(‘near’,{ type: “near”, slug: “me”, title: geodir_params.txt_form_my_location })); if(jQuery(gdlmls_selected).val()==”){ var $search_history = JSON.parse(gdlm_ls_get_location_history()); if($search_history){ jQuery.each($search_history, function(index, value) { jQuery(gdlmls_selected).parent().find(“ul.gdlmls-near”).append(gdlm_ls_create_li(value.type,value)); }); } // add near cities from ip gdlm_ls_nearest_cities(); } console.log(JSON.parse(gdlm_ls_get_location_history())); } function gdlm_ls_nearest_cities(){ jQuery.ajax({ type: “GET”, url: geodir_params.api_url+”locations/cities/?orderby=ip”, success: function(data) { if(data){ jQuery.each(data, function(index, value) { jQuery(gdlmls_selected).parent().find(“ul.gdlmls-near”).append(gdlm_ls_create_li(‘city’,value)); }); } }, error: function(xhr, textStatus, errorThrown) { console.log(errorThrown); } }); } function gdlm_ls_create_li($type,$data){ var output; var history = ”; var $delete = ”; if($data.history){ history = ‘ ‘; $delete = ‘ ‘; }else if($type == ‘neighbourhood’ || $type == ‘city’ || $type == ‘region’ || $type == ‘country’){ history = ‘ ‘; } console.log($data); if($type==’neighbourhood’){ if($data.area){$data.city = $data.area;} output = ‘

  • ‘+history+’In: ‘+ $data.title + ‘, ‘+ $data.city + ‘ (Neighbourhood)’+$delete+”; }else if($type==’city’){ if($data.area){$data.region = $data.area;} output = ‘
  • ‘+history+’In: ‘+ $data.title + ‘, ‘+$data.region+’ (City)’+$delete+”; }else if($type==’region’){ if($data.area){$data.country = $data.area;} output = ‘
  • ‘+history+’In: ‘+ $data.title + ‘, ‘+$data.country+’ (Region)’+$delete+”; }else if($type==’country’){ output = ‘
  • ‘+history+’In: ‘+ $data.title + ‘ (Country)’+$delete+”; }else if($type==’near’){ output = ‘
  • Near: ‘+ $data.title + ”; }else if($type==’near-search’){ output = ‘
  • Near: ‘+ $data.description + ”; } return output; } function gdlm_click_action($type,$title,$area,$country_slug,$region_slug,$city_slug,$hood_slug){ if(gdlmls_is_search){ if($type==’neighbourhood’ || $type==’city’ || $type==’region’ || $type==’country’){ $slug = ”; if($type==’neighbourhood’){$slug = $hood_slug;} else if($type==’city’){$slug = $city_slug;} else if($type==’region’){$slug = $region_slug;} else if($type==’country’){$slug = $country_slug;} gdlm_search_fill_location($type,$slug,$title); }else if($type==’near-search’){ gdlm_search_fill_location($type,”,$title); }else if($type==’near’){ gd_get_user_position(gdlm_search_near_me); } }else{ if($type==’neighbourhood’ || $type==’city’ || $type==’region’ || $type==’country’){ gdlm_go_location($type,$title,$area,$country_slug,$region_slug,$city_slug,$hood_slug); }else if($type==’near-search’){ gdlm_go_search($title); }else if($type==’near’){ gd_get_user_position(gdlm_ls_near_me); } } } function gdlm_ls_near_me($lat,$lon){ window.location = geodir_params.location_base_url+”near/me/”+$lat+”,”+$lon+”/”; } function gdlm_ls_near_gps($lat,$lon){ window.location = geodir_params.location_base_url+”near/gps/”+$lat+”,”+$lon+”/”; } function gdlm_search_near_me($lat,$lon){ gdlm_search_fill_location(‘near’,’me’,”Near: “+geodir_params.txt_form_my_location,$lat,$lon) } function gdlm_search_fill_location($type,$slug,$title,$lat,$lon){ if($type==’near’){ }else if($type==’near-search’){ $type=”; }else{ var txtType; if ($type == ‘country’) { txtType = ‘(Country)’; } else if ($type == ‘region’) { txtType = ‘(Region)’; } else if ($type == ‘city’) { txtType = ‘(City)’; } else if ($type == ‘neighbourhood’) { txtType = ‘(Neighbourhood)’; } else { txtType = “(“+$type+”)”; } $title = “In: “+$title+” “+txtType; } jQuery(‘.geodir-location-search-type’).val($slug).attr(‘name’, $type); jQuery(‘.sgeo_lat’).val($lat); jQuery(‘.sgeo_lon’).val($lon); jQuery(‘.snear’).val($title).trigger(‘change’); // fire change event so we can check if we need to add in-location class //gdlm_set_is_location(); } function gdlm_go_search($text){ //alert($text); if (window.gdMaps === ‘google’) { var geocoder = new google.maps.Geocoder(); geocoder.geocode({‘address’: $text}, function (results, status) { if (status == ‘OK’) { // console.log(results); $lat = results[0].geometry.location.lat(); $lon = results[0].geometry.location.lng(); gdlm_ls_near_gps($lat,$lon); } else { alert(“Search was not successful for the following reason :” + status); } }); } else if (window.gdMaps === ‘osm’) { geocodePositionOSM(false, $text, false, false, function(geo) { if (typeof geo !== ‘undefined’ && geo.lat && geo.lon) { console.log(results); } else { alert(“Search was not successful for the requested address.”); } }); } } function gdlm_ls_search_location($type,$term){ jQuery.ajax({ type: “GET”, url: geodir_params.api_url+$type+”/?search=”+$term, success: function(data) { console.log(data); return data; //jQuery(‘#’ + map_canvas_var + ‘_loading_div’).hide(); //parse_marker_jason(data, map_canvas_var); }, error: function(xhr, textStatus, errorThrown) { console.log(errorThrown); } }); } function gdlm_go_location($type,$title,$area,$country_slug,$region_slug,$city_slug,$hood_slug){ // save search history before redirect gdlm_ls_set_location_history($type,$title,$area,$country_slug,$region_slug,$city_slug,$hood_slug); window.location = gdlm_ls_location_url($country_slug,$region_slug,$city_slug,$hood_slug); // console.log( gdlm_ls_location_url($country_slug,$region_slug,$city_slug,$hood_slug)); } function gdlm_ls_location_url($country_slug,$region_slug,$city_slug,$hood_slug){ //$url = geodir_params.location_url.slice(0, -1); // get location url without the ending slash $url = geodir_params.location_base_url; // get location url without the ending slash var show_country = 1; var show_region = 1; var show_city = 1; var show_hood = 0; if(show_country && $country_slug){ $url += “”+$country_slug+”/”; } if(show_region && $region_slug){ $url += “”+$region_slug+”/”; } if(show_city && $city_slug){ $url += “”+$city_slug+”/”; } if(show_hood && $hood_slug){ $url += “”+$hood_slug+”/”; } return $url; } function gdlm_ls_get_location_history(){ if (geodir_is_localstorage() === true) { return gdlm_ls_history = localStorage.getItem(“gdlm_ls_history”); }else{ return ”; } } function gdlm_ls_del_location_history($slug){ gdlmls_do_not_close = true; if (geodir_is_localstorage() === true) { gdlm_ls_history = JSON.parse(localStorage.getItem(“gdlm_ls_history”)); var found = ”; console.log(gdlm_ls_history); jQuery.each(gdlm_ls_history, function(index, value) { if($slug && $slug==value.slug){ // its already in the list so bail. //gdlm_ls_history.splice(index, 1); found = index; } }); if(found!==”){ gdlm_ls_history.splice(found, 1); // store the user selection localStorage.setItem(“gdlm_ls_history”, JSON.stringify(gdlm_ls_history)); } } setTimeout(function(){gdlmls_do_not_close = false;}, 200); } function gdlm_ls_set_location_history($type,$title,$area,$country_slug,$region_slug,$city_slug,$hood_slug){ // set a searched location if (geodir_is_localstorage() === true) { var gdlm_ls_history = localStorage.getItem(“gdlm_ls_history”); var $exists = false; if (!gdlm_ls_history || gdlm_ls_history === undefined) { gdlm_ls_history = [] }else{ gdlm_ls_history = JSON.parse(gdlm_ls_history); jQuery.each(gdlm_ls_history, function(index, value) { console.log(value); if(value.type == $type && value.title==$title){ // its already in the list so bail. $exists = true; } }); } if(!$exists){ $slug = $city_slug; if($type==’neighbourhood’){ $slug = $hood_slug; }if($type==’city’){ $slug = $city_slug; }else if($type==’region’){ $slug = $region_slug; }else if($type==’country’){ $slug = $country_slug; } var $location = { history:true, // set it as historical type:$type, title:$title, country_slug:$country_slug, region_slug:$region_slug, city_slug:$city_slug, hood_slug:$hood_slug, slug:$slug, area:$area }; console.log(gdlm_ls_history); console.log($location); gdlm_ls_history.unshift($location); // gdlm_ls_history = $location; // only keep latest 5 searches if(gdlm_ls_history.length > 5){ gdlm_ls_history.pop(); } } // store the user selection localStorage.setItem(“gdlm_ls_history”, JSON.stringify(gdlm_ls_history)); } } function gdlm_ls_google_suggestions($search){ // Create a new session token. if(!gdlmls_google_sessionToken){ gdlmls_google_sessionToken = new google.maps.places.AutocompleteSessionToken(); } // display function var displaySuggestions = function(predictions, status) { if (status != google.maps.places.PlacesServiceStatus.OK) { return; } console.log(predictions); html = ”; predictions.forEach(function(prediction) { html = html + gdlm_ls_create_li(‘near-search’, prediction); }); jQuery(gdlmls_selected).parent().find(“ul.gdlmls-more”).empty().append(html); }; if(!gdlmls_google_service){ gdlmls_google_service = new google.maps.places.AutocompleteService(); } gdlmls_google_service.getPlacePredictions({ input: $search, sessionToken: gdlmls_google_sessionToken, types: [‘geocode’] // restrict to locations not establishments //@todo implement country restrictions: https://developers.google.com/maps/documentation/javascript/reference/3/places-widget#ComponentRestrictions }, displaySuggestions); } function gdlm_ls_slashit(str) { if (str) { str = str.replace(/’/g, “\'”); } return str; } ]]>

Source

Leave a Comment

Your email address will not be published. Required fields are marked *

http://adfoc.us/serve/sitelinks/?id=573083&url=https://demosites.onlinebizopps.info//