Let me outline a little of what I am trying to do and let me know if I should just be creating a new module or this could be implemented into this module.

What I need is an Input field exposed to all users. Anonymous or Registered, when they input City & State, or Zip Code or Street address it would geocode this information and either replace or store it as new location data in the $_SESSION variable. With the ability to revert back to there "Current Location". Either way I would be pulling there current location from this module or GEOIP API. Id prefer this one because it has device geolocation capabilities.

Let me know what you think. I could help develop this etc.

Comments

arpeggio’s picture

What I think is that the Smart IP admin spoofing feature is almost similar to this feature. The only difference, it is only available to admin users. It is interesting to know:
- How will this exposed Input field presented to users?
- Why we include Anonymous and non-admin authenticated users?
- Please share to us some sample applications for this feature?

dobe’s picture

Well the main idea is to use it as a search mechanism that will store lat and long, as well as the searched city, state, or street information in the $_SESSION variable so you can use it say with the locations module and views to output accurate proximity of nodes to the user. Currently exposed filters with locations is only able to do each field separately (So basically, exposed State, City, Postal Code etc...). Proximity is also only able to be determined based on lat/long coordinates or postal code. Location can only achieve outputting this data by having the postal code and country to pull the lat/long.

This is all fine, but say your accessing the information from a mobile device. People traveling will not know the postal code not to mention if the user is attempting to pull the information before they have reached there destination (this would render the smart ip useless till they get to the location). In addition to all this. If a user has to put all there information from a mobile device separating the fields is not user friendly.

Search should be capable of being used by anonymous and users depending on the content itself.

I guess this feature would only be usable for situations that include proximity based searches.

For example.
If you had a proximity/distance filter on a view provided by locations you could use the following PHP code in theory.

if(isset($_SESSION['smart_ip']['searched'])){
     return array('latitude' => $_SESSION['smart_ip']['searched']['latitude'], 'longitude' => $_SESSION['smart_ip']['searched']['longitude']);
} else {
     return array('latitude' => $_SESSION['smart_ip']['location']['latitude'], 'longitude' => $_SESSION['smart_ip']['location']['longitude']);
} 

Basically the idea in simple form is for a user to be able to change the location that smart ip has provided to display different data if they are not looking for things where they are currently at.

I could be going about this all wrong but I have been making a solution based off of what I have told you and so far it is working. Maybe you have a better approach?

Hopefully I made things clear. I would also understand if this is not a fit in this module as it's uses would be dependent of working in conjunction with other modules.

Thanks for your time!

-Jesse

arpeggio’s picture

Thank you for the detailed explanation. That is a good approach. I'm thinking now is what will be the best way this user-defined coordinates input fields presented to users without confusing them? My opinion is make these fields available only if the current page is using views location proximity/distance feature. What will be your plan for this one?
Its ok to integrate your idea to Smart IP as long as it is modular (I recommend to make this feature as a sub-module of Smart IP). Thanks. Looking forward for your progress.

dobe’s picture

I think the best way to accomplish this so it is able to be used in multiple applications would be to make a filter that's able to be exposed in views.

I have been able to create a module that is more geared to my specific case. But I will try to work on it so I can create the same functionality with a sub-module providing an exposable views filter or views argument.

arpeggio’s picture

I think the best way to accomplish this so it is able to be used in multiple applications would be to make a filter that's able to be exposed in views.

Actually, that will be my next project which will start next week... We can collaborate on this one.

dobe’s picture

Positive. I look forward to seeing what you come up with. I ended up using locations module, the google geocoding file located at location/geocoding/google.inc to geocode an address which outputs a lat/lon based on pretty much any address/city/state that you feed it. This helped greatly in implementing it into views. Within that same module I created $_SESSION variables with that info. Then simply based on if the $_SESSION variables existence I determine which set of coordinates to pass to views.

arpeggio’s picture

I will share to you what will I come up with views filters. Thank you for the info.

socialnicheguru’s picture

Is there a way to save the location information to user location or node location using the location module

arpeggio’s picture

@SocialNicheGuru if I have spare time I will investigate on that one.

@dobe, sorry the project I mentioned was postponed and the schedule is still TBD.

voodootea’s picture

Was there any more development on this idea?

arpeggio’s picture

@dobe, any development in this feature?

dobe’s picture

I have got a working solution at http://cuilpon.com; however, I feel it would need to have a views argument handler developed. I am currently using a global argument with php code to handle the situation, this is a hack at the final solution though.

arpeggio’s picture

@dobe can you share with us how you implemented this working solution using global argument with PHP code?

dobe’s picture

Sorry @arpeggio for the belated response. I will be resurfacing this project soon and will provide the solution please bare with me.

arpeggio’s picture

@dobe no problem.

voodootea’s picture

bump :)

heddn’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 6 is no longer supported