Small bounty available for two snippets

Events happening in the community are now at Drupal community events on www.drupal.org.
dpatte's picture

I need two snippets of code. I unfortunately can only pay a total bounty of $100, since the site in question does not generate any income at this point.

Can anyone help me on these?

1) When a new session is started (authenticated or anonymous user) save into session data:

country
postal code
    I currently have this data available in variables, so they are accessible using get_variable i believe

lat
lng
    this can be determined with the above using some function in the location/gmap suite


- i just need to know what function to use to generate the lat/lng, and at what point at session startup to save the 4 items of data into the session data  

2) Define a block (which I can put onto any page I want) which shows the current session data from above. Country, selected from within a dropdown list of all countries, & the postal code, shown inside a text field, and a small search button. The block will likely be displayed at the top of the content area of my pages - so the country list, postal code, and search button should be able to horizotantally beside each other in less than about 300 pixels.

when the button is pressed:

- it computes the new lat/lng using the current contents of the dropdown & textfield 
- updates the session data and does a page refresh
- if there is a geocoding error when computing the lat/lng, it instead restores the fields to their current session values - no need of a page refresh 


- Here I really just need someone to write some php code I can put into a block definition, and to write the code to do the update when the button is pressed, and tell me where that updating code should go.

Thanks!

I can pay with PayPal

Comments

still need help?

sano's picture

Hi, do you still need help with this? If so, let me know.

A.

Yes Sano 1) Given that I

dpatte's picture

Yes Sano

1) Given that I already have $country & $zip, I need a patch that when a session starts (anonymous or authenticated), it would calculate $lat, $lng and set all 4 variables as session variables. If a person starts anon, then logs in, the current values should be carried over into the authenticated session.

2) I need php code I can put into a block for any page that would display the current session country (in a list) and the current zip and a button. pressing the button would

3) call a patch that would calculate the new $lat, $lng and then save the new 4 variables into the session variables.

I would then use these to display proximity based data for users on a site.

Well were both after the same

paulfrottawa's picture

Well were both after the same thing. I'm a new drupal user with a working site as well and want to have certain forums seen only within the right proximity or postal code info.

To my understanding this can be done so expect me back soon.

I'm happy we have a drupal group for Ottawa.

My biggest obstacle in Drupal is understanding it.
paulb

Purl.module can help you pass

Adam S's picture

Purl.module can help you pass parameters in the URL. http://drupal.org/project/purl You might want to investigate this with the geo module.

Marine job board with Drupal 7 at http://windwardjobs.com

Location and Mapping

Group organizers

Group categories

Wiki type

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: