[development] Making a whole site location aware - a design question

Darrel O'Pry dopry at thing.net
Sat Aug 19 01:01:56 UTC 2006


On Fri, 2006-08-18 at 01:00 -0400, drupal at mclewin.com wrote:
> Dave,
> 
> I will seriously consider that route.  I'm only vaguely aware that the
> db_rewrite_sql hook exists but don't know all of what it can do for me.  I
> will head off to study it this evening.
> 
> I will want a few exceptions to having displays filter based on location
> (admin interfaces and search engine friendly lists of everything in the
> db).  If I use hook_db_rewrite_sql to filter as you suggest below, can I
> also selectivly disable the rewrite?  (If RTFM is the most appropriate
> answer here I'll take it :) )
> 
> Scott
> 
> 
> > Consider...
> >
> > Write a module which stores this data however you see fit.  (Could be a
> > table
> > you create that joins the users table on uid).
> >
> > Then, use hook_db_rewrite_sql to filter out any nodes which have location
> > information which is not within the users radius.  This way, your work
> > applies to any node with location information, not just events.  And the
> > event (or any other) module does not have to change at all.
> >
> > If you take this approach, your module is essentially a location-based
> > access
> > control module.  Read up on how node.module uses hook_db_rewrite_sql to
> > filter nodes based on the node_access table and emulate that.
> >
> > -Dave
> >
> > On Thursday 17 August 2006 19:39, drupal at mclewin.com wrote:
> >> I have a question for the masters.  If you are an impatient master, jump
> >> over the context and to the second to last sentence for the question.
> > [snip]
> >> Hopefully that is enough context for you.  Here's the question: What is
> >> an
> >> appropriate "well recognized location" within Drupal to keep these seven
> >> pieces of information? (latitide, longitude, search radius (storage in
> >> miles), country code, province, postal code and city.
> >>
> >> I'm looking forward to having an answer (or seven :) ) so that we can
> >> get
> >> closer to having patches in the patch queue.
> >>
> >> Scott
> >


I did something like that for site that ever got out the door... also
gave users a ui to manage 'search', but was using taxonomy terms to do
it...

btw, postgres has some nifty gis plugin's that make querying that kind
of stuff easy...




More information about the development mailing list