I am using the Location module within Drupal 6 to tag geographical locations to blog entries. So every blog entry has a long/lat
My question is: What is the most efficient way of querying all coordinates for all blog entries of a given user?
I am using the Location module within Drupal 6 to tag geographical locations to blog entries. So every blog entry has a long/lat
My question is: What is the most efficient way of querying all coordinates for all blog entries of a given user?
I don't know the location modules db setup. But it probably stores it data in it's own table with a nid (node id) to reference which blog post it is for. Nodes have the uid (user id) of the user who posted it so you should be able to do a query on the locations left joining the node table.
"SELECT geo FROM {location} l LEFT JOIN {node} n ON l.nid = n.nid WHERE n.uid = %d"
The above query used with db_query is just to give an idea. I don't know the exact table layout, but something like that should work just fine.
Location itself also integrates with Views; in addition to providing fields and filters for Locations, it also offers basic proximity filtering and sorting features.
Install Views module, add filter = blog and argument of user id. Add fields of location module that will show coordinates...
Nice post thanks admin. Install Views module, add filter = blog and argument of user id. Add fields of location module that will show coordinates...