adyp
Forum Replies Created
-
AuthorPosts
-
Now the forum is being very naughty with me – I just typed a reply, submitted it, then went to edit it a little bit and it wouldn’t let me submit it as it claimed it was a duplicate post – though the first one has disappeared!!!!
I will try again …
Hi Stiofan,
that really doesn’t make much sense to me I am afraid.
I would like to see if I can work out a way of having the Near Me button also return a geolocated country code (as happens in the add listing page with gdGeoLocateMe when the crosshairs button is pressed) in addition to what it currently does, no either/or’s.
I am happy to play around with this myself, but just want to find the file with the code for getting the geolocated country using
gdGeoLocateMe(this, 'add-listing')
Is this something you can direct me to?
Thanks,
AdrianI am not having much success with my search – can you please point me to the file where
gdGeoLocateMe(this, 'add-listing')
determines the country to populate the country in add-listing form.
Thanks
I think I have tracked it down to wanting the functionality (translating shared/geolocation of website user into a country value) of this on the add listing page cross-hairs button:
gdGeoLocateMe(this, 'add-listing')
(it will need some adapting)
to the Near Me widget button so that the same country value can be used to set widget logic on the /me page – this button, though, currently is using the following:
gdGetLocationNearMe()
I am quite happy for the moment being in my own little bubble and thinking it is possible and will see how far I get – the deepest learning comes from this type of experimentation (I hope!)
Thanks,
AdrianHmmm, I am not sure we are grasping each other’s points of view!
When the target button at the address section of the add listing page is pressed, geolocation (if location is shared) loads the correct country into the appropriate field of that page (and city, region) – it may use the lat/lon to get there, but it is the country (city, etc) information that is auto-loaded ) – I know this, I have just done it!
I am interested in having the same functionality when the Near Me button is pressed (for clarity, I am talking about pressing the Near Me button from the Near Me widget – not conducting a search using the search bar with Near Me checked), although not actually wishing in this case that the country be printed anywhere on the page, but just have the country set for a variable that I can use in widget logic to load appropriate content to the page /me. (Ideally the same variable used in setting location-specific widget logic when the location selector is used to select a county, as per the GD documentation on widget logic).
From your previous answer the Near Me button can find the nearest city, so I don’t understand why it can’t be set up to use that information to select country for use in widget logic.
I think I am going to have to go and learn php now! Can you tell me which GD files the functionality for the following are located: 1) setting the address from geolocation using the target button; 2) what happens when you press the Near Me button from the Near me widget?
Thanks,
AdrianHi Stiofan,
thanks for the info. My issue is not what the ‘Near Me’ button does – but what it could (possibly should) do, in order to allow location-based content to be displayed on the /me page that loads once the button has been pressed.
It would be great if when the ‘Near Me’ button was pressed then the location variable that is being used to set widget logic for countries based on the Location Selector (or another variable that could be used in widget logic) is set to the shared/geolocated country of the visitor pressing the button – in the same way that that country is set when adding a listing, and pressing the target button populates the country part of the listing address.
I may be missing something, but it seems logical to me that all the capabilities are there in the GD code, but some function just needs to be added to the ‘Near Me’ button to secure some really useful/necessary functionality. As I have pointed out, I am not a coder, but I like to think I have a logical mind.
Adrian
That is disappointing Kiran!
I can understand that sorting this out might be considered beyond ‘support’, especially if you are tasked with rapidly reacting to and solving bugs and other critical issues – but equally, I feel that this is a key, though missing, part of the offering of a geographical directory – and might be addressed by the broader GD development team.
The ‘Near Me’ button and functionality have been provided and they are likely to be a key part of a directory developed using this plugin. Anyone developing an international directory with GD (and having purchased – or thinking about purchasing – the Multi-locations add-on) would benefit from being able to target content based upon shared/geolocated visitor country on the /me page! Without that functionality we cannot approach potential advertisers in different countries and offer to target content to website visitors in their country (most visitors will find using the ‘near me’ button easier and quicker than the Change Location function – especially since it is slow at finding countries based on search of input text, and often erroneously returns a ‘not-found’) – and visitors are encouraged to ‘geo-locate’ for the benefits that offers.
It seems to me that the information must be readily available as it is used to provide the shared/geolocated Country when adding listings – all I want to do is to use that info to target widgets on the /me page. Can you PLEASE flag this for consideration by the wider GD team? I am not an experienced coder, otherwise I would look in the GD files and work out what was needed.
Thanks,
AdrianThat is precisely what I want to do! I am hoping that you can tell me the code to use in widget-logic?
I just had a ‘lightbulb moment’! Surely it must be easy to implement: when adding a listing an alternative to manually adding an address is to press the button to populate address fields based on location. It is only the country part of this data that I need for my widget logic! And so maybe have pressing the ‘Near Me’ button set this value?
Am I right?
Adrian
… Thinking about it, since only one map/page is displayed at a time, it might be better to have the geo-location/shared-location code use the SAME variable name as Selected Location on this page – this would make coding Widget Logic simpler. I take it that the variable (Country as used in existing logic) could be set each time either the Location Selector was used or a geolocation/shared-location search performed (including use of ‘Near Me’).
Hi Kiran – thanks for looking into this,
yes, logic for country selection works fine when the Location Selector is used. The context is: I am targeting Country-specific slide-shows in the sidebar that display advertisements for country-specific organizations and businesses. Fine with Location Selector – I want to get it working when the ‘Near Me’ button has been pressed and the viewer directed to the /me page (whether this works with a different variable than that used in existing Location logic, or over-writes that variable is another matter!). With ‘Near Me’ button prominent, and likely to be used as much (or more) than the Location Selector due to it being quicker and easier (and more likely to suit what website visitors want to do), I want to get this right. (I recognise ‘Near Me’ compliments, not replaces, the Location Selector and each might be used in different circumstances – the latter when planning a trip, for instance).
I am willing to have a go at hacking something together as a learning exercise (though frustrated that it will take me some time – IF I am able to do it! – and I want to start using this functionality asap) – I was hoping that since Geodirectory aspires to be (and is, of course!) the best geographical directory solution available, then its developers might consider this a key part of the ‘Near Me’ functionality and write the functionality in. Is this something the GD team could think about?
Thanks,
AdrianAugust 3, 2017 at 11:00 am in reply to: Use geolocation data to determine widget visibility? #389582(this issue is now being dealt with in the related thread about the ‘/me’ page, which is displayed after pressing the ‘Near Me’ button:
https://wpgeodirectory.com/support/topic/the-me-location-page-from-near-me-button/#post-389581)This reply has been marked as private.This reply has been marked as private.Hi,
unfortunately it is not working. When I press the ‘Near Me’ button (top of all pages) I am geolocated ok in uk – map shows blue beacon – but the widget is not displayed.
Interestingly, a widget with the following logic IS displayed on this /me page:
strtolower(geodir_get_current_location(array('echo' => false)))==strtolower('')
(and the widget with your code is displayed if United Kingdom is selected from location changer)
Which adds up to telling me the code isn’t selecting for a user being geolocated in UK – despite this page being for geolocated users. That is essentially what I am trying to achieve: have the geolocation country determine widget visibility on what is the geolocated ‘Near Me’ page.
login details to follow in case you want to see for yourself …
-
AuthorPosts