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

drupal at mclewin.com drupal at mclewin.com
Fri Aug 18 05:00:56 UTC 2006


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
>




More information about the development mailing list