Posted by husainsn on January 30, 2010 at 4:16pm
Hello
I have a node type with location data. I want to access latitude and longitude data to calculate Sunrise time in a computed field on the same node - but no success. The code in computed field is:
$lat = $node->$location[latitude];
$long = $node->$location[longitude];
$node_field[0]['value'] = date_sunrise(time(), SUNFUNCS_RET_STRING, $lat, $long, 90, -5);
I can access latitude data $location[latitude] in the theme override, and can calculate sunrise. I want to use the computed field in a View.
Any help will be appreciated.
Comments
Your code snippet seems
Your code snippet seems wrong.
Assuming location is an array held in your node object, you would reference it as
$node->location['latitude']and$node->location['longitude'].I think you might find some
I think you might find some good tips in this blog post. http://www.coalmarch.com/coalmarch-blog/20090607268/building-a-lunar-cal...
Thanks
Tried but no success
Did you found a solution ?
Did you found a solution ?
Not Yet
Hi bneel:
It did not have my full time attention on the problem. I run a charity and was trying out ideas for web new page. Anyway I have been abroad for the last 6 weeks and I am replying you from Pakistan. I am a 70 year old retired engineer, and a self taught Drupalist (www.MuslimServ.com). As I perceive the problem has something to do with views as I want to show the the output in a view. I went over views but without success as yet. I thank you for replying me and letting me know possible solution.