This is a plug-in for the notifications framework that notifies users of location-enabled content that is geographically near.

Make sure permissions are enabled for "subscribe to locations" and "set own user location".

A block is also included that provides a compact signup by zip code. Note if anonymous users are allowed to use this block, user accounts are automatically created, so make sure this is what you want.

### TODO ###

- Currently a per-subscription distance field is stored in the database, but it needs a UI. Right now it's hard-coded to 100 km. This is tricky because notifications_user_form() doesn't yet handle multiple fields.

You can see a demo here:
http://thefuelfilm.com/

CommentFileSizeAuthor
notifications_location.tar_.gz3.39 KBgrendzy

Comments

jose reyero’s picture

Looks really interesting. I'll see about fixing that field issues and adding this to the pack.

Also the automatic subscription part doesn't really belong here so I'll see how this can fit with the whole framework.

giorgio79’s picture

subs

grendzy’s picture

Hi Jose,

Yeah I agree the block is kind of special purpose, and maybe out of place in the main module (I put hook_block in a separate file so it's easy to remove).

I've also got a bit of feedback on the code from jhedstrom, so if I get a chance to implement his suggestions I'll post an update.

Thanks!

a_c_m’s picture

this does look interesting! subscribe

jusyjim’s picture

This is very nice!! Does it only work with 6.x version? If so, are there plans to port to 5?

Thanks.

jose reyero’s picture

I hope this will eventually get into Notifications 6.x. Not for 5.x (just bug fixes for that one).

grendzy’s picture

Hi Jose,

I've incorporated some feedback I got from a code review, and also started updating it for the 1.2-BETA1 API changes. The block code has been removed, since that was somewhat site-specific.

I'm a little confused by the new releases – what's the difference between 1.2-BETA1 and 2.0-BETA1? Which one should I be targeting?

For now, the code is in the sandbox:
http://cvs.drupal.org/viewvc.py/drupal/contributions/sandbox/grendzy/not...
Once I get things working under BETA1, I think I'll post in the location and mapping group to see if we can attract some reviews.

I'm really excited by the progress on Notifications, nice work!

jose reyero’s picture

With the 1.x-beta I screwed up, I didn't know it would show as the stable release, so I've asked for that one to be deleted.

The new development and good new betas are in the 2.x branch.

Your module looks absolutely great and I'd really like to make it available. However I'm already a bit concerned about the size of this Notifications package and also I'd like to roll out a new stable version ASAP, so I think it would make a lot of sense creating a new contrib module for it, so I can link it from the project page and instead of being hidden here on this issue tracker people can see it and try.

What do you think?

Lots of people are gonna love it :-)

grendzy’s picture

I think that's a fine idea. I certainly wouldn't want this to hold up a 2.0 release of notifications.

A couple of other questions... What do you think of the feasibility of #437294: API: support for multi-field subscriptions ? I'm trying to decide if it's better to write a UI for setting the distance, or if it's better to work on the multi-field capability.

Another thought.... is it possible that notifications_views makes this module obsolete? Since views can query by location. (I haven't tried this yet). Does notifications_views allow views arguments to be part of the subscription?

Anyway, the contrib project is located at http://drupal.org/project/notifications_location

Thanks!

jose reyero’s picture

Status: Needs review » Closed (fixed)

About the field subscriptions I've replied there. You just need to define a few callbacks for the fields.

About notifications_views, no way. That module currently just works for displaying some fields into views, but not for defining subscriptions nor handling them.

I'm closing this one, we'll follow up on the new module. Let me know if you need anything for that one.

Great!

likewhoa’s picture

subscribed

joncup’s picture

What is the possibility of having multiple locations set for a user?

grendzy’s picture

You can do this by allowing multiple user locations. Under /admin/user/settings -> User Locations -> Number of locations. I haven't tested multiple locations extensively, but it should work.

FYI, this module has it's own project page now, please post future support requests in http://drupal.org/project/notifications_location

Thanks!